From b4e8d07313ec8511a63f473a03edd273818516a6 Mon Sep 17 00:00:00 2001 From: Mahiru Date: Fri, 30 Aug 2024 19:54:27 +0800 Subject: [PATCH 1/2] update engine to solve bug --- .../assets/{index-2d7a304e.js => index-cb16cf2a.js} | 8 ++++---- .../{index-2d7a304e.js.map => index-cb16cf2a.js.map} | 2 +- ...{initRegister-8f09b33a.js => initRegister-99a9f9bd.js} | 4 ++-- ...ister-8f09b33a.js.map => initRegister-99a9f9bd.js.map} | 2 +- .../terre2/assets/templates/WebGAL_Template/index.html | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) rename packages/terre2/assets/templates/WebGAL_Template/assets/{index-2d7a304e.js => index-cb16cf2a.js} (98%) rename packages/terre2/assets/templates/WebGAL_Template/assets/{index-2d7a304e.js.map => index-cb16cf2a.js.map} (50%) rename packages/terre2/assets/templates/WebGAL_Template/assets/{initRegister-8f09b33a.js => initRegister-99a9f9bd.js} (94%) rename packages/terre2/assets/templates/WebGAL_Template/assets/{initRegister-8f09b33a.js.map => initRegister-99a9f9bd.js.map} (99%) diff --git a/packages/terre2/assets/templates/WebGAL_Template/assets/index-2d7a304e.js b/packages/terre2/assets/templates/WebGAL_Template/assets/index-cb16cf2a.js similarity index 98% rename from packages/terre2/assets/templates/WebGAL_Template/assets/index-2d7a304e.js rename to packages/terre2/assets/templates/WebGAL_Template/assets/index-cb16cf2a.js index 1cf29c085..1765e7cf6 100644 --- a/packages/terre2/assets/templates/WebGAL_Template/assets/index-2d7a304e.js +++ b/packages/terre2/assets/templates/WebGAL_Template/assets/index-cb16cf2a.js @@ -81,11 +81,11 @@ Add a component higher in the tree to provide a loading * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var aS=Symbol.for("react.element"),oS=Symbol.for("react.portal"),kv=Symbol.for("react.fragment"),Mv=Symbol.for("react.strict_mode"),Fv=Symbol.for("react.profiler"),Nv=Symbol.for("react.provider"),Lv=Symbol.for("react.context"),Mre=Symbol.for("react.server_context"),Dv=Symbol.for("react.forward_ref"),Bv=Symbol.for("react.suspense"),jv=Symbol.for("react.suspense_list"),Uv=Symbol.for("react.memo"),$v=Symbol.for("react.lazy"),Fre=Symbol.for("react.offscreen"),pF;pF=Symbol.for("react.module.reference");function ii(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case aS:switch(t=t.type,t){case kv:case Fv:case Mv:case Bv:case jv:return t;default:switch(t=t&&t.$$typeof,t){case Mre:case Lv:case Dv:case $v:case Uv:case Nv:return t;default:return e}}case oS:return e}}}gt.ContextConsumer=Lv;gt.ContextProvider=Nv;gt.Element=aS;gt.ForwardRef=Dv;gt.Fragment=kv;gt.Lazy=$v;gt.Memo=Uv;gt.Portal=oS;gt.Profiler=Fv;gt.StrictMode=Mv;gt.Suspense=Bv;gt.SuspenseList=jv;gt.isAsyncMode=function(){return!1};gt.isConcurrentMode=function(){return!1};gt.isContextConsumer=function(t){return ii(t)===Lv};gt.isContextProvider=function(t){return ii(t)===Nv};gt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===aS};gt.isForwardRef=function(t){return ii(t)===Dv};gt.isFragment=function(t){return ii(t)===kv};gt.isLazy=function(t){return ii(t)===$v};gt.isMemo=function(t){return ii(t)===Uv};gt.isPortal=function(t){return ii(t)===oS};gt.isProfiler=function(t){return ii(t)===Fv};gt.isStrictMode=function(t){return ii(t)===Mv};gt.isSuspense=function(t){return ii(t)===Bv};gt.isSuspenseList=function(t){return ii(t)===jv};gt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===kv||t===Fv||t===Mv||t===Bv||t===jv||t===Fre||typeof t=="object"&&t!==null&&(t.$$typeof===$v||t.$$typeof===Uv||t.$$typeof===Nv||t.$$typeof===Lv||t.$$typeof===Dv||t.$$typeof===pF||t.getModuleId!==void 0)};gt.typeOf=ii;function Nre(){const t=yre();let e=null,r=null;return{clear(){e=null,r=null},notify(){t(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],i=e;for(;i;)n.push(i),i=i.next;return n},subscribe(n){let i=!0,a=r={callback:n,next:null,prev:r};return a.prev?a.prev.next=a:e=a,function(){!i||e===null||(i=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}const mP={notify(){},get:()=>[]};function Lre(t,e){let r,n=mP,i=0,a=!1;function o(v){c();const g=n.subscribe(v);let m=!1;return()=>{m||(m=!0,g(),f())}}function s(){n.notify()}function u(){p.onStateChange&&p.onStateChange()}function l(){return a}function c(){i++,r||(r=e?e.addNestedSub(u):t.subscribe(u),n=Nre())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=mP)}function h(){a||(a=!0,c())}function d(){a&&(a=!1,f())}const p={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:u,isSubscribed:l,trySubscribe:h,tryUnsubscribe:d,getListeners:()=>n};return p}const Dre=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bre=Dre?ne.useLayoutEffect:ne.useEffect;function vF({store:t,context:e,children:r,serverState:n,stabilityCheck:i="once",noopCheck:a="once"}){const o=ne.useMemo(()=>{const l=Lre(t);return{store:t,subscription:l,getServerState:n?()=>n:void 0,stabilityCheck:i,noopCheck:a}},[t,n,i,a]),s=ne.useMemo(()=>t.getState(),[t]);Bre(()=>{const{subscription:l}=o;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),s!==t.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[o,s]);const u=e||Eo;return ne.createElement(u.Provider,{value:o},r)}function mF(t=Eo){const e=t===Eo?lF:tS(t);return function(){const{store:n}=e();return n}}const jre=mF();function Ure(t=Eo){const e=t===Eo?jre:mF(t);return function(){return e().dispatch}}const Nr=Ure();bre(vre.useSyncExternalStoreWithSelector);gre($I.unstable_batchedUpdates);const yn=()=>{const t=Nr();return{playSeEnter:()=>{t(Ge({key:"uiSe",value:tF}))},playSeClick:()=>{t(Ge({key:"uiSe",value:rF}))},playSePageChange:()=>{t(Ge({key:"uiSe",value:Hte}))},playSeDialogOpen:()=>{t(Ge({key:"uiSe",value:Kte}))},playSeSwitch:()=>{t(Ge({key:"uiSe",value:qte}))}}},sS=()=>({playSeEnter:()=>{te.dispatch(Ge({key:"uiSe",value:tF}))},playSeClick:()=>{te.dispatch(Ge({key:"uiSe",value:rF}))}}),$re=[{reg:/\\\\/g,val:"\\"},{reg:/\\\|/g,val:"|"},{reg:/\\:/g,val:":"},{reg:/\\,/g,val:","},{reg:/\\;/g,val:";"},{reg:/\\./g,val:"."}],lS=t=>{let e=t;for(let r of $re)e=e.replaceAll(r.reg,r.val);return e};function Vre(t){return Hv.parseScssToWebgalStyleObj(t)}function wi(t){const[e,r]=ne.useState(t);return{_value:e,set:function(n){this._value=n,r(n)},get value(){return this._value},set value(n){this.set(n)}}}function Gre(t){if(t.sheet)return t.sheet;for(var e=0;e0?Vr(fu,--Pn):0,Bl--,sr===10&&(Bl=1,Gv--),sr}function Bn(){return sr=Pn2||Hc(sr)>3?"":" "}function rne(t,e){for(;--e&&Bn()&&!(sr<48||sr>102||sr>57&&sr<65||sr>70&&sr<97););return Vf(t,cd()+(e<6&&Ji()==32&&Bn()==32))}function o_(t){for(;Bn();)switch(sr){case t:return Pn;case 34:case 39:t!==34&&t!==39&&o_(sr);break;case 40:t===41&&o_(t);break;case 92:Bn();break}return Pn}function nne(t,e){for(;Bn()&&t+sr!==47+10;)if(t+sr===42+42&&Ji()===47)break;return"/*"+Vf(e,Pn-1)+"*"+Vv(t===47?t:Bn())}function ine(t){for(;!Hc(Ji());)Bn();return Vf(t,Pn)}function ane(t){return SF(hd("",null,null,null,[""],t=bF(t),0,[0],t))}function hd(t,e,r,n,i,a,o,s,u){for(var l=0,c=0,f=o,h=0,d=0,p=0,v=1,g=1,m=1,y=0,_="",x=i,b=a,S=n,w=_;g;)switch(p=y,y=Bn()){case 40:if(p!=108&&Vr(w,f-1)==58){a_(w+=ot(fd(y),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:w+=fd(y);break;case 9:case 10:case 13:case 32:w+=tne(p);break;case 92:w+=rne(cd()-1,7);continue;case 47:switch(Ji()){case 42:case 47:ph(one(nne(Bn(),cd()),e,r),u);break;default:w+="/"}break;case 123*v:s[l++]=Ui(w)*m;case 125*v:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+c:m==-1&&(w=ot(w,/\f/g,"")),d>0&&Ui(w)-f&&ph(d>32?yP(w+";",n,r,f-1):yP(ot(w," ","")+";",n,r,f-2),u);break;case 59:w+=";";default:if(ph(S=gP(w,e,r,l,c,i,s,_,x=[],b=[],f),a),y===123)if(c===0)hd(w,e,S,S,x,a,f,s,b);else switch(h===99&&Vr(w,3)===110?100:h){case 100:case 108:case 109:case 115:hd(t,S,S,n&&ph(gP(t,S,S,0,0,i,s,_,i,x=[],f),b),i,b,f,s,n?x:b);break;default:hd(w,S,S,S,[""],b,0,s,b)}}l=c=d=0,v=m=1,_=w="",f=o;break;case 58:f=1+Ui(w),d=p;default:if(v<1){if(y==123)--v;else if(y==125&&v++==0&&ene()==125)continue}switch(w+=Vv(y),y*v){case 38:m=c>0?1:(w+="\f",-1);break;case 44:s[l++]=(Ui(w)-1)*m,m=1;break;case 64:Ji()===45&&(w+=fd(Bn())),h=Ji(),c=f=Ui(_=w+=ine(cd())),y++;break;case 45:p===45&&Ui(w)==2&&(v=0)}}return a}function gP(t,e,r,n,i,a,o,s,u,l,c){for(var f=i-1,h=i===0?a:[""],d=fS(h),p=0,v=0,g=0;p0?h[m]+" "+y:ot(y,/&\f/g,h[m])))&&(u[g++]=_);return Xv(t,e,r,i===0?uS:s,u,l,c)}function one(t,e,r){return Xv(t,e,r,gF,Vv(Jre()),Yc(t,2,-2),0)}function yP(t,e,r,n){return Xv(t,e,r,cS,Yc(t,0,n),Yc(t,n+1,-1),n)}function wl(t,e){for(var r="",n=fS(t),i=0;i6)switch(Vr(t,e+1)){case 109:if(Vr(t,e+4)!==45)break;case 102:return ot(t,/(.+:)(.+)-([^]+)/,"$1"+at+"$2-$3$1"+ap+(Vr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~a_(t,"stretch")?wF(ot(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Vr(t,e+1)!==115)break;case 6444:switch(Vr(t,Ui(t)-3-(~a_(t,"!important")&&10))){case 107:return ot(t,":",":"+at)+t;case 101:return ot(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+at+(Vr(t,14)===45?"inline-":"")+"box$3$1"+at+"$2$3$1"+Wr+"$2box$3")+t}break;case 5936:switch(Vr(t,e+11)){case 114:return at+t+Wr+ot(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return at+t+Wr+ot(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return at+t+Wr+ot(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return at+t+Wr+t+t}return t}var mne=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case cS:e.return=wF(e.value,e.length);break;case yF:return wl([ju(e,{value:ot(e.value,"@","@"+at)})],i);case uS:if(e.length)return Qre(e.props,function(a){switch(Zre(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([ju(e,{props:[ot(a,/:(read-\w+)/,":"+ap+"$1")]})],i);case"::placeholder":return wl([ju(e,{props:[ot(a,/:(plac\w+)/,":"+at+"input-$1")]}),ju(e,{props:[ot(a,/:(plac\w+)/,":"+ap+"$1")]}),ju(e,{props:[ot(a,/:(plac\w+)/,Wr+"input-$1")]})],i)}return""})}},gne=[mne],yne=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var g=v.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=e.stylisPlugins||gne,a={},o,s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var g=v.getAttribute("data-emotion").split(" "),m=1;m=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var xne={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},bne=/[A-Z]|^ms/g,Sne=/_EMO_([^_]+?)_([^]*?)_EMO_/g,EF=function(e){return e.charCodeAt(1)===45},xP=function(e){return e!=null&&typeof e!="boolean"},zg=cne(function(t){return EF(t)?t:t.replace(bne,"-$&").toLowerCase()}),bP=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(Sne,function(n,i,a){return $i={name:i,styles:a,next:$i},i})}return xne[e]!==1&&!EF(e)&&typeof r=="number"&&r!==0?r+"px":r};function qc(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return $i={name:r.name,styles:r.styles,next:$i},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)$i={name:n.name,styles:n.styles,next:$i},n=n.next;var i=r.styles+";";return i}return wne(t,e,r)}case"function":{if(t!==void 0){var a=$i,o=r(t);return $i=a,qc(t,e,o)}break}}if(e==null)return r;var s=e[r];return s!==void 0?s:r}function wne(t,e,r){var n="";if(Array.isArray(r))for(var i=0;ia.stage.replacedUIlable),n=(a,o)=>{var u;const s=(r==null?void 0:r[a])??a;if(Object.keys(e.value.classNameStyles).includes(s)){const l=s_(((u=e.value.classNameStyles)==null?void 0:u[s])??"");return`${o} ${l}`}return o},i=async()=>{ge.debug("更新 Scss 文件",t);const o=(await Xc.get(`game/template/${t}`)).data;e.set(Vre(o))};return ne.useEffect(()=>{i()},[]),ne.useEffect(()=>{One(e.value.others)},[e.value.others]),Rne(i),n}function Rne(t){const e=()=>{t()};ne.useEffect(()=>(L.events.styleUpdate.on(e),()=>L.events.styleUpdate.off(e)),[])}class dS{constructor(e,r){Ae(this,"text");Ae(this,"jump");Ae(this,"jumpToScene");Ae(this,"showCondition");Ae(this,"enableCondition");this.text=lS(e),this.jump=r,this.jumpToScene=r.match(new RegExp("(?"),n=r.length>1?r[0]:null,a=(r.length>1?r[1]:r[0]).split(new RegExp("(?{const r=t.content.split(new RegExp("(?dS.parse(n));return ea.render(C.jsx(vF,{store:te,children:C.jsx(kne,{chooseOptions:r})}),document.getElementById("chooseContainer")),{performName:"choose",duration:1e3*60*60*24,isHoldOn:!1,stopFunction:()=>{ea.render(C.jsx("div",{}),document.getElementById("chooseContainer"))},blockingNext:()=>!0,blockingAuto:()=>!0,stopTimeout:void 0}};function kne(t){const r=te.getState().userData.optionData.textboxFont===Zi.song?'"思源宋体", serif':'"WebgalUI", serif',{playSeEnter:n,playSeClick:i}=sS(),a=hS("Stage/Choose/choose.scss"),o=s=>s.filter((u,l)=>f_(u.showCondition)).map((u,l)=>{const c=f_(u.enableCondition),f=c?a("Choose_item",dh.Choose_item):a("Choose_item_disabled",dh.Choose_item_disabled),h=c?()=>{i(),u.jumpToScene?JM(u.jump,u.text):eF(u.jump),L.gameplay.performController.unmountPerform("choose")}:()=>{};return C.jsx("div",{className:a("Choose_item_outer",dh.Choose_item_outer),children:C.jsx("div",{className:f,style:{fontFamily:r},onClick:h,onMouseEnter:n,children:u.text})},u.jump+l)});return C.jsx("div",{className:a("Choose_Main",dh.Choose_Main),children:o(t.chooseOptions)})}const Mne=t=>(ge.debug(`脚本内注释${t.content}`),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),Fne=t=>(t.content!==""&&t.content!=="none"?te.dispatch(Ge({key:"enableFilm",value:t.content})):te.dispatch(Ge({key:"enableFilm",value:""})),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),Nne="_Choose_Main_4xkm5_1",Lne="_Choose_item_4xkm5_13",Dne="_glabalDialog_container_inner_4xkm5_28",Bne="_glabalDialog_container_4xkm5_28",jne="_title_4xkm5_47",Une="_button_4xkm5_59",$s={Choose_Main:Nne,Choose_item:Lne,glabalDialog_container_inner:Dne,glabalDialog_container:Bne,title:jne,button:Une},$ne=t=>{const e=t.content.toString().trim(),r=He(t,"title"),n=(r===0?"Please Input":r)??"Please Input",i=He(t,"buttonText"),a=(i===0?"OK":i)??"OK",s=te.getState().userData.optionData.textboxFont===Zi.song?'"思源宋体", serif':'"WebgalUI", serif',{playSeEnter:u,playSeClick:l}=sS(),c=C.jsx("div",{style:{fontFamily:s},className:$s.glabalDialog_container,children:C.jsxs("div",{className:$s.glabalDialog_container_inner,children:[C.jsx("div",{className:$s.title,children:n}),C.jsx("input",{id:"user-input",className:$s.Choose_item}),C.jsx("div",{onMouseEnter:u,onClick:()=>{const f=document.getElementById("user-input");f&&te.dispatch(Tk({key:e,value:((f==null?void 0:f.value)??"")===""?" ":(f==null?void 0:f.value)??""})),l(),L.gameplay.performController.unmountPerform("userInput"),en()},className:$s.button,children:a})]})});return ea.render(C.jsx("div",{className:$s.Choose_Main,children:c}),document.getElementById("chooseContainer")),{performName:"userInput",duration:1e3*60*60*24,isHoldOn:!1,stopFunction:()=>{ea.render(C.jsx("div",{}),document.getElementById("chooseContainer"))},blockingNext:()=>!0,blockingAuto:()=>!0,stopTimeout:void 0}},Vne="_FullScreenPerform_main_7er8a_2",Gne="_FullScreenPerform_element_7er8a_9",Xne="_fullScreen_video_7er8a_17",zne="_fadeIn_7er8a_74",Wne="_intro_showSoftly_7er8a_1",Yne="_slideIn_7er8a_80",Hne="_typingEffect_7er8a_86",qne="_typing_7er8a_86",Kne="_blinkCursor_7er8a_1",Zne="_pixelateEffect_7er8a_95",Qne="_pixelateAnimation_7er8a_1",Jne="_revealAnimation_7er8a_101",eie="_videoContainer_7er8a_115",Bi={FullScreenPerform_main:Vne,FullScreenPerform_element:Gne,fullScreen_video:Xne,fadeIn:zne,intro_showSoftly:Wne,slideIn:Yne,typingEffect:Hne,typing:qne,blinkCursor:Kne,pixelateEffect:Zne,pixelateAnimation:Qne,revealAnimation:Jne,videoContainer:eie},tie=t=>{const e=`introPerform${Math.random().toString()}`;let r,n="rgba(0, 0, 0, 1)",i="rgba(255, 255, 255, 1)";const a=(b,S=0)=>{switch(b){case"fadeIn":return Bi.fadeIn;case"slideIn":return Bi.slideIn;case"typingEffect":return`${Bi.typingEffect} ${S}`;case"pixelateEffect":return Bi.pixelateEffect;case"revealAnimation":return Bi.revealAnimation;default:return Bi.fadeIn}};let o=Bi.fadeIn,s=1500,u=!1;for(const b of t.args){if(b.key==="backgroundColor"&&(n=b.value||"rgba(0, 0, 0, 1)"),b.key==="fontColor"&&(i=b.value||"rgba(255, 255, 255, 1)"),b.key==="fontSize")switch(b.value){case"small":r="280%";break;case"medium":r="350%";break;case"large":r="420%";break}if(b.key==="animation"&&(o=a(b.value)),b.key==="delayTime"){const S=parseInt(b.value.toString(),10);s=isNaN(S)?s:S}b.key==="hold"&&b.value===!0&&(u=!0)}const l={background:n,color:i,fontSize:r||"350%",width:"100%",height:"100%"},c=t.content.split(new RegExp("(?lS(b));let h=1e3+s*c.length;const d=u?1e3*60*60*24:1e3+s*c.length;let p=!0,v=setTimeout(()=>{p=!1},h),g=setTimeout(()=>{});const m=()=>{const b=document.getElementById("introContainer");if(h-=s,clearTimeout(v),v=setTimeout(()=>{p=!1},h),b){const S=b.childNodes[0].childNodes[0].childNodes,w=S.length;S.forEach((T,E)=>{const A=Number(T.style.animationDelay.split("ms")[0]);A>0&&(T.style.animationDelay=`${A-s}ms`),E===w-1&&(A===0?(clearTimeout(g),L.gameplay.performController.unmountPerform(e)):(clearTimeout(g),u||(g=setTimeout(()=>{L.gameplay.performController.unmountPerform(e)},h))))})}};L.events.userInteractNext.on(m);const y=c.map((b,S)=>C.jsxs("div",{style:{animationDelay:`${s*S}ms`},className:o,children:[b,b===""?" ":""]},"introtext"+S+Math.random().toString())),_=C.jsx("div",{style:l,children:C.jsx("div",{style:{padding:"3em 4em 3em 4em"},children:y})});ea.render(_,document.getElementById("introContainer"));const x=document.getElementById("introContainer");return x&&(x.style.display="block"),{performName:e,duration:d,isHoldOn:!1,stopFunction:()=>{const b=document.getElementById("introContainer");b&&(b.style.display="none"),L.events.userInteractNext.off(m)},blockingNext:()=>p,blockingAuto:()=>p,stopTimeout:void 0,goNextWhenOver:!0}},rie=t=>({performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),nie=t=>{let e=t.content;return(t.content==="none"||t.content==="")&&(e=""),te.dispatch(Ge({key:"miniAvatar",value:e})),{performName:"none",duration:0,isHoldOn:!0,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},iie="modulepreload",aie=function(t,e){return new URL(t,e).href},TP={},oie=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=aie(a,n),a in TP)return;TP[a]=!0;const o=a.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let c=i.length-1;c>=0;c--){const f=i[c];if(f.href===a&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":iie,o||(l.as="script",l.crossOrigin=""),l.href=a,document.head.appendChild(l),o)return new Promise((c,f)=>{l.addEventListener("load",c),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})},CF=new Map;function sie(t){return t?typeof t=="string"?t:t():null}function PF(t){const e=sie(t);return e||(ge.error("Get name of perform failed. There no name of the perform."),"")}function gwe(t,e){if(!e||typeof e!="function")throw new Error(`"${t}" is not a callback.`);CF.set(PF(t),e)}function lie(t,e=[]){const r=CF.get(PF(t));if(!r||!(r instanceof Function))throw ge.error(`Can't call the perform named "${t}"`),new Error(`"${t}" don't have the pixiPerform callback.`);return r(...e)}oie(()=>import("./initRegister-8f09b33a.js"),[],import.meta.url);const uie=t=>{const e="PixiPerform"+t.content;L.gameplay.performController.performList.forEach(a=>{if(a.performName===e)return{performName:"none",duration:0,isOver:!1,isHoldOn:!0,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!1,stopTimeout:void 0}});const r=lie(t.content),{container:n,tickerKey:i}=r;return{performName:e,duration:0,isHoldOn:!0,stopFunction:()=>{var a,o;ge.warn("现在正在卸载pixi演出"),n.destroy({texture:!0,baseTexture:!0}),(a=L.gameplay.pixiStage)==null||a.effectsContainer.removeChild(n),(o=L.gameplay.pixiStage)==null||o.removeAnimation(i)},blockingNext:()=>!1,blockingAuto:()=>!1,stopTimeout:void 0}},cie=t=>{var a;ge.debug("play SE");let e="effect-sound";L.gameplay.performController.unmountPerform(e,!0);let r=t.content,n=!1;He(t,"id")&&(e=`effect-sound-${((a=He(t,"id"))==null?void 0:a.toString())??""}`,L.gameplay.performController.unmountPerform(e,!0),n=!0);let i=!1;return{performName:"none",blockingAuto(){return!1},blockingNext(){return!1},isHoldOn:!1,stopFunction(){},stopTimeout:void 0,duration:1e3*60*60,arrangePerformPromise:new Promise(o=>{setTimeout(()=>{var p;const s=He(t,"volume");let u=document.createElement("audio");u.src=r,n&&(u.loop=!0);const l=te.getState().userData,c=l.optionData.volumeMain,f=typeof s=="number"&&s>=0&&s<=100?s:100,h=c*.01*(((p=l.optionData)==null?void 0:p.seVolume)??100)*.01*f*.01;u.volume=h,u.currentTime=0;const d={performName:e,duration:1e3*60*60,isHoldOn:n,skipNextCollect:!0,stopFunction:()=>{u.pause()},blockingNext:()=>!1,blockingAuto:()=>n?!1:!i,stopTimeout:void 0};o(d),u==null||u.play(),u.onended=()=>{for(const v of L.gameplay.performController.performList)v.performName===e&&(i=!0,v.stopFunction(),L.gameplay.performController.unmountPerform(v.performName))}},1)})}},fie=t=>{const e=te.getState().userData,r=e.optionData.volumeMain,n=r*.01*e.optionData.vocalVolume*.01,i=r*.01*e.optionData.bgmVolume*.01,a=wS();let o=He(t,"skipOff"),s=!1;o&&(s=!0),ea.render(C.jsx("div",{className:Bi.videoContainer,children:C.jsx("video",{className:Bi.fullScreen_video,id:"playVideoElement",src:t.content,autoPlay:!0})}),document.getElementById("videoContainer"));let u=!1;return{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>s,blockingAuto:()=>!0,stopTimeout:void 0,arrangePerformPromise:new Promise(l=>{setTimeout(()=>{let c=document.getElementById("playVideoElement");if(c!==null){c.currentTime=0,c.volume=i;const f=()=>{for(const y of L.gameplay.performController.performList)y.performName===a&&(u=!0,y.stopFunction(),L.gameplay.performController.unmountPerform(y.performName))},h=()=>{f()};L.events.fullscreenDbClick.on(h);const d={performName:a,duration:1e3*60*60,isOver:!1,isHoldOn:!1,stopFunction:()=>{L.events.fullscreenDbClick.off(h);const y=document.getElementById("currentBgm");y&&(y.volume=i.toString());const _=document.getElementById("currentVocal");y&&(_.volume=n.toString()),ea.render(C.jsx("div",{}),document.getElementById("videoContainer"))},blockingNext:()=>s,blockingAuto:()=>!u,stopTimeout:void 0,goNextWhenOver:!0};l(d);const p=0,v=0,g=document.getElementById("currentBgm");g&&(g.volume=v.toString());const m=document.getElementById("currentVocal");g&&(m.volume=p.toString()),c==null||c.play(),c.onended=()=>{f()}}},1)})}},hie=t=>{var o;te.getState().stage.currentDialogKey;const e=t.content,r=En(e),n=(((o=He(t,"target"))==null?void 0:o.toString())??"default_id").toString(),i=`${n}-${e}-${r}`;let a;return setTimeout(()=>{var u,l;(u=L.gameplay.pixiStage)==null||u.stopPresetAnimationOnTarget(n);const s=ip(e,n,r);s&&(ge.debug(`动画${e}作用在${n}`,r),(l=L.gameplay.pixiStage)==null||l.registerAnimation(s,i,n))},0),a=()=>{setTimeout(()=>{var s;te.getState().stage.currentDialogKey,(s=L.gameplay.pixiStage)==null||s.removeAnimationWithSetEffects(i)},0)},{performName:i,duration:r,isHoldOn:!1,stopFunction:a,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function die(t,e){const r=L.gameplay.pixiStage.getStageObjByKey(t);function n(){r&&(r.pixiContainer.alpha=0,r.pixiContainer.blur=0)}function i(){r&&(r.pixiContainer.alpha=1,r.pixiContainer.blur=5)}function a(o){if(r){const s=r.pixiContainer,u=L.gameplay.pixiStage.frameDuration,l=e/u*o,c=1/l,f=5/l;s.alpha<1&&(s.alpha+=c),s.blur<5&&(s.blur+=f)}}return{setStartState:n,setEndState:i,tickerFunc:a}}const pie=[{name:"universalSoftIn",animationGenerateFunc:_M},{name:"universalSoftOff",animationGenerateFunc:xM},{name:"testblur",animationGenerateFunc:die}],vie=t=>{var s,u,l;te.getState().stage.currentDialogKey;const e=t.content,r=He(t,"duration")??0,n=((s=He(t,"target"))==null?void 0:s.toString())??"0",i=`${n}-${e}-${r}`,a=mie(e);let o=()=>{};if(a){ge.debug(`动画${e}作用在${n}`,r);const c=a(n,r);(u=L.gameplay.pixiStage)==null||u.stopPresetAnimationOnTarget(n),(l=L.gameplay.pixiStage)==null||l.registerAnimation(c,i,n),o=()=>{var f;te.getState().stage.currentDialogKey,(f=L.gameplay.pixiStage)==null||f.removeAnimationWithSetEffects(i)}}return{performName:i,duration:r,isHoldOn:!1,stopFunction:o,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function mie(t){const e=pie.find(r=>r.name===t);return ge.debug("装载动画",e),e?e.animationGenerateFunc:null}const gie=t=>({performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),yie=t=>{var l;te.getState().stage.currentDialogKey;const e=(Math.random()*10).toString(16),r=t.content;let n;try{n=JSON.parse(r)}catch{n=[]}const i={name:e,effects:n};L.animationManager.addAnimation(i);const a=En(e),o=((l=He(t,"target"))==null?void 0:l.toString())??"0",s=`${o}-${e}-${a}`;let u=()=>{};return setTimeout(()=>{var f,h;(f=L.gameplay.pixiStage)==null||f.stopPresetAnimationOnTarget(o);const c=ip(e,o,a);c&&(ge.debug(`动画${e}作用在${o}`,a),(h=L.gameplay.pixiStage)==null||h.registerAnimation(c,s,o))},0),u=()=>{setTimeout(()=>{var c;te.getState().stage.currentDialogKey,(c=L.gameplay.pixiStage)==null||c.removeAnimationWithSetEffects(s)},0)},{performName:s,duration:a,isHoldOn:!1,stopFunction:u,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function _ie(t){return t.content==="hide"?te.dispatch(Ge({key:"isDisableTextbox",value:!0})):te.dispatch(Ge({key:"isDisableTextbox",value:!1})),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}}const xie=t=>{var c;te.getState().stage.currentDialogKey;const e=(Math.random()*10).toString(16),r=t.content;let n;const i=He(t,"duration"),a=((c=He(t,"target"))==null?void 0:c.toString())??"0";try{const f=JSON.parse(r);n=zc(a,f,i)}catch{n=[]}const o={name:e,effects:n};L.animationManager.addAnimation(o);const s=Sie(e),u=`${a}-${e}-${s}`;let l=()=>{};return setTimeout(()=>{var h,d;(h=L.gameplay.pixiStage)==null||h.stopPresetAnimationOnTarget(a);const f=bie(e,a,s);f&&(ge.debug(`动画${e}作用在${a}`,s),(d=L.gameplay.pixiStage)==null||d.registerAnimation(f,u,a))},0),l=()=>{setTimeout(()=>{var f;te.getState().stage.currentDialogKey,(f=L.gameplay.pixiStage)==null||f.removeAnimationWithSetEffects(u)},0)},{performName:u,duration:s,isHoldOn:!1,stopFunction:l,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function bie(t,e,r){const n=L.animationManager.getAnimations().find(i=>i.name===t);if(n){const i=n.effects.map(a=>{const o=Jt({...Hb,duration:0});return Object.assign(o,a),o.duration=a.duration,o});return ge.debug("装载自定义动画",i),QM(i,e,r)}return null}function Sie(t){const e=L.animationManager.getAnimations().find(r=>r.name===t);if(e){let r=0;return e.effects.forEach(n=>{r+=n.duration}),r}return 0}const wie=t=>{let e="0";for(const r of t.args)r.key==="target"&&(e=r.value.toString());return He(t,"enter")&&L.animationManager.nextEnterAnimationName.set(e,He(t,"enter").toString()),He(t,"exit")&&L.animationManager.nextExitAnimationName.set(e+"-off",He(t,"exit").toString()),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!1,stopTimeout:void 0}},Eie=t=>{const e=t.content;let r=t.content,n="default";t.args.forEach(a=>{a.key==="name"&&(r=a.value.toString()),a.key==="series"&&(n=a.value.toString())}),ge.info(`解锁BGM:${r},路径:${e},所属系列:${n}`),te.dispatch(Gk({name:r,url:e,series:n}));const i=te.getState().userData;return Ps.setItem(L.gameKey,i).then(()=>{}),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},Tie=t=>{const e=t.content;let r=t.content,n="default";t.args.forEach(a=>{a.key==="name"&&(r=a.value.toString()),a.key==="series"&&(n=a.value.toString())}),ge.info(`解锁CG:${r},路径:${e},所属系列:${n}`),te.dispatch(Vk({name:r,url:e,series:n}));const i=te.getState().userData;return Ps.setItem(L.gameKey,i).then(()=>{}),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},pS=(t,e=!0)=>{t&&L.backlogManager.makeBacklogEmpty(),e&&L.sceneManager.resetScene(),L.gameplay.performController.removeAllPerform(),L.gameplay.resetGamePlay();const r=Jt(Ek),n=te.getState().stage.GameVar;te.dispatch(rv(r)),e||te.dispatch(Ge({key:"GameVar",value:n}))},Aie={saveData:[],quickSaveData:null},OF=Hp({name:"saveData",initialState:Jt(Aie),reducers:{setFastSave:(t,e)=>{t.quickSaveData=e.payload},resetFastSave:t=>{t.quickSaveData=null},resetSaves:t=>{t.quickSaveData=null,t.saveData=[]},saveGame:(t,e)=>{t.saveData[e.payload.index]=e.payload.saveData},replaceSaveGame:(t,e)=>{t.saveData=e.payload}}}),Oa=OF.actions,Cie=OF.reducer,Pie=t=>{pS(!0);const e=te.dispatch,r=Nn("start.txt",Fn.scene);return setTimeout(()=>{L.sceneManager.resetScene()},5),e(Oa.resetFastSave()),lp(),ua(r).then(n=>{L.sceneManager.sceneData.currentScene=ca(n,"start.txt",r)}),e(rt({component:"showTitle",visibility:!0})),ES(te.getState().GUI.titleBgm),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},Oie=t=>(eF(t.content),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),Rie=t=>(L.gameplay.performController.performList.forEach(e=>{if(e.performName.match(/PixiPerform/)){ge.warn("pixi 被脚本重新初始化",e.performName);for(let r=0;r{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),ut={audioContext:new AudioContext,source:null,analyser:void 0,dataArray:void 0,audioLevelInterval:setInterval(()=>{},0),blinkTimerID:setTimeout(()=>{},0),maxAudioLevel:0},Iie=t=>(ut.maxAudioLevel=Math.max(t,ut.maxAudioLevel),{OPEN_THRESHOLD:ut.maxAudioLevel*.75,HALF_OPEN_THRESHOLD:ut.maxAudioLevel*.5}),kie=t=>{let e=!1;function r(){var n;e||t.animationEndTime&&Date.now()>t.animationEndTime||(e=!0,(n=L.gameplay.pixiStage)==null||n.performBlinkAnimation(t.key,t.animationItem,"closed",t.pos),ut.blinkTimerID=setTimeout(()=>{var a;(a=L.gameplay.pixiStage)==null||a.performBlinkAnimation(t.key,t.animationItem,"open",t.pos),e=!1;const i=Math.random()*300+3500;ut.blinkTimerID=setTimeout(r,i)},200))}r()},Mie=(t,e,r)=>{t.getByteFrequencyData(e);let n=0;for(let i=0;i{var h,d;const{audioLevel:e,OPEN_THRESHOLD:r,HALF_OPEN_THRESHOLD:n,currentMouthValue:i,lerpSpeed:a,key:o,animationItem:s,pos:u}=t;let l;e>r?l=1:e>n?l=.5:l=0;const c=i+(l-i)*a;(h=L.gameplay.pixiStage)==null||h.setModelMouthY(o,e);let f;c>.75?f="open":c>.25?f="half_open":f="closed",s!==void 0&&((d=L.gameplay.pixiStage)==null||d.performMouthSyncAnimation(o,s,f,u))};class Fie{constructor(e){Ae(this,"subject");Ae(this,"result");Ae(this,"isEnd",!1);this.subject=e}with(e,r){return!this.isEnd&&this.subject===e&&(this.result=r(),this.isEnd=!0),this}endsWith(e,r){return!this.isEnd&&this.subject===e&&(this.result=r(),this.isEnd=!0),this.evaluate()}default(e){return this.isEnd||(this.result=e()),this.evaluate()}evaluate(){return this.result}}function zv(t){return new Fie(t)}const Nie=t=>{ge.debug("play vocal");const e="vocal-play",r=He(t,"vocal"),n=He(t,"volume");let i;i=te.getState().stage;let a="",o="";const s=i.freeFigure,u=i.figureAssociatedAnimation;let l=0,c=0;const f=1;let h=document.getElementById("currentVocal");L.gameplay.performController.unmountPerform("vocal-play",!0),h!==null&&(h.currentTime=0,h.pause());for(const p of t.args)p.value===!0&&zv(p.key).with("left",()=>{a="left"}).with("right",()=>{a="right"}).endsWith("center",()=>{a="center"}),p.key==="figureId"&&(o=`${p.value.toString()}`);te.dispatch(Ge({key:"playVocal",value:r})),te.dispatch(Ge({key:"vocal",value:r}));let d=!1;return{arrangePerformPromise:new Promise(p=>{setTimeout(()=>{let v=document.getElementById("currentVocal");if(typeof n=="number"&&n>=0&&n<=100?te.dispatch(Ge({key:"vocalVolume",value:n})):te.dispatch(Ge({key:"vocalVolume",value:100})),v!==null){v.currentTime=0;const g={performName:e,duration:1e3*60*60,isOver:!1,isHoldOn:!1,stopFunction:()=>{clearInterval(ut.audioLevelInterval),v.pause(),o=o||`fig-${a}`;const y=u.find(_=>_.targetId===o);AP({audioLevel:0,OPEN_THRESHOLD:1,HALF_OPEN_THRESHOLD:1,currentMouthValue:c,lerpSpeed:f,key:o,animationItem:y,pos:a}),clearTimeout(ut.blinkTimerID)},blockingNext:()=>!1,blockingAuto:()=>!d,skipNextCollect:!0,stopTimeout:void 0};L.gameplay.performController.arrangeNewPerform(g,t,!1),o=o||`fig-${a}`;const m=u.find(y=>y.targetId===o);if(m){const y=s.find(b=>b.key===o);if(y&&(a=y.basePosition),!ut.audioContext){let b;b=new AudioContext,ut.analyser=b.createAnalyser(),ut.analyser.fftSize=256,ut.dataArray=new Uint8Array(ut.analyser.frequencyBinCount)}ut.analyser||(ut.analyser=ut.audioContext.createAnalyser(),ut.analyser.fftSize=256),l=ut.analyser.frequencyBinCount,ut.dataArray=new Uint8Array(l);let _=document.getElementById("currentVocal");ut.source||(ut.source=ut.audioContext.createMediaElementSource(_),ut.source.connect(ut.analyser)),ut.analyser.connect(ut.audioContext.destination),ut.audioLevelInterval=setInterval(()=>{const b=Mie(ut.analyser,ut.dataArray,l),{OPEN_THRESHOLD:S,HALF_OPEN_THRESHOLD:w}=Iie(b);AP({audioLevel:b,OPEN_THRESHOLD:S,HALF_OPEN_THRESHOLD:w,currentMouthValue:c,lerpSpeed:f,key:o,animationItem:m,pos:a})},50);let x;x=Date.now()+1e4,kie({key:o,animationItem:m,pos:a,animationEndTime:x}),setTimeout(()=>{clearTimeout(ut.blinkTimerID)},1e4)}v==null||v.play(),v.onended=()=>{for(const y of L.gameplay.performController.performList)y.performName===e&&(d=!0,y.stopFunction(),L.gameplay.performController.unmountPerform(y.performName))}}},1)})}};function vS(t){switch(t){case fn.slow:return 80;case fn.normal:return 35;case fn.fast:return 3}}function RF(t){switch(t){case fn.slow:return 800;case fn.normal:return 350;case fn.fast:return 200}}function IF(){const t=Ne(r=>r.userData.optionData.textboxFont);function e(){return zv(t).with(Zi.song,()=>'"思源宋体", serif').with(Zi.lxgw,()=>'"LXGW", serif').with(Zi.hei,()=>'"WebgalUI", serif').default(()=>'"WebgalUI", serif')}return e()}function l_(t){switch(t){case 0:return 150;case 1:return 205;case 2:return 240;default:return 205}}const Lie="_TextBox_EventHandler_1svk4_1",Die="_TextBox_Container_1svk4_9",Bie="_showSoftly_1svk4_1",jie="_TextBox_main_1svk4_17",Uie="_TextBox_main_miniavatarOff_1svk4_38",$ie="_TextBox_Background_1svk4_42",Vie="_TextBox_textElement_start_1svk4_55",Gie="_TextDelayShow_1svk4_1",Xie="_outer_1svk4_61",zie="_inner_1svk4_73",Wie="_zhanwei_1svk4_82",Yie="_TextBox_textElement_Settled_1svk4_87",Hie="_TextBox_showName_1svk4_92",qie="_TextBox_ShowName_Background_1svk4_105",Kie="_miniAvatarContainer_1svk4_120",Zie="_miniAvatarImg_1svk4_130",Qie="_nameContainer_1svk4_138",Jie="_outerName_1svk4_144",eae="_innerName_1svk4_155",tae="_text_1svk4_162",yt={TextBox_EventHandler:Lie,TextBox_Container:Die,showSoftly:Bie,TextBox_main:jie,TextBox_main_miniavatarOff:Uie,TextBox_Background:$ie,TextBox_textElement_start:Vie,TextDelayShow:Gie,outer:Xie,inner:zie,zhanwei:Wie,TextBox_textElement_Settled:Yie,TextBox_showName:Hie,TextBox_ShowName_Background:qie,miniAvatarContainer:Kie,miniAvatarImg:Zie,nameContainer:Qie,outerName:Jie,innerName:eae,text:tae};function kF(t){const{textArray:e,textDelay:r,currentConcatDialogPrev:n,currentDialogKey:i,isText:a,isSafari:o,isFirefox:s,fontSize:u,miniAvatar:l,showName:c,font:f,textDuration:h,isUseStroke:d,textboxOpacity:p}=t,v=hS("Stage/TextBox/textbox.scss");ne.useEffect(()=>{function y(){[...document.querySelectorAll(".Textelement_start")].forEach(b=>{b.className=v("TextBox_textElement_Settled",yt.TextBox_textElement_Settled)})}return L.events.textSettle.on(y),()=>{L.events.textSettle.off(y)}},[]);let g=0;const m=e.map((y,_)=>{const x=y.map((b,S)=>{const w=b.reactNode;let T="",E="";if(b.enhancedValue){const k=b.enhancedValue;console.log(k);for(const B of k){const{key:U,value:z}=B;switch(U){case"style":T=z;break;case"tips":break;case"style-alltext":E=z;break}}}let A=g*r;g++;let O=n.length;n!==""&&g>=O&&(A=A-O*r);const P=" "+s_(T),F=" "+s_(E);return gC.jsx("span",{style:{position:"relative"},children:C.jsxs("span",{className:yt.zhanwei,children:[y,C.jsx("span",{className:v("outerName",yt.outerName),children:y}),d&&C.jsx("span",{className:v("innerName",yt.innerName),children:y})]})},y+_))})}),C.jsx("div",{className:v("TextBox_showName",yt.TextBox_showName),style:{fontSize:"200%"},children:c.split("").map((y,_)=>C.jsx("span",{style:{position:"relative"},children:C.jsxs("span",{className:yt.zhanwei,children:[y,C.jsx("span",{className:v("outerName",yt.outerName),children:y}),d&&C.jsx("span",{className:v("innerName",yt.innerName),children:y})]})},y+_))},c)]}),C.jsx("div",{className:v("text",yt.text),style:{fontSize:u,flexFlow:"column",overflow:"hidden",paddingLeft:"0.1em"},children:m})]})]})})}const op={height:1440,width:2560},MF=navigator.userAgent,rae=/firefox/i.test(MF),nae=/^((?!chrome|android).)*safari/i.test(MF),iae=()=>{const[t,e]=ne.useState(!0);ne.useEffect(()=>{const y=()=>{const _=op.height,x=op.width,b=window.innerHeight,S=window.innerWidth,w=b/_,T=S/x,E=S/_,A=b/x;[w,T,E,A].forEach(O=>{O<=.2?e(!1):e(!0)})};return window.addEventListener("resize",y),y(),()=>{window.removeEventListener("resize",y)}},[]);const r=Ne(y=>y.stage),n=Ne(y=>y.userData),i=vS(n.optionData.textSpeed),a=RF(n.optionData.textSpeed);let o=l_(n.optionData.textSize)+"%";const s=IF(),u=r.showText!==""||r.showName!=="";let l=n.optionData.textSize;u&&r.showTextSize!==-1&&(o=l_(r.showTextSize)+"%",l=r.showTextSize);const c=zv(n.optionData.textSize).with(_i.small,()=>3).with(_i.medium,()=>2).with(_i.large,()=>2).default(()=>2),f=Wv(r.showText,c),h=r.showName,d=r.currentConcatDialogPrev,p=r.currentDialogKey,v=r.miniAvatar,g=n.optionData.textboxOpacity,m=kF;return C.jsx(m,{textArray:f,isText:u,textDelay:i,showName:h,currentConcatDialogPrev:d,fontSize:o,currentDialogKey:p,isSafari:nae,isFirefox:rae,miniAvatar:v,textDuration:a,font:s,textSizeState:l,lineLimit:c,isUseStroke:t,textboxOpacity:g})};function CP(t){return!!t.match(/[\u4e00-\u9fa5]|[\u0800-\u4e00]|[\uac00-\ud7ff]/)}function Wv(t,e,r){return t.split(new RegExp("(?lS(o)).map(o=>oae(o)).map(o=>{const s=[];return o.forEach((u,l)=>{zv(u.type).with("SegmentType.String",()=>{const c=aae(u.value);s.push(...c.map(f=>({reactNode:f})))}).endsWith("SegmentType.Link",()=>{const c=u.value,f=C.jsx("span",{className:"__enhanced_text",children:C.jsxs("ruby",{children:[c.text,C.jsx("rt",{children:c.ruby})]},l+c.text)},c.text+`${l}`);s.push({reactNode:f,enhancedValue:c.values})})}),s}).slice(0,r?void 0:e)}function aae(t){if(!t)return[];const e=[];let r="",n=CP(t[0]);const i=a=>/[!-\/:-@\[-`{-~\u2000-\u206F\u3000-\u303F\uff00-\uffef]/g.test(a);for(const a of t)if(a===" ")r&&(e.push(r),r=""),e.push(" "),n=!1;else if(CP(a)&&!i(a))!n&&r&&(e.push(r),r=""),e.push(a),n=!0;else{if(i(a)){r?(r+=a,e.push(r),r=""):e.length>0?e[e.length-1]+=a:e.push(a);continue}n&&r&&(e.push(r),r=""),r+=a,n=!1}return r&&e.push(r),e}function oae(t){const e=/(\[(.*?)\]\((.*?)\))|([^\[\]]+)/g,r=[];let n;for(;(n=e.exec(t))!==null;)if(n[1]){const i=n[2],a=n[3];let o=[],s="";if(a.match(/style=|tips=|ruby=|style-alltext=/)){o=sae(a);const u=o.find(l=>l.key==="ruby");u&&(s=u.value)}else s=a;r.push({type:"SegmentType.Link",value:{text:i,ruby:s,values:o}})}else{const i=n[0];r.push({type:"SegmentType.String",value:i})}return r}function sae(t){const e=[],r=/(\S+)=(.*?)(?=\s+\S+=|\s*$)/g;let n;for(;(n=r.exec(t))!==null;)e.push({key:n[1],value:n[2].trim()});return e}const lae=t=>{const e=te.getState().stage,r=te.getState().userData,n=te.dispatch;let i=Math.random().toString(),a=t.content;const o=He(t,"concat"),s=He(t,"notend"),u=He(t,"speaker"),l=He(t,"clear"),c=He(t,"vocal");o?(i=e.currentDialogKey,a=e.showText+a,n(Ge({key:"currentConcatDialogPrev",value:e.showText}))):n(Ge({key:"currentConcatDialogPrev",value:""})),n(Ge({key:"showText",value:a})),n(Ge({key:"vocal",value:""})),r.optionData.voiceInterruption===Gc.no&&c===null||(n(Ge({key:"playVocal",value:""})),L.gameplay.performController.unmountPerform("vocal-play",!0)),n(Ge({key:"currentDialogKey",value:i}));const f=vS(r.optionData.textSpeed),d=Wv(t.content,3).reduce((y,_)=>y+_.length,0),p=f*d;for(const y of t.args)if(y.key==="fontSize")switch(y.value){case"default":n(Ge({key:"showTextSize",value:-1}));break;case"small":n(Ge({key:"showTextSize",value:_i.small}));break;case"medium":n(Ge({key:"showTextSize",value:_i.medium}));break;case"large":n(Ge({key:"showTextSize",value:_i.large}));break}let v=e.showName;u!==null&&(v=u),l&&(v=""),n(Ge({key:"showName",value:v})),c&&Nie(t);const g=wS();let m=750-r.optionData.textSpeed*250;return s&&(m=0),{performName:g,duration:p+m,isHoldOn:!1,stopFunction:()=>{L.events.textSettle.emit()},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0,goNextWhenOver:s}};var mS={},Kc={document:{}},FF=Object.prototype.hasOwnProperty,NF=function(t){return Yv(t)?t.toLowerCase():t},Sc=Array.isArray,uae=function(t){return Yv(t)?t.replace(/[A-Z]/g,function(e){return String.fromCharCode(e.charCodeAt(0)|32)}):t};"I".toLowerCase()!=="i"&&(NF=uae);var cae,gS=Object.prototype.toString,LF=Object.getPrototypeOf,Yg=$F("ng");Kc.angular||(Kc.angular={});Kc.document.documentMode;function fae(t){if(t==null||xS(t))return!1;if(Sc(t)||Yv(t)||cae)return!0;var e="length"in Object(t)&&t.length;return _S(e)&&(e>=0&&(e-1 in t||t instanceof Array)||typeof t.item=="function")}function Dt(t,e,r){var n,i;if(t)if(jF(t))for(n in t)n!=="prototype"&&n!=="length"&&n!=="name"&&t.hasOwnProperty(n)&&e.call(r,t[n],n,t);else if(Sc(t)||fae(t)){var a=typeof t!="object";for(n=0,i=t.length;n"u"}function ol(t){return typeof t<"u"}function DF(t){return t!==null&&typeof t=="object"}function BF(t){return t!==null&&typeof t=="object"&&!LF(t)}function Yv(t){return typeof t=="string"}function _S(t){return typeof t=="number"}function jF(t){return typeof t=="function"}function xS(t){return t&&t.window===t}function UF(t){return t&&t.$evalAsync&&t.$watch}var pae=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/;function vae(t){return t&&_S(t.length)&&pae.test(gS.call(t))}function mae(t){return gS.call(t)==="[object ArrayBuffer]"}function gae(t,e){var r=[],n=[];if(e){if(vae(e)||mae(e))throw Yg("cpta","Can't copy! TypedArray destination cannot be mutated.");if(t===e)throw Yg("cpi","Can't copy! Source and destination are identical.");return Sc(e)?e.length=0:Dt(e,function(s,u){u!=="$$hashKey"&&delete e[u]}),r.push(t),n.push(e),i(t,e)}return a(t);function i(s,u){var l=u.$$hashKey,c;if(Sc(s))for(var f=0,h=s.length;f=0)return"...";e.push(n)}return n})}function PP(t){return typeof t=="function"?t.toString().replace(/ \{[\s\S]*$/,""):dae(t)?"undefined":typeof t!="string"?bae(t):t}function $F(t,e){return e=e||Error,function(){var r=2,n=arguments,i=n[0],a="["+(t?t+":":"")+i+"] ",o=n[1],s,u;for(a+=o.replace(/\{\d+\}/g,function(l){var c=+l.slice(1,-1),f=c+r;return f{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],i=e;for(;i;)n.push(i),i=i.next;return n},subscribe(n){let i=!0,a=r={callback:n,next:null,prev:r};return a.prev?a.prev.next=a:e=a,function(){!i||e===null||(i=!1,a.next?a.next.prev=a.prev:r=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}const mP={notify(){},get:()=>[]};function Lre(t,e){let r,n=mP,i=0,a=!1;function o(v){c();const g=n.subscribe(v);let m=!1;return()=>{m||(m=!0,g(),f())}}function s(){n.notify()}function u(){p.onStateChange&&p.onStateChange()}function l(){return a}function c(){i++,r||(r=e?e.addNestedSub(u):t.subscribe(u),n=Nre())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=mP)}function h(){a||(a=!0,c())}function d(){a&&(a=!1,f())}const p={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:u,isSubscribed:l,trySubscribe:h,tryUnsubscribe:d,getListeners:()=>n};return p}const Dre=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Bre=Dre?ne.useLayoutEffect:ne.useEffect;function vF({store:t,context:e,children:r,serverState:n,stabilityCheck:i="once",noopCheck:a="once"}){const o=ne.useMemo(()=>{const l=Lre(t);return{store:t,subscription:l,getServerState:n?()=>n:void 0,stabilityCheck:i,noopCheck:a}},[t,n,i,a]),s=ne.useMemo(()=>t.getState(),[t]);Bre(()=>{const{subscription:l}=o;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),s!==t.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[o,s]);const u=e||Eo;return ne.createElement(u.Provider,{value:o},r)}function mF(t=Eo){const e=t===Eo?lF:tS(t);return function(){const{store:n}=e();return n}}const jre=mF();function Ure(t=Eo){const e=t===Eo?jre:mF(t);return function(){return e().dispatch}}const Nr=Ure();bre(vre.useSyncExternalStoreWithSelector);gre($I.unstable_batchedUpdates);const yn=()=>{const t=Nr();return{playSeEnter:()=>{t(Ge({key:"uiSe",value:tF}))},playSeClick:()=>{t(Ge({key:"uiSe",value:rF}))},playSePageChange:()=>{t(Ge({key:"uiSe",value:Hte}))},playSeDialogOpen:()=>{t(Ge({key:"uiSe",value:Kte}))},playSeSwitch:()=>{t(Ge({key:"uiSe",value:qte}))}}},sS=()=>({playSeEnter:()=>{te.dispatch(Ge({key:"uiSe",value:tF}))},playSeClick:()=>{te.dispatch(Ge({key:"uiSe",value:rF}))}}),$re=[{reg:/\\\\/g,val:"\\"},{reg:/\\\|/g,val:"|"},{reg:/\\:/g,val:":"},{reg:/\\,/g,val:","},{reg:/\\;/g,val:";"},{reg:/\\./g,val:"."}],lS=t=>{let e=t;for(let r of $re)e=e.replaceAll(r.reg,r.val);return e};function Vre(t){return Hv.parseScssToWebgalStyleObj(t)}function wi(t){const[e,r]=ne.useState(t);return{_value:e,set:function(n){this._value=n,r(n)},get value(){return this._value},set value(n){this.set(n)}}}function Gre(t){if(t.sheet)return t.sheet;for(var e=0;e0?Vr(fu,--Pn):0,Bl--,sr===10&&(Bl=1,Gv--),sr}function Bn(){return sr=Pn2||Hc(sr)>3?"":" "}function rne(t,e){for(;--e&&Bn()&&!(sr<48||sr>102||sr>57&&sr<65||sr>70&&sr<97););return Vf(t,cd()+(e<6&&Ji()==32&&Bn()==32))}function o_(t){for(;Bn();)switch(sr){case t:return Pn;case 34:case 39:t!==34&&t!==39&&o_(sr);break;case 40:t===41&&o_(t);break;case 92:Bn();break}return Pn}function nne(t,e){for(;Bn()&&t+sr!==47+10;)if(t+sr===42+42&&Ji()===47)break;return"/*"+Vf(e,Pn-1)+"*"+Vv(t===47?t:Bn())}function ine(t){for(;!Hc(Ji());)Bn();return Vf(t,Pn)}function ane(t){return SF(hd("",null,null,null,[""],t=bF(t),0,[0],t))}function hd(t,e,r,n,i,a,o,s,u){for(var l=0,c=0,f=o,h=0,d=0,p=0,v=1,g=1,m=1,y=0,_="",x=i,b=a,S=n,w=_;g;)switch(p=y,y=Bn()){case 40:if(p!=108&&Vr(w,f-1)==58){a_(w+=ot(fd(y),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:w+=fd(y);break;case 9:case 10:case 13:case 32:w+=tne(p);break;case 92:w+=rne(cd()-1,7);continue;case 47:switch(Ji()){case 42:case 47:ph(one(nne(Bn(),cd()),e,r),u);break;default:w+="/"}break;case 123*v:s[l++]=Ui(w)*m;case 125*v:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+c:m==-1&&(w=ot(w,/\f/g,"")),d>0&&Ui(w)-f&&ph(d>32?yP(w+";",n,r,f-1):yP(ot(w," ","")+";",n,r,f-2),u);break;case 59:w+=";";default:if(ph(S=gP(w,e,r,l,c,i,s,_,x=[],b=[],f),a),y===123)if(c===0)hd(w,e,S,S,x,a,f,s,b);else switch(h===99&&Vr(w,3)===110?100:h){case 100:case 108:case 109:case 115:hd(t,S,S,n&&ph(gP(t,S,S,0,0,i,s,_,i,x=[],f),b),i,b,f,s,n?x:b);break;default:hd(w,S,S,S,[""],b,0,s,b)}}l=c=d=0,v=m=1,_=w="",f=o;break;case 58:f=1+Ui(w),d=p;default:if(v<1){if(y==123)--v;else if(y==125&&v++==0&&ene()==125)continue}switch(w+=Vv(y),y*v){case 38:m=c>0?1:(w+="\f",-1);break;case 44:s[l++]=(Ui(w)-1)*m,m=1;break;case 64:Ji()===45&&(w+=fd(Bn())),h=Ji(),c=f=Ui(_=w+=ine(cd())),y++;break;case 45:p===45&&Ui(w)==2&&(v=0)}}return a}function gP(t,e,r,n,i,a,o,s,u,l,c){for(var f=i-1,h=i===0?a:[""],d=fS(h),p=0,v=0,g=0;p0?h[m]+" "+y:ot(y,/&\f/g,h[m])))&&(u[g++]=_);return Xv(t,e,r,i===0?uS:s,u,l,c)}function one(t,e,r){return Xv(t,e,r,gF,Vv(Jre()),Yc(t,2,-2),0)}function yP(t,e,r,n){return Xv(t,e,r,cS,Yc(t,0,n),Yc(t,n+1,-1),n)}function wl(t,e){for(var r="",n=fS(t),i=0;i6)switch(Vr(t,e+1)){case 109:if(Vr(t,e+4)!==45)break;case 102:return ot(t,/(.+:)(.+)-([^]+)/,"$1"+at+"$2-$3$1"+ap+(Vr(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~a_(t,"stretch")?wF(ot(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Vr(t,e+1)!==115)break;case 6444:switch(Vr(t,Ui(t)-3-(~a_(t,"!important")&&10))){case 107:return ot(t,":",":"+at)+t;case 101:return ot(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+at+(Vr(t,14)===45?"inline-":"")+"box$3$1"+at+"$2$3$1"+Wr+"$2box$3")+t}break;case 5936:switch(Vr(t,e+11)){case 114:return at+t+Wr+ot(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return at+t+Wr+ot(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return at+t+Wr+ot(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return at+t+Wr+t+t}return t}var mne=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case cS:e.return=wF(e.value,e.length);break;case yF:return wl([ju(e,{value:ot(e.value,"@","@"+at)})],i);case uS:if(e.length)return Qre(e.props,function(a){switch(Zre(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return wl([ju(e,{props:[ot(a,/:(read-\w+)/,":"+ap+"$1")]})],i);case"::placeholder":return wl([ju(e,{props:[ot(a,/:(plac\w+)/,":"+at+"input-$1")]}),ju(e,{props:[ot(a,/:(plac\w+)/,":"+ap+"$1")]}),ju(e,{props:[ot(a,/:(plac\w+)/,Wr+"input-$1")]})],i)}return""})}},gne=[mne],yne=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var g=v.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=e.stylisPlugins||gne,a={},o,s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var g=v.getAttribute("data-emotion").split(" "),m=1;m=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var xne={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},bne=/[A-Z]|^ms/g,Sne=/_EMO_([^_]+?)_([^]*?)_EMO_/g,EF=function(e){return e.charCodeAt(1)===45},xP=function(e){return e!=null&&typeof e!="boolean"},zg=cne(function(t){return EF(t)?t:t.replace(bne,"-$&").toLowerCase()}),bP=function(e,r){switch(e){case"animation":case"animationName":if(typeof r=="string")return r.replace(Sne,function(n,i,a){return $i={name:i,styles:a,next:$i},i})}return xne[e]!==1&&!EF(e)&&typeof r=="number"&&r!==0?r+"px":r};function qc(t,e,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return $i={name:r.name,styles:r.styles,next:$i},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)$i={name:n.name,styles:n.styles,next:$i},n=n.next;var i=r.styles+";";return i}return wne(t,e,r)}case"function":{if(t!==void 0){var a=$i,o=r(t);return $i=a,qc(t,e,o)}break}}if(e==null)return r;var s=e[r];return s!==void 0?s:r}function wne(t,e,r){var n="";if(Array.isArray(r))for(var i=0;ia.stage.replacedUIlable),n=(a,o)=>{var u;const s=(r==null?void 0:r[a])??a;if(Object.keys(e.value.classNameStyles).includes(s)){const l=s_(((u=e.value.classNameStyles)==null?void 0:u[s])??"");return`${o} ${l}`}return o},i=async()=>{ge.debug("更新 Scss 文件",t);const o=(await Xc.get(`game/template/${t}`)).data;e.set(Vre(o))};return ne.useEffect(()=>{i()},[]),ne.useEffect(()=>{One(e.value.others)},[e.value.others]),Rne(i),n}function Rne(t){const e=()=>{t()};ne.useEffect(()=>(L.events.styleUpdate.on(e),()=>L.events.styleUpdate.off(e)),[])}class dS{constructor(e,r){Ae(this,"text");Ae(this,"jump");Ae(this,"jumpToScene");Ae(this,"showCondition");Ae(this,"enableCondition");this.text=lS(e),this.jump=r,this.jumpToScene=r.match(new RegExp("(?"),n=r.length>1?r[0]:null,a=(r.length>1?r[1]:r[0]).split(new RegExp("(?{const r=t.content.split(new RegExp("(?dS.parse(n));return ea.render(C.jsx(vF,{store:te,children:C.jsx(kne,{chooseOptions:r})}),document.getElementById("chooseContainer")),{performName:"choose",duration:1e3*60*60*24,isHoldOn:!1,stopFunction:()=>{ea.render(C.jsx("div",{}),document.getElementById("chooseContainer"))},blockingNext:()=>!0,blockingAuto:()=>!0,stopTimeout:void 0}};function kne(t){const r=te.getState().userData.optionData.textboxFont===Zi.song?'"思源宋体", serif':'"WebgalUI", serif',{playSeEnter:n,playSeClick:i}=sS(),a=hS("Stage/Choose/choose.scss"),o=s=>s.filter((u,l)=>f_(u.showCondition)).map((u,l)=>{const c=f_(u.enableCondition),f=c?a("Choose_item",dh.Choose_item):a("Choose_item_disabled",dh.Choose_item_disabled),h=c?()=>{i(),u.jumpToScene?JM(u.jump,u.text):eF(u.jump),L.gameplay.performController.unmountPerform("choose")}:()=>{};return C.jsx("div",{className:a("Choose_item_outer",dh.Choose_item_outer),children:C.jsx("div",{className:f,style:{fontFamily:r},onClick:h,onMouseEnter:n,children:u.text})},u.jump+l)});return C.jsx("div",{className:a("Choose_Main",dh.Choose_Main),children:o(t.chooseOptions)})}const Mne=t=>(ge.debug(`脚本内注释${t.content}`),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),Fne=t=>(t.content!==""&&t.content!=="none"?te.dispatch(Ge({key:"enableFilm",value:t.content})):te.dispatch(Ge({key:"enableFilm",value:""})),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),Nne="_Choose_Main_4xkm5_1",Lne="_Choose_item_4xkm5_13",Dne="_glabalDialog_container_inner_4xkm5_28",Bne="_glabalDialog_container_4xkm5_28",jne="_title_4xkm5_47",Une="_button_4xkm5_59",$s={Choose_Main:Nne,Choose_item:Lne,glabalDialog_container_inner:Dne,glabalDialog_container:Bne,title:jne,button:Une},$ne=t=>{const e=t.content.toString().trim(),r=He(t,"title"),n=(r===0?"Please Input":r)??"Please Input",i=He(t,"buttonText"),a=(i===0?"OK":i)??"OK",s=te.getState().userData.optionData.textboxFont===Zi.song?'"思源宋体", serif':'"WebgalUI", serif',{playSeEnter:u,playSeClick:l}=sS(),c=C.jsx("div",{style:{fontFamily:s},className:$s.glabalDialog_container,children:C.jsxs("div",{className:$s.glabalDialog_container_inner,children:[C.jsx("div",{className:$s.title,children:n}),C.jsx("input",{id:"user-input",className:$s.Choose_item}),C.jsx("div",{onMouseEnter:u,onClick:()=>{const f=document.getElementById("user-input");f&&te.dispatch(Tk({key:e,value:((f==null?void 0:f.value)??"")===""?" ":(f==null?void 0:f.value)??""})),l(),L.gameplay.performController.unmountPerform("userInput"),en()},className:$s.button,children:a})]})});return ea.render(C.jsx("div",{className:$s.Choose_Main,children:c}),document.getElementById("chooseContainer")),{performName:"userInput",duration:1e3*60*60*24,isHoldOn:!1,stopFunction:()=>{ea.render(C.jsx("div",{}),document.getElementById("chooseContainer"))},blockingNext:()=>!0,blockingAuto:()=>!0,stopTimeout:void 0}},Vne="_FullScreenPerform_main_7er8a_2",Gne="_FullScreenPerform_element_7er8a_9",Xne="_fullScreen_video_7er8a_17",zne="_fadeIn_7er8a_74",Wne="_intro_showSoftly_7er8a_1",Yne="_slideIn_7er8a_80",Hne="_typingEffect_7er8a_86",qne="_typing_7er8a_86",Kne="_blinkCursor_7er8a_1",Zne="_pixelateEffect_7er8a_95",Qne="_pixelateAnimation_7er8a_1",Jne="_revealAnimation_7er8a_101",eie="_videoContainer_7er8a_115",Bi={FullScreenPerform_main:Vne,FullScreenPerform_element:Gne,fullScreen_video:Xne,fadeIn:zne,intro_showSoftly:Wne,slideIn:Yne,typingEffect:Hne,typing:qne,blinkCursor:Kne,pixelateEffect:Zne,pixelateAnimation:Qne,revealAnimation:Jne,videoContainer:eie},tie=t=>{const e=`introPerform${Math.random().toString()}`;let r,n="rgba(0, 0, 0, 1)",i="rgba(255, 255, 255, 1)";const a=(b,S=0)=>{switch(b){case"fadeIn":return Bi.fadeIn;case"slideIn":return Bi.slideIn;case"typingEffect":return`${Bi.typingEffect} ${S}`;case"pixelateEffect":return Bi.pixelateEffect;case"revealAnimation":return Bi.revealAnimation;default:return Bi.fadeIn}};let o=Bi.fadeIn,s=1500,u=!1;for(const b of t.args){if(b.key==="backgroundColor"&&(n=b.value||"rgba(0, 0, 0, 1)"),b.key==="fontColor"&&(i=b.value||"rgba(255, 255, 255, 1)"),b.key==="fontSize")switch(b.value){case"small":r="280%";break;case"medium":r="350%";break;case"large":r="420%";break}if(b.key==="animation"&&(o=a(b.value)),b.key==="delayTime"){const S=parseInt(b.value.toString(),10);s=isNaN(S)?s:S}b.key==="hold"&&b.value===!0&&(u=!0)}const l={background:n,color:i,fontSize:r||"350%",width:"100%",height:"100%"},c=t.content.split(new RegExp("(?lS(b));let h=1e3+s*c.length;const d=u?1e3*60*60*24:1e3+s*c.length;let p=!0,v=setTimeout(()=>{p=!1},h),g=setTimeout(()=>{});const m=()=>{const b=document.getElementById("introContainer");if(h-=s,clearTimeout(v),v=setTimeout(()=>{p=!1},h),b){const S=b.childNodes[0].childNodes[0].childNodes,w=S.length;S.forEach((T,E)=>{const A=Number(T.style.animationDelay.split("ms")[0]);A>0&&(T.style.animationDelay=`${A-s}ms`),E===w-1&&(A===0?(clearTimeout(g),L.gameplay.performController.unmountPerform(e)):(clearTimeout(g),u||(g=setTimeout(()=>{L.gameplay.performController.unmountPerform(e)},h))))})}};L.events.userInteractNext.on(m);const y=c.map((b,S)=>C.jsxs("div",{style:{animationDelay:`${s*S}ms`},className:o,children:[b,b===""?" ":""]},"introtext"+S+Math.random().toString())),_=C.jsx("div",{style:l,children:C.jsx("div",{style:{padding:"3em 4em 3em 4em"},children:y})});ea.render(_,document.getElementById("introContainer"));const x=document.getElementById("introContainer");return x&&(x.style.display="block"),{performName:e,duration:d,isHoldOn:!1,stopFunction:()=>{const b=document.getElementById("introContainer");b&&(b.style.display="none"),L.events.userInteractNext.off(m)},blockingNext:()=>p,blockingAuto:()=>p,stopTimeout:void 0,goNextWhenOver:!0}},rie=t=>({performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),nie=t=>{let e=t.content;return(t.content==="none"||t.content==="")&&(e=""),te.dispatch(Ge({key:"miniAvatar",value:e})),{performName:"none",duration:0,isHoldOn:!0,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},iie="modulepreload",aie=function(t,e){return new URL(t,e).href},TP={},oie=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=aie(a,n),a in TP)return;TP[a]=!0;const o=a.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let c=i.length-1;c>=0;c--){const f=i[c];if(f.href===a&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":iie,o||(l.as="script",l.crossOrigin=""),l.href=a,document.head.appendChild(l),o)return new Promise((c,f)=>{l.addEventListener("load",c),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})},CF=new Map;function sie(t){return t?typeof t=="string"?t:t():null}function PF(t){const e=sie(t);return e||(ge.error("Get name of perform failed. There no name of the perform."),"")}function gwe(t,e){if(!e||typeof e!="function")throw new Error(`"${t}" is not a callback.`);CF.set(PF(t),e)}function lie(t,e=[]){const r=CF.get(PF(t));if(!r||!(r instanceof Function))throw ge.error(`Can't call the perform named "${t}"`),new Error(`"${t}" don't have the pixiPerform callback.`);return r(...e)}oie(()=>import("./initRegister-99a9f9bd.js"),[],import.meta.url);const uie=t=>{const e="PixiPerform"+t.content;L.gameplay.performController.performList.forEach(a=>{if(a.performName===e)return{performName:"none",duration:0,isOver:!1,isHoldOn:!0,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!1,stopTimeout:void 0}});const r=lie(t.content),{container:n,tickerKey:i}=r;return{performName:e,duration:0,isHoldOn:!0,stopFunction:()=>{var a,o;ge.warn("现在正在卸载pixi演出"),n.destroy({texture:!0,baseTexture:!0}),(a=L.gameplay.pixiStage)==null||a.effectsContainer.removeChild(n),(o=L.gameplay.pixiStage)==null||o.removeAnimation(i)},blockingNext:()=>!1,blockingAuto:()=>!1,stopTimeout:void 0}},cie=t=>{var a;ge.debug("play SE");let e="effect-sound";L.gameplay.performController.unmountPerform(e,!0);let r=t.content,n=!1;He(t,"id")&&(e=`effect-sound-${((a=He(t,"id"))==null?void 0:a.toString())??""}`,L.gameplay.performController.unmountPerform(e,!0),n=!0);let i=!1;return{performName:"none",blockingAuto(){return!1},blockingNext(){return!1},isHoldOn:!1,stopFunction(){},stopTimeout:void 0,duration:1e3*60*60,arrangePerformPromise:new Promise(o=>{setTimeout(()=>{var p;const s=He(t,"volume");let u=document.createElement("audio");u.src=r,n&&(u.loop=!0);const l=te.getState().userData,c=l.optionData.volumeMain,f=typeof s=="number"&&s>=0&&s<=100?s:100,h=c*.01*(((p=l.optionData)==null?void 0:p.seVolume)??100)*.01*f*.01;u.volume=h,u.currentTime=0;const d={performName:e,duration:1e3*60*60,isHoldOn:n,skipNextCollect:!0,stopFunction:()=>{u.pause()},blockingNext:()=>!1,blockingAuto:()=>n?!1:!i,stopTimeout:void 0};o(d),u==null||u.play(),u.onended=()=>{for(const v of L.gameplay.performController.performList)v.performName===e&&(i=!0,v.stopFunction(),L.gameplay.performController.unmountPerform(v.performName))}},1)})}},fie=t=>{const e=te.getState().userData,r=e.optionData.volumeMain,n=r*.01*e.optionData.vocalVolume*.01,i=r*.01*e.optionData.bgmVolume*.01,a=wS();let o=He(t,"skipOff"),s=!1;o&&(s=!0),ea.render(C.jsx("div",{className:Bi.videoContainer,children:C.jsx("video",{className:Bi.fullScreen_video,id:"playVideoElement",src:t.content,autoPlay:!0})}),document.getElementById("videoContainer"));let u=!1;return{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>s,blockingAuto:()=>!0,stopTimeout:void 0,arrangePerformPromise:new Promise(l=>{setTimeout(()=>{let c=document.getElementById("playVideoElement");if(c!==null){c.currentTime=0,c.volume=i;const f=()=>{for(const y of L.gameplay.performController.performList)y.performName===a&&(u=!0,y.stopFunction(),L.gameplay.performController.unmountPerform(y.performName))},h=()=>{f()};L.events.fullscreenDbClick.on(h);const d={performName:a,duration:1e3*60*60,isOver:!1,isHoldOn:!1,stopFunction:()=>{L.events.fullscreenDbClick.off(h);const y=document.getElementById("currentBgm");y&&(y.volume=i.toString());const _=document.getElementById("currentVocal");y&&(_.volume=n.toString()),ea.render(C.jsx("div",{}),document.getElementById("videoContainer"))},blockingNext:()=>s,blockingAuto:()=>!u,stopTimeout:void 0,goNextWhenOver:!0};l(d);const p=0,v=0,g=document.getElementById("currentBgm");g&&(g.volume=v.toString());const m=document.getElementById("currentVocal");g&&(m.volume=p.toString()),c==null||c.play(),c.onended=()=>{f()}}},1)})}},hie=t=>{var o;te.getState().stage.currentDialogKey;const e=t.content,r=En(e),n=(((o=He(t,"target"))==null?void 0:o.toString())??"default_id").toString(),i=`${n}-${e}-${r}`;let a;return setTimeout(()=>{var u,l;(u=L.gameplay.pixiStage)==null||u.stopPresetAnimationOnTarget(n);const s=ip(e,n,r);s&&(ge.debug(`动画${e}作用在${n}`,r),(l=L.gameplay.pixiStage)==null||l.registerAnimation(s,i,n))},0),a=()=>{setTimeout(()=>{var s;te.getState().stage.currentDialogKey,(s=L.gameplay.pixiStage)==null||s.removeAnimationWithSetEffects(i)},0)},{performName:i,duration:r,isHoldOn:!1,stopFunction:a,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function die(t,e){const r=L.gameplay.pixiStage.getStageObjByKey(t);function n(){r&&(r.pixiContainer.alpha=0,r.pixiContainer.blur=0)}function i(){r&&(r.pixiContainer.alpha=1,r.pixiContainer.blur=5)}function a(o){if(r){const s=r.pixiContainer,u=L.gameplay.pixiStage.frameDuration,l=e/u*o,c=1/l,f=5/l;s.alpha<1&&(s.alpha+=c),s.blur<5&&(s.blur+=f)}}return{setStartState:n,setEndState:i,tickerFunc:a}}const pie=[{name:"universalSoftIn",animationGenerateFunc:_M},{name:"universalSoftOff",animationGenerateFunc:xM},{name:"testblur",animationGenerateFunc:die}],vie=t=>{var s,u,l;te.getState().stage.currentDialogKey;const e=t.content,r=He(t,"duration")??0,n=((s=He(t,"target"))==null?void 0:s.toString())??"0",i=`${n}-${e}-${r}`,a=mie(e);let o=()=>{};if(a){ge.debug(`动画${e}作用在${n}`,r);const c=a(n,r);(u=L.gameplay.pixiStage)==null||u.stopPresetAnimationOnTarget(n),(l=L.gameplay.pixiStage)==null||l.registerAnimation(c,i,n),o=()=>{var f;te.getState().stage.currentDialogKey,(f=L.gameplay.pixiStage)==null||f.removeAnimationWithSetEffects(i)}}return{performName:i,duration:r,isHoldOn:!1,stopFunction:o,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function mie(t){const e=pie.find(r=>r.name===t);return ge.debug("装载动画",e),e?e.animationGenerateFunc:null}const gie=t=>({performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),yie=t=>{var l;te.getState().stage.currentDialogKey;const e=(Math.random()*10).toString(16),r=t.content;let n;try{n=JSON.parse(r)}catch{n=[]}const i={name:e,effects:n};L.animationManager.addAnimation(i);const a=En(e),o=((l=He(t,"target"))==null?void 0:l.toString())??"0",s=`${o}-${e}-${a}`;let u=()=>{};return setTimeout(()=>{var f,h;(f=L.gameplay.pixiStage)==null||f.stopPresetAnimationOnTarget(o);const c=ip(e,o,a);c&&(ge.debug(`动画${e}作用在${o}`,a),(h=L.gameplay.pixiStage)==null||h.registerAnimation(c,s,o))},0),u=()=>{setTimeout(()=>{var c;te.getState().stage.currentDialogKey,(c=L.gameplay.pixiStage)==null||c.removeAnimationWithSetEffects(s)},0)},{performName:s,duration:a,isHoldOn:!1,stopFunction:u,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function _ie(t){return t.content==="hide"?te.dispatch(Ge({key:"isDisableTextbox",value:!0})):te.dispatch(Ge({key:"isDisableTextbox",value:!1})),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}}const xie=t=>{var c;te.getState().stage.currentDialogKey;const e=(Math.random()*10).toString(16),r=t.content;let n;const i=He(t,"duration"),a=((c=He(t,"target"))==null?void 0:c.toString())??"0";try{const f=JSON.parse(r);n=zc(a,f,i)}catch{n=[]}const o={name:e,effects:n};L.animationManager.addAnimation(o);const s=Sie(e),u=`${a}-${e}-${s}`;let l=()=>{};return setTimeout(()=>{var h,d;(h=L.gameplay.pixiStage)==null||h.stopPresetAnimationOnTarget(a);const f=bie(e,a,s);f&&(ge.debug(`动画${e}作用在${a}`,s),(d=L.gameplay.pixiStage)==null||d.registerAnimation(f,u,a))},0),l=()=>{setTimeout(()=>{var f;te.getState().stage.currentDialogKey,(f=L.gameplay.pixiStage)==null||f.removeAnimationWithSetEffects(u)},0)},{performName:u,duration:s,isHoldOn:!1,stopFunction:l,blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function bie(t,e,r){const n=L.animationManager.getAnimations().find(i=>i.name===t);if(n){const i=n.effects.map(a=>{const o=Jt({...Hb,duration:0});return Object.assign(o,a),o.duration=a.duration,o});return ge.debug("装载自定义动画",i),QM(i,e,r)}return null}function Sie(t){const e=L.animationManager.getAnimations().find(r=>r.name===t);if(e){let r=0;return e.effects.forEach(n=>{r+=n.duration}),r}return 0}const wie=t=>{let e="0";for(const r of t.args)r.key==="target"&&(e=r.value.toString());return He(t,"enter")&&L.animationManager.nextEnterAnimationName.set(e,He(t,"enter").toString()),He(t,"exit")&&L.animationManager.nextExitAnimationName.set(e+"-off",He(t,"exit").toString()),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!1,stopTimeout:void 0}},Eie=t=>{const e=t.content;let r=t.content,n="default";t.args.forEach(a=>{a.key==="name"&&(r=a.value.toString()),a.key==="series"&&(n=a.value.toString())}),ge.info(`解锁BGM:${r},路径:${e},所属系列:${n}`),te.dispatch(Gk({name:r,url:e,series:n}));const i=te.getState().userData;return Ps.setItem(L.gameKey,i).then(()=>{}),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},Tie=t=>{const e=t.content;let r=t.content,n="default";t.args.forEach(a=>{a.key==="name"&&(r=a.value.toString()),a.key==="series"&&(n=a.value.toString())}),ge.info(`解锁CG:${r},路径:${e},所属系列:${n}`),te.dispatch(Vk({name:r,url:e,series:n}));const i=te.getState().userData;return Ps.setItem(L.gameKey,i).then(()=>{}),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},pS=(t,e=!0)=>{t&&L.backlogManager.makeBacklogEmpty(),e&&L.sceneManager.resetScene(),L.gameplay.performController.removeAllPerform(),L.gameplay.resetGamePlay();const r=Jt(Ek),n=te.getState().stage.GameVar;te.dispatch(rv(r)),e||te.dispatch(Ge({key:"GameVar",value:n}))},Aie={saveData:[],quickSaveData:null},OF=Hp({name:"saveData",initialState:Jt(Aie),reducers:{setFastSave:(t,e)=>{t.quickSaveData=e.payload},resetFastSave:t=>{t.quickSaveData=null},resetSaves:t=>{t.quickSaveData=null,t.saveData=[]},saveGame:(t,e)=>{t.saveData[e.payload.index]=e.payload.saveData},replaceSaveGame:(t,e)=>{t.saveData=e.payload}}}),Oa=OF.actions,Cie=OF.reducer,Pie=t=>{pS(!0);const e=te.dispatch,r=Nn("start.txt",Fn.scene);return setTimeout(()=>{L.sceneManager.resetScene()},5),e(Oa.resetFastSave()),lp(),ua(r).then(n=>{L.sceneManager.sceneData.currentScene=ca(n,"start.txt",r)}),e(rt({component:"showTitle",visibility:!0})),ES(te.getState().GUI.titleBgm),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},Oie=t=>(eF(t.content),{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),Rie=t=>(L.gameplay.performController.performList.forEach(e=>{if(e.performName.match(/PixiPerform/)){ge.warn("pixi 被脚本重新初始化",e.performName);for(let r=0;r{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}),ut={audioContext:new AudioContext,source:null,analyser:void 0,dataArray:void 0,audioLevelInterval:setInterval(()=>{},0),blinkTimerID:setTimeout(()=>{},0),maxAudioLevel:0},Iie=t=>(ut.maxAudioLevel=Math.max(t,ut.maxAudioLevel),{OPEN_THRESHOLD:ut.maxAudioLevel*.75,HALF_OPEN_THRESHOLD:ut.maxAudioLevel*.5}),kie=t=>{let e=!1;function r(){var n;e||t.animationEndTime&&Date.now()>t.animationEndTime||(e=!0,(n=L.gameplay.pixiStage)==null||n.performBlinkAnimation(t.key,t.animationItem,"closed",t.pos),ut.blinkTimerID=setTimeout(()=>{var a;(a=L.gameplay.pixiStage)==null||a.performBlinkAnimation(t.key,t.animationItem,"open",t.pos),e=!1;const i=Math.random()*300+3500;ut.blinkTimerID=setTimeout(r,i)},200))}r()},Mie=(t,e,r)=>{t.getByteFrequencyData(e);let n=0;for(let i=0;i{var h,d;const{audioLevel:e,OPEN_THRESHOLD:r,HALF_OPEN_THRESHOLD:n,currentMouthValue:i,lerpSpeed:a,key:o,animationItem:s,pos:u}=t;let l;e>r?l=1:e>n?l=.5:l=0;const c=i+(l-i)*a;(h=L.gameplay.pixiStage)==null||h.setModelMouthY(o,e);let f;c>.75?f="open":c>.25?f="half_open":f="closed",s!==void 0&&((d=L.gameplay.pixiStage)==null||d.performMouthSyncAnimation(o,s,f,u))};class Fie{constructor(e){Ae(this,"subject");Ae(this,"result");Ae(this,"isEnd",!1);this.subject=e}with(e,r){return!this.isEnd&&this.subject===e&&(this.result=r(),this.isEnd=!0),this}endsWith(e,r){return!this.isEnd&&this.subject===e&&(this.result=r(),this.isEnd=!0),this.evaluate()}default(e){return this.isEnd||(this.result=e()),this.evaluate()}evaluate(){return this.result}}function zv(t){return new Fie(t)}const Nie=t=>{ge.debug("play vocal");const e="vocal-play",r=He(t,"vocal"),n=He(t,"volume");let i;i=te.getState().stage;let a="",o="";const s=i.freeFigure,u=i.figureAssociatedAnimation;let l=0,c=0;const f=1;let h=document.getElementById("currentVocal");L.gameplay.performController.unmountPerform("vocal-play",!0),h!==null&&(h.currentTime=0,h.pause());for(const p of t.args)p.value===!0&&zv(p.key).with("left",()=>{a="left"}).with("right",()=>{a="right"}).endsWith("center",()=>{a="center"}),p.key==="figureId"&&(o=`${p.value.toString()}`);te.dispatch(Ge({key:"playVocal",value:r})),te.dispatch(Ge({key:"vocal",value:r}));let d=!1;return{arrangePerformPromise:new Promise(p=>{setTimeout(()=>{let v=document.getElementById("currentVocal");if(typeof n=="number"&&n>=0&&n<=100?te.dispatch(Ge({key:"vocalVolume",value:n})):te.dispatch(Ge({key:"vocalVolume",value:100})),v!==null){v.currentTime=0;const g={performName:e,duration:1e3*60*60,isOver:!1,isHoldOn:!1,stopFunction:()=>{clearInterval(ut.audioLevelInterval),v.pause(),o=o||`fig-${a}`;const y=u.find(_=>_.targetId===o);AP({audioLevel:0,OPEN_THRESHOLD:1,HALF_OPEN_THRESHOLD:1,currentMouthValue:c,lerpSpeed:f,key:o,animationItem:y,pos:a}),clearTimeout(ut.blinkTimerID)},blockingNext:()=>!1,blockingAuto:()=>!d,skipNextCollect:!0,stopTimeout:void 0};L.gameplay.performController.arrangeNewPerform(g,t,!1),o=o||`fig-${a}`;const m=u.find(y=>y.targetId===o);if(m){const y=s.find(b=>b.key===o);if(y&&(a=y.basePosition),!ut.audioContext){let b;b=new AudioContext,ut.analyser=b.createAnalyser(),ut.analyser.fftSize=256,ut.dataArray=new Uint8Array(ut.analyser.frequencyBinCount)}ut.analyser||(ut.analyser=ut.audioContext.createAnalyser(),ut.analyser.fftSize=256),l=ut.analyser.frequencyBinCount,ut.dataArray=new Uint8Array(l);let _=document.getElementById("currentVocal");ut.source||(ut.source=ut.audioContext.createMediaElementSource(_),ut.source.connect(ut.analyser)),ut.analyser.connect(ut.audioContext.destination),ut.audioLevelInterval=setInterval(()=>{const b=Mie(ut.analyser,ut.dataArray,l),{OPEN_THRESHOLD:S,HALF_OPEN_THRESHOLD:w}=Iie(b);AP({audioLevel:b,OPEN_THRESHOLD:S,HALF_OPEN_THRESHOLD:w,currentMouthValue:c,lerpSpeed:f,key:o,animationItem:m,pos:a})},50);let x;x=Date.now()+1e4,kie({key:o,animationItem:m,pos:a,animationEndTime:x}),setTimeout(()=>{clearTimeout(ut.blinkTimerID)},1e4)}v==null||v.play(),v.onended=()=>{for(const y of L.gameplay.performController.performList)y.performName===e&&(d=!0,y.stopFunction(),L.gameplay.performController.unmountPerform(y.performName))}}},1)})}};function vS(t){switch(t){case fn.slow:return 80;case fn.normal:return 35;case fn.fast:return 3}}function RF(t){switch(t){case fn.slow:return 800;case fn.normal:return 350;case fn.fast:return 200}}function IF(){const t=Ne(r=>r.userData.optionData.textboxFont);function e(){return zv(t).with(Zi.song,()=>'"思源宋体", serif').with(Zi.lxgw,()=>'"LXGW", serif').with(Zi.hei,()=>'"WebgalUI", serif').default(()=>'"WebgalUI", serif')}return e()}function l_(t){switch(t){case 0:return 150;case 1:return 205;case 2:return 240;default:return 205}}const Lie="_TextBox_EventHandler_1svk4_1",Die="_TextBox_Container_1svk4_9",Bie="_showSoftly_1svk4_1",jie="_TextBox_main_1svk4_17",Uie="_TextBox_main_miniavatarOff_1svk4_38",$ie="_TextBox_Background_1svk4_42",Vie="_TextBox_textElement_start_1svk4_55",Gie="_TextDelayShow_1svk4_1",Xie="_outer_1svk4_61",zie="_inner_1svk4_73",Wie="_zhanwei_1svk4_82",Yie="_TextBox_textElement_Settled_1svk4_87",Hie="_TextBox_showName_1svk4_92",qie="_TextBox_ShowName_Background_1svk4_105",Kie="_miniAvatarContainer_1svk4_120",Zie="_miniAvatarImg_1svk4_130",Qie="_nameContainer_1svk4_138",Jie="_outerName_1svk4_144",eae="_innerName_1svk4_155",tae="_text_1svk4_162",yt={TextBox_EventHandler:Lie,TextBox_Container:Die,showSoftly:Bie,TextBox_main:jie,TextBox_main_miniavatarOff:Uie,TextBox_Background:$ie,TextBox_textElement_start:Vie,TextDelayShow:Gie,outer:Xie,inner:zie,zhanwei:Wie,TextBox_textElement_Settled:Yie,TextBox_showName:Hie,TextBox_ShowName_Background:qie,miniAvatarContainer:Kie,miniAvatarImg:Zie,nameContainer:Qie,outerName:Jie,innerName:eae,text:tae};function kF(t){const{textArray:e,textDelay:r,currentConcatDialogPrev:n,currentDialogKey:i,isText:a,isSafari:o,isFirefox:s,fontSize:u,miniAvatar:l,showName:c,font:f,textDuration:h,isUseStroke:d,textboxOpacity:p}=t,v=hS("Stage/TextBox/textbox.scss");ne.useEffect(()=>{function y(){[...document.querySelectorAll(".Textelement_start")].forEach(b=>{b.className=v("TextBox_textElement_Settled",yt.TextBox_textElement_Settled)})}return L.events.textSettle.on(y),()=>{L.events.textSettle.off(y)}},[]);let g=0;const m=e.map((y,_)=>{const x=y.map((b,S)=>{const w=b.reactNode;let T="",E="";if(b.enhancedValue){const k=b.enhancedValue;console.log(k);for(const B of k){const{key:U,value:z}=B;switch(U){case"style":T=z;break;case"tips":break;case"style-alltext":E=z;break}}}let A=g*r;g++;let O=n.length;n!==""&&g>=O&&(A=A-O*r);const P=" "+s_(T),F=" "+s_(E);return gC.jsx("span",{style:{position:"relative"},children:C.jsxs("span",{className:yt.zhanwei,children:[y,C.jsx("span",{className:v("outerName",yt.outerName),children:y}),d&&C.jsx("span",{className:v("innerName",yt.innerName),children:y})]})},y+_))})}),C.jsx("div",{className:v("TextBox_showName",yt.TextBox_showName),style:{fontSize:"200%"},children:c.split("").map((y,_)=>C.jsx("span",{style:{position:"relative"},children:C.jsxs("span",{className:yt.zhanwei,children:[y,C.jsx("span",{className:v("outerName",yt.outerName),children:y}),d&&C.jsx("span",{className:v("innerName",yt.innerName),children:y})]})},y+_))},c)]}),C.jsx("div",{className:v("text",yt.text),style:{fontSize:u,flexFlow:"column",overflow:"hidden",paddingLeft:"0.1em"},children:m})]})]})})}const op={height:1440,width:2560},MF=navigator.userAgent,rae=/firefox/i.test(MF),nae=/^((?!chrome|android).)*safari/i.test(MF),iae=()=>{const[t,e]=ne.useState(!0);ne.useEffect(()=>{const y=()=>{const _=op.height,x=op.width,b=window.innerHeight,S=window.innerWidth,w=b/_,T=S/x,E=S/_,A=b/x;[w,T,E,A].forEach(O=>{O<=.2?e(!1):e(!0)})};return window.addEventListener("resize",y),y(),()=>{window.removeEventListener("resize",y)}},[]);const r=Ne(y=>y.stage),n=Ne(y=>y.userData),i=vS(n.optionData.textSpeed),a=RF(n.optionData.textSpeed);let o=l_(n.optionData.textSize)+"%";const s=IF(),u=r.showText!==""||r.showName!=="";let l=n.optionData.textSize;u&&r.showTextSize!==-1&&(o=l_(r.showTextSize)+"%",l=r.showTextSize);const c=zv(n.optionData.textSize).with(_i.small,()=>3).with(_i.medium,()=>2).with(_i.large,()=>2).default(()=>2),f=Wv(r.showText,c),h=r.showName,d=r.currentConcatDialogPrev,p=r.currentDialogKey,v=r.miniAvatar,g=n.optionData.textboxOpacity,m=kF;return C.jsx(m,{textArray:f,isText:u,textDelay:i,showName:h,currentConcatDialogPrev:d,fontSize:o,currentDialogKey:p,isSafari:nae,isFirefox:rae,miniAvatar:v,textDuration:a,font:s,textSizeState:l,lineLimit:c,isUseStroke:t,textboxOpacity:g})};function CP(t){return!!t.match(/[\u4e00-\u9fa5]|[\u0800-\u4e00]|[\uac00-\ud7ff]/)}function Wv(t,e,r){return t.split(new RegExp("(?lS(o)).map(o=>oae(o)).map(o=>{const s=[];return o.forEach((u,l)=>{zv(u.type).with("SegmentType.String",()=>{const c=aae(u.value);s.push(...c.map(f=>({reactNode:f})))}).endsWith("SegmentType.Link",()=>{const c=u.value,f=C.jsx("span",{className:"__enhanced_text",children:C.jsxs("ruby",{children:[c.text,C.jsx("rt",{children:c.ruby})]},l+c.text)},c.text+`${l}`);s.push({reactNode:f,enhancedValue:c.values})})}),s}).slice(0,r?void 0:e)}function aae(t){if(!t)return[];const e=[];let r="",n=CP(t[0]);const i=a=>/[!-\/:-@\[-`{-~\u2000-\u206F\u3000-\u303F\uff00-\uffef]/g.test(a);for(const a of t)if(a===" ")r&&(e.push(r),r=""),e.push(" "),n=!1;else if(CP(a)&&!i(a))!n&&r&&(e.push(r),r=""),e.push(a),n=!0;else{if(i(a)){r?(r+=a,e.push(r),r=""):e.length>0?e[e.length-1]+=a:e.push(a);continue}n&&r&&(e.push(r),r=""),r+=a,n=!1}return r&&e.push(r),e}function oae(t){const e=/(\[(.*?)\]\((.*?)\))|([^\[\]]+)/g,r=[];let n;for(;(n=e.exec(t))!==null;)if(n[1]){const i=n[2],a=n[3];let o=[],s="";if(a.match(/style=|tips=|ruby=|style-alltext=/)){o=sae(a);const u=o.find(l=>l.key==="ruby");u&&(s=u.value)}else s=a;r.push({type:"SegmentType.Link",value:{text:i,ruby:s,values:o}})}else{const i=n[0];r.push({type:"SegmentType.String",value:i})}return r}function sae(t){const e=[],r=/(\S+)=(.*?)(?=\s+\S+=|\s*$)/g;let n;for(;(n=r.exec(t))!==null;)e.push({key:n[1],value:n[2].trim()});return e}const lae=t=>{const e=te.getState().stage,r=te.getState().userData,n=te.dispatch;let i=Math.random().toString(),a=t.content;const o=He(t,"concat"),s=He(t,"notend"),u=He(t,"speaker"),l=He(t,"clear"),c=He(t,"vocal");o?(i=e.currentDialogKey,a=e.showText+a,n(Ge({key:"currentConcatDialogPrev",value:e.showText}))):n(Ge({key:"currentConcatDialogPrev",value:""})),n(Ge({key:"showText",value:a})),n(Ge({key:"vocal",value:""})),r.optionData.voiceInterruption===Gc.no&&c===null||(n(Ge({key:"playVocal",value:""})),L.gameplay.performController.unmountPerform("vocal-play",!0)),n(Ge({key:"currentDialogKey",value:i}));const f=vS(r.optionData.textSpeed),d=Wv(t.content,3).reduce((y,_)=>y+_.length,0),p=f*d;for(const y of t.args)if(y.key==="fontSize")switch(y.value){case"default":n(Ge({key:"showTextSize",value:-1}));break;case"small":n(Ge({key:"showTextSize",value:_i.small}));break;case"medium":n(Ge({key:"showTextSize",value:_i.medium}));break;case"large":n(Ge({key:"showTextSize",value:_i.large}));break}let v=e.showName;u!==null&&(v=u),l&&(v=""),n(Ge({key:"showName",value:v})),c&&Nie(t);const g=wS();let m=750-r.optionData.textSpeed*250;return s&&(m=0),{performName:g,duration:p+m,isHoldOn:!1,stopFunction:()=>{L.events.textSettle.emit()},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0,goNextWhenOver:s}};var mS={},Kc={document:{}},FF=Object.prototype.hasOwnProperty,NF=function(t){return Yv(t)?t.toLowerCase():t},Sc=Array.isArray,uae=function(t){return Yv(t)?t.replace(/[A-Z]/g,function(e){return String.fromCharCode(e.charCodeAt(0)|32)}):t};"I".toLowerCase()!=="i"&&(NF=uae);var cae,gS=Object.prototype.toString,LF=Object.getPrototypeOf,Yg=$F("ng");Kc.angular||(Kc.angular={});Kc.document.documentMode;function fae(t){if(t==null||xS(t))return!1;if(Sc(t)||Yv(t)||cae)return!0;var e="length"in Object(t)&&t.length;return _S(e)&&(e>=0&&(e-1 in t||t instanceof Array)||typeof t.item=="function")}function Dt(t,e,r){var n,i;if(t)if(jF(t))for(n in t)n!=="prototype"&&n!=="length"&&n!=="name"&&t.hasOwnProperty(n)&&e.call(r,t[n],n,t);else if(Sc(t)||fae(t)){var a=typeof t!="object";for(n=0,i=t.length;n"u"}function ol(t){return typeof t<"u"}function DF(t){return t!==null&&typeof t=="object"}function BF(t){return t!==null&&typeof t=="object"&&!LF(t)}function Yv(t){return typeof t=="string"}function _S(t){return typeof t=="number"}function jF(t){return typeof t=="function"}function xS(t){return t&&t.window===t}function UF(t){return t&&t.$evalAsync&&t.$watch}var pae=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/;function vae(t){return t&&_S(t.length)&&pae.test(gS.call(t))}function mae(t){return gS.call(t)==="[object ArrayBuffer]"}function gae(t,e){var r=[],n=[];if(e){if(vae(e)||mae(e))throw Yg("cpta","Can't copy! TypedArray destination cannot be mutated.");if(t===e)throw Yg("cpi","Can't copy! Source and destination are identical.");return Sc(e)?e.length=0:Dt(e,function(s,u){u!=="$$hashKey"&&delete e[u]}),r.push(t),n.push(e),i(t,e)}return a(t);function i(s,u){var l=u.$$hashKey,c;if(Sc(s))for(var f=0,h=s.length;f=0)return"...";e.push(n)}return n})}function PP(t){return typeof t=="function"?t.toString().replace(/ \{[\s\S]*$/,""):dae(t)?"undefined":typeof t!="string"?bae(t):t}function $F(t,e){return e=e||Error,function(){var r=2,n=arguments,i=n[0],a="["+(t?t+":":"")+i+"] ",o=n[1],s,u;for(a+=o.replace(/\{\d+\}/g,function(l){var c=+l.slice(1,-1),f=c+r;return f <= >= && || ! = |".split(" "),function(t){dd[t]=!0});var Sae={n:` `,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},u_=function(e){this.options=e};u_.prototype={constructor:u_,lex:function(t){for(this.text=t,this.index=0,this.tokens=[];this.index=55296&&r<=56319&&n>=56320&&n<=57343?t+e:t},isExpOperator:function(t){return t==="-"||t==="+"||this.isNumber(t)},throwError:function(t,e,r){r=r||this.index;var n=ol(e)?"s "+e+"-"+this.index+" ["+this.text.substring(e,r)+"]":" "+r;throw sl("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",t,n,this.text)},readNumber:function(){for(var t="",e=this.index;this.index0&&!this.peek("}",")",";","]")&&t.push(this.expressionStatement()),!this.expect(";"))return{type:le.Program,body:t}},expressionStatement:function(){return{type:le.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var t=this.expression();this.expect("|");)t=this.filter(t);return t},expression:function(){return this.assignment()},assignment:function(){var t=this.ternary();if(this.expect("=")){if(!zF(t))throw sl("lval","Trying to assign a value to a non l-value");t={type:le.AssignmentExpression,left:t,right:this.assignment(),operator:"="}}return t},ternary:function(){var t=this.logicalOR(),e,r;return this.expect("?")&&(e=this.expression(),this.consume(":"))?(r=this.expression(),{type:le.ConditionalExpression,test:t,alternate:e,consequent:r}):t},logicalOR:function(){for(var t=this.logicalAND();this.expect("||");)t={type:le.LogicalExpression,operator:"||",left:t,right:this.logicalAND()};return t},logicalAND:function(){for(var t=this.equality();this.expect("&&");)t={type:le.LogicalExpression,operator:"&&",left:t,right:this.equality()};return t},equality:function(){for(var t=this.relational(),e;e=this.expect("==","!=","===","!==");)t={type:le.BinaryExpression,operator:e.text,left:t,right:this.relational()};return t},relational:function(){for(var t=this.additive(),e;e=this.expect("<",">","<=",">=");)t={type:le.BinaryExpression,operator:e.text,left:t,right:this.additive()};return t},additive:function(){for(var t=this.multiplicative(),e;e=this.expect("+","-");)t={type:le.BinaryExpression,operator:e.text,left:t,right:this.multiplicative()};return t},multiplicative:function(){for(var t=this.unary(),e;e=this.expect("*","/","%");)t={type:le.BinaryExpression,operator:e.text,left:t,right:this.unary()};return t},unary:function(){var t;return(t=this.expect("+","-","!"))?{type:le.UnaryExpression,operator:t.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var t;this.expect("(")?(t=this.filterChain(),this.consume(")")):this.expect("[")?t=this.arrayDeclaration():this.expect("{")?t=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?t=gae(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?t={type:le.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?t=this.identifier():this.peek().constant?t=this.constant():this.throwError("not a primary expression",this.peek());for(var e;e=this.expect("(","[",".");)e.text==="("?(t={type:le.CallExpression,callee:t,arguments:this.parseArguments()},this.consume(")")):e.text==="["?(t={type:le.MemberExpression,object:t,property:this.expression(),computed:!0},this.consume("]")):e.text==="."?t={type:le.MemberExpression,object:t,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return t},filter:function(t){for(var e=[t],r={type:le.CallExpression,callee:this.identifier(),arguments:e,filter:!0};this.expect(":");)e.push(this.expression());return r},parseArguments:function(){var t=[];if(this.peekToken().text!==")")do t.push(this.filterChain());while(this.expect(","));return t},identifier:function(){var t=this.consume();return t.identifier||this.throwError("is not a valid identifier",t),{type:le.Identifier,name:t.text}},constant:function(){return{type:le.Literal,value:this.consume().value}},arrayDeclaration:function(){var t=[];if(this.peekToken().text!=="]")do{if(this.peek("]"))break;t.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:le.ArrayExpression,elements:t}},object:function(){var t=[],e;if(this.peekToken().text!=="}")do{if(this.peek("}"))break;e={type:le.Property,kind:"init"},this.peek().constant?(e.key=this.constant(),e.computed=!1,this.consume(":"),e.value=this.expression()):this.peek().identifier?(e.key=this.identifier(),e.computed=!1,this.peek(":")?(this.consume(":"),e.value=this.expression()):e.value=e.key):this.peek("[")?(this.consume("["),e.key=this.expression(),this.consume("]"),e.computed=!0,this.consume(":"),e.value=this.expression()):this.throwError("invalid key",this.peek()),t.push(e)}while(this.expect(","));return this.consume("}"),{type:le.ObjectExpression,properties:t}},throwError:function(t,e){throw sl("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",e.text,t,e.index+1,this.text,this.text.substring(e.index))},consume:function(t){if(this.tokens.length===0)throw sl("ueoe","Unexpected end of expression: {0}",this.text);var e=this.expect(t);return e||this.throwError("is unexpected, expecting ["+t+"]",this.peek()),e},peekToken:function(){if(this.tokens.length===0)throw sl("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(t,e,r,n){return this.peekAhead(0,t,e,r,n)},peekAhead:function(t,e,r,n,i){if(this.tokens.length>t){var a=this.tokens[t],o=a.text;if(o===e||o===r||o===n||o===i||!e&&!r&&!n&&!i)return a}return!1},expect:function(t,e,r,n){var i=this.peek(t,e,r,n);return i?(this.tokens.shift(),i):!1},selfReferential:{this:{type:le.ThisExpression},$locals:{type:le.LocalsExpression}}};function wae(t,e){return typeof t<"u"?t:e}function GF(t,e){return typeof t>"u"?e:typeof e>"u"?t:t+e}function Eae(t,e){var r=t(e);if(!r)throw new Error("Filter '"+e+"' is not defined");return!r.$stateful}function Er(t,e){var r,n,i;switch(t.type){case le.Program:r=!0,Dt(t.body,function(a){Er(a.expression,e),r=r&&a.expression.constant}),t.constant=r;break;case le.Literal:t.constant=!0,t.toWatch=[];break;case le.UnaryExpression:Er(t.argument,e),t.constant=t.argument.constant,t.toWatch=t.argument.toWatch;break;case le.BinaryExpression:Er(t.left,e),Er(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=t.left.toWatch.concat(t.right.toWatch);break;case le.LogicalExpression:Er(t.left,e),Er(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=t.constant?[]:[t];break;case le.ConditionalExpression:Er(t.test,e),Er(t.alternate,e),Er(t.consequent,e),t.constant=t.test.constant&&t.alternate.constant&&t.consequent.constant,t.toWatch=t.constant?[]:[t];break;case le.Identifier:t.constant=!1,t.toWatch=[t];break;case le.MemberExpression:Er(t.object,e),t.computed&&Er(t.property,e),t.constant=t.object.constant&&(!t.computed||t.property.constant),t.toWatch=[t];break;case le.CallExpression:i=t.filter?Eae(e,t.callee.name):!1,r=i,n=[],Dt(t.arguments,function(a){Er(a,e),r=r&&a.constant,a.constant||n.push.apply(n,a.toWatch)}),t.constant=r,t.toWatch=i?n:[t];break;case le.AssignmentExpression:Er(t.left,e),Er(t.right,e),t.constant=t.left.constant&&t.right.constant,t.toWatch=[t];break;case le.ArrayExpression:r=!0,n=[],Dt(t.elements,function(a){Er(a,e),r=r&&a.constant,a.constant||n.push.apply(n,a.toWatch)}),t.constant=r,t.toWatch=n;break;case le.ObjectExpression:r=!0,n=[],Dt(t.properties,function(a){Er(a.value,e),r=r&&a.value.constant&&!a.computed,a.value.constant||n.push.apply(n,a.value.toWatch)}),t.constant=r,t.toWatch=n;break;case le.ThisExpression:t.constant=!1,t.toWatch=[];break;case le.LocalsExpression:t.constant=!1,t.toWatch=[];break}}function XF(t){if(t.length===1){var e=t[0].expression,r=e.toWatch;return r.length!==1||r[0]!==e?r:void 0}}function zF(t){return t.type===le.Identifier||t.type===le.MemberExpression}function WF(t){if(t.body.length===1&&zF(t.body[0].expression))return{type:le.AssignmentExpression,left:t.body[0].expression,right:{type:le.NGValueParameter},operator:"="}}function YF(t){return t.body.length===0||t.body.length===1&&(t.body[0].expression.type===le.Literal||t.body[0].expression.type===le.ArrayExpression||t.body[0].expression.type===le.ObjectExpression)}function HF(t){return t.constant}function qF(t,e){this.astBuilder=t,this.$filter=e}qF.prototype={compile:function(t){var e=this,r=this.astBuilder.ast(t);this.state={nextId:0,filters:{},fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},Er(r,e.$filter);var n="",i;if(this.stage="assign",i=WF(r)){this.state.computing="assign";var a=this.nextId();this.recurse(i,a),this.return_(a),n="fn.assign="+this.generateFunction("assign","s,v,l")}var o=XF(r.body);e.stage="inputs",Dt(o,function(l,c){var f="fn"+c;e.state[f]={vars:[],body:[],own:{}},e.state.computing=f;var h=e.nextId();e.recurse(l,h),e.return_(h),e.state.inputs.push(f),l.watchId=c}),this.state.computing="fn",this.stage="main",this.recurse(r);var s='"'+this.USE+" "+this.STRICT+`"; -`+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+n+this.watchFns()+"return fn;",u=new Function("$filter","getStringValue","ifDefined","plus",s)(this.$filter,VF,wae,GF);return this.state=this.stage=void 0,u.ast=r,u.literal=YF(r),u.constant=HF(r),u},USE:"use",STRICT:"strict",watchFns:function(){var t=[],e=this.state.inputs,r=this;return Dt(e,function(n){t.push("var "+n+"="+r.generateFunction(n,"s"))}),e.length&&t.push("fn.inputs=["+e.join(",")+"];"),t.join("")},generateFunction:function(t,e){return"function("+e+"){"+this.varsPrefix(t)+this.body(t)+"};"},filterPrefix:function(){var t=[],e=this;return Dt(this.state.filters,function(r,n){t.push(r+"=$filter("+e.escape(n)+")")}),t.length?"var "+t.join(",")+";":""},varsPrefix:function(t){return this.state[t].vars.length?"var "+this.state[t].vars.join(",")+";":""},body:function(t){return this.state[t].body.join("")},recurse:function(t,e,r,n,i,a){var o,s,u=this,l,c,f;if(n=n||yS,!a&&ol(t.watchId)){e=e||this.nextId(),this.if_("i",this.lazyAssign(e,this.unsafeComputedMember("i",t.watchId)),this.lazyRecurse(t,e,r,n,i,!0));return}switch(t.type){case le.Program:Dt(t.body,function(d,p){u.recurse(d.expression,void 0,void 0,function(v){s=v}),p!==t.body.length-1?u.current().body.push(s,";"):u.return_(s)});break;case le.Literal:c=this.escape(t.value),this.assign(e,c),n(e||c);break;case le.UnaryExpression:this.recurse(t.argument,void 0,void 0,function(d){s=d}),c=t.operator+"("+this.ifDefined(s,0)+")",this.assign(e,c),n(c);break;case le.BinaryExpression:this.recurse(t.left,void 0,void 0,function(d){o=d}),this.recurse(t.right,void 0,void 0,function(d){s=d}),t.operator==="+"?c=this.plus(o,s):t.operator==="-"?c=this.ifDefined(o,0)+t.operator+this.ifDefined(s,0):c="("+o+")"+t.operator+"("+s+")",this.assign(e,c),n(c);break;case le.LogicalExpression:e=e||this.nextId(),u.recurse(t.left,e),u.if_(t.operator==="&&"?e:u.not(e),u.lazyRecurse(t.right,e)),n(e);break;case le.ConditionalExpression:e=e||this.nextId(),u.recurse(t.test,e),u.if_(e,u.lazyRecurse(t.alternate,e),u.lazyRecurse(t.consequent,e)),n(e);break;case le.Identifier:e=e||this.nextId();var h=u.current().inAssignment;r&&(h?r.context=this.assign(this.nextId(),"s"):r.context=u.stage==="inputs"?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",t.name)+"?l:s"),r.computed=!1,r.name=t.name),u.if_(u.stage==="inputs"||u.not(u.getHasOwnProperty("l",t.name)),function(){u.if_(u.stage==="inputs"||u.and_("s",u.or_(u.isNull(u.nonComputedMember("s",t.name)),u.hasOwnProperty_("s",t.name))),function(){i&&i!==1&&u.if_(u.isNull(u.nonComputedMember("s",t.name)),u.lazyAssign(u.nonComputedMember("s",t.name),"{}")),u.assign(e,u.nonComputedMember("s",t.name))})},e&&u.lazyAssign(e,u.nonComputedMember("l",t.name))),n(e);break;case le.MemberExpression:o=r&&(r.context=this.nextId())||this.nextId(),e=e||this.nextId(),u.recurse(t.object,o,void 0,function(){var d=null,p=u.current().inAssignment;t.computed?(s=u.nextId(),p||u.state.computing==="assign"?d=u.unsafeComputedMember(o,s):d=u.computedMember(o,s)):(p||u.state.computing==="assign"?d=u.unsafeNonComputedMember(o,t.property.name):d=u.nonComputedMember(o,t.property.name),s=t.property.name),t.computed&&t.property.type===le.Literal&&u.recurse(t.property,s),u.if_(u.and_(u.notNull(o),u.or_(u.isNull(d),u.hasOwnProperty_(o,s,t.computed))),function(){t.computed?(t.property.type!==le.Literal&&u.recurse(t.property,s),i&&i!==1&&u.if_(u.not(d),u.lazyAssign(d,"{}")),u.assign(e,d),r&&(r.computed=!0,r.name=s)):(i&&i!==1&&u.if_(u.isNull(d),u.lazyAssign(d,"{}")),u.assign(e,d),r&&(r.computed=!1,r.name=t.property.name))},function(){u.assign(e,"undefined")}),n(e)},!!i);break;case le.CallExpression:e=e||this.nextId(),t.filter?(s=u.filter(t.callee.name),l=[],Dt(t.arguments,function(d){var p=u.nextId();u.recurse(d,p),l.push(p)}),c=s+".call("+s+","+l.join(",")+")",u.assign(e,c),n(e)):(s=u.nextId(),o={},l=[],u.recurse(t.callee,s,o,function(){u.if_(u.notNull(s),function(){if(Dt(t.arguments,function(p){u.recurse(p,t.constant?void 0:u.nextId(),void 0,function(v){l.push(v)})}),o.name){var d=u.member(o.context,o.name,o.computed);c="("+d+" === null ? null : "+u.unsafeMember(o.context,o.name,o.computed)+".call("+[o.context].concat(l).join(",")+"))"}else c=s+"("+l.join(",")+")";u.assign(e,c)},function(){u.assign(e,"undefined")}),n(e)}));break;case le.AssignmentExpression:s=this.nextId(),o={},u.current().inAssignment=!0,this.recurse(t.left,void 0,o,function(){u.if_(u.and_(u.notNull(o.context),u.or_(u.hasOwnProperty_(o.context,o.name),u.isNull(u.member(o.context,o.name,o.computed)))),function(){u.recurse(t.right,s),c=u.member(o.context,o.name,o.computed)+t.operator+s,u.assign(e,c),n(e||c)}),u.current().inAssignment=!1,u.recurse(t.right,s),u.current().inAssignment=!0},1),u.current().inAssignment=!1;break;case le.ArrayExpression:l=[],Dt(t.elements,function(d){u.recurse(d,t.constant?void 0:u.nextId(),void 0,function(p){l.push(p)})}),c="["+l.join(",")+"]",this.assign(e,c),n(e||c);break;case le.ObjectExpression:l=[],f=!1,Dt(t.properties,function(d){d.computed&&(f=!0)}),f?(e=e||this.nextId(),this.assign(e,"{}"),Dt(t.properties,function(d){d.computed?(o=u.nextId(),u.recurse(d.key,o)):o=d.key.type===le.Identifier?d.key.name:""+d.key.value,s=u.nextId(),u.recurse(d.value,s),u.assign(u.unsafeMember(e,o,d.computed),s)})):(Dt(t.properties,function(d){u.recurse(d.value,t.constant?void 0:u.nextId(),void 0,function(p){l.push(u.escape(d.key.type===le.Identifier?d.key.name:""+d.key.value)+":"+p)})}),c="{"+l.join(",")+"}",this.assign(e,c)),n(e||c);break;case le.ThisExpression:this.assign(e,"s"),n(e||"s");break;case le.LocalsExpression:this.assign(e,"l"),n(e||"l");break;case le.NGValueParameter:this.assign(e,"v"),n(e||"v");break}},getHasOwnProperty:function(t,e){var r=t+"."+e,n=this.current().own;return n.hasOwnProperty(r)||(n[r]=this.nextId(!1,t+"&&("+this.escape(e)+" in "+t+")")),n[r]},assign:function(t,e){if(t)return this.current().body.push(t,"=",e,";"),t},filter:function(t){return this.state.filters.hasOwnProperty(t)||(this.state.filters[t]=this.nextId(!0)),this.state.filters[t]},ifDefined:function(t,e){return"ifDefined("+t+","+this.escape(e)+")"},plus:function(t,e){return"plus("+t+","+e+")"},return_:function(t){this.current().body.push("return ",t,";")},if_:function(t,e,r){if(t===!0)e();else{var n=this.current().body;n.push("if(",t,"){"),e(),n.push("}"),r&&(n.push("else{"),r(),n.push("}"))}},or_:function(t,e){return"("+t+") || ("+e+")"},hasOwnProperty_:function(t,e,r){return r?"(Object.prototype.hasOwnProperty.call("+t+","+e+"))":"(Object.prototype.hasOwnProperty.call("+t+",'"+e+"'))"},and_:function(t,e){return"("+t+") && ("+e+")"},not:function(t){return"!("+t+")"},isNull:function(t){return t+"==null"},notNull:function(t){return t+"!=null"},nonComputedMember:function(t,e){var r=/^[$_a-zA-Z][$_a-zA-Z0-9]*$/,n=/[^$_a-zA-Z0-9]/g,i="";return r.test(e)?i=t+"."+e:(e=e.replace(n,this.stringEscapeFn),i=t+'["'+e+'"]'),i},unsafeComputedMember:function(t,e){return t+"["+e+"]"},unsafeNonComputedMember:function(t,e){return this.nonComputedMember(t,e)},computedMember:function(t,e){return this.state.computing==="assign"?this.unsafeComputedMember(t,e):"("+t+".hasOwnProperty("+e+") ? "+t+"["+e+"] : null)"},unsafeMember:function(t,e,r){return r?this.unsafeComputedMember(t,e):this.unsafeNonComputedMember(t,e)},member:function(t,e,r){return r?this.computedMember(t,e):this.nonComputedMember(t,e)},getStringValue:function(t){this.assign(t,"getStringValue("+t+")")},lazyRecurse:function(t,e,r,n,i,a){var o=this;return function(){o.recurse(t,e,r,n,i,a)}},lazyAssign:function(t,e){var r=this;return function(){r.assign(t,e)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)},escape:function(t){if(Yv(t))return"'"+t.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(_S(t))return t.toString();if(t===!0)return"true";if(t===!1)return"false";if(t===null)return"null";if(typeof t>"u")return"undefined";throw sl("esc","IMPOSSIBLE")},nextId:function(t,e){var r="v"+this.state.nextId++;return t||this.current().vars.push(r+(e?"="+e:"")),r},current:function(){return this.state[this.state.computing]}};function KF(t,e){this.astBuilder=t,this.$filter=e}KF.prototype={compile:function(t){var e=this,r=this.astBuilder.ast(t);Er(r,e.$filter);var n,i;(n=WF(r))&&(i=this.recurse(n));var a=XF(r.body),o;a&&(o=[],Dt(a,function(l,c){var f=e.recurse(l);l.input=f,o.push(f),l.watchId=c}));var s=[];Dt(r.body,function(l){s.push(e.recurse(l.expression))});var u=r.body.length===0?yS:r.body.length===1?s[0]:function(l,c){var f;return Dt(s,function(h){f=h(l,c)}),f};return i&&(u.assign=function(l,c,f){return i(l,f,c)}),o&&(u.inputs=o),u.ast=r,u.literal=YF(r),u.constant=HF(r),u},recurse:function(t,e,r){var n,i,a=this,o;if(t.input)return this.inputs(t.input,t.watchId);switch(t.type){case le.Literal:return this.value(t.value,e);case le.UnaryExpression:return i=this.recurse(t.argument),this["unary"+t.operator](i,e);case le.BinaryExpression:return n=this.recurse(t.left),i=this.recurse(t.right),this["binary"+t.operator](n,i,e);case le.LogicalExpression:return n=this.recurse(t.left),i=this.recurse(t.right),this["binary"+t.operator](n,i,e);case le.ConditionalExpression:return this["ternary?:"](this.recurse(t.test),this.recurse(t.alternate),this.recurse(t.consequent),e);case le.Identifier:return a.identifier(t.name,e,r);case le.MemberExpression:return n=this.recurse(t.object,!1,!!r),t.computed||(i=t.property.name),t.computed&&(i=this.recurse(t.property)),t.computed?this.computedMember(n,i,e,r):this.nonComputedMember(n,i,e,r);case le.CallExpression:return o=[],Dt(t.arguments,function(s){o.push(a.recurse(s))}),t.filter&&(i=this.$filter(t.callee.name)),t.filter||(i=this.recurse(t.callee,!0)),t.filter?function(s,u,l,c){for(var f=[],h=0;h":function(t,e,r){return function(n,i,a,o){var s=t(n,i,a,o)>e(n,i,a,o);return r?{value:s}:s}},"binary<=":function(t,e,r){return function(n,i,a,o){var s=t(n,i,a,o)<=e(n,i,a,o);return r?{value:s}:s}},"binary>=":function(t,e,r){return function(n,i,a,o){var s=t(n,i,a,o)>=e(n,i,a,o);return r?{value:s}:s}},"binary&&":function(t,e,r){return function(n,i,a,o){var s=t(n,i,a,o)&&e(n,i,a,o);return r?{value:s}:s}},"binary||":function(t,e,r){return function(n,i,a,o){var s=t(n,i,a,o)||e(n,i,a,o);return r?{value:s}:s}},"ternary?:":function(t,e,r,n){return function(i,a,o,s){var u=t(i,a,o,s)?e(i,a,o,s):r(i,a,o,s);return n?{value:u}:u}},value:function(t,e){return function(){return e?{context:void 0,name:void 0,value:t}:t}},identifier:function(t,e,r){return function(n,i,a,o){var s=i&&t in i?i:n;r&&r!==1&&s&&s[t]==null&&(s[t]={});var u=s?s[t]:void 0;return e?{context:s,name:t,value:u}:u}},computedMember:function(t,e,r,n){return function(i,a,o,s){var u=t(i,a,o,s),l,c;return u!=null&&(l=e(i,a,o,s),l=VF(l),n&&n!==1&&u&&!u[l]&&(u[l]={}),Object.prototype.hasOwnProperty.call(u,l)&&(c=u[l])),r?{context:u,name:l,value:c}:c}},nonComputedMember:function(t,e,r,n){return function(i,a,o,s){var u=t(i,a,o,s);n&&n!==1&&u&&u[e]==null&&(u[e]={});var l=void 0;return u!=null&&Object.prototype.hasOwnProperty.call(u,e)&&(l=u[e]),r?{context:u,name:e,value:l}:l}},inputs:function(t,e){return function(r,n,i,a){return a?a[e]:t(r,n,i)}}};var c_=function(e,r,n){this.lexer=e,this.$filter=r,this.options=n,this.ast=new le(e,n),this.astCompiler=n.csp?new KF(this.ast,r):new qF(this.ast,r)};c_.prototype={constructor:c_,parse:function(t){return this.astCompiler.compile(t)}};mS.Lexer=u_;mS.Parser=c_;var ZF=mS,Tae={},Aae=ZF.Lexer,Cae=ZF.Parser;function bS(t,e){e=e||{};var r=e.filters||Tae,n=e.filters?e.cache||{}:bS.cache,i=e,a;if(typeof t!="string")throw new TypeError("src must be a string, instead saw '"+typeof t+"'");var o={csp:e.csp!=null?e.csp:!1,literals:e.literals!=null?e.literals:{true:!0,false:!1,null:null,undefined:void 0}},s=new Aae(i),u=new Cae(s,function(c){return r[c]},o);return n?(a=n[t],a||(a=n[t]=u.parse(t)),a):u.parse(t)}bS.cache=Object.create(null);var QF=bS;const Pae=t=>{let e=!1;t.args.forEach(n=>{n.key==="global"&&(e=!0)});let r;if(e?r=aW:r=Tk,t.content.match(/\s*=\s*/)){const n=t.content.split(/\s*=\s*/)[0],i=t.content.split(/\s*=\s*/)[1];if(i==="random()")te.dispatch(r({key:n,value:Math.random()}));else if(i.match(/[+\-*\/()]/)){const o=i.split(/([+\-*\/()])/g).map(u=>{if(!u.trim().match(/^[a-zA-Z_$][a-zA-Z0-9_.]*$/))return u;const l=sp(u.trim());return typeof l=="string"?`'${l}'`:l}).reduce((u,l)=>u+l,"");let s="";try{s=QF(o)()}catch(u){ge.error("expression compile error",u)}te.dispatch(r({key:n,value:s}))}else i.match(/true|false/)?(i.match(/true/)&&te.dispatch(r({key:n,value:!0})),i.match(/false/)&&te.dispatch(r({key:n,value:!1}))):i.length===0?te.dispatch(r({key:n,value:""})):isNaN(Number(i))?te.dispatch(r({key:n,value:sp(i)})):te.dispatch(r({key:n,value:Number(i)}));e?(ge.debug("设置全局变量:",{key:n,value:te.getState().userData.globalGameVar[n]}),lp()):ge.debug("设置变量:",{key:n,value:te.getState().stage.GameVar[n]})}return{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function Oae(t){let e;const r=te.getState().stage,n=te.getState().userData,i={stage:r,userData:n};if(r.GameVar.hasOwnProperty(t))e=r.GameVar[t];else if(n.globalGameVar.hasOwnProperty(t))e=n.globalGameVar[t];else if(t.startsWith("$")){const a=t.replace("$","");e=wee(i,a,void 0)}return e}function sp(t){const e=Oae(t);return e??(ge.warn("valueFromState result null, key = "+t),t)}const Rae=t=>{const e=te.getState().stage,r=te.getState().userData,n=te.dispatch,i={stageGameVar:e.GameVar,globalGameVar:r.globalGameVar};n(Ge({key:"showText",value:JSON.stringify(i)})),n(Ge({key:"showName",value:"展示变量"})),ge.debug("展示变量:",i),setTimeout(()=>{L.events.textSettle.emit()},0);const a=wS(),o=750-r.optionData.textSpeed*250;return{performName:a,duration:o,isHoldOn:!1,stopFunction:()=>{L.events.textSettle.emit()},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}};function it(t,e,r){return{scriptType:t,scriptFunction:e,...r}}const JF={};function Iae(t){const e={};for(const[r,n]of Object.entries(t))e[r]=JF[n.scriptType]={scriptString:r,...n};return e}const kae=t=>{const{content:e}=t,r=e.split(",");for(const n of r){const i=n.split("->");if(i.length>=2){const a=i[0],o=i[1];te.dispatch(wn.replaceUIlable([a,o]))}}return{performName:"none",duration:0,isHoldOn:!1,stopFunction:()=>{},blockingNext:()=>!1,blockingAuto:()=>!0,stopTimeout:void 0}},eN=Iae({intro:it(Qe.intro,tie),changeBg:it(Qe.changeBg,$te),changeFigure:it(Qe.changeFigure,Vte),miniAvatar:it(Qe.miniAvatar,nie,{next:!0}),changeScene:it(Qe.changeScene,Gte),choose:it(Qe.choose,Ine),end:it(Qe.end,Pie),bgm:it(Qe.bgm,n7,{next:!0}),playVideo:it(Qe.video,fie),setComplexAnimation:it(Qe.setComplexAnimation,vie),setFilter:it(Qe.setFilter,gie),pixiInit:it(Qe.pixiInit,Rie,{next:!0}),pixiPerform:it(Qe.pixi,uie,{next:!0}),label:it(Qe.label,rie,{next:!0}),jumpLabel:it(Qe.jumpLabel,Oie),setVar:it(Qe.setVar,Pae,{next:!0}),showVars:it(Qe.showVars,Rae),unlockCg:it(Qe.unlockCg,Tie,{next:!0}),unlockBgm:it(Qe.unlockBgm,Eie,{next:!0}),say:it(Qe.say,lae),filmMode:it(Qe.filmMode,Fne,{next:!0}),callScene:it(Qe.callScene,RZ),setTextbox:it(Qe.setTextbox,_ie),setAnimation:it(Qe.setAnimation,hie),playEffect:it(Qe.playEffect,cie,{next:!0}),setTempAnimation:it(Qe.setTempAnimation,yie),__commment:it(Qe.comment,Mne,{next:!0}),setTransform:it(Qe.setTransform,xie),setTransition:it(Qe.setTransition,wie,{next:!0}),getUserInput:it(Qe.getUserInput,$ne),applyStyle:it(Qe.applyStyle,kae,{next:!0})}),tN=Object.values(eN),Mae=tN.filter(t=>t.next).map(t=>t.scriptType),Hv=new r7(pW,Nn,Mae,tN),ca=(t,e,r)=>{const n=Hv.parse(t,e,r);return ge.info(`解析场景:${e},数据为:`,n),n},SS=t=>{var n;let e=dW;e=(((n=JF[t.command])==null?void 0:n.scriptFunction)??eN.say.scriptFunction)(t),e.arrangePerformPromise?e.arrangePerformPromise.then(i=>L.gameplay.performController.arrangeNewPerform(i,t)):L.gameplay.performController.arrangeNewPerform(e,t)},Fae=t=>{L.sceneManager.lockSceneWrite||(L.sceneManager.lockSceneWrite=!0,ua(t.sceneUrl).then(e=>{L.sceneManager.sceneData.currentScene=ca(e,t.sceneName,t.sceneUrl),L.sceneManager.sceneData.currentSentenceId=t.continueLine+1,ge.debug("现在恢复场景,恢复后场景:",L.sceneManager.sceneData.currentScene),L.sceneManager.lockSceneWrite=!1,en()}).catch(e=>{ge.error("场景调用错误",e),L.sceneManager.lockSceneWrite=!1}))};function Nae(t){try{return QF(t)()}catch{return!1}}const f_=t=>{if(t===void 0)return!0;const r=t.split(/([+\-*\/()>=|<=|==|&&|\|\||!=)/g).map(n=>n.match(/[a-zA-Z]/)?n.match(/true/)||n.match(/false/)?n:sp(n):n).reduce((n,i)=>n+i,"");return!!Nae(r)},rN=()=>{if(L.sceneManager.sceneData.currentSentenceId>L.sceneManager.sceneData.currentScene.sentenceList.length-1){if(L.sceneManager.sceneData.sceneStack.length!==0){const l=L.sceneManager.sceneData.sceneStack.pop();l!==void 0&&Fae(l)}return}const t=L.sceneManager.sceneData.currentScene.sentenceList[L.sceneManager.sceneData.currentSentenceId],e=l=>{let c=l;const f=c.match(new RegExp("(?{const d=sp(h.replace(new RegExp("(?{t.content=e(t.content),t.args.forEach(l=>{l.value&&typeof l.value=="string"&&(l.value=e(l.value))})})();let n=!0,i=!1,a="";if(t.args.forEach(l=>{l.key==="when"&&(i=!0,a=l.value.toString())}),i&&(n=f_(a)),!n){ge.warn("不满足条件,跳过本句!"),L.sceneManager.sceneData.currentSentenceId++,en();return}SS(t);let o=!1;t.args.forEach(l=>{l.key==="next"&&l.value&&(o=!0)});let s=t.command===Qe.say;t.args.forEach(l=>{l.key==="notend"&&l.value===!0&&(s=!1)});let u;if(o){L.sceneManager.sceneData.currentSentenceId++,rN();return}setTimeout(()=>{u=te.getState().stage;const l={currentStageState:u,globalGameVar:te.getState().userData.globalGameVar};ge.debug("本条语句执行结果",l),s&&L.backlogManager.saveCurrentStateToBacklog()},0),L.sceneManager.sceneData.currentSentenceId++},en=()=>{if(L.events.userInteractNext.emit(),te.getState().GUI.showTitle)return;let e=!1;if(L.gameplay.performController.performList.forEach(i=>{i.blockingNext()&&(e=!0)}),e){ge.warn("next 被阻塞!");return}let r=!0;if(L.gameplay.performController.performList.forEach(i=>{!i.isHoldOn&&!i.skipNextCollect&&(r=!1)}),r){const i=te.getState().stage,a=Jt(i);for(let o=0;oMath.random().toString().substring(0,10);class Lae{constructor(){Ae(this,"performList",[]);Ae(this,"timeoutList",[])}arrangeNewPerform(e,r,n=!0){if(e.performName!=="none"){if(n){const i={id:e.performName,isHoldOn:e.isHoldOn,script:r};te.dispatch(wn.addPerform(i))}e.stopTimeout=setTimeout(()=>{e.isHoldOn||this.unmountPerform(e.performName)},e.duration),r.args.find(i=>i.key==="continue"&&i.value===!0)&&(e.goNextWhenOver=!0),this.performList.push(e)}}unmountPerform(e,r=!1){if(r)for(let n=0;n{n.blockingAuto()&&(e=!0)}),e?setTimeout(this.goNextWhenOver,100):en()}}class Dae{constructor(){Ae(this,"isAuto",!1);Ae(this,"isFast",!1);Ae(this,"autoInterval",null);Ae(this,"fastInterval",null);Ae(this,"autoTimeout",null);Ae(this,"pixiStage",null);Ae(this,"performController",new Lae)}resetGamePlay(){this.performController.timeoutList=[],this.isAuto=!1,this.isFast=!1;const e=this.autoInterval;e!==null&&clearInterval(e),this.autoInterval=null;const r=this.fastInterval;r!==null&&clearInterval(r),this.fastInterval=null;const n=this.autoTimeout;n!==null&&clearInterval(n),this.autoTimeout=null}}function Bae(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}class jae{constructor(){Ae(this,"textSettle",vh("text-settle"));Ae(this,"userInteractNext",vh("__NEXT"));Ae(this,"fullscreenDbClick",vh("fullscreen-dbclick"));Ae(this,"styleUpdate",vh("style-update"))}}const Hg=Bae();function vh(t){return{on:(e,r)=>{Hg.on(`${t}-${r??""}`,e)},emit:(e,r)=>{Hg.emit(`${t}-${r??""}`,e)},off:(e,r)=>{Hg.off(`${t}-${r??""}`,e)}}}class Uae{constructor(){Ae(this,"sceneManager",new fW);Ae(this,"backlogManager",new cW(this.sceneManager));Ae(this,"animationManager",new hW);Ae(this,"gameplay",new Dae);Ae(this,"gameName","");Ae(this,"gameKey","");Ae(this,"events",new jae)}}const L=new Uae,st=nN(()=>{const t=te.getState().userData;ms.setItem(L.gameKey,t).then(()=>{ge.info("写入本地存储")})},100),Zc=nN(()=>{ms.getItem(L.gameKey).then(t=>{if(!t||!iN(t)){ge.warn("现在重置数据"),st();return}te.dispatch(Lb(t))})},100);function nN(t,e){let r;function n(...i){clearTimeout(r);let a;return r=setTimeout(()=>{a=t.apply(n,i)},e),a}return n}const lp=()=>{const t=te.getState().userData;ms.setItem(L.gameKey,t).then(()=>{ms.getItem(L.gameKey).then(e=>{if(!e){st();return}te.dispatch(Lb(e))}),ge.info("同步本地存储")})};function iN(t){let e=!0;for(const r in H0)t.hasOwnProperty(r)||(e=!1);return e}async function aN(){const t=await ms.getItem(L.gameKey);if(!t||!iN(t)){const e=te.getState().userData;return ge.warn("现在重置数据"),await ms.setItem(L.gameKey,e)}else te.dispatch(Lb(t))}var vt=(t=>(t[t.Save=0]="Save",t[t.Load=1]="Load",t[t.Option=2]="Option",t))(vt||{});const $ae={showBacklog:!1,showStarter:!0,showTitle:!0,showMenuPanel:!1,showTextBox:!0,showControls:!0,controlsVisibility:!0,currentMenuTag:vt.Option,titleBg:"",titleBgm:"",logoImage:[],showExtra:!1,showGlobalDialog:!1,showPanicOverlay:!1,isEnterGame:!1,isShowLogo:!0},oN=Hp({name:"gui",initialState:$ae,reducers:{setVisibility:(t,e)=>{Zc();const{component:r,visibility:n}=e.payload;t[r]=n},setMenuPanelTag:(t,e)=>{Zc(),t.currentMenuTag=e.payload},setGuiAsset:(t,e)=>{const{asset:r,value:n}=e.payload;t[r]=n},setLogoImage:(t,e)=>{t.logoImage=[...e.payload]}}}),{setVisibility:rt,setMenuPanelTag:ss,setGuiAsset:up,setLogoImage:Vae}=oN.actions,Gae=oN.reducer,te=SU({reducer:{stage:JX,GUI:Gae,userData:lW,saveData:Cie},middleware:QI({serializableCheck:!1})});let OP;function ES(t,e=0,r=100){if(ge.debug("playing bgm"+t),t===""){OP=setTimeout(()=>{te.dispatch(Ge({key:"bgm",value:{src:"",enter:0,volume:100}}))},e);const n=te.getState().stage.bgm.src;te.dispatch(Ge({key:"bgm",value:{src:n,enter:-e,volume:r}}))}else clearTimeout(OP),te.dispatch(Ge({key:"bgm",value:{src:t,enter:e,volume:r}}));setTimeout(()=>{const n=document.getElementById("currentBgm");n.src&&(n==null||n.play())},0)}function Gf(t){const e=document.getElementById("ebg");e&&(e.style.backgroundImage=`url("${t}")`)}const TS=()=>{ge.warn("清除所有演出");for(let t=0;t{te.getState().stage.PerformList.forEach(e=>{SS(e.script)})},sN=(t,e=!0)=>{const r=te.dispatch,n=L.backlogManager.getBacklog()[t];ge.debug("读取的backlog数据",n),e&&ua(n.saveScene.sceneUrl).then(a=>{L.sceneManager.sceneData.currentScene=ca(a,n.saveScene.sceneName,n.saveScene.sceneUrl);const o=L.sceneManager.sceneData.currentScene.subSceneList;L.sceneManager.settledScenes.push(L.sceneManager.sceneData.currentScene.sceneUrl);const s=Df(o);Bf(s)}),L.sceneManager.sceneData.currentSentenceId=n.saveScene.currentSentenceId,L.sceneManager.sceneData.sceneStack=Jt(n.saveScene.sceneStack),TS();for(let a=L.backlogManager.getBacklog().length-1;a>t;a--)L.backlogManager.getBacklog().pop();L.backlogManager.isSaveBacklogNext=!0;const i=Jt(n.currentStageState);r(rv(i)),setTimeout(AS,0),r(rt({component:"showBacklog",visibility:!1})),r(rt({component:"showTextBox",visibility:!0}))},lN=t=>{const r=te.getState().saveData.saveData[t];ge.debug("读取的存档数据",r),uN(r)};function uN(t){if(!t){ge.info("暂无存档");return}const e=t;ua(e.sceneData.sceneUrl).then(a=>{L.sceneManager.sceneData.currentScene=ca(a,e.sceneData.sceneName,e.sceneData.sceneUrl);const o=L.sceneManager.sceneData.currentScene.subSceneList;L.sceneManager.settledScenes.push(L.sceneManager.sceneData.currentScene.sceneUrl);const s=Df(o);Bf(s)}),L.sceneManager.sceneData.currentSentenceId=e.sceneData.currentSentenceId,L.sceneManager.sceneData.sceneStack=Jt(e.sceneData.sceneStack),TS();const r=e.backlog;L.backlogManager.getBacklog().splice(0,L.backlogManager.getBacklog().length);for(const a of r)L.backlogManager.getBacklog().push(a);const n=Jt(e.nowStageState),i=te.dispatch;i(rv(n)),setTimeout(AS,0),i(rt({component:"showTitle",visibility:!1})),i(rt({component:"showMenuPanel",visibility:!1})),Gf(te.getState().stage.bgName)}function pd(t,e){for(let r=t;r<=e;r++){const n=te.getState().saveData.saveData[r];Ps.setItem(`${L.gameKey}-saves${r}`,n).then(()=>{ge.info(`存档${r}写入本地存储`)})}}function qv(t,e){for(let r=t;r<=e;r++)Ps.getItem(`${L.gameKey}-saves${r}`).then(n=>{te.dispatch(Oa.saveGame({index:r,saveData:n})),ge.info(`存档${r}读取自本地存储`)})}async function vd(){const t=te.getState().saveData.quickSaveData;await Ps.setItem(`${L.gameKey}-saves-fast`,t),ge.info("快速存档写入本地存储")}async function CS(){const t=await Ps.getItem(`${L.gameKey}-saves-fast`);te.dispatch(Oa.setFastSave(t)),ge.info("快速存档读取自本地存储")}const h_=t=>{const e=cN(t);te.dispatch(Oa.saveGame({index:t,saveData:e})),pd(t,t)};function cN(t,e=!0){const r=te.getState().stage,n=Jt(L.backlogManager.getBacklog());let i="";if(e){const o=document.getElementById("pixiCanvas"),s=document.createElement("canvas"),u=s.getContext("2d");s.width=480,s.height=270,u.drawImage(o,0,0,480,270),i=s.toDataURL("image/webp",.5),s.remove()}return{nowStageState:Jt(r),backlog:n,index:t,saveTime:new Date().toLocaleDateString()+" "+new Date().toLocaleTimeString("chinese",{hour12:!1}),sceneData:{currentSentenceId:L.sceneManager.sceneData.currentSentenceId,sceneStack:Jt(L.sceneManager.sceneData.sceneStack),sceneName:L.sceneManager.sceneData.currentScene.sceneName,sceneUrl:L.sceneManager.sceneData.currentScene.sceneUrl},previewImage:i}}function Xae(){`${L.gameName}${L.gameKey}`,`${L.gameName}${L.gameKey}`}async function zae(){const t=cN(-1,!1),e=Jt(t);te.dispatch(Oa.setFastSave(e)),await vd()}async function Wae(){return await aN(),te.getState().saveData.quickSaveData!==null}async function Yae(){await CS();const t=te.getState().saveData.quickSaveData;t&&uN(t)}const Hae=()=>{pS(!0);const t=Nn("start.txt",Fn.scene);ua(t).then(e=>{L.sceneManager.sceneData.currentScene=ca(e,"start.txt",t),en()}),te.dispatch(rt({component:"showTitle",visibility:!1}))};async function qae(){if(Gf(te.getState().stage.bgName),await Wae()&&L.sceneManager.sceneData.currentSentenceId===0){await Yae();return}L.sceneManager.sceneData.currentSentenceId===0&&L.sceneManager.sceneData.currentScene.sceneName==="start.txt"?en():AS()}function PS(t,e){if(t==null)return{};var r=Ere(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var Kae={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const Zae=mn(Kae);var Qae=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function RP(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},r=t.match(/<\/?([^\s]+?)[/\s>]/);if(r&&(e.name=r[1],(Zae[r[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var n=t.indexOf("-->");return{type:"comment",comment:n!==-1?t.slice(4,n):""}}for(var i=new RegExp(Qae),a=null;(a=i.exec(t))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,""];o.indexOf("=")>-1&&(s=o.split("=")),e.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(e.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return e}var Jae=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,eoe=/^\s*$/,toe=Object.create(null);function fN(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(r){var n=[];for(var i in r)n.push(i+'="'+r[i]+'"');return n.length?" "+n.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(fN,"")+"";case"comment":return t+""}}var roe={parse:function(t,e){e||(e={}),e.components||(e.components=toe);var r,n=[],i=[],a=-1,o=!1;if(t.indexOf("<")!==0){var s=t.indexOf("<");n.push({type:"text",content:s===-1?t:t.substring(0,s)})}return t.replace(Jae,function(u,l){if(o){if(u!=="")return;o=!1}var c,f=u.charAt(1)!=="/",h=u.startsWith("");return{type:"comment",comment:n!==-1?t.slice(4,n):""}}for(var i=new RegExp(Qae),a=null;(a=i.exec(t))!==null;)if(a[0].trim())if(a[1]){var o=a[1].trim(),s=[o,""];o.indexOf("=")>-1&&(s=o.split("=")),e.attrs[s[0]]=s[1],i.lastIndex--}else a[2]&&(e.attrs[a[2]]=a[3].trim().substring(1,a[3].length-1));return e}var Jae=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,eoe=/^\s*$/,toe=Object.create(null);function fN(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(r){var n=[];for(var i in r)n.push(i+'="'+r[i]+'"');return n.length?" "+n.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(fN,"")+"";case"comment":return t+""}}var roe={parse:function(t,e){e||(e={}),e.components||(e.components=toe);var r,n=[],i=[],a=-1,o=!1;if(t.indexOf("<")!==0){var s=t.indexOf("<");n.push({type:"text",content:s===-1?t:t.substring(0,s)})}return t.replace(Jae,function(u,l){if(o){if(u!=="")return;o=!1}var c,f=u.charAt(1)!=="/",h=u.startsWith(")]*-->)?\\s*\\]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*>/i; // eslint-disable-line max-len\n return SVGResource;\n}(BaseImageResource));\n\n/**\n * Resource type for {@code HTMLVideoElement}.\n * @memberof PIXI\n */\nvar VideoResource = /** @class */ (function (_super) {\n __extends(VideoResource, _super);\n /**\n * @param {HTMLVideoElement|object|string|Array} source - Video element to use.\n * @param {object} [options] - Options to use\n * @param {boolean} [options.autoLoad=true] - Start loading the video immediately\n * @param {boolean} [options.autoPlay=true] - Start playing video immediately\n * @param {number} [options.updateFPS=0] - How many times a second to update the texture from the video.\n * Leave at 0 to update at every render.\n * @param {boolean} [options.crossorigin=true] - Load image using cross origin\n */\n function VideoResource(source, options) {\n var _this = this;\n options = options || {};\n if (!(source instanceof HTMLVideoElement)) {\n var videoElement = document.createElement('video');\n // workaround for https://github.com/pixijs/pixi.js/issues/5996\n videoElement.setAttribute('preload', 'auto');\n videoElement.setAttribute('webkit-playsinline', '');\n videoElement.setAttribute('playsinline', '');\n if (typeof source === 'string') {\n source = [source];\n }\n var firstSrc = source[0].src || source[0];\n BaseImageResource.crossOrigin(videoElement, firstSrc, options.crossorigin);\n // array of objects or strings\n for (var i = 0; i < source.length; ++i) {\n var sourceElement = document.createElement('source');\n var _a = source[i], src = _a.src, mime = _a.mime;\n src = src || source[i];\n var baseSrc = src.split('?').shift().toLowerCase();\n var ext = baseSrc.slice(baseSrc.lastIndexOf('.') + 1);\n mime = mime || VideoResource.MIME_TYPES[ext] || \"video/\" + ext;\n sourceElement.src = src;\n sourceElement.type = mime;\n videoElement.appendChild(sourceElement);\n }\n // Override the source\n source = videoElement;\n }\n _this = _super.call(this, source) || this;\n _this.noSubImage = true;\n _this._autoUpdate = true;\n _this._isConnectedToTicker = false;\n _this._updateFPS = options.updateFPS || 0;\n _this._msToNextUpdate = 0;\n _this.autoPlay = options.autoPlay !== false;\n _this._load = null;\n _this._resolve = null;\n // Bind for listeners\n _this._onCanPlay = _this._onCanPlay.bind(_this);\n _this._onError = _this._onError.bind(_this);\n if (options.autoLoad !== false) {\n _this.load();\n }\n return _this;\n }\n /**\n * Trigger updating of the texture.\n * @param _deltaTime - time delta since last tick\n */\n VideoResource.prototype.update = function (_deltaTime) {\n if (!this.destroyed) {\n // account for if video has had its playbackRate changed\n var elapsedMS = Ticker.shared.elapsedMS * this.source.playbackRate;\n this._msToNextUpdate = Math.floor(this._msToNextUpdate - elapsedMS);\n if (!this._updateFPS || this._msToNextUpdate <= 0) {\n _super.prototype.update.call(this);\n this._msToNextUpdate = this._updateFPS ? Math.floor(1000 / this._updateFPS) : 0;\n }\n }\n };\n /**\n * Start preloading the video resource.\n * @returns {Promise} Handle the validate event\n */\n VideoResource.prototype.load = function () {\n var _this = this;\n if (this._load) {\n return this._load;\n }\n var source = this.source;\n if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA)\n && source.width && source.height) {\n source.complete = true;\n }\n source.addEventListener('play', this._onPlayStart.bind(this));\n source.addEventListener('pause', this._onPlayStop.bind(this));\n if (!this._isSourceReady()) {\n source.addEventListener('canplay', this._onCanPlay);\n source.addEventListener('canplaythrough', this._onCanPlay);\n source.addEventListener('error', this._onError, true);\n }\n else {\n this._onCanPlay();\n }\n this._load = new Promise(function (resolve) {\n if (_this.valid) {\n resolve(_this);\n }\n else {\n _this._resolve = resolve;\n source.load();\n }\n });\n return this._load;\n };\n /**\n * Handle video error events.\n * @param event\n */\n VideoResource.prototype._onError = function (event) {\n this.source.removeEventListener('error', this._onError, true);\n this.onError.emit(event);\n };\n /**\n * Returns true if the underlying source is playing.\n * @returns - True if playing.\n */\n VideoResource.prototype._isSourcePlaying = function () {\n var source = this.source;\n return (!source.paused && !source.ended && this._isSourceReady());\n };\n /**\n * Returns true if the underlying source is ready for playing.\n * @returns - True if ready.\n */\n VideoResource.prototype._isSourceReady = function () {\n var source = this.source;\n return source.readyState > 2;\n };\n /** Runs the update loop when the video is ready to play. */\n VideoResource.prototype._onPlayStart = function () {\n // Just in case the video has not received its can play even yet..\n if (!this.valid) {\n this._onCanPlay();\n }\n if (this.autoUpdate && !this._isConnectedToTicker) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n };\n /** Fired when a pause event is triggered, stops the update loop. */\n VideoResource.prototype._onPlayStop = function () {\n if (this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n };\n /** Fired when the video is loaded and ready to play. */\n VideoResource.prototype._onCanPlay = function () {\n var source = this.source;\n source.removeEventListener('canplay', this._onCanPlay);\n source.removeEventListener('canplaythrough', this._onCanPlay);\n var valid = this.valid;\n this.resize(source.videoWidth, source.videoHeight);\n // prevent multiple loaded dispatches..\n if (!valid && this._resolve) {\n this._resolve(this);\n this._resolve = null;\n }\n if (this._isSourcePlaying()) {\n this._onPlayStart();\n }\n else if (this.autoPlay) {\n source.play();\n }\n };\n /** Destroys this texture. */\n VideoResource.prototype.dispose = function () {\n if (this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n var source = this.source;\n if (source) {\n source.removeEventListener('error', this._onError, true);\n source.pause();\n source.src = '';\n source.load();\n }\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(VideoResource.prototype, \"autoUpdate\", {\n /** Should the base texture automatically update itself, set to true by default. */\n get: function () {\n return this._autoUpdate;\n },\n set: function (value) {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n if (!this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n else if (this._autoUpdate && !this._isConnectedToTicker && this._isSourcePlaying()) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(VideoResource.prototype, \"updateFPS\", {\n /**\n * How many times a second to update the texture from the video. Leave at 0 to update at every render.\n * A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient.\n */\n get: function () {\n return this._updateFPS;\n },\n set: function (value) {\n if (value !== this._updateFPS) {\n this._updateFPS = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @param {string} extension - The extension of source, if set\n * @returns {boolean} `true` if video source\n */\n VideoResource.test = function (source, extension) {\n return (globalThis.HTMLVideoElement && source instanceof HTMLVideoElement)\n || VideoResource.TYPES.indexOf(extension) > -1;\n };\n /**\n * List of common video file extensions supported by VideoResource.\n * @readonly\n */\n VideoResource.TYPES = ['mp4', 'm4v', 'webm', 'ogg', 'ogv', 'h264', 'avi', 'mov'];\n /**\n * Map of video MIME types that can't be directly derived from file extensions.\n * @readonly\n */\n VideoResource.MIME_TYPES = {\n ogv: 'video/ogg',\n mov: 'video/quicktime',\n m4v: 'video/mp4',\n };\n return VideoResource;\n}(BaseImageResource));\n\n/**\n * Resource type for ImageBitmap.\n * @memberof PIXI\n */\nvar ImageBitmapResource = /** @class */ (function (_super) {\n __extends(ImageBitmapResource, _super);\n /**\n * @param source - Image element to use\n */\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n function ImageBitmapResource(source) {\n return _super.call(this, source) || this;\n }\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is an ImageBitmap\n */\n ImageBitmapResource.test = function (source) {\n return !!globalThis.createImageBitmap && typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap;\n };\n return ImageBitmapResource;\n}(BaseImageResource));\n\nINSTALLED.push(ImageResource, ImageBitmapResource, CanvasResource, VideoResource, SVGResource, BufferResource, CubeResource, ArrayResource);\n\nvar _resources = {\n __proto__: null,\n Resource: Resource,\n BaseImageResource: BaseImageResource,\n INSTALLED: INSTALLED,\n autoDetectResource: autoDetectResource,\n AbstractMultiResource: AbstractMultiResource,\n ArrayResource: ArrayResource,\n BufferResource: BufferResource,\n CanvasResource: CanvasResource,\n CubeResource: CubeResource,\n ImageResource: ImageResource,\n SVGResource: SVGResource,\n VideoResource: VideoResource,\n ImageBitmapResource: ImageBitmapResource\n};\n\n/**\n * Resource type for DepthTexture.\n * @memberof PIXI\n */\nvar DepthResource = /** @class */ (function (_super) {\n __extends(DepthResource, _super);\n function DepthResource() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Upload the texture to the GPU.\n * @param renderer - Upload to the renderer\n * @param baseTexture - Reference to parent texture\n * @param glTexture - glTexture\n * @returns - true is success\n */\n DepthResource.prototype.upload = function (renderer, baseTexture, glTexture) {\n var gl = renderer.gl;\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === ALPHA_MODES.UNPACK);\n var width = baseTexture.realWidth;\n var height = baseTexture.realHeight;\n if (glTexture.width === width && glTexture.height === height) {\n gl.texSubImage2D(baseTexture.target, 0, 0, 0, width, height, baseTexture.format, glTexture.type, this.data);\n }\n else {\n glTexture.width = width;\n glTexture.height = height;\n gl.texImage2D(baseTexture.target, 0, glTexture.internalFormat, width, height, 0, baseTexture.format, glTexture.type, this.data);\n }\n return true;\n };\n return DepthResource;\n}(BufferResource));\n\n/**\n * A framebuffer can be used to render contents off of the screen. {@link PIXI.BaseRenderTexture} uses\n * one internally to render into itself. You can attach a depth or stencil buffer to a framebuffer.\n *\n * On WebGL 2 machines, shaders can output to multiple textures simultaneously with GLSL 300 ES.\n * @memberof PIXI\n */\nvar Framebuffer = /** @class */ (function () {\n /**\n * @param width - Width of the frame buffer\n * @param height - Height of the frame buffer\n */\n function Framebuffer(width, height) {\n this.width = Math.round(width || 100);\n this.height = Math.round(height || 100);\n this.stencil = false;\n this.depth = false;\n this.dirtyId = 0;\n this.dirtyFormat = 0;\n this.dirtySize = 0;\n this.depthTexture = null;\n this.colorTextures = [];\n this.glFramebuffers = {};\n this.disposeRunner = new Runner('disposeFramebuffer');\n this.multisample = MSAA_QUALITY.NONE;\n }\n Object.defineProperty(Framebuffer.prototype, \"colorTexture\", {\n /**\n * Reference to the colorTexture.\n * @readonly\n */\n get: function () {\n return this.colorTextures[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add texture to the colorTexture array.\n * @param index - Index of the array to add the texture to\n * @param texture - Texture to add to the array\n */\n Framebuffer.prototype.addColorTexture = function (index, texture) {\n if (index === void 0) { index = 0; }\n // TODO add some validation to the texture - same width / height etc?\n this.colorTextures[index] = texture || new BaseTexture(null, {\n scaleMode: SCALE_MODES.NEAREST,\n resolution: 1,\n mipmap: MIPMAP_MODES.OFF,\n width: this.width,\n height: this.height,\n });\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /**\n * Add a depth texture to the frame buffer.\n * @param texture - Texture to add.\n */\n Framebuffer.prototype.addDepthTexture = function (texture) {\n /* eslint-disable max-len */\n this.depthTexture = texture || new BaseTexture(new DepthResource(null, { width: this.width, height: this.height }), {\n scaleMode: SCALE_MODES.NEAREST,\n resolution: 1,\n width: this.width,\n height: this.height,\n mipmap: MIPMAP_MODES.OFF,\n format: FORMATS.DEPTH_COMPONENT,\n type: TYPES.UNSIGNED_SHORT,\n });\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /** Enable depth on the frame buffer. */\n Framebuffer.prototype.enableDepth = function () {\n this.depth = true;\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /** Enable stencil on the frame buffer. */\n Framebuffer.prototype.enableStencil = function () {\n this.stencil = true;\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /**\n * Resize the frame buffer\n * @param width - Width of the frame buffer to resize to\n * @param height - Height of the frame buffer to resize to\n */\n Framebuffer.prototype.resize = function (width, height) {\n width = Math.round(width);\n height = Math.round(height);\n if (width === this.width && height === this.height)\n { return; }\n this.width = width;\n this.height = height;\n this.dirtyId++;\n this.dirtySize++;\n for (var i = 0; i < this.colorTextures.length; i++) {\n var texture = this.colorTextures[i];\n var resolution = texture.resolution;\n // take into account the fact the texture may have a different resolution..\n texture.setSize(width / resolution, height / resolution);\n }\n if (this.depthTexture) {\n var resolution = this.depthTexture.resolution;\n this.depthTexture.setSize(width / resolution, height / resolution);\n }\n };\n /** Disposes WebGL resources that are connected to this geometry. */\n Framebuffer.prototype.dispose = function () {\n this.disposeRunner.emit(this, false);\n };\n /** Destroys and removes the depth texture added to this framebuffer. */\n Framebuffer.prototype.destroyDepthTexture = function () {\n if (this.depthTexture) {\n this.depthTexture.destroy();\n this.depthTexture = null;\n ++this.dirtyId;\n ++this.dirtyFormat;\n }\n };\n return Framebuffer;\n}());\n\n/**\n * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer();\n * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 800, height: 600 });\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n * let sprite = PIXI.Sprite.from(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, {renderTexture});\n * ```\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 100, height: 100 });\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n *\n * renderer.render(sprite, {renderTexture}); // Renders to center of RenderTexture\n * ```\n * @memberof PIXI\n */\nvar BaseRenderTexture = /** @class */ (function (_super) {\n __extends(BaseRenderTexture, _super);\n /**\n * @param options\n * @param {number} [options.width=100] - The width of the base render texture.\n * @param {number} [options.height=100] - The height of the base render texture.\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES}\n * for possible values.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio\n * of the texture being generated.\n * @param {PIXI.MSAA_QUALITY} [options.multisample=PIXI.MSAA_QUALITY.NONE] - The number of samples of the frame buffer.\n */\n function BaseRenderTexture(options) {\n if (options === void 0) { options = {}; }\n var _this = this;\n if (typeof options === 'number') {\n /* eslint-disable prefer-rest-params */\n // Backward compatibility of signature\n var width = arguments[0];\n var height = arguments[1];\n var scaleMode = arguments[2];\n var resolution = arguments[3];\n options = { width: width, height: height, scaleMode: scaleMode, resolution: resolution };\n /* eslint-enable prefer-rest-params */\n }\n options.width = options.width || 100;\n options.height = options.height || 100;\n options.multisample = options.multisample !== undefined ? options.multisample : MSAA_QUALITY.NONE;\n _this = _super.call(this, null, options) || this;\n // Set defaults\n _this.mipmap = MIPMAP_MODES.OFF;\n _this.valid = true;\n _this.clearColor = [0, 0, 0, 0];\n _this.framebuffer = new Framebuffer(_this.realWidth, _this.realHeight)\n .addColorTexture(0, _this);\n _this.framebuffer.multisample = options.multisample;\n // TODO - could this be added the systems?\n _this.maskStack = [];\n _this.filterStack = [{}];\n return _this;\n }\n /**\n * Resizes the BaseRenderTexture.\n * @param desiredWidth - The desired width to resize to.\n * @param desiredHeight - The desired height to resize to.\n */\n BaseRenderTexture.prototype.resize = function (desiredWidth, desiredHeight) {\n this.framebuffer.resize(desiredWidth * this.resolution, desiredHeight * this.resolution);\n this.setRealSize(this.framebuffer.width, this.framebuffer.height);\n };\n /**\n * Frees the texture and framebuffer from WebGL memory without destroying this texture object.\n * This means you can still use the texture later which will upload it to GPU\n * memory again.\n * @fires PIXI.BaseTexture#dispose\n */\n BaseRenderTexture.prototype.dispose = function () {\n this.framebuffer.dispose();\n _super.prototype.dispose.call(this);\n };\n /** Destroys this texture. */\n BaseRenderTexture.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.framebuffer.destroyDepthTexture();\n this.framebuffer = null;\n };\n return BaseRenderTexture;\n}(BaseTexture));\n\n/**\n * Stores a texture's frame in UV coordinates, in\n * which everything lies in the rectangle `[(0,0), (1,0),\n * (1,1), (0,1)]`.\n *\n * | Corner | Coordinates |\n * |--------------|-------------|\n * | Top-Left | `(x0,y0)` |\n * | Top-Right | `(x1,y1)` |\n * | Bottom-Right | `(x2,y2)` |\n * | Bottom-Left | `(x3,y3)` |\n * @protected\n * @memberof PIXI\n */\nvar TextureUvs = /** @class */ (function () {\n function TextureUvs() {\n this.x0 = 0;\n this.y0 = 0;\n this.x1 = 1;\n this.y1 = 0;\n this.x2 = 1;\n this.y2 = 1;\n this.x3 = 0;\n this.y3 = 1;\n this.uvsFloat32 = new Float32Array(8);\n }\n /**\n * Sets the texture Uvs based on the given frame information.\n * @protected\n * @param frame - The frame of the texture\n * @param baseFrame - The base frame of the texture\n * @param rotate - Rotation of frame, see {@link PIXI.groupD8}\n */\n TextureUvs.prototype.set = function (frame, baseFrame, rotate) {\n var tw = baseFrame.width;\n var th = baseFrame.height;\n if (rotate) {\n // width and height div 2 div baseFrame size\n var w2 = frame.width / 2 / tw;\n var h2 = frame.height / 2 / th;\n // coordinates of center\n var cX = (frame.x / tw) + w2;\n var cY = (frame.y / th) + h2;\n rotate = groupD8.add(rotate, groupD8.NW); // NW is top-left corner\n this.x0 = cX + (w2 * groupD8.uX(rotate));\n this.y0 = cY + (h2 * groupD8.uY(rotate));\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\n this.x1 = cX + (w2 * groupD8.uX(rotate));\n this.y1 = cY + (h2 * groupD8.uY(rotate));\n rotate = groupD8.add(rotate, 2);\n this.x2 = cX + (w2 * groupD8.uX(rotate));\n this.y2 = cY + (h2 * groupD8.uY(rotate));\n rotate = groupD8.add(rotate, 2);\n this.x3 = cX + (w2 * groupD8.uX(rotate));\n this.y3 = cY + (h2 * groupD8.uY(rotate));\n }\n else {\n this.x0 = frame.x / tw;\n this.y0 = frame.y / th;\n this.x1 = (frame.x + frame.width) / tw;\n this.y1 = frame.y / th;\n this.x2 = (frame.x + frame.width) / tw;\n this.y2 = (frame.y + frame.height) / th;\n this.x3 = frame.x / tw;\n this.y3 = (frame.y + frame.height) / th;\n }\n this.uvsFloat32[0] = this.x0;\n this.uvsFloat32[1] = this.y0;\n this.uvsFloat32[2] = this.x1;\n this.uvsFloat32[3] = this.y1;\n this.uvsFloat32[4] = this.x2;\n this.uvsFloat32[5] = this.y2;\n this.uvsFloat32[6] = this.x3;\n this.uvsFloat32[7] = this.y3;\n };\n TextureUvs.prototype.toString = function () {\n return \"[@pixi/core:TextureUvs \"\n + (\"x0=\" + this.x0 + \" y0=\" + this.y0 + \" \")\n + (\"x1=\" + this.x1 + \" y1=\" + this.y1 + \" x2=\" + this.x2 + \" \")\n + (\"y2=\" + this.y2 + \" x3=\" + this.x3 + \" y3=\" + this.y3)\n + \"]\";\n };\n return TextureUvs;\n}());\n\nvar DEFAULT_UVS = new TextureUvs();\n/**\n * Used to remove listeners from WHITE and EMPTY Textures\n * @ignore\n */\nfunction removeAllHandlers(tex) {\n tex.destroy = function _emptyDestroy() { };\n tex.on = function _emptyOn() { };\n tex.once = function _emptyOnce() { };\n tex.emit = function _emptyEmit() { };\n}\n/**\n * A texture stores the information that represents an image or part of an image.\n *\n * It cannot be added to the display list directly; instead use it as the texture for a Sprite.\n * If no frame is provided for a texture, then the whole image is used.\n *\n * You can directly create a texture from an image and then reuse it multiple times like this :\n *\n * ```js\n * let texture = PIXI.Texture.from('assets/image.png');\n * let sprite1 = new PIXI.Sprite(texture);\n * let sprite2 = new PIXI.Sprite(texture);\n * ```\n *\n * If you didnt pass the texture frame to constructor, it enables `noFrame` mode:\n * it subscribes on baseTexture events, it automatically resizes at the same time as baseTexture.\n *\n * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing.\n * You can check for this by checking the sprite's _textureID property.\n * ```js\n * var texture = PIXI.Texture.from('assets/image.svg');\n * var sprite1 = new PIXI.Sprite(texture);\n * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file\n * ```\n * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.\n * @memberof PIXI\n * @typeParam R - The BaseTexture's Resource type.\n */\nvar Texture = /** @class */ (function (_super) {\n __extends(Texture, _super);\n /**\n * @param baseTexture - The base texture source to create the texture from\n * @param frame - The rectangle frame of the texture to show\n * @param orig - The area of original texture\n * @param trim - Trimmed rectangle of original texture\n * @param rotate - indicates how the texture was rotated by texture packer. See {@link PIXI.groupD8}\n * @param anchor - Default anchor point used for sprite placement / rotation\n */\n function Texture(baseTexture, frame, orig, trim, rotate, anchor) {\n var _this = _super.call(this) || this;\n _this.noFrame = false;\n if (!frame) {\n _this.noFrame = true;\n frame = new Rectangle(0, 0, 1, 1);\n }\n if (baseTexture instanceof Texture) {\n baseTexture = baseTexture.baseTexture;\n }\n _this.baseTexture = baseTexture;\n _this._frame = frame;\n _this.trim = trim;\n _this.valid = false;\n _this._uvs = DEFAULT_UVS;\n _this.uvMatrix = null;\n _this.orig = orig || frame; // new Rectangle(0, 0, 1, 1);\n _this._rotate = Number(rotate || 0);\n if (rotate === true) {\n // this is old texturepacker legacy, some games/libraries are passing \"true\" for rotated textures\n _this._rotate = 2;\n }\n else if (_this._rotate % 2 !== 0) {\n throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually');\n }\n _this.defaultAnchor = anchor ? new Point(anchor.x, anchor.y) : new Point(0, 0);\n _this._updateID = 0;\n _this.textureCacheIds = [];\n if (!baseTexture.valid) {\n baseTexture.once('loaded', _this.onBaseTextureUpdated, _this);\n }\n else if (_this.noFrame) {\n // if there is no frame we should monitor for any base texture changes..\n if (baseTexture.valid) {\n _this.onBaseTextureUpdated(baseTexture);\n }\n }\n else {\n _this.frame = frame;\n }\n if (_this.noFrame) {\n baseTexture.on('update', _this.onBaseTextureUpdated, _this);\n }\n return _this;\n }\n /**\n * Updates this texture on the gpu.\n *\n * Calls the TextureResource update.\n *\n * If you adjusted `frame` manually, please call `updateUvs()` instead.\n */\n Texture.prototype.update = function () {\n if (this.baseTexture.resource) {\n this.baseTexture.resource.update();\n }\n };\n /**\n * Called when the base texture is updated\n * @protected\n * @param baseTexture - The base texture.\n */\n Texture.prototype.onBaseTextureUpdated = function (baseTexture) {\n if (this.noFrame) {\n if (!this.baseTexture.valid) {\n return;\n }\n this._frame.width = baseTexture.width;\n this._frame.height = baseTexture.height;\n this.valid = true;\n this.updateUvs();\n }\n else {\n // TODO this code looks confusing.. boo to abusing getters and setters!\n // if user gave us frame that has bigger size than resized texture it can be a problem\n this.frame = this._frame;\n }\n this.emit('update', this);\n };\n /**\n * Destroys this texture\n * @param [destroyBase=false] - Whether to destroy the base texture as well\n */\n Texture.prototype.destroy = function (destroyBase) {\n if (this.baseTexture) {\n if (destroyBase) {\n var resource = this.baseTexture.resource;\n // delete the texture if it exists in the texture cache..\n // this only needs to be removed if the base texture is actually destroyed too..\n if (resource && resource.url && TextureCache[resource.url]) {\n Texture.removeFromCache(resource.url);\n }\n this.baseTexture.destroy();\n }\n this.baseTexture.off('loaded', this.onBaseTextureUpdated, this);\n this.baseTexture.off('update', this.onBaseTextureUpdated, this);\n this.baseTexture = null;\n }\n this._frame = null;\n this._uvs = null;\n this.trim = null;\n this.orig = null;\n this.valid = false;\n Texture.removeFromCache(this);\n this.textureCacheIds = null;\n };\n /**\n * Creates a new texture object that acts the same as this one.\n * @returns - The new texture\n */\n Texture.prototype.clone = function () {\n var clonedFrame = this._frame.clone();\n var clonedOrig = this._frame === this.orig ? clonedFrame : this.orig.clone();\n var clonedTexture = new Texture(this.baseTexture, !this.noFrame && clonedFrame, clonedOrig, this.trim && this.trim.clone(), this.rotate, this.defaultAnchor);\n if (this.noFrame) {\n clonedTexture._frame = clonedFrame;\n }\n return clonedTexture;\n };\n /**\n * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.\n * Call it after changing the frame\n */\n Texture.prototype.updateUvs = function () {\n if (this._uvs === DEFAULT_UVS) {\n this._uvs = new TextureUvs();\n }\n this._uvs.set(this._frame, this.baseTexture, this.rotate);\n this._updateID++;\n };\n /**\n * Helper function that creates a new Texture based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @param {string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source -\n * Source or array of sources to create texture from\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {string} [options.pixiIdPrefix=pixiid] - If a source has no id, this is the prefix of the generated id\n * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.\n * @returns {PIXI.Texture} The newly created texture\n */\n Texture.from = function (source, options, strict) {\n if (options === void 0) { options = {}; }\n if (strict === void 0) { strict = settings.STRICT_TEXTURE_CACHE; }\n var isFrame = typeof source === 'string';\n var cacheId = null;\n if (isFrame) {\n cacheId = source;\n }\n else if (source instanceof BaseTexture) {\n if (!source.cacheId) {\n var prefix = (options && options.pixiIdPrefix) || 'pixiid';\n source.cacheId = prefix + \"-\" + uid();\n BaseTexture.addToCache(source, source.cacheId);\n }\n cacheId = source.cacheId;\n }\n else {\n if (!source._pixiId) {\n var prefix = (options && options.pixiIdPrefix) || 'pixiid';\n source._pixiId = prefix + \"_\" + uid();\n }\n cacheId = source._pixiId;\n }\n var texture = TextureCache[cacheId];\n // Strict-mode rejects invalid cacheIds\n if (isFrame && strict && !texture) {\n throw new Error(\"The cacheId \\\"\" + cacheId + \"\\\" does not exist in TextureCache.\");\n }\n if (!texture && !(source instanceof BaseTexture)) {\n if (!options.resolution) {\n options.resolution = getResolutionOfUrl(source);\n }\n texture = new Texture(new BaseTexture(source, options));\n texture.baseTexture.cacheId = cacheId;\n BaseTexture.addToCache(texture.baseTexture, cacheId);\n Texture.addToCache(texture, cacheId);\n }\n else if (!texture && (source instanceof BaseTexture)) {\n texture = new Texture(source);\n Texture.addToCache(texture, cacheId);\n }\n // lets assume its a base texture!\n return texture;\n };\n /**\n * Useful for loading textures via URLs. Use instead of `Texture.from` because\n * it does a better job of handling failed URLs more effectively. This also ignores\n * `PIXI.settings.STRICT_TEXTURE_CACHE`. Works for Videos, SVGs, Images.\n * @param url - The remote URL or array of URLs to load.\n * @param options - Optional options to include\n * @returns - A Promise that resolves to a Texture.\n */\n Texture.fromURL = function (url, options) {\n var resourceOptions = Object.assign({ autoLoad: false }, options === null || options === void 0 ? void 0 : options.resourceOptions);\n var texture = Texture.from(url, Object.assign({ resourceOptions: resourceOptions }, options), false);\n var resource = texture.baseTexture.resource;\n // The texture was already loaded\n if (texture.baseTexture.valid) {\n return Promise.resolve(texture);\n }\n // Manually load the texture, this should allow users to handle load errors\n return resource.load().then(function () { return Promise.resolve(texture); });\n };\n /**\n * Create a new Texture with a BufferResource from a Float32Array.\n * RGBA values are floats from 0 to 1.\n * @param {Float32Array|Uint8Array} buffer - The optional array to use, if no data\n * is provided, a new Float32Array is created.\n * @param width - Width of the resource\n * @param height - Height of the resource\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @returns - The resulting new BaseTexture\n */\n Texture.fromBuffer = function (buffer, width, height, options) {\n return new Texture(BaseTexture.fromBuffer(buffer, width, height, options));\n };\n /**\n * Create a texture from a source and add to the cache.\n * @param {HTMLImageElement|HTMLCanvasElement|string} source - The input source.\n * @param imageUrl - File name of texture, for cache and resolving resolution.\n * @param name - Human readable name for the texture cache. If no name is\n * specified, only `imageUrl` will be used as the cache ID.\n * @param options\n * @returns - Output texture\n */\n Texture.fromLoader = function (source, imageUrl, name, options) {\n var baseTexture = new BaseTexture(source, Object.assign({\n scaleMode: settings.SCALE_MODE,\n resolution: getResolutionOfUrl(imageUrl),\n }, options));\n var resource = baseTexture.resource;\n if (resource instanceof ImageResource) {\n resource.url = imageUrl;\n }\n var texture = new Texture(baseTexture);\n // No name, use imageUrl instead\n if (!name) {\n name = imageUrl;\n }\n // lets also add the frame to pixi's global cache for 'fromLoader' function\n BaseTexture.addToCache(texture.baseTexture, name);\n Texture.addToCache(texture, name);\n // also add references by url if they are different.\n if (name !== imageUrl) {\n BaseTexture.addToCache(texture.baseTexture, imageUrl);\n Texture.addToCache(texture, imageUrl);\n }\n // Generally images are valid right away\n if (texture.baseTexture.valid) {\n return Promise.resolve(texture);\n }\n // SVG assets need to be parsed async, let's wait\n return new Promise(function (resolve) {\n texture.baseTexture.once('loaded', function () { return resolve(texture); });\n });\n };\n /**\n * Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object.\n * @param texture - The Texture to add to the cache.\n * @param id - The id that the Texture will be stored against.\n */\n Texture.addToCache = function (texture, id) {\n if (id) {\n if (texture.textureCacheIds.indexOf(id) === -1) {\n texture.textureCacheIds.push(id);\n }\n if (TextureCache[id]) {\n // eslint-disable-next-line no-console\n console.warn(\"Texture added to the cache with an id [\" + id + \"] that already had an entry\");\n }\n TextureCache[id] = texture;\n }\n };\n /**\n * Remove a Texture from the global TextureCache.\n * @param texture - id of a Texture to be removed, or a Texture instance itself\n * @returns - The Texture that was removed\n */\n Texture.removeFromCache = function (texture) {\n if (typeof texture === 'string') {\n var textureFromCache = TextureCache[texture];\n if (textureFromCache) {\n var index = textureFromCache.textureCacheIds.indexOf(texture);\n if (index > -1) {\n textureFromCache.textureCacheIds.splice(index, 1);\n }\n delete TextureCache[texture];\n return textureFromCache;\n }\n }\n else if (texture && texture.textureCacheIds) {\n for (var i = 0; i < texture.textureCacheIds.length; ++i) {\n // Check that texture matches the one being passed in before deleting it from the cache.\n if (TextureCache[texture.textureCacheIds[i]] === texture) {\n delete TextureCache[texture.textureCacheIds[i]];\n }\n }\n texture.textureCacheIds.length = 0;\n return texture;\n }\n return null;\n };\n Object.defineProperty(Texture.prototype, \"resolution\", {\n /**\n * Returns resolution of baseTexture\n * @readonly\n */\n get: function () {\n return this.baseTexture.resolution;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"frame\", {\n /**\n * The frame specifies the region of the base texture that this texture uses.\n * Please call `updateUvs()` after you change coordinates of `frame` manually.\n */\n get: function () {\n return this._frame;\n },\n set: function (frame) {\n this._frame = frame;\n this.noFrame = false;\n var x = frame.x, y = frame.y, width = frame.width, height = frame.height;\n var xNotFit = x + width > this.baseTexture.width;\n var yNotFit = y + height > this.baseTexture.height;\n if (xNotFit || yNotFit) {\n var relationship = xNotFit && yNotFit ? 'and' : 'or';\n var errorX = \"X: \" + x + \" + \" + width + \" = \" + (x + width) + \" > \" + this.baseTexture.width;\n var errorY = \"Y: \" + y + \" + \" + height + \" = \" + (y + height) + \" > \" + this.baseTexture.height;\n throw new Error('Texture Error: frame does not fit inside the base Texture dimensions: '\n + (errorX + \" \" + relationship + \" \" + errorY));\n }\n this.valid = width && height && this.baseTexture.valid;\n if (!this.trim && !this.rotate) {\n this.orig = frame;\n }\n if (this.valid) {\n this.updateUvs();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"rotate\", {\n /**\n * Indicates whether the texture is rotated inside the atlas\n * set to 2 to compensate for texture packer rotation\n * set to 6 to compensate for spine packer rotation\n * can be used to rotate or mirror sprites\n * See {@link PIXI.groupD8} for explanation\n */\n get: function () {\n return this._rotate;\n },\n set: function (rotate) {\n this._rotate = rotate;\n if (this.valid) {\n this.updateUvs();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"width\", {\n /** The width of the Texture in pixels. */\n get: function () {\n return this.orig.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"height\", {\n /** The height of the Texture in pixels. */\n get: function () {\n return this.orig.height;\n },\n enumerable: false,\n configurable: true\n });\n /** Utility function for BaseTexture|Texture cast. */\n Texture.prototype.castToBaseTexture = function () {\n return this.baseTexture;\n };\n Object.defineProperty(Texture, \"EMPTY\", {\n /** An empty texture, used often to not have to create multiple empty textures. Can not be destroyed. */\n get: function () {\n if (!Texture._EMPTY) {\n Texture._EMPTY = new Texture(new BaseTexture());\n removeAllHandlers(Texture._EMPTY);\n removeAllHandlers(Texture._EMPTY.baseTexture);\n }\n return Texture._EMPTY;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture, \"WHITE\", {\n /** A white texture of 16x16 size, used for graphics and other things Can not be destroyed. */\n get: function () {\n if (!Texture._WHITE) {\n var canvas = settings.ADAPTER.createCanvas(16, 16);\n var context = canvas.getContext('2d');\n canvas.width = 16;\n canvas.height = 16;\n context.fillStyle = 'white';\n context.fillRect(0, 0, 16, 16);\n Texture._WHITE = new Texture(BaseTexture.from(canvas));\n removeAllHandlers(Texture._WHITE);\n removeAllHandlers(Texture._WHITE.baseTexture);\n }\n return Texture._WHITE;\n },\n enumerable: false,\n configurable: true\n });\n return Texture;\n}(EventEmitter));\n\n/**\n * A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * __Hint-2__: The actual memory allocation will happen on first render.\n * You shouldn't create renderTextures each frame just to delete them after, try to reuse them.\n *\n * A RenderTexture takes a snapshot of any Display Object given to its render method. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer();\n * let renderTexture = PIXI.RenderTexture.create({ width: 800, height: 600 });\n * let sprite = PIXI.Sprite.from(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, {renderTexture});\n * ```\n * Note that you should not create a new renderer, but reuse the same one as the rest of the application.\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let renderTexture = new PIXI.RenderTexture.create({ width: 100, height: 100 });\n *\n * renderer.render(sprite, {renderTexture}); // Renders to center of RenderTexture\n * ```\n * @memberof PIXI\n */\nvar RenderTexture = /** @class */ (function (_super) {\n __extends(RenderTexture, _super);\n /**\n * @param baseRenderTexture - The base texture object that this texture uses.\n * @param frame - The rectangle frame of the texture to show.\n */\n function RenderTexture(baseRenderTexture, frame) {\n var _this = _super.call(this, baseRenderTexture, frame) || this;\n _this.valid = true;\n _this.filterFrame = null;\n _this.filterPoolKey = null;\n _this.updateUvs();\n return _this;\n }\n Object.defineProperty(RenderTexture.prototype, \"framebuffer\", {\n /**\n * Shortcut to `this.baseTexture.framebuffer`, saves baseTexture cast.\n * @readonly\n */\n get: function () {\n return this.baseTexture.framebuffer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RenderTexture.prototype, \"multisample\", {\n /**\n * Shortcut to `this.framebuffer.multisample`.\n * @default PIXI.MSAA_QUALITY.NONE\n */\n get: function () {\n return this.framebuffer.multisample;\n },\n set: function (value) {\n this.framebuffer.multisample = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Resizes the RenderTexture.\n * @param desiredWidth - The desired width to resize to.\n * @param desiredHeight - The desired height to resize to.\n * @param resizeBaseTexture - Should the baseTexture.width and height values be resized as well?\n */\n RenderTexture.prototype.resize = function (desiredWidth, desiredHeight, resizeBaseTexture) {\n if (resizeBaseTexture === void 0) { resizeBaseTexture = true; }\n var resolution = this.baseTexture.resolution;\n var width = Math.round(desiredWidth * resolution) / resolution;\n var height = Math.round(desiredHeight * resolution) / resolution;\n // TODO - could be not required..\n this.valid = (width > 0 && height > 0);\n this._frame.width = this.orig.width = width;\n this._frame.height = this.orig.height = height;\n if (resizeBaseTexture) {\n this.baseTexture.resize(width, height);\n }\n this.updateUvs();\n };\n /**\n * Changes the resolution of baseTexture, but does not change framebuffer size.\n * @param resolution - The new resolution to apply to RenderTexture\n */\n RenderTexture.prototype.setResolution = function (resolution) {\n var baseTexture = this.baseTexture;\n if (baseTexture.resolution === resolution) {\n return;\n }\n baseTexture.setResolution(resolution);\n this.resize(baseTexture.width, baseTexture.height, false);\n };\n RenderTexture.create = function (options) {\n var arguments$1 = arguments;\n\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments$1[_i];\n }\n // @deprecated fallback, old-style: create(width, height, scaleMode, resolution)\n if (typeof options === 'number') {\n deprecation('6.0.0', 'Arguments (width, height, scaleMode, resolution) have been deprecated.');\n /* eslint-disable prefer-rest-params */\n options = {\n width: options,\n height: rest[0],\n scaleMode: rest[1],\n resolution: rest[2],\n };\n /* eslint-enable prefer-rest-params */\n }\n return new RenderTexture(new BaseRenderTexture(options));\n };\n return RenderTexture;\n}(Texture));\n\n/**\n * Texture pool, used by FilterSystem and plugins.\n *\n * Stores collection of temporary pow2 or screen-sized renderTextures\n *\n * If you use custom RenderTexturePool for your filters, you can use methods\n * `getFilterTexture` and `returnFilterTexture` same as in\n * @memberof PIXI\n */\nvar RenderTexturePool = /** @class */ (function () {\n /**\n * @param textureOptions - options that will be passed to BaseRenderTexture constructor\n * @param {PIXI.SCALE_MODES} [textureOptions.scaleMode] - See {@link PIXI.SCALE_MODES} for possible values.\n */\n function RenderTexturePool(textureOptions) {\n this.texturePool = {};\n this.textureOptions = textureOptions || {};\n this.enableFullScreen = false;\n this._pixelsWidth = 0;\n this._pixelsHeight = 0;\n }\n /**\n * Creates texture with params that were specified in pool constructor.\n * @param realWidth - Width of texture in pixels.\n * @param realHeight - Height of texture in pixels.\n * @param multisample - Number of samples of the framebuffer.\n */\n RenderTexturePool.prototype.createTexture = function (realWidth, realHeight, multisample) {\n if (multisample === void 0) { multisample = MSAA_QUALITY.NONE; }\n var baseRenderTexture = new BaseRenderTexture(Object.assign({\n width: realWidth,\n height: realHeight,\n resolution: 1,\n multisample: multisample,\n }, this.textureOptions));\n return new RenderTexture(baseRenderTexture);\n };\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param minWidth - The minimum width of the render texture.\n * @param minHeight - The minimum height of the render texture.\n * @param resolution - The resolution of the render texture.\n * @param multisample - Number of samples of the render texture.\n * @returns The new render texture.\n */\n RenderTexturePool.prototype.getOptimalTexture = function (minWidth, minHeight, resolution, multisample) {\n if (resolution === void 0) { resolution = 1; }\n if (multisample === void 0) { multisample = MSAA_QUALITY.NONE; }\n var key;\n minWidth = Math.ceil((minWidth * resolution) - 1e-6);\n minHeight = Math.ceil((minHeight * resolution) - 1e-6);\n if (!this.enableFullScreen || minWidth !== this._pixelsWidth || minHeight !== this._pixelsHeight) {\n minWidth = nextPow2(minWidth);\n minHeight = nextPow2(minHeight);\n key = (((minWidth & 0xFFFF) << 16) | (minHeight & 0xFFFF)) >>> 0;\n if (multisample > 1) {\n key += multisample * 0x100000000;\n }\n }\n else {\n key = multisample > 1 ? -multisample : -1;\n }\n if (!this.texturePool[key]) {\n this.texturePool[key] = [];\n }\n var renderTexture = this.texturePool[key].pop();\n if (!renderTexture) {\n renderTexture = this.createTexture(minWidth, minHeight, multisample);\n }\n renderTexture.filterPoolKey = key;\n renderTexture.setResolution(resolution);\n return renderTexture;\n };\n /**\n * Gets extra texture of the same size as input renderTexture\n *\n * `getFilterTexture(input, 0.5)` or `getFilterTexture(0.5, input)`\n * @param input - renderTexture from which size and resolution will be copied\n * @param resolution - override resolution of the renderTexture\n * It overrides, it does not multiply\n * @param multisample - number of samples of the renderTexture\n */\n RenderTexturePool.prototype.getFilterTexture = function (input, resolution, multisample) {\n var filterTexture = this.getOptimalTexture(input.width, input.height, resolution || input.resolution, multisample || MSAA_QUALITY.NONE);\n filterTexture.filterFrame = input.filterFrame;\n return filterTexture;\n };\n /**\n * Place a render texture back into the pool.\n * @param renderTexture - The renderTexture to free\n */\n RenderTexturePool.prototype.returnTexture = function (renderTexture) {\n var key = renderTexture.filterPoolKey;\n renderTexture.filterFrame = null;\n this.texturePool[key].push(renderTexture);\n };\n /**\n * Alias for returnTexture, to be compliant with FilterSystem interface.\n * @param renderTexture - The renderTexture to free\n */\n RenderTexturePool.prototype.returnFilterTexture = function (renderTexture) {\n this.returnTexture(renderTexture);\n };\n /**\n * Clears the pool.\n * @param destroyTextures - Destroy all stored textures.\n */\n RenderTexturePool.prototype.clear = function (destroyTextures) {\n destroyTextures = destroyTextures !== false;\n if (destroyTextures) {\n for (var i in this.texturePool) {\n var textures = this.texturePool[i];\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n }\n }\n this.texturePool = {};\n };\n /**\n * If screen size was changed, drops all screen-sized textures,\n * sets new screen size, sets `enableFullScreen` to true\n *\n * Size is measured in pixels, `renderer.view` can be passed here, not `renderer.screen`\n * @param size - Initial size of screen.\n */\n RenderTexturePool.prototype.setScreenSize = function (size) {\n if (size.width === this._pixelsWidth\n && size.height === this._pixelsHeight) {\n return;\n }\n this.enableFullScreen = size.width > 0 && size.height > 0;\n for (var i in this.texturePool) {\n if (!(Number(i) < 0)) {\n continue;\n }\n var textures = this.texturePool[i];\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n this.texturePool[i] = [];\n }\n this._pixelsWidth = size.width;\n this._pixelsHeight = size.height;\n };\n /**\n * Key that is used to store fullscreen renderTextures in a pool\n * @constant\n */\n RenderTexturePool.SCREEN_KEY = -1;\n return RenderTexturePool;\n}());\n\n/* eslint-disable max-len */\n/**\n * Holds the information for a single attribute structure required to render geometry.\n *\n * This does not contain the actual data, but instead has a buffer id that maps to a {@link PIXI.Buffer}\n * This can include anything from positions, uvs, normals, colors etc.\n * @memberof PIXI\n */\nvar Attribute = /** @class */ (function () {\n /**\n * @param buffer - the id of the buffer that this attribute will look for\n * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2.\n * @param normalized - should the data be normalized.\n * @param {PIXI.TYPES} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @param [start=0] - How far into the array to start reading values (used for interleaving data)\n * @param [instance=false] - Whether the geometry is instanced.\n */\n function Attribute(buffer, size, normalized, type, stride, start, instance) {\n if (size === void 0) { size = 0; }\n if (normalized === void 0) { normalized = false; }\n if (type === void 0) { type = TYPES.FLOAT; }\n this.buffer = buffer;\n this.size = size;\n this.normalized = normalized;\n this.type = type;\n this.stride = stride;\n this.start = start;\n this.instance = instance;\n }\n /** Destroys the Attribute. */\n Attribute.prototype.destroy = function () {\n this.buffer = null;\n };\n /**\n * Helper function that creates an Attribute based on the information provided\n * @param buffer - the id of the buffer that this attribute will look for\n * @param [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2\n * @param [normalized=false] - should the data be normalized.\n * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @returns - A new {@link PIXI.Attribute} based on the information provided\n */\n Attribute.from = function (buffer, size, normalized, type, stride) {\n return new Attribute(buffer, size, normalized, type, stride);\n };\n return Attribute;\n}());\n\nvar UID$4 = 0;\n/**\n * A wrapper for data so that it can be used and uploaded by WebGL\n * @memberof PIXI\n */\nvar Buffer = /** @class */ (function () {\n /**\n * @param {PIXI.IArrayBuffer} data - the data to store in the buffer.\n * @param _static - `true` for static buffer\n * @param index - `true` for index buffer\n */\n function Buffer(data, _static, index) {\n if (_static === void 0) { _static = true; }\n if (index === void 0) { index = false; }\n this.data = (data || new Float32Array(1));\n this._glBuffers = {};\n this._updateID = 0;\n this.index = index;\n this.static = _static;\n this.id = UID$4++;\n this.disposeRunner = new Runner('disposeBuffer');\n }\n // TODO could explore flagging only a partial upload?\n /**\n * Flags this buffer as requiring an upload to the GPU.\n * @param {PIXI.IArrayBuffer|number[]} [data] - the data to update in the buffer.\n */\n Buffer.prototype.update = function (data) {\n if (data instanceof Array) {\n data = new Float32Array(data);\n }\n this.data = data || this.data;\n this._updateID++;\n };\n /** Disposes WebGL resources that are connected to this geometry. */\n Buffer.prototype.dispose = function () {\n this.disposeRunner.emit(this, false);\n };\n /** Destroys the buffer. */\n Buffer.prototype.destroy = function () {\n this.dispose();\n this.data = null;\n };\n Object.defineProperty(Buffer.prototype, \"index\", {\n get: function () {\n return this.type === BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n },\n /**\n * Flags whether this is an index buffer.\n *\n * Index buffers are of type `ELEMENT_ARRAY_BUFFER`. Note that setting this property to false will make\n * the buffer of type `ARRAY_BUFFER`.\n *\n * For backwards compatibility.\n */\n set: function (value) {\n this.type = value ? BUFFER_TYPE.ELEMENT_ARRAY_BUFFER : BUFFER_TYPE.ARRAY_BUFFER;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Helper function that creates a buffer based on an array or TypedArray\n * @param {ArrayBufferView | number[]} data - the TypedArray that the buffer will store. If this is a regular Array it will be converted to a Float32Array.\n * @returns - A new Buffer based on the data provided.\n */\n Buffer.from = function (data) {\n if (data instanceof Array) {\n data = new Float32Array(data);\n }\n return new Buffer(data);\n };\n return Buffer;\n}());\n\n/* eslint-disable object-shorthand */\nvar map$1 = {\n Float32Array: Float32Array,\n Uint32Array: Uint32Array,\n Int32Array: Int32Array,\n Uint8Array: Uint8Array,\n};\nfunction interleaveTypedArrays(arrays, sizes) {\n var outSize = 0;\n var stride = 0;\n var views = {};\n for (var i = 0; i < arrays.length; i++) {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n var buffer = new ArrayBuffer(outSize * 4);\n var out = null;\n var littleOffset = 0;\n for (var i = 0; i < arrays.length; i++) {\n var size = sizes[i];\n var array = arrays[i];\n var type = getBufferType(array);\n if (!views[type]) {\n views[type] = new map$1[type](buffer);\n }\n out = views[type];\n for (var j = 0; j < array.length; j++) {\n var indexStart = ((j / size | 0) * stride) + littleOffset;\n var index = j % size;\n out[indexStart + index] = array[j];\n }\n littleOffset += size;\n }\n return new Float32Array(buffer);\n}\n\nvar byteSizeMap$1 = { 5126: 4, 5123: 2, 5121: 1 };\nvar UID$3 = 0;\n/* eslint-disable object-shorthand */\nvar map = {\n Float32Array: Float32Array,\n Uint32Array: Uint32Array,\n Int32Array: Int32Array,\n Uint8Array: Uint8Array,\n Uint16Array: Uint16Array,\n};\n/* eslint-disable max-len */\n/**\n * The Geometry represents a model. It consists of two components:\n * - GeometryStyle - The structure of the model such as the attributes layout\n * - GeometryData - the data of the model - this consists of buffers.\n * This can include anything from positions, uvs, normals, colors etc.\n *\n * Geometry can be defined without passing in a style or data if required (thats how I prefer!)\n *\n * ```js\n * let geometry = new PIXI.Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1],2)\n * geometry.addIndex([0,1,2,1,3,2])\n * ```\n * @memberof PIXI\n */\nvar Geometry = /** @class */ (function () {\n /**\n * @param buffers - An array of buffers. optional.\n * @param attributes - Of the geometry, optional structure of the attributes layout\n */\n function Geometry(buffers, attributes) {\n if (buffers === void 0) { buffers = []; }\n if (attributes === void 0) { attributes = {}; }\n this.buffers = buffers;\n this.indexBuffer = null;\n this.attributes = attributes;\n this.glVertexArrayObjects = {};\n this.id = UID$3++;\n this.instanced = false;\n this.instanceCount = 1;\n this.disposeRunner = new Runner('disposeGeometry');\n this.refCount = 0;\n }\n /**\n *\n * Adds an attribute to the geometry\n * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!\n * @param id - the name of the attribute (matching up to a shader)\n * @param {PIXI.Buffer|number[]} buffer - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.\n * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2\n * @param normalized - should the data be normalized.\n * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @param [start=0] - How far into the array to start reading values (used for interleaving data)\n * @param instance - Instancing flag\n * @returns - Returns self, useful for chaining.\n */\n Geometry.prototype.addAttribute = function (id, buffer, size, normalized, type, stride, start, instance) {\n if (size === void 0) { size = 0; }\n if (normalized === void 0) { normalized = false; }\n if (instance === void 0) { instance = false; }\n if (!buffer) {\n throw new Error('You must pass a buffer when creating an attribute');\n }\n // check if this is a buffer!\n if (!(buffer instanceof Buffer)) {\n // its an array!\n if (buffer instanceof Array) {\n buffer = new Float32Array(buffer);\n }\n buffer = new Buffer(buffer);\n }\n var ids = id.split('|');\n if (ids.length > 1) {\n for (var i = 0; i < ids.length; i++) {\n this.addAttribute(ids[i], buffer, size, normalized, type);\n }\n return this;\n }\n var bufferIndex = this.buffers.indexOf(buffer);\n if (bufferIndex === -1) {\n this.buffers.push(buffer);\n bufferIndex = this.buffers.length - 1;\n }\n this.attributes[id] = new Attribute(bufferIndex, size, normalized, type, stride, start, instance);\n // assuming that if there is instanced data then this will be drawn with instancing!\n this.instanced = this.instanced || instance;\n return this;\n };\n /**\n * Returns the requested attribute.\n * @param id - The name of the attribute required\n * @returns - The attribute requested.\n */\n Geometry.prototype.getAttribute = function (id) {\n return this.attributes[id];\n };\n /**\n * Returns the requested buffer.\n * @param id - The name of the buffer required.\n * @returns - The buffer requested.\n */\n Geometry.prototype.getBuffer = function (id) {\n return this.buffers[this.getAttribute(id).buffer];\n };\n /**\n *\n * Adds an index buffer to the geometry\n * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.\n * @param {PIXI.Buffer|number[]} [buffer] - The buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.\n * @returns - Returns self, useful for chaining.\n */\n Geometry.prototype.addIndex = function (buffer) {\n if (!(buffer instanceof Buffer)) {\n // its an array!\n if (buffer instanceof Array) {\n buffer = new Uint16Array(buffer);\n }\n buffer = new Buffer(buffer);\n }\n buffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n this.indexBuffer = buffer;\n if (this.buffers.indexOf(buffer) === -1) {\n this.buffers.push(buffer);\n }\n return this;\n };\n /**\n * Returns the index buffer\n * @returns - The index buffer.\n */\n Geometry.prototype.getIndex = function () {\n return this.indexBuffer;\n };\n /**\n * This function modifies the structure so that all current attributes become interleaved into a single buffer\n * This can be useful if your model remains static as it offers a little performance boost\n * @returns - Returns self, useful for chaining.\n */\n Geometry.prototype.interleave = function () {\n // a simple check to see if buffers are already interleaved..\n if (this.buffers.length === 1 || (this.buffers.length === 2 && this.indexBuffer))\n { return this; }\n // assume already that no buffers are interleaved\n var arrays = [];\n var sizes = [];\n var interleavedBuffer = new Buffer();\n var i;\n for (i in this.attributes) {\n var attribute = this.attributes[i];\n var buffer = this.buffers[attribute.buffer];\n arrays.push(buffer.data);\n sizes.push((attribute.size * byteSizeMap$1[attribute.type]) / 4);\n attribute.buffer = 0;\n }\n interleavedBuffer.data = interleaveTypedArrays(arrays, sizes);\n for (i = 0; i < this.buffers.length; i++) {\n if (this.buffers[i] !== this.indexBuffer) {\n this.buffers[i].destroy();\n }\n }\n this.buffers = [interleavedBuffer];\n if (this.indexBuffer) {\n this.buffers.push(this.indexBuffer);\n }\n return this;\n };\n /** Get the size of the geometries, in vertices. */\n Geometry.prototype.getSize = function () {\n for (var i in this.attributes) {\n var attribute = this.attributes[i];\n var buffer = this.buffers[attribute.buffer];\n return buffer.data.length / ((attribute.stride / 4) || attribute.size);\n }\n return 0;\n };\n /** Disposes WebGL resources that are connected to this geometry. */\n Geometry.prototype.dispose = function () {\n this.disposeRunner.emit(this, false);\n };\n /** Destroys the geometry. */\n Geometry.prototype.destroy = function () {\n this.dispose();\n this.buffers = null;\n this.indexBuffer = null;\n this.attributes = null;\n };\n /**\n * Returns a clone of the geometry.\n * @returns - A new clone of this geometry.\n */\n Geometry.prototype.clone = function () {\n var geometry = new Geometry();\n for (var i = 0; i < this.buffers.length; i++) {\n geometry.buffers[i] = new Buffer(this.buffers[i].data.slice(0));\n }\n for (var i in this.attributes) {\n var attrib = this.attributes[i];\n geometry.attributes[i] = new Attribute(attrib.buffer, attrib.size, attrib.normalized, attrib.type, attrib.stride, attrib.start, attrib.instance);\n }\n if (this.indexBuffer) {\n geometry.indexBuffer = geometry.buffers[this.buffers.indexOf(this.indexBuffer)];\n geometry.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n }\n return geometry;\n };\n /**\n * Merges an array of geometries into a new single one.\n *\n * Geometry attribute styles must match for this operation to work.\n * @param geometries - array of geometries to merge\n * @returns - Shiny new geometry!\n */\n Geometry.merge = function (geometries) {\n // todo add a geometry check!\n // also a size check.. cant be too big!]\n var geometryOut = new Geometry();\n var arrays = [];\n var sizes = [];\n var offsets = [];\n var geometry;\n // pass one.. get sizes..\n for (var i = 0; i < geometries.length; i++) {\n geometry = geometries[i];\n for (var j = 0; j < geometry.buffers.length; j++) {\n sizes[j] = sizes[j] || 0;\n sizes[j] += geometry.buffers[j].data.length;\n offsets[j] = 0;\n }\n }\n // build the correct size arrays..\n for (var i = 0; i < geometry.buffers.length; i++) {\n // TODO types!\n arrays[i] = new map[getBufferType(geometry.buffers[i].data)](sizes[i]);\n geometryOut.buffers[i] = new Buffer(arrays[i]);\n }\n // pass to set data..\n for (var i = 0; i < geometries.length; i++) {\n geometry = geometries[i];\n for (var j = 0; j < geometry.buffers.length; j++) {\n arrays[j].set(geometry.buffers[j].data, offsets[j]);\n offsets[j] += geometry.buffers[j].data.length;\n }\n }\n geometryOut.attributes = geometry.attributes;\n if (geometry.indexBuffer) {\n geometryOut.indexBuffer = geometryOut.buffers[geometry.buffers.indexOf(geometry.indexBuffer)];\n geometryOut.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n var offset = 0;\n var stride = 0;\n var offset2 = 0;\n var bufferIndexToCount = 0;\n // get a buffer\n for (var i = 0; i < geometry.buffers.length; i++) {\n if (geometry.buffers[i] !== geometry.indexBuffer) {\n bufferIndexToCount = i;\n break;\n }\n }\n // figure out the stride of one buffer..\n for (var i in geometry.attributes) {\n var attribute = geometry.attributes[i];\n if ((attribute.buffer | 0) === bufferIndexToCount) {\n stride += ((attribute.size * byteSizeMap$1[attribute.type]) / 4);\n }\n }\n // time to off set all indexes..\n for (var i = 0; i < geometries.length; i++) {\n var indexBufferData = geometries[i].indexBuffer.data;\n for (var j = 0; j < indexBufferData.length; j++) {\n geometryOut.indexBuffer.data[j + offset2] += offset;\n }\n offset += geometries[i].buffers[bufferIndexToCount].data.length / (stride);\n offset2 += indexBufferData.length;\n }\n }\n return geometryOut;\n };\n return Geometry;\n}());\n\n/**\n * Helper class to create a quad\n * @memberof PIXI\n */\nvar Quad = /** @class */ (function (_super) {\n __extends(Quad, _super);\n function Quad() {\n var _this = _super.call(this) || this;\n _this.addAttribute('aVertexPosition', new Float32Array([\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 1 ]))\n .addIndex([0, 1, 3, 2]);\n return _this;\n }\n return Quad;\n}(Geometry));\n\n/**\n * Helper class to create a quad with uvs like in v4\n * @memberof PIXI\n */\nvar QuadUv = /** @class */ (function (_super) {\n __extends(QuadUv, _super);\n function QuadUv() {\n var _this = _super.call(this) || this;\n _this.vertices = new Float32Array([\n -1, -1,\n 1, -1,\n 1, 1,\n -1, 1 ]);\n _this.uvs = new Float32Array([\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 1 ]);\n _this.vertexBuffer = new Buffer(_this.vertices);\n _this.uvBuffer = new Buffer(_this.uvs);\n _this.addAttribute('aVertexPosition', _this.vertexBuffer)\n .addAttribute('aTextureCoord', _this.uvBuffer)\n .addIndex([0, 1, 2, 0, 2, 3]);\n return _this;\n }\n /**\n * Maps two Rectangle to the quad.\n * @param targetTextureFrame - The first rectangle\n * @param destinationFrame - The second rectangle\n * @returns - Returns itself.\n */\n QuadUv.prototype.map = function (targetTextureFrame, destinationFrame) {\n var x = 0; // destinationFrame.x / targetTextureFrame.width;\n var y = 0; // destinationFrame.y / targetTextureFrame.height;\n this.uvs[0] = x;\n this.uvs[1] = y;\n this.uvs[2] = x + (destinationFrame.width / targetTextureFrame.width);\n this.uvs[3] = y;\n this.uvs[4] = x + (destinationFrame.width / targetTextureFrame.width);\n this.uvs[5] = y + (destinationFrame.height / targetTextureFrame.height);\n this.uvs[6] = x;\n this.uvs[7] = y + (destinationFrame.height / targetTextureFrame.height);\n x = destinationFrame.x;\n y = destinationFrame.y;\n this.vertices[0] = x;\n this.vertices[1] = y;\n this.vertices[2] = x + destinationFrame.width;\n this.vertices[3] = y;\n this.vertices[4] = x + destinationFrame.width;\n this.vertices[5] = y + destinationFrame.height;\n this.vertices[6] = x;\n this.vertices[7] = y + destinationFrame.height;\n this.invalidate();\n return this;\n };\n /**\n * Legacy upload method, just marks buffers dirty.\n * @returns - Returns itself.\n */\n QuadUv.prototype.invalidate = function () {\n this.vertexBuffer._updateID++;\n this.uvBuffer._updateID++;\n return this;\n };\n return QuadUv;\n}(Geometry));\n\nvar UID$2 = 0;\n/**\n * Uniform group holds uniform map and some ID's for work\n *\n * `UniformGroup` has two modes:\n *\n * 1: Normal mode\n * Normal mode will upload the uniforms with individual function calls as required\n *\n * 2: Uniform buffer mode\n * This mode will treat the uniforms as a uniform buffer. You can pass in either a buffer that you manually handle, or\n * or a generic object that PixiJS will automatically map to a buffer for you.\n * For maximum benefits, make Ubo UniformGroups static, and only update them each frame.\n *\n * Rules of UBOs:\n * - UBOs only work with WebGL2, so make sure you have a fallback!\n * - Only floats are supported (including vec[2,3,4], mat[2,3,4])\n * - Samplers cannot be used in ubo's (a GPU limitation)\n * - You must ensure that the object you pass in exactly matches in the shader ubo structure.\n * Otherwise, weirdness will ensue!\n * - The name of the ubo object added to the group must match exactly the name of the ubo in the shader.\n *\n * ```\n * // ubo in shader:\n * uniform myCoolData { // declaring a ubo..\n * mat4 uCoolMatrix;\n * float uFloatyMcFloatFace\n *\n *\n * // a new uniform buffer object..\n * const myCoolData = new UniformBufferGroup({\n * uCoolMatrix: new Matrix(),\n * uFloatyMcFloatFace: 23,\n * }}\n *\n * // build a shader...\n * const shader = Shader.from(srcVert, srcFrag, {\n * myCoolData // name matches the ubo name in the shader. will be processed accordingly.\n * })\n *\n * ```\n * @memberof PIXI\n */\nvar UniformGroup = /** @class */ (function () {\n /**\n * @param {object | Buffer} [uniforms] - Custom uniforms to use to augment the built-in ones. Or a pixi buffer.\n * @param isStatic - Uniforms wont be changed after creation.\n * @param isUbo - If true, will treat this uniform group as a uniform buffer object.\n */\n function UniformGroup(uniforms, isStatic, isUbo) {\n this.group = true;\n // lets generate this when the shader ?\n this.syncUniforms = {};\n this.dirtyId = 0;\n this.id = UID$2++;\n this.static = !!isStatic;\n this.ubo = !!isUbo;\n if (uniforms instanceof Buffer) {\n this.buffer = uniforms;\n this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER;\n this.autoManage = false;\n this.ubo = true;\n }\n else {\n this.uniforms = uniforms;\n if (this.ubo) {\n this.buffer = new Buffer(new Float32Array(1));\n this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER;\n this.autoManage = true;\n }\n }\n }\n UniformGroup.prototype.update = function () {\n this.dirtyId++;\n if (!this.autoManage && this.buffer) {\n this.buffer.update();\n }\n };\n UniformGroup.prototype.add = function (name, uniforms, _static) {\n if (!this.ubo) {\n this.uniforms[name] = new UniformGroup(uniforms, _static);\n }\n else {\n // eslint-disable-next-line max-len\n throw new Error('[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them');\n }\n };\n UniformGroup.from = function (uniforms, _static, _ubo) {\n return new UniformGroup(uniforms, _static, _ubo);\n };\n /**\n * A short hand function for creating a static UBO UniformGroup.\n * @param uniforms - the ubo item\n * @param _static - should this be updated each time it is used? defaults to true here!\n */\n UniformGroup.uboFrom = function (uniforms, _static) {\n return new UniformGroup(uniforms, _static !== null && _static !== void 0 ? _static : true, true);\n };\n return UniformGroup;\n}());\n\n/**\n * System plugin to the renderer to manage filter states.\n * @ignore\n */\nvar FilterState = /** @class */ (function () {\n function FilterState() {\n this.renderTexture = null;\n this.target = null;\n this.legacy = false;\n this.resolution = 1;\n this.multisample = MSAA_QUALITY.NONE;\n // next three fields are created only for root\n // re-assigned for everything else\n this.sourceFrame = new Rectangle();\n this.destinationFrame = new Rectangle();\n this.bindingSourceFrame = new Rectangle();\n this.bindingDestinationFrame = new Rectangle();\n this.filters = [];\n this.transform = null;\n }\n /** Clears the state */\n FilterState.prototype.clear = function () {\n this.target = null;\n this.filters = null;\n this.renderTexture = null;\n };\n return FilterState;\n}());\n\nvar tempPoints = [new Point(), new Point(), new Point(), new Point()];\nvar tempMatrix$2 = new Matrix();\n/**\n * System plugin to the renderer to manage filters.\n *\n * ## Pipeline\n *\n * The FilterSystem executes the filtering pipeline by rendering the display-object into a texture, applying its\n * [filters]{@link PIXI.Filter} in series, and the last filter outputs into the final render-target.\n *\n * The filter-frame is the rectangle in world space being filtered, and those contents are mapped into\n * `(0, 0, filterFrame.width, filterFrame.height)` into the filter render-texture. The filter-frame is also called\n * the source-frame, as it is used to bind the filter render-textures. The last filter outputs to the `filterFrame`\n * in the final render-target.\n *\n * ## Usage\n *\n * {@link PIXI.Container#renderAdvanced} is an example of how to use the filter system. It is a 3 step process:\n *\n * **push**: Use {@link PIXI.FilterSystem#push} to push the set of filters to be applied on a filter-target.\n * **render**: Render the contents to be filtered using the renderer. The filter-system will only capture the contents\n * inside the bounds of the filter-target. NOTE: Using {@link PIXI.Renderer#render} is\n * illegal during an existing render cycle, and it may reset the filter system.\n * **pop**: Use {@link PIXI.FilterSystem#pop} to pop & execute the filters you initially pushed. It will apply them\n * serially and output to the bounds of the filter-target.\n * @memberof PIXI\n */\nvar FilterSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function FilterSystem(renderer) {\n this.renderer = renderer;\n this.defaultFilterStack = [{}];\n this.texturePool = new RenderTexturePool();\n this.texturePool.setScreenSize(renderer.view);\n this.statePool = [];\n this.quad = new Quad();\n this.quadUv = new QuadUv();\n this.tempRect = new Rectangle();\n this.activeState = {};\n this.globalUniforms = new UniformGroup({\n outputFrame: new Rectangle(),\n inputSize: new Float32Array(4),\n inputPixel: new Float32Array(4),\n inputClamp: new Float32Array(4),\n resolution: 1,\n // legacy variables\n filterArea: new Float32Array(4),\n filterClamp: new Float32Array(4),\n }, true);\n this.forceClear = false;\n this.useMaxPadding = false;\n }\n /**\n * Pushes a set of filters to be applied later to the system. This will redirect further rendering into an\n * input render-texture for the rest of the filtering pipeline.\n * @param {PIXI.DisplayObject} target - The target of the filter to render.\n * @param filters - The filters to apply.\n */\n FilterSystem.prototype.push = function (target, filters) {\n var _a, _b;\n var renderer = this.renderer;\n var filterStack = this.defaultFilterStack;\n var state = this.statePool.pop() || new FilterState();\n var renderTextureSystem = this.renderer.renderTexture;\n var resolution = filters[0].resolution;\n var multisample = filters[0].multisample;\n var padding = filters[0].padding;\n var autoFit = filters[0].autoFit;\n // We don't know whether it's a legacy filter until it was bound for the first time,\n // therefore we have to assume that it is if legacy is undefined.\n var legacy = (_a = filters[0].legacy) !== null && _a !== void 0 ? _a : true;\n for (var i = 1; i < filters.length; i++) {\n var filter = filters[i];\n // let's use the lowest resolution\n resolution = Math.min(resolution, filter.resolution);\n // let's use the lowest number of samples\n multisample = Math.min(multisample, filter.multisample);\n // figure out the padding required for filters\n padding = this.useMaxPadding\n // old behavior: use largest amount of padding!\n ? Math.max(padding, filter.padding)\n // new behavior: sum the padding\n : padding + filter.padding;\n // only auto fit if all filters are autofit\n autoFit = autoFit && filter.autoFit;\n legacy = legacy || ((_b = filter.legacy) !== null && _b !== void 0 ? _b : true);\n }\n if (filterStack.length === 1) {\n this.defaultFilterStack[0].renderTexture = renderTextureSystem.current;\n }\n filterStack.push(state);\n state.resolution = resolution;\n state.multisample = multisample;\n state.legacy = legacy;\n state.target = target;\n state.sourceFrame.copyFrom(target.filterArea || target.getBounds(true));\n state.sourceFrame.pad(padding);\n var sourceFrameProjected = this.tempRect.copyFrom(renderTextureSystem.sourceFrame);\n // Project source frame into world space (if projection is applied)\n if (renderer.projection.transform) {\n this.transformAABB(tempMatrix$2.copyFrom(renderer.projection.transform).invert(), sourceFrameProjected);\n }\n if (autoFit) {\n state.sourceFrame.fit(sourceFrameProjected);\n if (state.sourceFrame.width <= 0 || state.sourceFrame.height <= 0) {\n state.sourceFrame.width = 0;\n state.sourceFrame.height = 0;\n }\n }\n else if (!state.sourceFrame.intersects(sourceFrameProjected)) {\n state.sourceFrame.width = 0;\n state.sourceFrame.height = 0;\n }\n // Round sourceFrame in screen space based on render-texture.\n this.roundFrame(state.sourceFrame, renderTextureSystem.current ? renderTextureSystem.current.resolution : renderer.resolution, renderTextureSystem.sourceFrame, renderTextureSystem.destinationFrame, renderer.projection.transform);\n state.renderTexture = this.getOptimalFilterTexture(state.sourceFrame.width, state.sourceFrame.height, resolution, multisample);\n state.filters = filters;\n state.destinationFrame.width = state.renderTexture.width;\n state.destinationFrame.height = state.renderTexture.height;\n var destinationFrame = this.tempRect;\n destinationFrame.x = 0;\n destinationFrame.y = 0;\n destinationFrame.width = state.sourceFrame.width;\n destinationFrame.height = state.sourceFrame.height;\n state.renderTexture.filterFrame = state.sourceFrame;\n state.bindingSourceFrame.copyFrom(renderTextureSystem.sourceFrame);\n state.bindingDestinationFrame.copyFrom(renderTextureSystem.destinationFrame);\n state.transform = renderer.projection.transform;\n renderer.projection.transform = null;\n renderTextureSystem.bind(state.renderTexture, state.sourceFrame, destinationFrame);\n renderer.framebuffer.clear(0, 0, 0, 0);\n };\n /** Pops off the filter and applies it. */\n FilterSystem.prototype.pop = function () {\n var filterStack = this.defaultFilterStack;\n var state = filterStack.pop();\n var filters = state.filters;\n this.activeState = state;\n var globalUniforms = this.globalUniforms.uniforms;\n globalUniforms.outputFrame = state.sourceFrame;\n globalUniforms.resolution = state.resolution;\n var inputSize = globalUniforms.inputSize;\n var inputPixel = globalUniforms.inputPixel;\n var inputClamp = globalUniforms.inputClamp;\n inputSize[0] = state.destinationFrame.width;\n inputSize[1] = state.destinationFrame.height;\n inputSize[2] = 1.0 / inputSize[0];\n inputSize[3] = 1.0 / inputSize[1];\n inputPixel[0] = Math.round(inputSize[0] * state.resolution);\n inputPixel[1] = Math.round(inputSize[1] * state.resolution);\n inputPixel[2] = 1.0 / inputPixel[0];\n inputPixel[3] = 1.0 / inputPixel[1];\n inputClamp[0] = 0.5 * inputPixel[2];\n inputClamp[1] = 0.5 * inputPixel[3];\n inputClamp[2] = (state.sourceFrame.width * inputSize[2]) - (0.5 * inputPixel[2]);\n inputClamp[3] = (state.sourceFrame.height * inputSize[3]) - (0.5 * inputPixel[3]);\n // only update the rect if its legacy..\n if (state.legacy) {\n var filterArea = globalUniforms.filterArea;\n filterArea[0] = state.destinationFrame.width;\n filterArea[1] = state.destinationFrame.height;\n filterArea[2] = state.sourceFrame.x;\n filterArea[3] = state.sourceFrame.y;\n globalUniforms.filterClamp = globalUniforms.inputClamp;\n }\n this.globalUniforms.update();\n var lastState = filterStack[filterStack.length - 1];\n this.renderer.framebuffer.blit();\n if (filters.length === 1) {\n filters[0].apply(this, state.renderTexture, lastState.renderTexture, CLEAR_MODES.BLEND, state);\n this.returnFilterTexture(state.renderTexture);\n }\n else {\n var flip = state.renderTexture;\n var flop = this.getOptimalFilterTexture(flip.width, flip.height, state.resolution);\n flop.filterFrame = flip.filterFrame;\n var i = 0;\n for (i = 0; i < filters.length - 1; ++i) {\n if (i === 1 && state.multisample > 1) {\n flop = this.getOptimalFilterTexture(flip.width, flip.height, state.resolution);\n flop.filterFrame = flip.filterFrame;\n }\n filters[i].apply(this, flip, flop, CLEAR_MODES.CLEAR, state);\n var t = flip;\n flip = flop;\n flop = t;\n }\n filters[i].apply(this, flip, lastState.renderTexture, CLEAR_MODES.BLEND, state);\n if (i > 1 && state.multisample > 1) {\n this.returnFilterTexture(state.renderTexture);\n }\n this.returnFilterTexture(flip);\n this.returnFilterTexture(flop);\n }\n // lastState.renderTexture is blitted when lastState is popped\n state.clear();\n this.statePool.push(state);\n };\n /**\n * Binds a renderTexture with corresponding `filterFrame`, clears it if mode corresponds.\n * @param filterTexture - renderTexture to bind, should belong to filter pool or filter stack\n * @param clearMode - clearMode, by default its CLEAR/YES. See {@link PIXI.CLEAR_MODES}\n */\n FilterSystem.prototype.bindAndClear = function (filterTexture, clearMode) {\n if (clearMode === void 0) { clearMode = CLEAR_MODES.CLEAR; }\n var _a = this.renderer, renderTextureSystem = _a.renderTexture, stateSystem = _a.state;\n if (filterTexture === this.defaultFilterStack[this.defaultFilterStack.length - 1].renderTexture) {\n // Restore projection transform if rendering into the output render-target.\n this.renderer.projection.transform = this.activeState.transform;\n }\n else {\n // Prevent projection within filtering pipeline.\n this.renderer.projection.transform = null;\n }\n if (filterTexture && filterTexture.filterFrame) {\n var destinationFrame = this.tempRect;\n destinationFrame.x = 0;\n destinationFrame.y = 0;\n destinationFrame.width = filterTexture.filterFrame.width;\n destinationFrame.height = filterTexture.filterFrame.height;\n renderTextureSystem.bind(filterTexture, filterTexture.filterFrame, destinationFrame);\n }\n else if (filterTexture !== this.defaultFilterStack[this.defaultFilterStack.length - 1].renderTexture) {\n renderTextureSystem.bind(filterTexture);\n }\n else {\n // Restore binding for output render-target.\n this.renderer.renderTexture.bind(filterTexture, this.activeState.bindingSourceFrame, this.activeState.bindingDestinationFrame);\n }\n // Clear the texture in BLIT mode if blending is disabled or the forceClear flag is set. The blending\n // is stored in the 0th bit of the state.\n var autoClear = (stateSystem.stateId & 1) || this.forceClear;\n if (clearMode === CLEAR_MODES.CLEAR\n || (clearMode === CLEAR_MODES.BLIT && autoClear)) {\n // Use framebuffer.clear because we want to clear the whole filter texture, not just the filtering\n // area over which the shaders are run. This is because filters may sampling outside of it (e.g. blur)\n // instead of clamping their arithmetic.\n this.renderer.framebuffer.clear(0, 0, 0, 0);\n }\n };\n /**\n * Draws a filter using the default rendering process.\n *\n * This should be called only by {@link Filter#apply}.\n * @param filter - The filter to draw.\n * @param input - The input render target.\n * @param output - The target to output to.\n * @param clearMode - Should the output be cleared before rendering to it\n */\n FilterSystem.prototype.applyFilter = function (filter, input, output, clearMode) {\n var renderer = this.renderer;\n // Set state before binding, so bindAndClear gets the blend mode.\n renderer.state.set(filter.state);\n this.bindAndClear(output, clearMode);\n // set the uniforms..\n filter.uniforms.uSampler = input;\n filter.uniforms.filterGlobals = this.globalUniforms;\n // TODO make it so that the order of this does not matter..\n // because it does at the moment cos of global uniforms.\n // they need to get resynced\n renderer.shader.bind(filter);\n // check to see if the filter is a legacy one..\n filter.legacy = !!filter.program.attributeData.aTextureCoord;\n if (filter.legacy) {\n this.quadUv.map(input._frame, input.filterFrame);\n renderer.geometry.bind(this.quadUv);\n renderer.geometry.draw(DRAW_MODES.TRIANGLES);\n }\n else {\n renderer.geometry.bind(this.quad);\n renderer.geometry.draw(DRAW_MODES.TRIANGLE_STRIP);\n }\n };\n /**\n * Multiply _input normalized coordinates_ to this matrix to get _sprite texture normalized coordinates_.\n *\n * Use `outputMatrix * vTextureCoord` in the shader.\n * @param outputMatrix - The matrix to output to.\n * @param {PIXI.Sprite} sprite - The sprite to map to.\n * @returns The mapped matrix.\n */\n FilterSystem.prototype.calculateSpriteMatrix = function (outputMatrix, sprite) {\n var _a = this.activeState, sourceFrame = _a.sourceFrame, destinationFrame = _a.destinationFrame;\n var orig = sprite._texture.orig;\n var mappedMatrix = outputMatrix.set(destinationFrame.width, 0, 0, destinationFrame.height, sourceFrame.x, sourceFrame.y);\n var worldTransform = sprite.worldTransform.copyTo(Matrix.TEMP_MATRIX);\n worldTransform.invert();\n mappedMatrix.prepend(worldTransform);\n mappedMatrix.scale(1.0 / orig.width, 1.0 / orig.height);\n mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y);\n return mappedMatrix;\n };\n /** Destroys this Filter System. */\n FilterSystem.prototype.destroy = function () {\n this.renderer = null;\n // Those textures has to be destroyed by RenderTextureSystem or FramebufferSystem\n this.texturePool.clear(false);\n };\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param minWidth - The minimum width of the render texture in real pixels.\n * @param minHeight - The minimum height of the render texture in real pixels.\n * @param resolution - The resolution of the render texture.\n * @param multisample - Number of samples of the render texture.\n * @returns - The new render texture.\n */\n FilterSystem.prototype.getOptimalFilterTexture = function (minWidth, minHeight, resolution, multisample) {\n if (resolution === void 0) { resolution = 1; }\n if (multisample === void 0) { multisample = MSAA_QUALITY.NONE; }\n return this.texturePool.getOptimalTexture(minWidth, minHeight, resolution, multisample);\n };\n /**\n * Gets extra render texture to use inside current filter\n * To be compliant with older filters, you can use params in any order\n * @param input - renderTexture from which size and resolution will be copied\n * @param resolution - override resolution of the renderTexture\n * @param multisample - number of samples of the renderTexture\n */\n FilterSystem.prototype.getFilterTexture = function (input, resolution, multisample) {\n if (typeof input === 'number') {\n var swap = input;\n input = resolution;\n resolution = swap;\n }\n input = input || this.activeState.renderTexture;\n var filterTexture = this.texturePool.getOptimalTexture(input.width, input.height, resolution || input.resolution, multisample || MSAA_QUALITY.NONE);\n filterTexture.filterFrame = input.filterFrame;\n return filterTexture;\n };\n /**\n * Frees a render texture back into the pool.\n * @param renderTexture - The renderTarget to free\n */\n FilterSystem.prototype.returnFilterTexture = function (renderTexture) {\n this.texturePool.returnTexture(renderTexture);\n };\n /** Empties the texture pool. */\n FilterSystem.prototype.emptyPool = function () {\n this.texturePool.clear(true);\n };\n /** Calls `texturePool.resize()`, affects fullScreen renderTextures. */\n FilterSystem.prototype.resize = function () {\n this.texturePool.setScreenSize(this.renderer.view);\n };\n /**\n * @param matrix - first param\n * @param rect - second param\n */\n FilterSystem.prototype.transformAABB = function (matrix, rect) {\n var lt = tempPoints[0];\n var lb = tempPoints[1];\n var rt = tempPoints[2];\n var rb = tempPoints[3];\n lt.set(rect.left, rect.top);\n lb.set(rect.left, rect.bottom);\n rt.set(rect.right, rect.top);\n rb.set(rect.right, rect.bottom);\n matrix.apply(lt, lt);\n matrix.apply(lb, lb);\n matrix.apply(rt, rt);\n matrix.apply(rb, rb);\n var x0 = Math.min(lt.x, lb.x, rt.x, rb.x);\n var y0 = Math.min(lt.y, lb.y, rt.y, rb.y);\n var x1 = Math.max(lt.x, lb.x, rt.x, rb.x);\n var y1 = Math.max(lt.y, lb.y, rt.y, rb.y);\n rect.x = x0;\n rect.y = y0;\n rect.width = x1 - x0;\n rect.height = y1 - y0;\n };\n FilterSystem.prototype.roundFrame = function (frame, resolution, bindingSourceFrame, bindingDestinationFrame, transform) {\n if (frame.width <= 0 || frame.height <= 0 || bindingSourceFrame.width <= 0 || bindingSourceFrame.height <= 0) {\n return;\n }\n if (transform) {\n var a = transform.a, b = transform.b, c = transform.c, d = transform.d;\n // Skip if skew/rotation present in matrix, except for multiple of 90° rotation. If rotation\n // is a multiple of 90°, then either pair of (b,c) or (a,d) will be (0,0).\n if ((Math.abs(b) > 1e-4 || Math.abs(c) > 1e-4)\n && (Math.abs(a) > 1e-4 || Math.abs(d) > 1e-4)) {\n return;\n }\n }\n transform = transform ? tempMatrix$2.copyFrom(transform) : tempMatrix$2.identity();\n // Get forward transform from world space to screen space\n transform\n .translate(-bindingSourceFrame.x, -bindingSourceFrame.y)\n .scale(bindingDestinationFrame.width / bindingSourceFrame.width, bindingDestinationFrame.height / bindingSourceFrame.height)\n .translate(bindingDestinationFrame.x, bindingDestinationFrame.y);\n // Convert frame to screen space\n this.transformAABB(transform, frame);\n // Round frame in screen space\n frame.ceil(resolution);\n // Project back into world space.\n this.transformAABB(transform.invert(), frame);\n };\n return FilterSystem;\n}());\n\n/**\n * Base for a common object renderer that can be used as a\n * system renderer plugin.\n * @memberof PIXI\n */\nvar ObjectRenderer = /** @class */ (function () {\n /**\n * @param renderer - The renderer this manager works for.\n */\n function ObjectRenderer(renderer) {\n this.renderer = renderer;\n }\n /** Stub method that should be used to empty the current batch by rendering objects now. */\n ObjectRenderer.prototype.flush = function () {\n // flush!\n };\n /** Generic destruction method that frees all resources. This should be called by subclasses. */\n ObjectRenderer.prototype.destroy = function () {\n this.renderer = null;\n };\n /**\n * Stub method that initializes any state required before\n * rendering starts. It is different from the `prerender`\n * signal, which occurs every frame, in that it is called\n * whenever an object requests _this_ renderer specifically.\n */\n ObjectRenderer.prototype.start = function () {\n // set the shader..\n };\n /** Stops the renderer. It should free up any state and become dormant. */\n ObjectRenderer.prototype.stop = function () {\n this.flush();\n };\n /**\n * Keeps the object to render. It doesn't have to be\n * rendered immediately.\n * @param {PIXI.DisplayObject} _object - The object to render.\n */\n ObjectRenderer.prototype.render = function (_object) {\n // render the object\n };\n return ObjectRenderer;\n}());\n\n/**\n * System plugin to the renderer to manage batching.\n * @memberof PIXI\n */\nvar BatchSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function BatchSystem(renderer) {\n this.renderer = renderer;\n this.emptyRenderer = new ObjectRenderer(renderer);\n this.currentRenderer = this.emptyRenderer;\n }\n /**\n * Changes the current renderer to the one given in parameter\n * @param objectRenderer - The object renderer to use.\n */\n BatchSystem.prototype.setObjectRenderer = function (objectRenderer) {\n if (this.currentRenderer === objectRenderer) {\n return;\n }\n this.currentRenderer.stop();\n this.currentRenderer = objectRenderer;\n this.currentRenderer.start();\n };\n /**\n * This should be called if you wish to do some custom rendering\n * It will basically render anything that may be batched up such as sprites\n */\n BatchSystem.prototype.flush = function () {\n this.setObjectRenderer(this.emptyRenderer);\n };\n /** Reset the system to an empty renderer */\n BatchSystem.prototype.reset = function () {\n this.setObjectRenderer(this.emptyRenderer);\n };\n /**\n * Handy function for batch renderers: copies bound textures in first maxTextures locations to array\n * sets actual _batchLocation for them\n * @param arr - arr copy destination\n * @param maxTextures - number of copied elements\n */\n BatchSystem.prototype.copyBoundTextures = function (arr, maxTextures) {\n var boundTextures = this.renderer.texture.boundTextures;\n for (var i = maxTextures - 1; i >= 0; --i) {\n arr[i] = boundTextures[i] || null;\n if (arr[i]) {\n arr[i]._batchLocation = i;\n }\n }\n };\n /**\n * Assigns batch locations to textures in array based on boundTextures state.\n * All textures in texArray should have `_batchEnabled = _batchId`,\n * and their count should be less than `maxTextures`.\n * @param texArray - textures to bound\n * @param boundTextures - current state of bound textures\n * @param batchId - marker for _batchEnabled param of textures in texArray\n * @param maxTextures - number of texture locations to manipulate\n */\n BatchSystem.prototype.boundArray = function (texArray, boundTextures, batchId, maxTextures) {\n var elements = texArray.elements, ids = texArray.ids, count = texArray.count;\n var j = 0;\n for (var i = 0; i < count; i++) {\n var tex = elements[i];\n var loc = tex._batchLocation;\n if (loc >= 0 && loc < maxTextures\n && boundTextures[loc] === tex) {\n ids[i] = loc;\n continue;\n }\n while (j < maxTextures) {\n var bound = boundTextures[j];\n if (bound && bound._batchEnabled === batchId\n && bound._batchLocation === j) {\n j++;\n continue;\n }\n ids[i] = j;\n tex._batchLocation = j;\n boundTextures[j] = tex;\n break;\n }\n }\n };\n /**\n * @ignore\n */\n BatchSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return BatchSystem;\n}());\n\nvar CONTEXT_UID_COUNTER = 0;\n/**\n * System plugin to the renderer to manage the context.\n * @memberof PIXI\n */\nvar ContextSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function ContextSystem(renderer) {\n this.renderer = renderer;\n this.webGLVersion = 1;\n this.extensions = {};\n this.supports = {\n uint32Indices: false,\n };\n // Bind functions\n this.handleContextLost = this.handleContextLost.bind(this);\n this.handleContextRestored = this.handleContextRestored.bind(this);\n renderer.view.addEventListener('webglcontextlost', this.handleContextLost, false);\n renderer.view.addEventListener('webglcontextrestored', this.handleContextRestored, false);\n }\n Object.defineProperty(ContextSystem.prototype, \"isLost\", {\n /**\n * `true` if the context is lost\n * @readonly\n */\n get: function () {\n return (!this.gl || this.gl.isContextLost());\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Handles the context change event.\n * @param {WebGLRenderingContext} gl - New WebGL context.\n */\n ContextSystem.prototype.contextChange = function (gl) {\n this.gl = gl;\n this.renderer.gl = gl;\n this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++;\n };\n /**\n * Initializes the context.\n * @protected\n * @param {WebGLRenderingContext} gl - WebGL context\n */\n ContextSystem.prototype.initFromContext = function (gl) {\n this.gl = gl;\n this.validateContext(gl);\n this.renderer.gl = gl;\n this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++;\n this.renderer.runners.contextChange.emit(gl);\n };\n /**\n * Initialize from context options\n * @protected\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext\n * @param {object} options - context attributes\n */\n ContextSystem.prototype.initFromOptions = function (options) {\n var gl = this.createContext(this.renderer.view, options);\n this.initFromContext(gl);\n };\n /**\n * Helper class to create a WebGL Context\n * @param canvas - the canvas element that we will get the context from\n * @param options - An options object that gets passed in to the canvas element containing the\n * context attributes\n * @see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext\n * @returns {WebGLRenderingContext} the WebGL context\n */\n ContextSystem.prototype.createContext = function (canvas, options) {\n var gl;\n if (settings.PREFER_ENV >= ENV.WEBGL2) {\n gl = canvas.getContext('webgl2', options);\n }\n if (gl) {\n this.webGLVersion = 2;\n }\n else {\n this.webGLVersion = 1;\n gl = canvas.getContext('webgl', options) || canvas.getContext('experimental-webgl', options);\n if (!gl) {\n // fail, not able to get a context\n throw new Error('This browser does not support WebGL. Try using the canvas renderer');\n }\n }\n this.gl = gl;\n this.getExtensions();\n return this.gl;\n };\n /** Auto-populate the {@link PIXI.ContextSystem.extensions extensions}. */\n ContextSystem.prototype.getExtensions = function () {\n // time to set up default extensions that Pixi uses.\n var gl = this.gl;\n var common = {\n loseContext: gl.getExtension('WEBGL_lose_context'),\n anisotropicFiltering: gl.getExtension('EXT_texture_filter_anisotropic'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n s3tc: gl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: gl.getExtension('WEBGL_compressed_texture_s3tc_srgb'),\n etc: gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: gl.getExtension('WEBGL_compressed_texture_astc')\n };\n if (this.webGLVersion === 1) {\n Object.assign(this.extensions, common, {\n drawBuffers: gl.getExtension('WEBGL_draw_buffers'),\n depthTexture: gl.getExtension('WEBGL_depth_texture'),\n vertexArrayObject: gl.getExtension('OES_vertex_array_object')\n || gl.getExtension('MOZ_OES_vertex_array_object')\n || gl.getExtension('WEBKIT_OES_vertex_array_object'),\n uint32ElementIndex: gl.getExtension('OES_element_index_uint'),\n // Floats and half-floats\n floatTexture: gl.getExtension('OES_texture_float'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n textureHalfFloat: gl.getExtension('OES_texture_half_float'),\n textureHalfFloatLinear: gl.getExtension('OES_texture_half_float_linear'),\n });\n }\n else if (this.webGLVersion === 2) {\n Object.assign(this.extensions, common, {\n // Floats and half-floats\n colorBufferFloat: gl.getExtension('EXT_color_buffer_float')\n });\n }\n };\n /**\n * Handles a lost webgl context\n * @param {WebGLContextEvent} event - The context lost event.\n */\n ContextSystem.prototype.handleContextLost = function (event) {\n var _this = this;\n // Prevent default to be able to restore the context\n event.preventDefault();\n // Restore the context after this event has exited\n setTimeout(function () {\n if (_this.gl.isContextLost() && _this.extensions.loseContext) {\n _this.extensions.loseContext.restoreContext();\n }\n }, 0);\n };\n /** Handles a restored webgl context. */\n ContextSystem.prototype.handleContextRestored = function () {\n this.renderer.runners.contextChange.emit(this.gl);\n };\n ContextSystem.prototype.destroy = function () {\n var view = this.renderer.view;\n this.renderer = null;\n // remove listeners\n view.removeEventListener('webglcontextlost', this.handleContextLost);\n view.removeEventListener('webglcontextrestored', this.handleContextRestored);\n this.gl.useProgram(null);\n if (this.extensions.loseContext) {\n this.extensions.loseContext.loseContext();\n }\n };\n /** Handle the post-render runner event. */\n ContextSystem.prototype.postrender = function () {\n if (this.renderer.renderingToScreen) {\n this.gl.flush();\n }\n };\n /**\n * Validate context.\n * @param {WebGLRenderingContext} gl - Render context.\n */\n ContextSystem.prototype.validateContext = function (gl) {\n var attributes = gl.getContextAttributes();\n var isWebGl2 = 'WebGL2RenderingContext' in globalThis && gl instanceof globalThis.WebGL2RenderingContext;\n if (isWebGl2) {\n this.webGLVersion = 2;\n }\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (attributes && !attributes.stencil) {\n /* eslint-disable max-len, no-console */\n console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n /* eslint-enable max-len, no-console */\n }\n var hasuint32 = isWebGl2 || !!gl.getExtension('OES_element_index_uint');\n this.supports.uint32Indices = hasuint32;\n if (!hasuint32) {\n /* eslint-disable max-len, no-console */\n console.warn('Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly');\n /* eslint-enable max-len, no-console */\n }\n };\n return ContextSystem;\n}());\n\n/**\n * Internal framebuffer for WebGL context.\n * @memberof PIXI\n */\nvar GLFramebuffer = /** @class */ (function () {\n function GLFramebuffer(framebuffer) {\n this.framebuffer = framebuffer;\n this.stencil = null;\n this.dirtyId = -1;\n this.dirtyFormat = -1;\n this.dirtySize = -1;\n this.multisample = MSAA_QUALITY.NONE;\n this.msaaBuffer = null;\n this.blitFramebuffer = null;\n this.mipLevel = 0;\n }\n return GLFramebuffer;\n}());\n\nvar tempRectangle = new Rectangle();\n/**\n * System plugin to the renderer to manage framebuffers.\n * @memberof PIXI\n */\nvar FramebufferSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function FramebufferSystem(renderer) {\n this.renderer = renderer;\n this.managedFramebuffers = [];\n this.unknownFramebuffer = new Framebuffer(10, 10);\n this.msaaSamples = null;\n }\n /** Sets up the renderer context and necessary buffers. */\n FramebufferSystem.prototype.contextChange = function () {\n this.disposeAll(true);\n var gl = this.gl = this.renderer.gl;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle();\n this.hasMRT = true;\n this.writeDepthTexture = true;\n // webgl2\n if (this.renderer.context.webGLVersion === 1) {\n // webgl 1!\n var nativeDrawBuffersExtension_1 = this.renderer.context.extensions.drawBuffers;\n var nativeDepthTextureExtension = this.renderer.context.extensions.depthTexture;\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) {\n nativeDrawBuffersExtension_1 = null;\n nativeDepthTextureExtension = null;\n }\n if (nativeDrawBuffersExtension_1) {\n gl.drawBuffers = function (activeTextures) {\n return nativeDrawBuffersExtension_1.drawBuffersWEBGL(activeTextures);\n };\n }\n else {\n this.hasMRT = false;\n gl.drawBuffers = function () {\n // empty\n };\n }\n if (!nativeDepthTextureExtension) {\n this.writeDepthTexture = false;\n }\n }\n else {\n // WebGL2\n // cache possible MSAA samples\n this.msaaSamples = gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES);\n }\n };\n /**\n * Bind a framebuffer.\n * @param framebuffer\n * @param frame - frame, default is framebuffer size\n * @param mipLevel - optional mip level to set on the framebuffer - defaults to 0\n */\n FramebufferSystem.prototype.bind = function (framebuffer, frame, mipLevel) {\n if (mipLevel === void 0) { mipLevel = 0; }\n var gl = this.gl;\n if (framebuffer) {\n // TODO caching layer!\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID] || this.initFramebuffer(framebuffer);\n if (this.current !== framebuffer) {\n this.current = framebuffer;\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo.framebuffer);\n }\n // make sure all textures are unbound..\n if (fbo.mipLevel !== mipLevel) {\n framebuffer.dirtyId++;\n framebuffer.dirtyFormat++;\n fbo.mipLevel = mipLevel;\n }\n // now check for updates...\n if (fbo.dirtyId !== framebuffer.dirtyId) {\n fbo.dirtyId = framebuffer.dirtyId;\n if (fbo.dirtyFormat !== framebuffer.dirtyFormat) {\n fbo.dirtyFormat = framebuffer.dirtyFormat;\n fbo.dirtySize = framebuffer.dirtySize;\n this.updateFramebuffer(framebuffer, mipLevel);\n }\n else if (fbo.dirtySize !== framebuffer.dirtySize) {\n fbo.dirtySize = framebuffer.dirtySize;\n this.resizeFramebuffer(framebuffer);\n }\n }\n for (var i = 0; i < framebuffer.colorTextures.length; i++) {\n var tex = framebuffer.colorTextures[i];\n this.renderer.texture.unbind(tex.parentTextureArray || tex);\n }\n if (framebuffer.depthTexture) {\n this.renderer.texture.unbind(framebuffer.depthTexture);\n }\n if (frame) {\n var mipWidth = (frame.width >> mipLevel);\n var mipHeight = (frame.height >> mipLevel);\n var scale = mipWidth / frame.width;\n this.setViewport(frame.x * scale, frame.y * scale, mipWidth, mipHeight);\n }\n else {\n var mipWidth = (framebuffer.width >> mipLevel);\n var mipHeight = (framebuffer.height >> mipLevel);\n this.setViewport(0, 0, mipWidth, mipHeight);\n }\n }\n else {\n if (this.current) {\n this.current = null;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n if (frame) {\n this.setViewport(frame.x, frame.y, frame.width, frame.height);\n }\n else {\n this.setViewport(0, 0, this.renderer.width, this.renderer.height);\n }\n }\n };\n /**\n * Set the WebGLRenderingContext's viewport.\n * @param x - X position of viewport\n * @param y - Y position of viewport\n * @param width - Width of viewport\n * @param height - Height of viewport\n */\n FramebufferSystem.prototype.setViewport = function (x, y, width, height) {\n var v = this.viewport;\n x = Math.round(x);\n y = Math.round(y);\n width = Math.round(width);\n height = Math.round(height);\n if (v.width !== width || v.height !== height || v.x !== x || v.y !== y) {\n v.x = x;\n v.y = y;\n v.width = width;\n v.height = height;\n this.gl.viewport(x, y, width, height);\n }\n };\n Object.defineProperty(FramebufferSystem.prototype, \"size\", {\n /**\n * Get the size of the current width and height. Returns object with `width` and `height` values.\n * @readonly\n */\n get: function () {\n if (this.current) {\n // TODO store temp\n return { x: 0, y: 0, width: this.current.width, height: this.current.height };\n }\n return { x: 0, y: 0, width: this.renderer.width, height: this.renderer.height };\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clear the color of the context\n * @param r - Red value from 0 to 1\n * @param g - Green value from 0 to 1\n * @param b - Blue value from 0 to 1\n * @param a - Alpha value from 0 to 1\n * @param {PIXI.BUFFER_BITS} [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks\n * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.\n */\n FramebufferSystem.prototype.clear = function (r, g, b, a, mask) {\n if (mask === void 0) { mask = BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH; }\n var gl = this.gl;\n // TODO clear color can be set only one right?\n gl.clearColor(r, g, b, a);\n gl.clear(mask);\n };\n /**\n * Initialize framebuffer for this context\n * @protected\n * @param framebuffer\n * @returns - created GLFramebuffer\n */\n FramebufferSystem.prototype.initFramebuffer = function (framebuffer) {\n var gl = this.gl;\n var fbo = new GLFramebuffer(gl.createFramebuffer());\n fbo.multisample = this.detectSamples(framebuffer.multisample);\n framebuffer.glFramebuffers[this.CONTEXT_UID] = fbo;\n this.managedFramebuffers.push(framebuffer);\n framebuffer.disposeRunner.add(this);\n return fbo;\n };\n /**\n * Resize the framebuffer\n * @param framebuffer\n * @protected\n */\n FramebufferSystem.prototype.resizeFramebuffer = function (framebuffer) {\n var gl = this.gl;\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n if (fbo.msaaBuffer) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.msaaBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.RGBA8, framebuffer.width, framebuffer.height);\n }\n if (fbo.stencil) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.stencil);\n if (fbo.msaaBuffer) {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.DEPTH24_STENCIL8, framebuffer.width, framebuffer.height);\n }\n else {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, framebuffer.width, framebuffer.height);\n }\n }\n var colorTextures = framebuffer.colorTextures;\n var count = colorTextures.length;\n if (!gl.drawBuffers) {\n count = Math.min(count, 1);\n }\n for (var i = 0; i < count; i++) {\n var texture = colorTextures[i];\n var parentTexture = texture.parentTextureArray || texture;\n this.renderer.texture.bind(parentTexture, 0);\n }\n if (framebuffer.depthTexture && this.writeDepthTexture) {\n this.renderer.texture.bind(framebuffer.depthTexture, 0);\n }\n };\n /**\n * Update the framebuffer\n * @param framebuffer\n * @param mipLevel\n * @protected\n */\n FramebufferSystem.prototype.updateFramebuffer = function (framebuffer, mipLevel) {\n var gl = this.gl;\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n // bind the color texture\n var colorTextures = framebuffer.colorTextures;\n var count = colorTextures.length;\n if (!gl.drawBuffers) {\n count = Math.min(count, 1);\n }\n if (fbo.multisample > 1 && this.canMultisampleFramebuffer(framebuffer)) {\n fbo.msaaBuffer = fbo.msaaBuffer || gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.msaaBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.RGBA8, framebuffer.width, framebuffer.height);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, fbo.msaaBuffer);\n }\n else if (fbo.msaaBuffer) {\n gl.deleteRenderbuffer(fbo.msaaBuffer);\n fbo.msaaBuffer = null;\n if (fbo.blitFramebuffer) {\n fbo.blitFramebuffer.dispose();\n fbo.blitFramebuffer = null;\n }\n }\n var activeTextures = [];\n for (var i = 0; i < count; i++) {\n var texture = colorTextures[i];\n var parentTexture = texture.parentTextureArray || texture;\n this.renderer.texture.bind(parentTexture, 0);\n if (i === 0 && fbo.msaaBuffer) {\n continue;\n }\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, texture.target, parentTexture._glTextures[this.CONTEXT_UID].texture, mipLevel);\n activeTextures.push(gl.COLOR_ATTACHMENT0 + i);\n }\n if (activeTextures.length > 1) {\n gl.drawBuffers(activeTextures);\n }\n if (framebuffer.depthTexture) {\n var writeDepthTexture = this.writeDepthTexture;\n if (writeDepthTexture) {\n var depthTexture = framebuffer.depthTexture;\n this.renderer.texture.bind(depthTexture, 0);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture._glTextures[this.CONTEXT_UID].texture, mipLevel);\n }\n }\n if ((framebuffer.stencil || framebuffer.depth) && !(framebuffer.depthTexture && this.writeDepthTexture)) {\n fbo.stencil = fbo.stencil || gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.stencil);\n if (fbo.msaaBuffer) {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.DEPTH24_STENCIL8, framebuffer.width, framebuffer.height);\n }\n else {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, framebuffer.width, framebuffer.height);\n }\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, fbo.stencil);\n }\n else if (fbo.stencil) {\n gl.deleteRenderbuffer(fbo.stencil);\n fbo.stencil = null;\n }\n };\n /**\n * Returns true if the frame buffer can be multisampled.\n * @param framebuffer\n */\n FramebufferSystem.prototype.canMultisampleFramebuffer = function (framebuffer) {\n return this.renderer.context.webGLVersion !== 1\n && framebuffer.colorTextures.length <= 1 && !framebuffer.depthTexture;\n };\n /**\n * Detects number of samples that is not more than a param but as close to it as possible\n * @param samples - number of samples\n * @returns - recommended number of samples\n */\n FramebufferSystem.prototype.detectSamples = function (samples) {\n var msaaSamples = this.msaaSamples;\n var res = MSAA_QUALITY.NONE;\n if (samples <= 1 || msaaSamples === null) {\n return res;\n }\n for (var i = 0; i < msaaSamples.length; i++) {\n if (msaaSamples[i] <= samples) {\n res = msaaSamples[i];\n break;\n }\n }\n if (res === 1) {\n res = MSAA_QUALITY.NONE;\n }\n return res;\n };\n /**\n * Only works with WebGL2\n *\n * blits framebuffer to another of the same or bigger size\n * after that target framebuffer is bound\n *\n * Fails with WebGL warning if blits multisample framebuffer to different size\n * @param framebuffer - by default it blits \"into itself\", from renderBuffer to texture.\n * @param sourcePixels - source rectangle in pixels\n * @param destPixels - dest rectangle in pixels, assumed to be the same as sourcePixels\n */\n FramebufferSystem.prototype.blit = function (framebuffer, sourcePixels, destPixels) {\n var _a = this, current = _a.current, renderer = _a.renderer, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n if (renderer.context.webGLVersion !== 2) {\n return;\n }\n if (!current) {\n return;\n }\n var fbo = current.glFramebuffers[CONTEXT_UID];\n if (!fbo) {\n return;\n }\n if (!framebuffer) {\n if (!fbo.msaaBuffer) {\n return;\n }\n var colorTexture = current.colorTextures[0];\n if (!colorTexture) {\n return;\n }\n if (!fbo.blitFramebuffer) {\n fbo.blitFramebuffer = new Framebuffer(current.width, current.height);\n fbo.blitFramebuffer.addColorTexture(0, colorTexture);\n }\n framebuffer = fbo.blitFramebuffer;\n if (framebuffer.colorTextures[0] !== colorTexture) {\n framebuffer.colorTextures[0] = colorTexture;\n framebuffer.dirtyId++;\n framebuffer.dirtyFormat++;\n }\n if (framebuffer.width !== current.width || framebuffer.height !== current.height) {\n framebuffer.width = current.width;\n framebuffer.height = current.height;\n framebuffer.dirtyId++;\n framebuffer.dirtySize++;\n }\n }\n if (!sourcePixels) {\n sourcePixels = tempRectangle;\n sourcePixels.width = current.width;\n sourcePixels.height = current.height;\n }\n if (!destPixels) {\n destPixels = sourcePixels;\n }\n var sameSize = sourcePixels.width === destPixels.width && sourcePixels.height === destPixels.height;\n this.bind(framebuffer);\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo.framebuffer);\n gl.blitFramebuffer(sourcePixels.left, sourcePixels.top, sourcePixels.right, sourcePixels.bottom, destPixels.left, destPixels.top, destPixels.right, destPixels.bottom, gl.COLOR_BUFFER_BIT, sameSize ? gl.NEAREST : gl.LINEAR);\n };\n /**\n * Disposes framebuffer.\n * @param framebuffer - framebuffer that has to be disposed of\n * @param contextLost - If context was lost, we suppress all delete function calls\n */\n FramebufferSystem.prototype.disposeFramebuffer = function (framebuffer, contextLost) {\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n var gl = this.gl;\n if (!fbo) {\n return;\n }\n delete framebuffer.glFramebuffers[this.CONTEXT_UID];\n var index = this.managedFramebuffers.indexOf(framebuffer);\n if (index >= 0) {\n this.managedFramebuffers.splice(index, 1);\n }\n framebuffer.disposeRunner.remove(this);\n if (!contextLost) {\n gl.deleteFramebuffer(fbo.framebuffer);\n if (fbo.msaaBuffer) {\n gl.deleteRenderbuffer(fbo.msaaBuffer);\n }\n if (fbo.stencil) {\n gl.deleteRenderbuffer(fbo.stencil);\n }\n }\n if (fbo.blitFramebuffer) {\n fbo.blitFramebuffer.dispose();\n }\n };\n /**\n * Disposes all framebuffers, but not textures bound to them.\n * @param [contextLost=false] - If context was lost, we suppress all delete function calls\n */\n FramebufferSystem.prototype.disposeAll = function (contextLost) {\n var list = this.managedFramebuffers;\n this.managedFramebuffers = [];\n for (var i = 0; i < list.length; i++) {\n this.disposeFramebuffer(list[i], contextLost);\n }\n };\n /**\n * Forcing creation of stencil buffer for current framebuffer, if it wasn't done before.\n * Used by MaskSystem, when its time to use stencil mask for Graphics element.\n *\n * Its an alternative for public lazy `framebuffer.enableStencil`, in case we need stencil without rebind.\n * @private\n */\n FramebufferSystem.prototype.forceStencil = function () {\n var framebuffer = this.current;\n if (!framebuffer) {\n return;\n }\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n if (!fbo || fbo.stencil) {\n return;\n }\n framebuffer.stencil = true;\n var w = framebuffer.width;\n var h = framebuffer.height;\n var gl = this.gl;\n var stencil = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, stencil);\n if (fbo.msaaBuffer) {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.DEPTH24_STENCIL8, w, h);\n }\n else {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, w, h);\n }\n fbo.stencil = stencil;\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, stencil);\n };\n /** Resets framebuffer stored state, binds screen framebuffer. Should be called before renderTexture reset(). */\n FramebufferSystem.prototype.reset = function () {\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle();\n };\n FramebufferSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return FramebufferSystem;\n}());\n\nvar byteSizeMap = { 5126: 4, 5123: 2, 5121: 1 };\n/**\n * System plugin to the renderer to manage geometry.\n * @memberof PIXI\n */\nvar GeometrySystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function GeometrySystem(renderer) {\n this.renderer = renderer;\n this._activeGeometry = null;\n this._activeVao = null;\n this.hasVao = true;\n this.hasInstance = true;\n this.canUseUInt32ElementIndex = false;\n this.managedGeometries = {};\n }\n /** Sets up the renderer context and necessary buffers. */\n GeometrySystem.prototype.contextChange = function () {\n this.disposeAll(true);\n var gl = this.gl = this.renderer.gl;\n var context = this.renderer.context;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n // webgl2\n if (context.webGLVersion !== 2) {\n // webgl 1!\n var nativeVaoExtension_1 = this.renderer.context.extensions.vertexArrayObject;\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) {\n nativeVaoExtension_1 = null;\n }\n if (nativeVaoExtension_1) {\n gl.createVertexArray = function () {\n return nativeVaoExtension_1.createVertexArrayOES();\n };\n gl.bindVertexArray = function (vao) {\n return nativeVaoExtension_1.bindVertexArrayOES(vao);\n };\n gl.deleteVertexArray = function (vao) {\n return nativeVaoExtension_1.deleteVertexArrayOES(vao);\n };\n }\n else {\n this.hasVao = false;\n gl.createVertexArray = function () {\n return null;\n };\n gl.bindVertexArray = function () {\n return null;\n };\n gl.deleteVertexArray = function () {\n return null;\n };\n }\n }\n if (context.webGLVersion !== 2) {\n var instanceExt_1 = gl.getExtension('ANGLE_instanced_arrays');\n if (instanceExt_1) {\n gl.vertexAttribDivisor = function (a, b) {\n return instanceExt_1.vertexAttribDivisorANGLE(a, b);\n };\n gl.drawElementsInstanced = function (a, b, c, d, e) {\n return instanceExt_1.drawElementsInstancedANGLE(a, b, c, d, e);\n };\n gl.drawArraysInstanced = function (a, b, c, d) {\n return instanceExt_1.drawArraysInstancedANGLE(a, b, c, d);\n };\n }\n else {\n this.hasInstance = false;\n }\n }\n this.canUseUInt32ElementIndex = context.webGLVersion === 2 || !!context.extensions.uint32ElementIndex;\n };\n /**\n * Binds geometry so that is can be drawn. Creating a Vao if required\n * @param geometry - Instance of geometry to bind.\n * @param shader - Instance of shader to use vao for.\n */\n GeometrySystem.prototype.bind = function (geometry, shader) {\n shader = shader || this.renderer.shader.shader;\n var gl = this.gl;\n // not sure the best way to address this..\n // currently different shaders require different VAOs for the same geometry\n // Still mulling over the best way to solve this one..\n // will likely need to modify the shader attribute locations at run time!\n var vaos = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n var incRefCount = false;\n if (!vaos) {\n this.managedGeometries[geometry.id] = geometry;\n geometry.disposeRunner.add(this);\n geometry.glVertexArrayObjects[this.CONTEXT_UID] = vaos = {};\n incRefCount = true;\n }\n var vao = vaos[shader.program.id] || this.initGeometryVao(geometry, shader, incRefCount);\n this._activeGeometry = geometry;\n if (this._activeVao !== vao) {\n this._activeVao = vao;\n if (this.hasVao) {\n gl.bindVertexArray(vao);\n }\n else {\n this.activateVao(geometry, shader.program);\n }\n }\n // TODO - optimise later!\n // don't need to loop through if nothing changed!\n // maybe look to add an 'autoupdate' to geometry?\n this.updateBuffers();\n };\n /** Reset and unbind any active VAO and geometry. */\n GeometrySystem.prototype.reset = function () {\n this.unbind();\n };\n /** Update buffers of the currently bound geometry. */\n GeometrySystem.prototype.updateBuffers = function () {\n var geometry = this._activeGeometry;\n var bufferSystem = this.renderer.buffer;\n for (var i = 0; i < geometry.buffers.length; i++) {\n var buffer = geometry.buffers[i];\n bufferSystem.update(buffer);\n }\n };\n /**\n * Check compatibility between a geometry and a program\n * @param geometry - Geometry instance.\n * @param program - Program instance.\n */\n GeometrySystem.prototype.checkCompatibility = function (geometry, program) {\n // geometry must have at least all the attributes that the shader requires.\n var geometryAttributes = geometry.attributes;\n var shaderAttributes = program.attributeData;\n for (var j in shaderAttributes) {\n if (!geometryAttributes[j]) {\n throw new Error(\"shader and geometry incompatible, geometry missing the \\\"\" + j + \"\\\" attribute\");\n }\n }\n };\n /**\n * Takes a geometry and program and generates a unique signature for them.\n * @param geometry - To get signature from.\n * @param program - To test geometry against.\n * @returns - Unique signature of the geometry and program\n */\n GeometrySystem.prototype.getSignature = function (geometry, program) {\n var attribs = geometry.attributes;\n var shaderAttributes = program.attributeData;\n var strings = ['g', geometry.id];\n for (var i in attribs) {\n if (shaderAttributes[i]) {\n strings.push(i, shaderAttributes[i].location);\n }\n }\n return strings.join('-');\n };\n /**\n * Creates or gets Vao with the same structure as the geometry and stores it on the geometry.\n * If vao is created, it is bound automatically. We use a shader to infer what and how to set up the\n * attribute locations.\n * @param geometry - Instance of geometry to to generate Vao for.\n * @param shader - Instance of the shader.\n * @param incRefCount - Increment refCount of all geometry buffers.\n */\n GeometrySystem.prototype.initGeometryVao = function (geometry, shader, incRefCount) {\n if (incRefCount === void 0) { incRefCount = true; }\n var gl = this.gl;\n var CONTEXT_UID = this.CONTEXT_UID;\n var bufferSystem = this.renderer.buffer;\n var program = shader.program;\n if (!program.glPrograms[CONTEXT_UID]) {\n this.renderer.shader.generateProgram(shader);\n }\n this.checkCompatibility(geometry, program);\n var signature = this.getSignature(geometry, program);\n var vaoObjectHash = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n var vao = vaoObjectHash[signature];\n if (vao) {\n // this will give us easy access to the vao\n vaoObjectHash[program.id] = vao;\n return vao;\n }\n var buffers = geometry.buffers;\n var attributes = geometry.attributes;\n var tempStride = {};\n var tempStart = {};\n for (var j in buffers) {\n tempStride[j] = 0;\n tempStart[j] = 0;\n }\n for (var j in attributes) {\n if (!attributes[j].size && program.attributeData[j]) {\n attributes[j].size = program.attributeData[j].size;\n }\n else if (!attributes[j].size) {\n console.warn(\"PIXI Geometry attribute '\" + j + \"' size cannot be determined (likely the bound shader does not have the attribute)\"); // eslint-disable-line\n }\n tempStride[attributes[j].buffer] += attributes[j].size * byteSizeMap[attributes[j].type];\n }\n for (var j in attributes) {\n var attribute = attributes[j];\n var attribSize = attribute.size;\n if (attribute.stride === undefined) {\n if (tempStride[attribute.buffer] === attribSize * byteSizeMap[attribute.type]) {\n attribute.stride = 0;\n }\n else {\n attribute.stride = tempStride[attribute.buffer];\n }\n }\n if (attribute.start === undefined) {\n attribute.start = tempStart[attribute.buffer];\n tempStart[attribute.buffer] += attribSize * byteSizeMap[attribute.type];\n }\n }\n vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n // first update - and create the buffers!\n // only create a gl buffer if it actually gets\n for (var i = 0; i < buffers.length; i++) {\n var buffer = buffers[i];\n bufferSystem.bind(buffer);\n if (incRefCount) {\n buffer._glBuffers[CONTEXT_UID].refCount++;\n }\n }\n // TODO - maybe make this a data object?\n // lets wait to see if we need to first!\n this.activateVao(geometry, program);\n this._activeVao = vao;\n // add it to the cache!\n vaoObjectHash[program.id] = vao;\n vaoObjectHash[signature] = vao;\n return vao;\n };\n /**\n * Disposes geometry.\n * @param geometry - Geometry with buffers. Only VAO will be disposed\n * @param [contextLost=false] - If context was lost, we suppress deleteVertexArray\n */\n GeometrySystem.prototype.disposeGeometry = function (geometry, contextLost) {\n var _a;\n if (!this.managedGeometries[geometry.id]) {\n return;\n }\n delete this.managedGeometries[geometry.id];\n var vaos = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n var gl = this.gl;\n var buffers = geometry.buffers;\n var bufferSystem = (_a = this.renderer) === null || _a === void 0 ? void 0 : _a.buffer;\n geometry.disposeRunner.remove(this);\n if (!vaos) {\n return;\n }\n // bufferSystem may have already been destroyed..\n // if this is the case, there is no need to destroy the geometry buffers...\n // they already have been!\n if (bufferSystem) {\n for (var i = 0; i < buffers.length; i++) {\n var buf = buffers[i]._glBuffers[this.CONTEXT_UID];\n // my be null as context may have changed right before the dispose is called\n if (buf) {\n buf.refCount--;\n if (buf.refCount === 0 && !contextLost) {\n bufferSystem.dispose(buffers[i], contextLost);\n }\n }\n }\n }\n if (!contextLost) {\n for (var vaoId in vaos) {\n // delete only signatures, everything else are copies\n if (vaoId[0] === 'g') {\n var vao = vaos[vaoId];\n if (this._activeVao === vao) {\n this.unbind();\n }\n gl.deleteVertexArray(vao);\n }\n }\n }\n delete geometry.glVertexArrayObjects[this.CONTEXT_UID];\n };\n /**\n * Dispose all WebGL resources of all managed geometries.\n * @param [contextLost=false] - If context was lost, we suppress `gl.delete` calls\n */\n GeometrySystem.prototype.disposeAll = function (contextLost) {\n var all = Object.keys(this.managedGeometries);\n for (var i = 0; i < all.length; i++) {\n this.disposeGeometry(this.managedGeometries[all[i]], contextLost);\n }\n };\n /**\n * Activate vertex array object.\n * @param geometry - Geometry instance.\n * @param program - Shader program instance.\n */\n GeometrySystem.prototype.activateVao = function (geometry, program) {\n var gl = this.gl;\n var CONTEXT_UID = this.CONTEXT_UID;\n var bufferSystem = this.renderer.buffer;\n var buffers = geometry.buffers;\n var attributes = geometry.attributes;\n if (geometry.indexBuffer) {\n // first update the index buffer if we have one..\n bufferSystem.bind(geometry.indexBuffer);\n }\n var lastBuffer = null;\n // add a new one!\n for (var j in attributes) {\n var attribute = attributes[j];\n var buffer = buffers[attribute.buffer];\n var glBuffer = buffer._glBuffers[CONTEXT_UID];\n if (program.attributeData[j]) {\n if (lastBuffer !== glBuffer) {\n bufferSystem.bind(buffer);\n lastBuffer = glBuffer;\n }\n var location = program.attributeData[j].location;\n // TODO introduce state again\n // we can optimise this for older devices that have no VAOs\n gl.enableVertexAttribArray(location);\n gl.vertexAttribPointer(location, attribute.size, attribute.type || gl.FLOAT, attribute.normalized, attribute.stride, attribute.start);\n if (attribute.instance) {\n // TODO calculate instance count based of this...\n if (this.hasInstance) {\n gl.vertexAttribDivisor(location, 1);\n }\n else {\n throw new Error('geometry error, GPU Instancing is not supported on this device');\n }\n }\n }\n }\n };\n /**\n * Draws the currently bound geometry.\n * @param type - The type primitive to render.\n * @param size - The number of elements to be rendered. If not specified, all vertices after the\n * starting vertex will be drawn.\n * @param start - The starting vertex in the geometry to start drawing from. If not specified,\n * drawing will start from the first vertex.\n * @param instanceCount - The number of instances of the set of elements to execute. If not specified,\n * all instances will be drawn.\n */\n GeometrySystem.prototype.draw = function (type, size, start, instanceCount) {\n var gl = this.gl;\n var geometry = this._activeGeometry;\n // TODO.. this should not change so maybe cache the function?\n if (geometry.indexBuffer) {\n var byteSize = geometry.indexBuffer.data.BYTES_PER_ELEMENT;\n var glType = byteSize === 2 ? gl.UNSIGNED_SHORT : gl.UNSIGNED_INT;\n if (byteSize === 2 || (byteSize === 4 && this.canUseUInt32ElementIndex)) {\n if (geometry.instanced) {\n /* eslint-disable max-len */\n gl.drawElementsInstanced(type, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize, instanceCount || 1);\n /* eslint-enable max-len */\n }\n else {\n /* eslint-disable max-len */\n gl.drawElements(type, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize);\n /* eslint-enable max-len */\n }\n }\n else {\n console.warn('unsupported index buffer type: uint32');\n }\n }\n else if (geometry.instanced) {\n // TODO need a better way to calculate size..\n gl.drawArraysInstanced(type, start, size || geometry.getSize(), instanceCount || 1);\n }\n else {\n gl.drawArrays(type, start, size || geometry.getSize());\n }\n return this;\n };\n /** Unbind/reset everything. */\n GeometrySystem.prototype.unbind = function () {\n this.gl.bindVertexArray(null);\n this._activeVao = null;\n this._activeGeometry = null;\n };\n GeometrySystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return GeometrySystem;\n}());\n\n/**\n * Component for masked elements.\n *\n * Holds mask mode and temporary data about current mask.\n * @memberof PIXI\n */\nvar MaskData = /** @class */ (function () {\n /**\n * Create MaskData\n * @param {PIXI.DisplayObject} [maskObject=null] - object that describes the mask\n */\n function MaskData(maskObject) {\n if (maskObject === void 0) { maskObject = null; }\n this.type = MASK_TYPES.NONE;\n this.autoDetect = true;\n this.maskObject = maskObject || null;\n this.pooled = false;\n this.isMaskData = true;\n this.resolution = null;\n this.multisample = settings.FILTER_MULTISAMPLE;\n this.enabled = true;\n this.colorMask = 0xf;\n this._filters = null;\n this._stencilCounter = 0;\n this._scissorCounter = 0;\n this._scissorRect = null;\n this._scissorRectLocal = null;\n this._colorMask = 0xf;\n this._target = null;\n }\n Object.defineProperty(MaskData.prototype, \"filter\", {\n /**\n * The sprite mask filter.\n * If set to `null`, the default sprite mask filter is used.\n * @default null\n */\n get: function () {\n return this._filters ? this._filters[0] : null;\n },\n set: function (value) {\n if (value) {\n if (this._filters) {\n this._filters[0] = value;\n }\n else {\n this._filters = [value];\n }\n }\n else {\n this._filters = null;\n }\n },\n enumerable: false,\n configurable: true\n });\n /** Resets the mask data after popMask(). */\n MaskData.prototype.reset = function () {\n if (this.pooled) {\n this.maskObject = null;\n this.type = MASK_TYPES.NONE;\n this.autoDetect = true;\n }\n this._target = null;\n this._scissorRectLocal = null;\n };\n /**\n * Copies counters from maskData above, called from pushMask().\n * @param maskAbove\n */\n MaskData.prototype.copyCountersOrReset = function (maskAbove) {\n if (maskAbove) {\n this._stencilCounter = maskAbove._stencilCounter;\n this._scissorCounter = maskAbove._scissorCounter;\n this._scissorRect = maskAbove._scissorRect;\n }\n else {\n this._stencilCounter = 0;\n this._scissorCounter = 0;\n this._scissorRect = null;\n }\n };\n return MaskData;\n}());\n\n/**\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL context {WebGLProgram}\n * @param {number} type - the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param {string} src - The vertex shader source as an array of strings.\n * @returns {WebGLShader} the shader\n */\nfunction compileShader(gl, type, src) {\n var shader = gl.createShader(type);\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n}\n\n/**\n * will log a shader error highlighting the lines with the error\n * also will add numbers along the side.\n * @param gl - the WebGLContext\n * @param shader - the shader to log errors for\n */\nfunction logPrettyShaderError(gl, shader) {\n var shaderSrc = gl.getShaderSource(shader)\n .split('\\n')\n .map(function (line, index) { return index + \": \" + line; });\n var shaderLog = gl.getShaderInfoLog(shader);\n var splitShader = shaderLog.split('\\n');\n var dedupe = {};\n var lineNumbers = splitShader.map(function (line) { return parseFloat(line.replace(/^ERROR\\: 0\\:([\\d]+)\\:.*$/, '$1')); })\n .filter(function (n) {\n if (n && !dedupe[n]) {\n dedupe[n] = true;\n return true;\n }\n return false;\n });\n var logArgs = [''];\n lineNumbers.forEach(function (number) {\n shaderSrc[number - 1] = \"%c\" + shaderSrc[number - 1] + \"%c\";\n logArgs.push('background: #FF0000; color:#FFFFFF; font-size: 10px', 'font-size: 10px');\n });\n var fragmentSourceToLog = shaderSrc\n .join('\\n');\n logArgs[0] = fragmentSourceToLog;\n console.error(shaderLog);\n // eslint-disable-next-line no-console\n console.groupCollapsed('click to view full shader code');\n console.warn.apply(console, logArgs);\n // eslint-disable-next-line no-console\n console.groupEnd();\n}\n/**\n *\n * logs out any program errors\n * @param gl - The current WebGL context\n * @param program - the WebGL program to display errors for\n * @param vertexShader - the fragment WebGL shader program\n * @param fragmentShader - the vertex WebGL shader program\n */\nfunction logProgramError(gl, program, vertexShader, fragmentShader) {\n // if linking fails, then log and cleanup\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n logPrettyShaderError(gl, vertexShader);\n }\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n logPrettyShaderError(gl, fragmentShader);\n }\n console.error('PixiJS Error: Could not initialize shader.');\n // if there is a program info log, log it\n if (gl.getProgramInfoLog(program) !== '') {\n console.warn('PixiJS Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n }\n }\n}\n\nfunction booleanArray(size) {\n var array = new Array(size);\n for (var i = 0; i < array.length; i++) {\n array[i] = false;\n }\n return array;\n}\n/**\n * @method defaultValue\n * @memberof PIXI.glCore.shader\n * @param {string} type - Type of value\n * @param {number} size\n * @private\n */\nfunction defaultValue(type, size) {\n switch (type) {\n case 'float':\n return 0;\n case 'vec2':\n return new Float32Array(2 * size);\n case 'vec3':\n return new Float32Array(3 * size);\n case 'vec4':\n return new Float32Array(4 * size);\n case 'int':\n case 'uint':\n case 'sampler2D':\n case 'sampler2DArray':\n return 0;\n case 'ivec2':\n return new Int32Array(2 * size);\n case 'ivec3':\n return new Int32Array(3 * size);\n case 'ivec4':\n return new Int32Array(4 * size);\n case 'uvec2':\n return new Uint32Array(2 * size);\n case 'uvec3':\n return new Uint32Array(3 * size);\n case 'uvec4':\n return new Uint32Array(4 * size);\n case 'bool':\n return false;\n case 'bvec2':\n return booleanArray(2 * size);\n case 'bvec3':\n return booleanArray(3 * size);\n case 'bvec4':\n return booleanArray(4 * size);\n case 'mat2':\n return new Float32Array([1, 0,\n 0, 1]);\n case 'mat3':\n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n case 'mat4':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n return null;\n}\n\nvar unknownContext = {};\nvar context = unknownContext;\n/**\n * returns a little WebGL context to use for program inspection.\n * @static\n * @private\n * @returns {WebGLRenderingContext} a gl context to test with\n */\nfunction getTestContext() {\n if (context === unknownContext || (context && context.isContextLost())) {\n var canvas = settings.ADAPTER.createCanvas();\n var gl = void 0;\n if (settings.PREFER_ENV >= ENV.WEBGL2) {\n gl = canvas.getContext('webgl2', {});\n }\n if (!gl) {\n gl = (canvas.getContext('webgl', {})\n || canvas.getContext('experimental-webgl', {}));\n if (!gl) {\n // fail, not able to get a context\n gl = null;\n }\n else {\n // for shader testing..\n gl.getExtension('WEBGL_draw_buffers');\n }\n }\n context = gl;\n }\n return context;\n}\n\nvar maxFragmentPrecision;\nfunction getMaxFragmentPrecision() {\n if (!maxFragmentPrecision) {\n maxFragmentPrecision = PRECISION.MEDIUM;\n var gl = getTestContext();\n if (gl) {\n if (gl.getShaderPrecisionFormat) {\n var shaderFragment = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n maxFragmentPrecision = shaderFragment.precision ? PRECISION.HIGH : PRECISION.MEDIUM;\n }\n }\n }\n return maxFragmentPrecision;\n}\n\n/**\n * Sets the float precision on the shader, ensuring the device supports the request precision.\n * If the precision is already present, it just ensures that the device is able to handle it.\n * @private\n * @param {string} src - The shader source\n * @param {PIXI.PRECISION} requestedPrecision - The request float precision of the shader.\n * @param {PIXI.PRECISION} maxSupportedPrecision - The maximum precision the shader supports.\n * @returns {string} modified shader source\n */\nfunction setPrecision(src, requestedPrecision, maxSupportedPrecision) {\n if (src.substring(0, 9) !== 'precision') {\n // no precision supplied, so PixiJS will add the requested level.\n var precision = requestedPrecision;\n // If highp is requested but not supported, downgrade precision to a level all devices support.\n if (requestedPrecision === PRECISION.HIGH && maxSupportedPrecision !== PRECISION.HIGH) {\n precision = PRECISION.MEDIUM;\n }\n return \"precision \" + precision + \" float;\\n\" + src;\n }\n else if (maxSupportedPrecision !== PRECISION.HIGH && src.substring(0, 15) === 'precision highp') {\n // precision was supplied, but at a level this device does not support, so downgrading to mediump.\n return src.replace('precision highp', 'precision mediump');\n }\n return src;\n}\n\nvar GLSL_TO_SIZE = {\n float: 1,\n vec2: 2,\n vec3: 3,\n vec4: 4,\n int: 1,\n ivec2: 2,\n ivec3: 3,\n ivec4: 4,\n uint: 1,\n uvec2: 2,\n uvec3: 3,\n uvec4: 4,\n bool: 1,\n bvec2: 2,\n bvec3: 3,\n bvec4: 4,\n mat2: 4,\n mat3: 9,\n mat4: 16,\n sampler2D: 1,\n};\n/**\n * @private\n * @method mapSize\n * @memberof PIXI.glCore.shader\n * @param {string} type\n */\nfunction mapSize(type) {\n return GLSL_TO_SIZE[type];\n}\n\nvar GL_TABLE = null;\nvar GL_TO_GLSL_TYPES = {\n FLOAT: 'float',\n FLOAT_VEC2: 'vec2',\n FLOAT_VEC3: 'vec3',\n FLOAT_VEC4: 'vec4',\n INT: 'int',\n INT_VEC2: 'ivec2',\n INT_VEC3: 'ivec3',\n INT_VEC4: 'ivec4',\n UNSIGNED_INT: 'uint',\n UNSIGNED_INT_VEC2: 'uvec2',\n UNSIGNED_INT_VEC3: 'uvec3',\n UNSIGNED_INT_VEC4: 'uvec4',\n BOOL: 'bool',\n BOOL_VEC2: 'bvec2',\n BOOL_VEC3: 'bvec3',\n BOOL_VEC4: 'bvec4',\n FLOAT_MAT2: 'mat2',\n FLOAT_MAT3: 'mat3',\n FLOAT_MAT4: 'mat4',\n SAMPLER_2D: 'sampler2D',\n INT_SAMPLER_2D: 'sampler2D',\n UNSIGNED_INT_SAMPLER_2D: 'sampler2D',\n SAMPLER_CUBE: 'samplerCube',\n INT_SAMPLER_CUBE: 'samplerCube',\n UNSIGNED_INT_SAMPLER_CUBE: 'samplerCube',\n SAMPLER_2D_ARRAY: 'sampler2DArray',\n INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n UNSIGNED_INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n};\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction mapType(gl, type) {\n if (!GL_TABLE) {\n var typeNames = Object.keys(GL_TO_GLSL_TYPES);\n GL_TABLE = {};\n for (var i = 0; i < typeNames.length; ++i) {\n var tn = typeNames[i];\n GL_TABLE[gl[tn]] = GL_TO_GLSL_TYPES[tn];\n }\n }\n return GL_TABLE[type];\n}\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n// Parsers, each one of these will take a look at the type of shader property and uniform.\n// if they pass the test function then the code function is called that returns a the shader upload code for that uniform.\n// Shader upload code is automagically generated with these parsers.\n// If no parser is valid then the default upload functions are used.\n// exposing Parsers means that custom upload logic can be added to pixi's shaders.\n// A good example would be a pixi rectangle can be directly set on a uniform.\n// If the shader sees it it knows how to upload the rectangle structure as a vec4\n// format is as follows:\n//\n// {\n// test: (data, uniform) => {} <--- test is this code should be used for this uniform\n// code: (name, uniform) => {} <--- returns the string of the piece of code that uploads the uniform\n// codeUbo: (name, uniform) => {} <--- returns the string of the piece of code that uploads the\n// uniform to a uniform buffer\n// }\nvar uniformParsers = [\n // a float cache layer\n {\n test: function (data) {\n return data.type === 'float' && data.size === 1 && !data.isArray;\n },\n code: function (name) {\n return \"\\n if(uv[\\\"\" + name + \"\\\"] !== ud[\\\"\" + name + \"\\\"].value)\\n {\\n ud[\\\"\" + name + \"\\\"].value = uv[\\\"\" + name + \"\\\"]\\n gl.uniform1f(ud[\\\"\" + name + \"\\\"].location, uv[\\\"\" + name + \"\\\"])\\n }\\n \";\n },\n },\n // handling samplers\n {\n test: function (data, uniform) {\n // eslint-disable-next-line max-len,no-eq-null,eqeqeq\n return (data.type === 'sampler2D' || data.type === 'samplerCube' || data.type === 'sampler2DArray') && data.size === 1 && !data.isArray && (uniform == null || uniform.castToBaseTexture !== undefined);\n },\n code: function (name) { return \"t = syncData.textureCount++;\\n\\n renderer.texture.bind(uv[\\\"\" + name + \"\\\"], t);\\n\\n if(ud[\\\"\" + name + \"\\\"].value !== t)\\n {\\n ud[\\\"\" + name + \"\\\"].value = t;\\n gl.uniform1i(ud[\\\"\" + name + \"\\\"].location, t);\\n; // eslint-disable-line max-len\\n }\"; },\n },\n // uploading pixi matrix object to mat3\n {\n test: function (data, uniform) {\n return data.type === 'mat3' && data.size === 1 && !data.isArray && uniform.a !== undefined;\n },\n code: function (name) {\n // TODO and some smart caching dirty ids here!\n return \"\\n gl.uniformMatrix3fv(ud[\\\"\" + name + \"\\\"].location, false, uv[\\\"\" + name + \"\\\"].toArray(true));\\n \";\n },\n codeUbo: function (name) {\n return \"\\n var \" + name + \"_matrix = uv.\" + name + \".toArray(true);\\n\\n data[offset] = \" + name + \"_matrix[0];\\n data[offset+1] = \" + name + \"_matrix[1];\\n data[offset+2] = \" + name + \"_matrix[2];\\n \\n data[offset + 4] = \" + name + \"_matrix[3];\\n data[offset + 5] = \" + name + \"_matrix[4];\\n data[offset + 6] = \" + name + \"_matrix[5];\\n \\n data[offset + 8] = \" + name + \"_matrix[6];\\n data[offset + 9] = \" + name + \"_matrix[7];\\n data[offset + 10] = \" + name + \"_matrix[8];\\n \";\n },\n },\n // uploading a pixi point as a vec2 with caching layer\n {\n test: function (data, uniform) {\n return data.type === 'vec2' && data.size === 1 && !data.isArray && uniform.x !== undefined;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v.x || cv[1] !== v.y)\\n {\\n cv[0] = v.x;\\n cv[1] = v.y;\\n gl.uniform2f(ud[\\\"\" + name + \"\\\"].location, v.x, v.y);\\n }\";\n },\n codeUbo: function (name) {\n return \"\\n v = uv.\" + name + \";\\n\\n data[offset] = v.x;\\n data[offset+1] = v.y;\\n \";\n }\n },\n // caching layer for a vec2\n {\n test: function (data) {\n return data.type === 'vec2' && data.size === 1 && !data.isArray;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n gl.uniform2f(ud[\\\"\" + name + \"\\\"].location, v[0], v[1]);\\n }\\n \";\n },\n },\n // upload a pixi rectangle as a vec4 with caching layer\n {\n test: function (data, uniform) {\n return data.type === 'vec4' && data.size === 1 && !data.isArray && uniform.width !== undefined;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\\n {\\n cv[0] = v.x;\\n cv[1] = v.y;\\n cv[2] = v.width;\\n cv[3] = v.height;\\n gl.uniform4f(ud[\\\"\" + name + \"\\\"].location, v.x, v.y, v.width, v.height)\\n }\";\n },\n codeUbo: function (name) {\n return \"\\n v = uv.\" + name + \";\\n\\n data[offset] = v.x;\\n data[offset+1] = v.y;\\n data[offset+2] = v.width;\\n data[offset+3] = v.height;\\n \";\n }\n },\n // a caching layer for vec4 uploading\n {\n test: function (data) {\n return data.type === 'vec4' && data.size === 1 && !data.isArray;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4f(ud[\\\"\" + name + \"\\\"].location, v[0], v[1], v[2], v[3])\\n }\";\n },\n } ];\n\n// cu = Cached value's uniform data field\n// cv = Cached value\n// v = value to upload\n// ud = uniformData\n// uv = uniformValue\n// l = location\nvar GLSL_TO_SINGLE_SETTERS_CACHED = {\n float: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n gl.uniform1f(location, v);\\n }\",\n vec2: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2f(location, v[0], v[1])\\n }\",\n vec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3f(location, v[0], v[1], v[2])\\n }\",\n vec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\\n }\",\n int: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n ivec2: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2i(location, v[0], v[1]);\\n }\",\n ivec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3i(location, v[0], v[1], v[2]);\\n }\",\n ivec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\\n }\",\n uint: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1ui(location, v);\\n }\",\n uvec2: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2ui(location, v[0], v[1]);\\n }\",\n uvec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3ui(location, v[0], v[1], v[2]);\\n }\",\n uvec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\\n }\",\n bool: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n gl.uniform1i(location, v);\\n }\",\n bvec2: \"\\n if (cv[0] != v[0] || cv[1] != v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2i(location, v[0], v[1]);\\n }\",\n bvec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3i(location, v[0], v[1], v[2]);\\n }\",\n bvec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\\n }\",\n mat2: 'gl.uniformMatrix2fv(location, false, v)',\n mat3: 'gl.uniformMatrix3fv(location, false, v)',\n mat4: 'gl.uniformMatrix4fv(location, false, v)',\n sampler2D: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n samplerCube: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n sampler2DArray: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n};\nvar GLSL_TO_ARRAY_SETTERS = {\n float: \"gl.uniform1fv(location, v)\",\n vec2: \"gl.uniform2fv(location, v)\",\n vec3: \"gl.uniform3fv(location, v)\",\n vec4: 'gl.uniform4fv(location, v)',\n mat4: 'gl.uniformMatrix4fv(location, false, v)',\n mat3: 'gl.uniformMatrix3fv(location, false, v)',\n mat2: 'gl.uniformMatrix2fv(location, false, v)',\n int: 'gl.uniform1iv(location, v)',\n ivec2: 'gl.uniform2iv(location, v)',\n ivec3: 'gl.uniform3iv(location, v)',\n ivec4: 'gl.uniform4iv(location, v)',\n uint: 'gl.uniform1uiv(location, v)',\n uvec2: 'gl.uniform2uiv(location, v)',\n uvec3: 'gl.uniform3uiv(location, v)',\n uvec4: 'gl.uniform4uiv(location, v)',\n bool: 'gl.uniform1iv(location, v)',\n bvec2: 'gl.uniform2iv(location, v)',\n bvec3: 'gl.uniform3iv(location, v)',\n bvec4: 'gl.uniform4iv(location, v)',\n sampler2D: 'gl.uniform1iv(location, v)',\n samplerCube: 'gl.uniform1iv(location, v)',\n sampler2DArray: 'gl.uniform1iv(location, v)',\n};\nfunction generateUniformsSync(group, uniformData) {\n var _a;\n var funcFragments = [\"\\n var v = null;\\n var cv = null;\\n var cu = null;\\n var t = 0;\\n var gl = renderer.gl;\\n \"];\n for (var i in group.uniforms) {\n var data = uniformData[i];\n if (!data) {\n if ((_a = group.uniforms[i]) === null || _a === void 0 ? void 0 : _a.group) {\n if (group.uniforms[i].ubo) {\n funcFragments.push(\"\\n renderer.shader.syncUniformBufferGroup(uv.\" + i + \", '\" + i + \"');\\n \");\n }\n else {\n funcFragments.push(\"\\n renderer.shader.syncUniformGroup(uv.\" + i + \", syncData);\\n \");\n }\n }\n continue;\n }\n var uniform = group.uniforms[i];\n var parsed = false;\n for (var j = 0; j < uniformParsers.length; j++) {\n if (uniformParsers[j].test(data, uniform)) {\n funcFragments.push(uniformParsers[j].code(i, uniform));\n parsed = true;\n break;\n }\n }\n if (!parsed) {\n var templateType = data.size === 1 && !data.isArray ? GLSL_TO_SINGLE_SETTERS_CACHED : GLSL_TO_ARRAY_SETTERS;\n var template = templateType[data.type].replace('location', \"ud[\\\"\" + i + \"\\\"].location\");\n funcFragments.push(\"\\n cu = ud[\\\"\" + i + \"\\\"];\\n cv = cu.value;\\n v = uv[\\\"\" + i + \"\\\"];\\n \" + template + \";\");\n }\n }\n /*\n * the introduction of syncData is to solve an issue where textures in uniform groups are not set correctly\n * the texture count was always starting from 0 in each group. This needs to increment each time a texture is used\n * no matter which group is being used\n *\n */\n // eslint-disable-next-line no-new-func\n return new Function('ud', 'uv', 'renderer', 'syncData', funcFragments.join('\\n'));\n}\n\nvar fragTemplate = [\n 'precision mediump float;',\n 'void main(void){',\n 'float test = 0.1;',\n '%forloop%',\n 'gl_FragColor = vec4(0.0);',\n '}' ].join('\\n');\nfunction generateIfTestSrc(maxIfs) {\n var src = '';\n for (var i = 0; i < maxIfs; ++i) {\n if (i > 0) {\n src += '\\nelse ';\n }\n if (i < maxIfs - 1) {\n src += \"if(test == \" + i + \".0){}\";\n }\n }\n return src;\n}\nfunction checkMaxIfStatementsInShader(maxIfs, gl) {\n if (maxIfs === 0) {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n var shader = gl.createShader(gl.FRAGMENT_SHADER);\n while (true) // eslint-disable-line no-constant-condition\n {\n var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n maxIfs = (maxIfs / 2) | 0;\n }\n else {\n // valid!\n break;\n }\n }\n return maxIfs;\n}\n\n// Cache the result to prevent running this over and over\nvar unsafeEval;\n/**\n * Not all platforms allow to generate function code (e.g., `new Function`).\n * this provides the platform-level detection.\n * @private\n * @returns {boolean} `true` if `new Function` is supported.\n */\nfunction unsafeEvalSupported() {\n if (typeof unsafeEval === 'boolean') {\n return unsafeEval;\n }\n try {\n /* eslint-disable no-new-func */\n var func = new Function('param1', 'param2', 'param3', 'return param1[param2] === param3;');\n /* eslint-enable no-new-func */\n unsafeEval = func({ a: 'b' }, 'a', 'b') === true;\n }\n catch (e) {\n unsafeEval = false;\n }\n return unsafeEval;\n}\n\nvar defaultFragment$2 = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void){\\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\\n}\";\n\nvar defaultVertex$3 = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void){\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\\n\";\n\nvar UID$1 = 0;\nvar nameCache = {};\n/**\n * Helper class to create a shader program.\n * @memberof PIXI\n */\nvar Program = /** @class */ (function () {\n /**\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param name - Name for shader\n */\n function Program(vertexSrc, fragmentSrc, name) {\n if (name === void 0) { name = 'pixi-shader'; }\n this.id = UID$1++;\n this.vertexSrc = vertexSrc || Program.defaultVertexSrc;\n this.fragmentSrc = fragmentSrc || Program.defaultFragmentSrc;\n this.vertexSrc = this.vertexSrc.trim();\n this.fragmentSrc = this.fragmentSrc.trim();\n if (this.vertexSrc.substring(0, 8) !== '#version') {\n name = name.replace(/\\s+/g, '-');\n if (nameCache[name]) {\n nameCache[name]++;\n name += \"-\" + nameCache[name];\n }\n else {\n nameCache[name] = 1;\n }\n this.vertexSrc = \"#define SHADER_NAME \" + name + \"\\n\" + this.vertexSrc;\n this.fragmentSrc = \"#define SHADER_NAME \" + name + \"\\n\" + this.fragmentSrc;\n this.vertexSrc = setPrecision(this.vertexSrc, settings.PRECISION_VERTEX, PRECISION.HIGH);\n this.fragmentSrc = setPrecision(this.fragmentSrc, settings.PRECISION_FRAGMENT, getMaxFragmentPrecision());\n }\n // currently this does not extract structs only default types\n // this is where we store shader references..\n this.glPrograms = {};\n this.syncUniforms = null;\n }\n Object.defineProperty(Program, \"defaultVertexSrc\", {\n /**\n * The default vertex shader source.\n * @constant\n */\n get: function () {\n return defaultVertex$3;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Program, \"defaultFragmentSrc\", {\n /**\n * The default fragment shader source.\n * @constant\n */\n get: function () {\n return defaultFragment$2;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A short hand function to create a program based of a vertex and fragment shader.\n *\n * This method will also check to see if there is a cached program.\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param name - Name for shader\n * @returns A shiny new PixiJS shader program!\n */\n Program.from = function (vertexSrc, fragmentSrc, name) {\n var key = vertexSrc + fragmentSrc;\n var program = ProgramCache[key];\n if (!program) {\n ProgramCache[key] = program = new Program(vertexSrc, fragmentSrc, name);\n }\n return program;\n };\n return Program;\n}());\n\n/**\n * A helper class for shaders.\n * @memberof PIXI\n */\nvar Shader = /** @class */ (function () {\n /**\n * @param program - The program the shader will use.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n */\n function Shader(program, uniforms) {\n /**\n * Used internally to bind uniform buffer objects.\n * @ignore\n */\n this.uniformBindCount = 0;\n this.program = program;\n // lets see whats been passed in\n // uniforms should be converted to a uniform group\n if (uniforms) {\n if (uniforms instanceof UniformGroup) {\n this.uniformGroup = uniforms;\n }\n else {\n this.uniformGroup = new UniformGroup(uniforms);\n }\n }\n else {\n this.uniformGroup = new UniformGroup({});\n }\n this.disposeRunner = new Runner('disposeShader');\n }\n // TODO move to shader system..\n Shader.prototype.checkUniformExists = function (name, group) {\n if (group.uniforms[name]) {\n return true;\n }\n for (var i in group.uniforms) {\n var uniform = group.uniforms[i];\n if (uniform.group) {\n if (this.checkUniformExists(name, uniform)) {\n return true;\n }\n }\n }\n return false;\n };\n Shader.prototype.destroy = function () {\n // usage count on programs?\n // remove if not used!\n this.uniformGroup = null;\n this.disposeRunner.emit(this);\n this.disposeRunner.destroy();\n };\n Object.defineProperty(Shader.prototype, \"uniforms\", {\n /**\n * Shader uniform values, shortcut for `uniformGroup.uniforms`.\n * @readonly\n */\n get: function () {\n return this.uniformGroup.uniforms;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A short hand function to create a shader based of a vertex and fragment shader.\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n * @returns A shiny new PixiJS shader!\n */\n Shader.from = function (vertexSrc, fragmentSrc, uniforms) {\n var program = Program.from(vertexSrc, fragmentSrc);\n return new Shader(program, uniforms);\n };\n return Shader;\n}());\n\n/* eslint-disable max-len */\nvar BLEND$1 = 0;\nvar OFFSET$1 = 1;\nvar CULLING$1 = 2;\nvar DEPTH_TEST$1 = 3;\nvar WINDING$1 = 4;\nvar DEPTH_MASK$1 = 5;\n/**\n * This is a WebGL state, and is is passed to {@link PIXI.StateSystem}.\n *\n * Each mesh rendered may require WebGL to be in a different state.\n * For example you may want different blend mode or to enable polygon offsets\n * @memberof PIXI\n */\nvar State = /** @class */ (function () {\n function State() {\n this.data = 0;\n this.blendMode = BLEND_MODES.NORMAL;\n this.polygonOffset = 0;\n this.blend = true;\n this.depthMask = true;\n // this.depthTest = true;\n }\n Object.defineProperty(State.prototype, \"blend\", {\n /**\n * Activates blending of the computed fragment color values.\n * @default true\n */\n get: function () {\n return !!(this.data & (1 << BLEND$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << BLEND$1)) !== value) {\n this.data ^= (1 << BLEND$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"offsets\", {\n /**\n * Activates adding an offset to depth values of polygon's fragments\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << OFFSET$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << OFFSET$1)) !== value) {\n this.data ^= (1 << OFFSET$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"culling\", {\n /**\n * Activates culling of polygons.\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << CULLING$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << CULLING$1)) !== value) {\n this.data ^= (1 << CULLING$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"depthTest\", {\n /**\n * Activates depth comparisons and updates to the depth buffer.\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << DEPTH_TEST$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << DEPTH_TEST$1)) !== value) {\n this.data ^= (1 << DEPTH_TEST$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"depthMask\", {\n /**\n * Enables or disables writing to the depth buffer.\n * @default true\n */\n get: function () {\n return !!(this.data & (1 << DEPTH_MASK$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << DEPTH_MASK$1)) !== value) {\n this.data ^= (1 << DEPTH_MASK$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"clockwiseFrontFace\", {\n /**\n * Specifies whether or not front or back-facing polygons can be culled.\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << WINDING$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << WINDING$1)) !== value) {\n this.data ^= (1 << WINDING$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"blendMode\", {\n /**\n * The blend mode to be applied when this state is set. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n * Setting this mode to anything other than NO_BLEND will automatically switch blending on.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this._blendMode;\n },\n set: function (value) {\n this.blend = (value !== BLEND_MODES.NONE);\n this._blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"polygonOffset\", {\n /**\n * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.\n * @default 0\n */\n get: function () {\n return this._polygonOffset;\n },\n set: function (value) {\n this.offsets = !!value;\n this._polygonOffset = value;\n },\n enumerable: false,\n configurable: true\n });\n State.prototype.toString = function () {\n return \"[@pixi/core:State \"\n + (\"blendMode=\" + this.blendMode + \" \")\n + (\"clockwiseFrontFace=\" + this.clockwiseFrontFace + \" \")\n + (\"culling=\" + this.culling + \" \")\n + (\"depthMask=\" + this.depthMask + \" \")\n + (\"polygonOffset=\" + this.polygonOffset)\n + \"]\";\n };\n State.for2d = function () {\n var state = new State();\n state.depthTest = false;\n state.blend = true;\n return state;\n };\n return State;\n}());\n\nvar defaultFragment$1 = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void){\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n}\\n\";\n\nvar defaultVertex$2 = \"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n gl_Position = filterVertexPosition();\\n vTextureCoord = filterTextureCoord();\\n}\\n\";\n\n/**\n * A filter is a special shader that applies post-processing effects to an input texture and writes into an output\n * render-target.\n *\n * {@link http://pixijs.io/examples/#/filters/blur-filter.js Example} of the\n * {@link PIXI.filters.BlurFilter BlurFilter}.\n *\n * ### Usage\n * Filters can be applied to any DisplayObject or Container.\n * PixiJS' `FilterSystem` renders the container into temporary Framebuffer,\n * then filter renders it to the screen.\n * Multiple filters can be added to the `filters` array property and stacked on each other.\n *\n * ```\n * const filter = new PIXI.Filter(myShaderVert, myShaderFrag, { myUniform: 0.5 });\n * const container = new PIXI.Container();\n * container.filters = [filter];\n * ```\n *\n * ### Previous Version Differences\n *\n * In PixiJS **v3**, a filter was always applied to _whole screen_.\n *\n * In PixiJS **v4**, a filter can be applied _only part of the screen_.\n * Developers had to create a set of uniforms to deal with coordinates.\n *\n * In PixiJS **v5** combines _both approaches_.\n * Developers can use normal coordinates of v3 and then allow filter to use partial Framebuffers,\n * bringing those extra uniforms into account.\n *\n * Also be aware that we have changed default vertex shader, please consult\n * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.\n *\n * ### Frames\n *\n * The following table summarizes the coordinate spaces used in the filtering pipeline:\n *\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n *
Coordinate SpaceDescription
Texture Coordinates\n * The texture (or UV) coordinates in the input base-texture's space. These are normalized into the (0,1) range along\n * both axes.\n *
World Space\n * A point in the same space as the world bounds of any display-object (i.e. in the scene graph's space).\n *
Physical Pixels\n * This is base-texture's space with the origin on the top-left. You can calculate these by multiplying the texture\n * coordinates by the dimensions of the texture.\n *
\n *\n * ### Built-in Uniforms\n *\n * PixiJS viewport uses screen (CSS) coordinates, `(0, 0, renderer.screen.width, renderer.screen.height)`,\n * and `projectionMatrix` uniform maps it to the gl viewport.\n *\n * **uSampler**\n *\n * The most important uniform is the input texture that container was rendered into.\n * _Important note: as with all Framebuffers in PixiJS, both input and output are\n * premultiplied by alpha._\n *\n * By default, input normalized coordinates are passed to fragment shader with `vTextureCoord`.\n * Use it to sample the input.\n *\n * ```\n * const fragment = `\n * varying vec2 vTextureCoord;\n * uniform sampler2D uSampler;\n * void main(void)\n * {\n * gl_FragColor = texture2D(uSampler, vTextureCoord);\n * }\n * `;\n *\n * const myFilter = new PIXI.Filter(null, fragment);\n * ```\n *\n * This filter is just one uniform less than {@link PIXI.filters.AlphaFilter AlphaFilter}.\n *\n * **outputFrame**\n *\n * The `outputFrame` holds the rectangle where filter is applied in screen (CSS) coordinates.\n * It's the same as `renderer.screen` for a fullscreen filter.\n * Only a part of `outputFrame.zw` size of temporary Framebuffer is used,\n * `(0, 0, outputFrame.width, outputFrame.height)`,\n *\n * Filters uses this quad to normalized (0-1) space, its passed into `aVertexPosition` attribute.\n * To calculate vertex position in screen space using normalized (0-1) space:\n *\n * ```\n * vec4 filterVertexPosition( void )\n * {\n * vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n * return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n * }\n * ```\n *\n * **inputSize**\n *\n * Temporary framebuffer is different, it can be either the size of screen, either power-of-two.\n * The `inputSize.xy` are size of temporary framebuffer that holds input.\n * The `inputSize.zw` is inverted, it's a shortcut to evade division inside the shader.\n *\n * Set `inputSize.xy = outputFrame.zw` for a fullscreen filter.\n *\n * To calculate input normalized coordinate, you have to map it to filter normalized space.\n * Multiply by `outputFrame.zw` to get input coordinate.\n * Divide by `inputSize.xy` to get input normalized coordinate.\n *\n * ```\n * vec2 filterTextureCoord( void )\n * {\n * return aVertexPosition * (outputFrame.zw * inputSize.zw); // same as /inputSize.xy\n * }\n * ```\n * **resolution**\n *\n * The `resolution` is the ratio of screen (CSS) pixels to real pixels.\n *\n * **inputPixel**\n *\n * `inputPixel.xy` is the size of framebuffer in real pixels, same as `inputSize.xy * resolution`\n * `inputPixel.zw` is inverted `inputPixel.xy`.\n *\n * It's handy for filters that use neighbour pixels, like {@link PIXI.filters.FXAAFilter FXAAFilter}.\n *\n * **inputClamp**\n *\n * If you try to get info from outside of used part of Framebuffer - you'll get undefined behaviour.\n * For displacements, coordinates has to be clamped.\n *\n * The `inputClamp.xy` is left-top pixel center, you may ignore it, because we use left-top part of Framebuffer\n * `inputClamp.zw` is bottom-right pixel center.\n *\n * ```\n * vec4 color = texture2D(uSampler, clamp(modifiedTextureCoord, inputClamp.xy, inputClamp.zw))\n * ```\n * OR\n * ```\n * vec4 color = texture2D(uSampler, min(modifigedTextureCoord, inputClamp.zw))\n * ```\n *\n * ### Additional Information\n *\n * Complete documentation on Filter usage is located in the\n * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters can be downloaded\n * {@link https://github.com/pixijs/pixi-filters here} from the PixiJS Filters repository.\n * @memberof PIXI\n */\nvar Filter = /** @class */ (function (_super) {\n __extends(Filter, _super);\n /**\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n */\n function Filter(vertexSrc, fragmentSrc, uniforms) {\n var _this = this;\n var program = Program.from(vertexSrc || Filter.defaultVertexSrc, fragmentSrc || Filter.defaultFragmentSrc);\n _this = _super.call(this, program, uniforms) || this;\n _this.padding = 0;\n _this.resolution = settings.FILTER_RESOLUTION;\n _this.multisample = settings.FILTER_MULTISAMPLE;\n _this.enabled = true;\n _this.autoFit = true;\n _this.state = new State();\n return _this;\n }\n /**\n * Applies the filter\n * @param {PIXI.FilterSystem} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTexture} input - The input render target.\n * @param {PIXI.RenderTexture} output - The target to output to.\n * @param {PIXI.CLEAR_MODES} [clearMode] - Should the output be cleared before rendering to it.\n * @param {object} [_currentState] - It's current state of filter.\n * There are some useful properties in the currentState :\n * target, filters, sourceFrame, destinationFrame, renderTarget, resolution\n */\n Filter.prototype.apply = function (filterManager, input, output, clearMode, _currentState) {\n // do as you please!\n filterManager.applyFilter(this, input, output, clearMode);\n // or just do a regular render..\n };\n Object.defineProperty(Filter.prototype, \"blendMode\", {\n /**\n * Sets the blend mode of the filter.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this.state.blendMode;\n },\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Filter.prototype, \"resolution\", {\n /**\n * The resolution of the filter. Setting this to be lower will lower the quality but\n * increase the performance of the filter.\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._resolution = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Filter, \"defaultVertexSrc\", {\n /**\n * The default vertex shader source\n * @constant\n */\n get: function () {\n return defaultVertex$2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Filter, \"defaultFragmentSrc\", {\n /**\n * The default fragment shader source\n * @constant\n */\n get: function () {\n return defaultFragment$1;\n },\n enumerable: false,\n configurable: true\n });\n return Filter;\n}(Shader));\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 otherMatrix;\\n\\nvarying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n}\\n\";\n\nvar fragment = \"varying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform sampler2D mask;\\nuniform float alpha;\\nuniform float npmAlpha;\\nuniform vec4 maskClamp;\\n\\nvoid main(void)\\n{\\n float clip = step(3.5,\\n step(maskClamp.x, vMaskCoord.x) +\\n step(maskClamp.y, vMaskCoord.y) +\\n step(vMaskCoord.x, maskClamp.z) +\\n step(vMaskCoord.y, maskClamp.w));\\n\\n vec4 original = texture2D(uSampler, vTextureCoord);\\n vec4 masky = texture2D(mask, vMaskCoord);\\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\\n\\n original *= (alphaMul * masky.r * alpha * clip);\\n\\n gl_FragColor = original;\\n}\\n\";\n\nvar tempMat = new Matrix();\n/**\n * Class controls uv mapping from Texture normal space to BaseTexture normal space.\n *\n * Takes `trim` and `rotate` into account. May contain clamp settings for Meshes and TilingSprite.\n *\n * Can be used in Texture `uvMatrix` field, or separately, you can use different clamp settings on the same texture.\n * If you want to add support for texture region of certain feature or filter, that's what you're looking for.\n *\n * Takes track of Texture changes through `_lastTextureID` private field.\n * Use `update()` method call to track it from outside.\n * @see PIXI.Texture\n * @see PIXI.Mesh\n * @see PIXI.TilingSprite\n * @memberof PIXI\n */\nvar TextureMatrix = /** @class */ (function () {\n /**\n * @param texture - observed texture\n * @param clampMargin - Changes frame clamping, 0.5 by default. Use -0.5 for extra border.\n */\n function TextureMatrix(texture, clampMargin) {\n this._texture = texture;\n this.mapCoord = new Matrix();\n this.uClampFrame = new Float32Array(4);\n this.uClampOffset = new Float32Array(2);\n this._textureID = -1;\n this._updateID = 0;\n this.clampOffset = 0;\n this.clampMargin = (typeof clampMargin === 'undefined') ? 0.5 : clampMargin;\n this.isSimple = false;\n }\n Object.defineProperty(TextureMatrix.prototype, \"texture\", {\n /** Texture property. */\n get: function () {\n return this._texture;\n },\n set: function (value) {\n this._texture = value;\n this._textureID = -1;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Multiplies uvs array to transform\n * @param uvs - mesh uvs\n * @param [out=uvs] - output\n * @returns - output\n */\n TextureMatrix.prototype.multiplyUvs = function (uvs, out) {\n if (out === undefined) {\n out = uvs;\n }\n var mat = this.mapCoord;\n for (var i = 0; i < uvs.length; i += 2) {\n var x = uvs[i];\n var y = uvs[i + 1];\n out[i] = (x * mat.a) + (y * mat.c) + mat.tx;\n out[i + 1] = (x * mat.b) + (y * mat.d) + mat.ty;\n }\n return out;\n };\n /**\n * Updates matrices if texture was changed.\n * @param [forceUpdate=false] - if true, matrices will be updated any case\n * @returns - Whether or not it was updated\n */\n TextureMatrix.prototype.update = function (forceUpdate) {\n var tex = this._texture;\n if (!tex || !tex.valid) {\n return false;\n }\n if (!forceUpdate\n && this._textureID === tex._updateID) {\n return false;\n }\n this._textureID = tex._updateID;\n this._updateID++;\n var uvs = tex._uvs;\n this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0);\n var orig = tex.orig;\n var trim = tex.trim;\n if (trim) {\n tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height, -trim.x / trim.width, -trim.y / trim.height);\n this.mapCoord.append(tempMat);\n }\n var texBase = tex.baseTexture;\n var frame = this.uClampFrame;\n var margin = this.clampMargin / texBase.resolution;\n var offset = this.clampOffset;\n frame[0] = (tex._frame.x + margin + offset) / texBase.width;\n frame[1] = (tex._frame.y + margin + offset) / texBase.height;\n frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width;\n frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height;\n this.uClampOffset[0] = offset / texBase.realWidth;\n this.uClampOffset[1] = offset / texBase.realHeight;\n this.isSimple = tex._frame.width === texBase.width\n && tex._frame.height === texBase.height\n && tex.rotate === 0;\n return true;\n };\n return TextureMatrix;\n}());\n\n/**\n * This handles a Sprite acting as a mask, as opposed to a Graphic.\n *\n * WebGL only.\n * @memberof PIXI\n */\nvar SpriteMaskFilter = /** @class */ (function (_super) {\n __extends(SpriteMaskFilter, _super);\n /** @ignore */\n function SpriteMaskFilter(vertexSrc, fragmentSrc, uniforms) {\n var _this = this;\n var sprite = null;\n if (typeof vertexSrc !== 'string' && fragmentSrc === undefined && uniforms === undefined) {\n sprite = vertexSrc;\n vertexSrc = undefined;\n fragmentSrc = undefined;\n uniforms = undefined;\n }\n _this = _super.call(this, vertexSrc || vertex, fragmentSrc || fragment, uniforms) || this;\n _this.maskSprite = sprite;\n _this.maskMatrix = new Matrix();\n return _this;\n }\n Object.defineProperty(SpriteMaskFilter.prototype, \"maskSprite\", {\n /**\n * Sprite mask\n * @type {PIXI.DisplayObject}\n */\n get: function () {\n return this._maskSprite;\n },\n set: function (value) {\n this._maskSprite = value;\n if (this._maskSprite) {\n this._maskSprite.renderable = false;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Applies the filter\n * @param filterManager - The renderer to retrieve the filter from\n * @param input - The input render target.\n * @param output - The target to output to.\n * @param clearMode - Should the output be cleared before rendering to it.\n */\n SpriteMaskFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var maskSprite = this._maskSprite;\n var tex = maskSprite._texture;\n if (!tex.valid) {\n return;\n }\n if (!tex.uvMatrix) {\n // margin = 0.0, let it bleed a bit, shader code becomes easier\n // assuming that atlas textures were made with 1-pixel padding\n tex.uvMatrix = new TextureMatrix(tex, 0.0);\n }\n tex.uvMatrix.update();\n this.uniforms.npmAlpha = tex.baseTexture.alphaMode ? 0.0 : 1.0;\n this.uniforms.mask = tex;\n // get _normalized sprite texture coords_ and convert them to _normalized atlas texture coords_ with `prepend`\n this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite)\n .prepend(tex.uvMatrix.mapCoord);\n this.uniforms.alpha = maskSprite.worldAlpha;\n this.uniforms.maskClamp = tex.uvMatrix.uClampFrame;\n filterManager.applyFilter(this, input, output, clearMode);\n };\n return SpriteMaskFilter;\n}(Filter));\n\n/**\n * System plugin to the renderer to manage masks.\n *\n * There are three built-in types of masking:\n * **Scissor Masking**: Scissor masking discards pixels that are outside of a rectangle called the scissor box. It is\n * the most performant as the scissor test is inexpensive. However, it can only be used when the mask is rectangular.\n * **Stencil Masking**: Stencil masking discards pixels that don't overlap with the pixels rendered into the stencil\n * buffer. It is the next fastest option as it does not require rendering into a separate framebuffer. However, it does\n * cause the mask to be rendered **twice** for each masking operation; hence, minimize the rendering cost of your masks.\n * **Sprite Mask Filtering**: Sprite mask filtering discards pixels based on the red channel of the sprite-mask's\n * texture. (Generally, the masking texture is grayscale). Using advanced techniques, you might be able to embed this\n * type of masking in a custom shader - and hence, bypassing the masking system fully for performance wins.\n *\n * The best type of masking is auto-detected when you `push` one. To use scissor masking, you must pass in a `Graphics`\n * object with just a rectangle drawn.\n *\n * ## Mask Stacks\n *\n * In the scene graph, masks can be applied recursively, i.e. a mask can be applied during a masking operation. The mask\n * stack stores the currently applied masks in order. Each {@link PIXI.BaseRenderTexture} holds its own mask stack, i.e.\n * when you switch render-textures, the old masks only applied when you switch back to rendering to the old render-target.\n * @memberof PIXI\n */\nvar MaskSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function MaskSystem(renderer) {\n this.renderer = renderer;\n this.enableScissor = true;\n this.alphaMaskPool = [];\n this.maskDataPool = [];\n this.maskStack = [];\n this.alphaMaskIndex = 0;\n }\n /**\n * Changes the mask stack that is used by this System.\n * @param maskStack - The mask stack\n */\n MaskSystem.prototype.setMaskStack = function (maskStack) {\n this.maskStack = maskStack;\n this.renderer.scissor.setMaskStack(maskStack);\n this.renderer.stencil.setMaskStack(maskStack);\n };\n /**\n * Enables the mask and appends it to the current mask stack.\n *\n * NOTE: The batch renderer should be flushed beforehand to prevent pending renders from being masked.\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.MaskData|PIXI.Sprite|PIXI.Graphics|PIXI.DisplayObject} maskDataOrTarget - The masking data.\n */\n MaskSystem.prototype.push = function (target, maskDataOrTarget) {\n var maskData = maskDataOrTarget;\n if (!maskData.isMaskData) {\n var d = this.maskDataPool.pop() || new MaskData();\n d.pooled = true;\n d.maskObject = maskDataOrTarget;\n maskData = d;\n }\n var maskAbove = this.maskStack.length !== 0 ? this.maskStack[this.maskStack.length - 1] : null;\n maskData.copyCountersOrReset(maskAbove);\n maskData._colorMask = maskAbove ? maskAbove._colorMask : 0xf;\n if (maskData.autoDetect) {\n this.detect(maskData);\n }\n maskData._target = target;\n if (maskData.type !== MASK_TYPES.SPRITE) {\n this.maskStack.push(maskData);\n }\n if (maskData.enabled) {\n switch (maskData.type) {\n case MASK_TYPES.SCISSOR:\n this.renderer.scissor.push(maskData);\n break;\n case MASK_TYPES.STENCIL:\n this.renderer.stencil.push(maskData);\n break;\n case MASK_TYPES.SPRITE:\n maskData.copyCountersOrReset(null);\n this.pushSpriteMask(maskData);\n break;\n case MASK_TYPES.COLOR:\n this.pushColorMask(maskData);\n break;\n }\n }\n if (maskData.type === MASK_TYPES.SPRITE) {\n this.maskStack.push(maskData);\n }\n };\n /**\n * Removes the last mask from the mask stack and doesn't return it.\n *\n * NOTE: The batch renderer should be flushed beforehand to render the masked contents before the mask is removed.\n * @param {PIXI.IMaskTarget} target - Display Object to pop the mask from\n */\n MaskSystem.prototype.pop = function (target) {\n var maskData = this.maskStack.pop();\n if (!maskData || maskData._target !== target) {\n // TODO: add an assert when we have it\n return;\n }\n if (maskData.enabled) {\n switch (maskData.type) {\n case MASK_TYPES.SCISSOR:\n this.renderer.scissor.pop(maskData);\n break;\n case MASK_TYPES.STENCIL:\n this.renderer.stencil.pop(maskData.maskObject);\n break;\n case MASK_TYPES.SPRITE:\n this.popSpriteMask(maskData);\n break;\n case MASK_TYPES.COLOR:\n this.popColorMask(maskData);\n break;\n }\n }\n maskData.reset();\n if (maskData.pooled) {\n this.maskDataPool.push(maskData);\n }\n if (this.maskStack.length !== 0) {\n var maskCurrent = this.maskStack[this.maskStack.length - 1];\n if (maskCurrent.type === MASK_TYPES.SPRITE && maskCurrent._filters) {\n maskCurrent._filters[0].maskSprite = maskCurrent.maskObject;\n }\n }\n };\n /**\n * Sets type of MaskData based on its maskObject.\n * @param maskData\n */\n MaskSystem.prototype.detect = function (maskData) {\n var maskObject = maskData.maskObject;\n if (!maskObject) {\n maskData.type = MASK_TYPES.COLOR;\n }\n else if (maskObject.isSprite) {\n maskData.type = MASK_TYPES.SPRITE;\n }\n else if (this.enableScissor && this.renderer.scissor.testScissor(maskData)) {\n maskData.type = MASK_TYPES.SCISSOR;\n }\n else {\n maskData.type = MASK_TYPES.STENCIL;\n }\n };\n /**\n * Applies the Mask and adds it to the current filter stack.\n * @param maskData - Sprite to be used as the mask.\n */\n MaskSystem.prototype.pushSpriteMask = function (maskData) {\n var _a, _b;\n var maskObject = maskData.maskObject;\n var target = maskData._target;\n var alphaMaskFilter = maskData._filters;\n if (!alphaMaskFilter) {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex];\n if (!alphaMaskFilter) {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new SpriteMaskFilter()];\n }\n }\n var renderer = this.renderer;\n var renderTextureSystem = renderer.renderTexture;\n var resolution;\n var multisample;\n if (renderTextureSystem.current) {\n var renderTexture = renderTextureSystem.current;\n resolution = maskData.resolution || renderTexture.resolution;\n multisample = (_a = maskData.multisample) !== null && _a !== void 0 ? _a : renderTexture.multisample;\n }\n else {\n resolution = maskData.resolution || renderer.resolution;\n multisample = (_b = maskData.multisample) !== null && _b !== void 0 ? _b : renderer.multisample;\n }\n alphaMaskFilter[0].resolution = resolution;\n alphaMaskFilter[0].multisample = multisample;\n alphaMaskFilter[0].maskSprite = maskObject;\n var stashFilterArea = target.filterArea;\n target.filterArea = maskObject.getBounds(true);\n renderer.filter.push(target, alphaMaskFilter);\n target.filterArea = stashFilterArea;\n if (!maskData._filters) {\n this.alphaMaskIndex++;\n }\n };\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n * @param maskData - Sprite to be used as the mask.\n */\n MaskSystem.prototype.popSpriteMask = function (maskData) {\n this.renderer.filter.pop();\n if (maskData._filters) {\n maskData._filters[0].maskSprite = null;\n }\n else {\n this.alphaMaskIndex--;\n this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite = null;\n }\n };\n /**\n * Pushes the color mask.\n * @param maskData - The mask data\n */\n MaskSystem.prototype.pushColorMask = function (maskData) {\n var currColorMask = maskData._colorMask;\n var nextColorMask = maskData._colorMask = currColorMask & maskData.colorMask;\n if (nextColorMask !== currColorMask) {\n this.renderer.gl.colorMask((nextColorMask & 0x1) !== 0, (nextColorMask & 0x2) !== 0, (nextColorMask & 0x4) !== 0, (nextColorMask & 0x8) !== 0);\n }\n };\n /**\n * Pops the color mask.\n * @param maskData - The mask data\n */\n MaskSystem.prototype.popColorMask = function (maskData) {\n var currColorMask = maskData._colorMask;\n var nextColorMask = this.maskStack.length > 0\n ? this.maskStack[this.maskStack.length - 1]._colorMask : 0xf;\n if (nextColorMask !== currColorMask) {\n this.renderer.gl.colorMask((nextColorMask & 0x1) !== 0, (nextColorMask & 0x2) !== 0, (nextColorMask & 0x4) !== 0, (nextColorMask & 0x8) !== 0);\n }\n };\n MaskSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return MaskSystem;\n}());\n\n/**\n * System plugin to the renderer to manage specific types of masking operations.\n * @memberof PIXI\n */\nvar AbstractMaskSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function AbstractMaskSystem(renderer) {\n this.renderer = renderer;\n this.maskStack = [];\n this.glConst = 0;\n }\n /** Gets count of masks of certain type. */\n AbstractMaskSystem.prototype.getStackLength = function () {\n return this.maskStack.length;\n };\n /**\n * Changes the mask stack that is used by this System.\n * @param {PIXI.MaskData[]} maskStack - The mask stack\n */\n AbstractMaskSystem.prototype.setMaskStack = function (maskStack) {\n var gl = this.renderer.gl;\n var curStackLen = this.getStackLength();\n this.maskStack = maskStack;\n var newStackLen = this.getStackLength();\n if (newStackLen !== curStackLen) {\n if (newStackLen === 0) {\n gl.disable(this.glConst);\n }\n else {\n gl.enable(this.glConst);\n this._useCurrent();\n }\n }\n };\n /**\n * Setup renderer to use the current mask data.\n * @private\n */\n AbstractMaskSystem.prototype._useCurrent = function () {\n // OVERWRITE;\n };\n /** Destroys the mask stack. */\n AbstractMaskSystem.prototype.destroy = function () {\n this.renderer = null;\n this.maskStack = null;\n };\n return AbstractMaskSystem;\n}());\n\nvar tempMatrix$1 = new Matrix();\nvar rectPool = [];\n/**\n * System plugin to the renderer to manage scissor masking.\n *\n * Scissor masking discards pixels outside of a rectangle called the scissor box. The scissor box is in the framebuffer\n * viewport's space; however, the mask's rectangle is projected from world-space to viewport space automatically\n * by this system.\n * @memberof PIXI\n */\nvar ScissorSystem = /** @class */ (function (_super) {\n __extends(ScissorSystem, _super);\n /**\n * @param {PIXI.Renderer} renderer - The renderer this System works for.\n */\n function ScissorSystem(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.glConst = settings.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST;\n return _this;\n }\n ScissorSystem.prototype.getStackLength = function () {\n var maskData = this.maskStack[this.maskStack.length - 1];\n if (maskData) {\n return maskData._scissorCounter;\n }\n return 0;\n };\n /**\n * evaluates _boundsTransformed, _scissorRect for MaskData\n * @param maskData\n */\n ScissorSystem.prototype.calcScissorRect = function (maskData) {\n var _a;\n if (maskData._scissorRectLocal) {\n return;\n }\n var prevData = maskData._scissorRect;\n var maskObject = maskData.maskObject;\n var renderer = this.renderer;\n var renderTextureSystem = renderer.renderTexture;\n var rect = maskObject.getBounds(true, (_a = rectPool.pop()) !== null && _a !== void 0 ? _a : new Rectangle());\n this.roundFrameToPixels(rect, renderTextureSystem.current ? renderTextureSystem.current.resolution : renderer.resolution, renderTextureSystem.sourceFrame, renderTextureSystem.destinationFrame, renderer.projection.transform);\n if (prevData) {\n rect.fit(prevData);\n }\n maskData._scissorRectLocal = rect;\n };\n ScissorSystem.isMatrixRotated = function (matrix) {\n if (!matrix) {\n return false;\n }\n var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d;\n // Skip if skew/rotation present in matrix, except for multiple of 90° rotation. If rotation\n // is a multiple of 90°, then either pair of (b,c) or (a,d) will be (0,0).\n return ((Math.abs(b) > 1e-4 || Math.abs(c) > 1e-4)\n && (Math.abs(a) > 1e-4 || Math.abs(d) > 1e-4));\n };\n /**\n * Test, whether the object can be scissor mask with current renderer projection.\n * Calls \"calcScissorRect()\" if its true.\n * @param maskData - mask data\n * @returns whether Whether the object can be scissor mask\n */\n ScissorSystem.prototype.testScissor = function (maskData) {\n var maskObject = maskData.maskObject;\n if (!maskObject.isFastRect || !maskObject.isFastRect()) {\n return false;\n }\n if (ScissorSystem.isMatrixRotated(maskObject.worldTransform)) {\n return false;\n }\n if (ScissorSystem.isMatrixRotated(this.renderer.projection.transform)) {\n return false;\n }\n this.calcScissorRect(maskData);\n var rect = maskData._scissorRectLocal;\n return rect.width > 0 && rect.height > 0;\n };\n ScissorSystem.prototype.roundFrameToPixels = function (frame, resolution, bindingSourceFrame, bindingDestinationFrame, transform) {\n if (ScissorSystem.isMatrixRotated(transform)) {\n return;\n }\n transform = transform ? tempMatrix$1.copyFrom(transform) : tempMatrix$1.identity();\n // Get forward transform from world space to screen space\n transform\n .translate(-bindingSourceFrame.x, -bindingSourceFrame.y)\n .scale(bindingDestinationFrame.width / bindingSourceFrame.width, bindingDestinationFrame.height / bindingSourceFrame.height)\n .translate(bindingDestinationFrame.x, bindingDestinationFrame.y);\n // Convert frame to screen space\n this.renderer.filter.transformAABB(transform, frame);\n frame.fit(bindingDestinationFrame);\n frame.x = Math.round(frame.x * resolution);\n frame.y = Math.round(frame.y * resolution);\n frame.width = Math.round(frame.width * resolution);\n frame.height = Math.round(frame.height * resolution);\n };\n /**\n * Applies the Mask and adds it to the current stencil stack.\n * @author alvin\n * @param maskData - The mask data.\n */\n ScissorSystem.prototype.push = function (maskData) {\n if (!maskData._scissorRectLocal) {\n this.calcScissorRect(maskData);\n }\n var gl = this.renderer.gl;\n if (!maskData._scissorRect) {\n gl.enable(gl.SCISSOR_TEST);\n }\n maskData._scissorCounter++;\n maskData._scissorRect = maskData._scissorRectLocal;\n this._useCurrent();\n };\n /**\n * This should be called after a mask is popped off the mask stack. It will rebind the scissor box to be latest with the\n * last mask in the stack.\n *\n * This can also be called when you directly modify the scissor box and want to restore PixiJS state.\n * @param maskData - The mask data.\n */\n ScissorSystem.prototype.pop = function (maskData) {\n var gl = this.renderer.gl;\n if (maskData) {\n rectPool.push(maskData._scissorRectLocal);\n }\n if (this.getStackLength() > 0) {\n this._useCurrent();\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n };\n /**\n * Setup renderer to use the current scissor data.\n * @private\n */\n ScissorSystem.prototype._useCurrent = function () {\n var rect = this.maskStack[this.maskStack.length - 1]._scissorRect;\n var y;\n if (this.renderer.renderTexture.current) {\n y = rect.y;\n }\n else {\n // flipY. In future we'll have it over renderTextures as an option\n y = this.renderer.height - rect.height - rect.y;\n }\n this.renderer.gl.scissor(rect.x, y, rect.width, rect.height);\n };\n return ScissorSystem;\n}(AbstractMaskSystem));\n\n/**\n * System plugin to the renderer to manage stencils (used for masks).\n * @memberof PIXI\n */\nvar StencilSystem = /** @class */ (function (_super) {\n __extends(StencilSystem, _super);\n /**\n * @param renderer - The renderer this System works for.\n */\n function StencilSystem(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.glConst = settings.ADAPTER.getWebGLRenderingContext().STENCIL_TEST;\n return _this;\n }\n StencilSystem.prototype.getStackLength = function () {\n var maskData = this.maskStack[this.maskStack.length - 1];\n if (maskData) {\n return maskData._stencilCounter;\n }\n return 0;\n };\n /**\n * Applies the Mask and adds it to the current stencil stack.\n * @param maskData - The mask data\n */\n StencilSystem.prototype.push = function (maskData) {\n var maskObject = maskData.maskObject;\n var gl = this.renderer.gl;\n var prevMaskCount = maskData._stencilCounter;\n if (prevMaskCount === 0) {\n // force use stencil texture in current framebuffer\n this.renderer.framebuffer.forceStencil();\n gl.clearStencil(0);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n gl.enable(gl.STENCIL_TEST);\n }\n maskData._stencilCounter++;\n var colorMask = maskData._colorMask;\n if (colorMask !== 0) {\n maskData._colorMask = 0;\n gl.colorMask(false, false, false, false);\n }\n // Increment the reference stencil value where the new mask overlaps with the old ones.\n gl.stencilFunc(gl.EQUAL, prevMaskCount, 0xFFFFFFFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n maskObject.renderable = true;\n maskObject.render(this.renderer);\n this.renderer.batch.flush();\n maskObject.renderable = false;\n if (colorMask !== 0) {\n maskData._colorMask = colorMask;\n gl.colorMask((colorMask & 1) !== 0, (colorMask & 2) !== 0, (colorMask & 4) !== 0, (colorMask & 8) !== 0);\n }\n this._useCurrent();\n };\n /**\n * Pops stencil mask. MaskData is already removed from stack\n * @param {PIXI.DisplayObject} maskObject - object of popped mask data\n */\n StencilSystem.prototype.pop = function (maskObject) {\n var gl = this.renderer.gl;\n if (this.getStackLength() === 0) {\n // the stack is empty!\n gl.disable(gl.STENCIL_TEST);\n }\n else {\n var maskData = this.maskStack.length !== 0 ? this.maskStack[this.maskStack.length - 1] : null;\n var colorMask = maskData ? maskData._colorMask : 0xf;\n if (colorMask !== 0) {\n maskData._colorMask = 0;\n gl.colorMask(false, false, false, false);\n }\n // Decrement the reference stencil value where the popped mask overlaps with the other ones\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n maskObject.renderable = true;\n maskObject.render(this.renderer);\n this.renderer.batch.flush();\n maskObject.renderable = false;\n if (colorMask !== 0) {\n maskData._colorMask = colorMask;\n gl.colorMask((colorMask & 0x1) !== 0, (colorMask & 0x2) !== 0, (colorMask & 0x4) !== 0, (colorMask & 0x8) !== 0);\n }\n this._useCurrent();\n }\n };\n /**\n * Setup renderer to use the current stencil data.\n * @private\n */\n StencilSystem.prototype._useCurrent = function () {\n var gl = this.renderer.gl;\n gl.stencilFunc(gl.EQUAL, this.getStackLength(), 0xFFFFFFFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n };\n return StencilSystem;\n}(AbstractMaskSystem));\n\n/**\n * System plugin to the renderer to manage the projection matrix.\n *\n * The `projectionMatrix` is a global uniform provided to all shaders. It is used to transform points in world space to\n * normalized device coordinates.\n * @memberof PIXI\n */\nvar ProjectionSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function ProjectionSystem(renderer) {\n this.renderer = renderer;\n this.destinationFrame = null;\n this.sourceFrame = null;\n this.defaultFrame = null;\n this.projectionMatrix = new Matrix();\n this.transform = null;\n }\n /**\n * Updates the projection-matrix based on the sourceFrame → destinationFrame mapping provided.\n *\n * NOTE: It is expected you call `renderer.framebuffer.setViewport(destinationFrame)` after this. This is because\n * the framebuffer viewport converts shader vertex output in normalized device coordinates to window coordinates.\n *\n * NOTE-2: {@link RenderTextureSystem#bind} updates the projection-matrix when you bind a render-texture. It is expected\n * that you dirty the current bindings when calling this manually.\n * @param destinationFrame - The rectangle in the render-target to render the contents into. If rendering to the canvas,\n * the origin is on the top-left; if rendering to a render-texture, the origin is on the bottom-left.\n * @param sourceFrame - The rectangle in world space that contains the contents being rendered.\n * @param resolution - The resolution of the render-target, which is the ratio of\n * world-space (or CSS) pixels to physical pixels.\n * @param root - Whether the render-target is the screen. This is required because rendering to textures\n * is y-flipped (i.e. upside down relative to the screen).\n */\n ProjectionSystem.prototype.update = function (destinationFrame, sourceFrame, resolution, root) {\n this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame;\n this.sourceFrame = sourceFrame || this.sourceFrame || destinationFrame;\n // Calculate object-space to clip-space projection\n this.calculateProjection(this.destinationFrame, this.sourceFrame, resolution, root);\n if (this.transform) {\n this.projectionMatrix.append(this.transform);\n }\n var renderer = this.renderer;\n renderer.globalUniforms.uniforms.projectionMatrix = this.projectionMatrix;\n renderer.globalUniforms.update();\n // this will work for now\n // but would be sweet to stick and even on the global uniforms..\n if (renderer.shader.shader) {\n renderer.shader.syncUniformGroup(renderer.shader.shader.uniforms.globals);\n }\n };\n /**\n * Calculates the `projectionMatrix` to map points inside `sourceFrame` to inside `destinationFrame`.\n * @param _destinationFrame - The destination frame in the render-target.\n * @param sourceFrame - The source frame in world space.\n * @param _resolution - The render-target's resolution, i.e. ratio of CSS to physical pixels.\n * @param root - Whether rendering into the screen. Otherwise, if rendering to a framebuffer, the projection\n * is y-flipped.\n */\n ProjectionSystem.prototype.calculateProjection = function (_destinationFrame, sourceFrame, _resolution, root) {\n var pm = this.projectionMatrix;\n var sign = !root ? 1 : -1;\n pm.identity();\n pm.a = (1 / sourceFrame.width * 2);\n pm.d = sign * (1 / sourceFrame.height * 2);\n pm.tx = -1 - (sourceFrame.x * pm.a);\n pm.ty = -sign - (sourceFrame.y * pm.d);\n };\n /**\n * Sets the transform of the active render target to the given matrix.\n * @param _matrix - The transformation matrix\n */\n ProjectionSystem.prototype.setTransform = function (_matrix) {\n // this._activeRenderTarget.transform = matrix;\n };\n ProjectionSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return ProjectionSystem;\n}());\n\n// Temporary rectangle for assigned sourceFrame or destinationFrame\nvar tempRect = new Rectangle();\n// Temporary rectangle for renderTexture destinationFrame\nvar tempRect2 = new Rectangle();\n/* eslint-disable max-len */\n/**\n * System plugin to the renderer to manage render textures.\n *\n * Should be added after FramebufferSystem\n *\n * ### Frames\n *\n * The `RenderTextureSystem` holds a sourceFrame → destinationFrame projection. The following table explains the different\n * coordinate spaces used:\n *\n * | Frame | Description | Coordinate System |\n * | ---------------------- | ---------------------------------------------------------------- | ------------------------------------------------------- |\n * | sourceFrame | The rectangle inside of which display-objects are being rendered | **World Space**: The origin on the top-left |\n * | destinationFrame | The rectangle in the render-target (canvas or texture) into which contents should be rendered | If rendering to the canvas, this is in screen space and the origin is on the top-left. If rendering to a render-texture, this is in its base-texture's space with the origin on the bottom-left. |\n * | viewportFrame | The framebuffer viewport corresponding to the destination-frame | **Window Coordinates**: The origin is always on the bottom-left. |\n * @memberof PIXI\n */\nvar RenderTextureSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function RenderTextureSystem(renderer) {\n this.renderer = renderer;\n this.clearColor = renderer._backgroundColorRgba;\n this.defaultMaskStack = [];\n this.current = null;\n this.sourceFrame = new Rectangle();\n this.destinationFrame = new Rectangle();\n this.viewportFrame = new Rectangle();\n }\n /**\n * Bind the current render texture.\n * @param renderTexture - RenderTexture to bind, by default its `null` - the screen.\n * @param sourceFrame - Part of world that is mapped to the renderTexture.\n * @param destinationFrame - Part of renderTexture, by default it has the same size as sourceFrame.\n */\n RenderTextureSystem.prototype.bind = function (renderTexture, sourceFrame, destinationFrame) {\n if (renderTexture === void 0) { renderTexture = null; }\n var renderer = this.renderer;\n this.current = renderTexture;\n var baseTexture;\n var framebuffer;\n var resolution;\n if (renderTexture) {\n baseTexture = renderTexture.baseTexture;\n resolution = baseTexture.resolution;\n if (!sourceFrame) {\n tempRect.width = renderTexture.frame.width;\n tempRect.height = renderTexture.frame.height;\n sourceFrame = tempRect;\n }\n if (!destinationFrame) {\n tempRect2.x = renderTexture.frame.x;\n tempRect2.y = renderTexture.frame.y;\n tempRect2.width = sourceFrame.width;\n tempRect2.height = sourceFrame.height;\n destinationFrame = tempRect2;\n }\n framebuffer = baseTexture.framebuffer;\n }\n else {\n resolution = renderer.resolution;\n if (!sourceFrame) {\n tempRect.width = renderer.screen.width;\n tempRect.height = renderer.screen.height;\n sourceFrame = tempRect;\n }\n if (!destinationFrame) {\n destinationFrame = tempRect;\n destinationFrame.width = sourceFrame.width;\n destinationFrame.height = sourceFrame.height;\n }\n }\n var viewportFrame = this.viewportFrame;\n viewportFrame.x = destinationFrame.x * resolution;\n viewportFrame.y = destinationFrame.y * resolution;\n viewportFrame.width = destinationFrame.width * resolution;\n viewportFrame.height = destinationFrame.height * resolution;\n if (!renderTexture) {\n viewportFrame.y = renderer.view.height - (viewportFrame.y + viewportFrame.height);\n }\n viewportFrame.ceil();\n this.renderer.framebuffer.bind(framebuffer, viewportFrame);\n this.renderer.projection.update(destinationFrame, sourceFrame, resolution, !framebuffer);\n if (renderTexture) {\n this.renderer.mask.setMaskStack(baseTexture.maskStack);\n }\n else {\n this.renderer.mask.setMaskStack(this.defaultMaskStack);\n }\n this.sourceFrame.copyFrom(sourceFrame);\n this.destinationFrame.copyFrom(destinationFrame);\n };\n /**\n * Erases the render texture and fills the drawing area with a colour.\n * @param clearColor - The color as rgba, default to use the renderer backgroundColor\n * @param [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks\n * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.\n */\n RenderTextureSystem.prototype.clear = function (clearColor, mask) {\n if (this.current) {\n clearColor = clearColor || this.current.baseTexture.clearColor;\n }\n else {\n clearColor = clearColor || this.clearColor;\n }\n var destinationFrame = this.destinationFrame;\n var baseFrame = this.current ? this.current.baseTexture : this.renderer.screen;\n var clearMask = destinationFrame.width !== baseFrame.width || destinationFrame.height !== baseFrame.height;\n if (clearMask) {\n var _a = this.viewportFrame, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n x = Math.round(x);\n y = Math.round(y);\n width = Math.round(width);\n height = Math.round(height);\n // TODO: ScissorSystem should cache whether the scissor test is enabled or not.\n this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);\n this.renderer.gl.scissor(x, y, width, height);\n }\n this.renderer.framebuffer.clear(clearColor[0], clearColor[1], clearColor[2], clearColor[3], mask);\n if (clearMask) {\n // Restore the scissor box\n this.renderer.scissor.pop();\n }\n };\n RenderTextureSystem.prototype.resize = function () {\n // resize the root only!\n this.bind(null);\n };\n /** Resets render-texture state. */\n RenderTextureSystem.prototype.reset = function () {\n this.bind(null);\n };\n RenderTextureSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return RenderTextureSystem;\n}());\n\nfunction uboUpdate(_ud, _uv, _renderer, _syncData, buffer) {\n _renderer.buffer.update(buffer);\n}\n// cv = CachedValue\n// v = value\n// ud = uniformData\n// uv = uniformValue\n// l = location\nvar UBO_TO_SINGLE_SETTERS = {\n float: \"\\n data[offset] = v;\\n \",\n vec2: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n \",\n vec3: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n\\n \",\n vec4: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n data[offset+3] = v[3];\\n \",\n mat2: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n\\n data[offset+4] = v[2];\\n data[offset+5] = v[3];\\n \",\n mat3: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n\\n data[offset + 4] = v[3];\\n data[offset + 5] = v[4];\\n data[offset + 6] = v[5];\\n\\n data[offset + 8] = v[6];\\n data[offset + 9] = v[7];\\n data[offset + 10] = v[8];\\n \",\n mat4: \"\\n for(var i = 0; i < 16; i++)\\n {\\n data[offset + i] = v[i];\\n }\\n \"\n};\nvar GLSL_TO_STD40_SIZE = {\n float: 4,\n vec2: 8,\n vec3: 12,\n vec4: 16,\n int: 4,\n ivec2: 8,\n ivec3: 12,\n ivec4: 16,\n uint: 4,\n uvec2: 8,\n uvec3: 12,\n uvec4: 16,\n bool: 4,\n bvec2: 8,\n bvec3: 12,\n bvec4: 16,\n mat2: 16 * 2,\n mat3: 16 * 3,\n mat4: 16 * 4,\n};\n/**\n * logic originally from here: https://github.com/sketchpunk/FunWithWebGL2/blob/master/lesson_022/Shaders.js\n * rewrote it, but this was a great starting point to get a solid understanding of whats going on :)\n * @ignore\n * @param uniformData\n */\nfunction createUBOElements(uniformData) {\n var uboElements = uniformData.map(function (data) {\n return ({\n data: data,\n offset: 0,\n dataLen: 0,\n dirty: 0\n });\n });\n var size = 0;\n var chunkSize = 0;\n var offset = 0;\n for (var i = 0; i < uboElements.length; i++) {\n var uboElement = uboElements[i];\n size = GLSL_TO_STD40_SIZE[uboElement.data.type];\n if (uboElement.data.size > 1) {\n size = Math.max(size, 16) * uboElement.data.size;\n }\n uboElement.dataLen = size;\n // add some size offset..\n // must align to the nearest 16 bytes or internally nearest round size\n if (chunkSize % size !== 0 && chunkSize < 16) {\n // diff required to line up..\n var lineUpValue = (chunkSize % size) % 16;\n chunkSize += lineUpValue;\n offset += lineUpValue;\n }\n if ((chunkSize + size) > 16) {\n offset = Math.ceil(offset / 16) * 16;\n uboElement.offset = offset;\n offset += size;\n chunkSize = size;\n }\n else {\n uboElement.offset = offset;\n chunkSize += size;\n offset += size;\n }\n }\n offset = Math.ceil(offset / 16) * 16;\n return { uboElements: uboElements, size: offset };\n}\nfunction getUBOData(uniforms, uniformData) {\n var usedUniformDatas = [];\n // build..\n for (var i in uniforms) {\n if (uniformData[i]) {\n usedUniformDatas.push(uniformData[i]);\n }\n }\n // sort them out by index!\n usedUniformDatas.sort(function (a, b) { return a.index - b.index; });\n return usedUniformDatas;\n}\nfunction generateUniformBufferSync(group, uniformData) {\n if (!group.autoManage) {\n // if the group is nott automatically managed, we don't need to generate a special function for it...\n return { size: 0, syncFunc: uboUpdate };\n }\n var usedUniformDatas = getUBOData(group.uniforms, uniformData);\n var _a = createUBOElements(usedUniformDatas), uboElements = _a.uboElements, size = _a.size;\n var funcFragments = [\"\\n var v = null;\\n var v2 = null;\\n var cv = null;\\n var t = 0;\\n var gl = renderer.gl\\n var index = 0;\\n var data = buffer.data;\\n \"];\n for (var i = 0; i < uboElements.length; i++) {\n var uboElement = uboElements[i];\n var uniform = group.uniforms[uboElement.data.name];\n var name = uboElement.data.name;\n var parsed = false;\n for (var j = 0; j < uniformParsers.length; j++) {\n var uniformParser = uniformParsers[j];\n if (uniformParser.codeUbo && uniformParser.test(uboElement.data, uniform)) {\n funcFragments.push(\"offset = \" + uboElement.offset / 4 + \";\", uniformParsers[j].codeUbo(uboElement.data.name, uniform));\n parsed = true;\n break;\n }\n }\n if (!parsed) {\n if (uboElement.data.size > 1) {\n var size_1 = mapSize(uboElement.data.type);\n var rowSize = Math.max(GLSL_TO_STD40_SIZE[uboElement.data.type] / 16, 1);\n var elementSize = size_1 / rowSize;\n var remainder = (4 - (elementSize % 4)) % 4;\n funcFragments.push(\"\\n cv = ud.\" + name + \".value;\\n v = uv.\" + name + \";\\n offset = \" + uboElement.offset / 4 + \";\\n\\n t = 0;\\n\\n for(var i=0; i < \" + uboElement.data.size * rowSize + \"; i++)\\n {\\n for(var j = 0; j < \" + elementSize + \"; j++)\\n {\\n data[offset++] = v[t++];\\n }\\n offset += \" + remainder + \";\\n }\\n\\n \");\n }\n else {\n var template = UBO_TO_SINGLE_SETTERS[uboElement.data.type];\n funcFragments.push(\"\\n cv = ud.\" + name + \".value;\\n v = uv.\" + name + \";\\n offset = \" + uboElement.offset / 4 + \";\\n \" + template + \";\\n \");\n }\n }\n }\n funcFragments.push(\"\\n renderer.buffer.update(buffer);\\n \");\n return {\n size: size,\n // eslint-disable-next-line no-new-func\n syncFunc: new Function('ud', 'uv', 'renderer', 'syncData', 'buffer', funcFragments.join('\\n'))\n };\n}\n\n/**\n * @private\n */\nvar IGLUniformData = /** @class */ (function () {\n function IGLUniformData() {\n }\n return IGLUniformData;\n}());\n/**\n * Helper class to create a WebGL Program\n * @memberof PIXI\n */\nvar GLProgram = /** @class */ (function () {\n /**\n * Makes a new Pixi program.\n * @param program - webgl program\n * @param uniformData - uniforms\n */\n function GLProgram(program, uniformData) {\n this.program = program;\n this.uniformData = uniformData;\n this.uniformGroups = {};\n this.uniformDirtyGroups = {};\n this.uniformBufferBindings = {};\n }\n /** Destroys this program. */\n GLProgram.prototype.destroy = function () {\n this.uniformData = null;\n this.uniformGroups = null;\n this.uniformDirtyGroups = null;\n this.uniformBufferBindings = null;\n this.program = null;\n };\n return GLProgram;\n}());\n\n/**\n * returns the attribute data from the program\n * @private\n * @param {WebGLProgram} [program] - the WebGL program\n * @param {WebGLRenderingContext} [gl] - the WebGL context\n * @returns {object} the attribute data for this program\n */\nfunction getAttributeData(program, gl) {\n var attributes = {};\n var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n for (var i = 0; i < totalAttributes; i++) {\n var attribData = gl.getActiveAttrib(program, i);\n if (attribData.name.indexOf('gl_') === 0) {\n continue;\n }\n var type = mapType(gl, attribData.type);\n var data = {\n type: type,\n name: attribData.name,\n size: mapSize(type),\n location: gl.getAttribLocation(program, attribData.name),\n };\n attributes[attribData.name] = data;\n }\n return attributes;\n}\n\n/**\n * returns the uniform data from the program\n * @private\n * @param program - the webgl program\n * @param gl - the WebGL context\n * @returns {object} the uniform data for this program\n */\nfunction getUniformData(program, gl) {\n var uniforms = {};\n var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n for (var i = 0; i < totalUniforms; i++) {\n var uniformData = gl.getActiveUniform(program, i);\n var name = uniformData.name.replace(/\\[.*?\\]$/, '');\n var isArray = !!(uniformData.name.match(/\\[.*?\\]$/));\n var type = mapType(gl, uniformData.type);\n uniforms[name] = {\n name: name,\n index: i,\n type: type,\n size: uniformData.size,\n isArray: isArray,\n value: defaultValue(type, uniformData.size),\n };\n }\n return uniforms;\n}\n\n/**\n * generates a WebGL Program object from a high level Pixi Program.\n * @param gl - a rendering context on which to generate the program\n * @param program - the high level Pixi Program.\n */\nfunction generateProgram(gl, program) {\n var glVertShader = compileShader(gl, gl.VERTEX_SHADER, program.vertexSrc);\n var glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, program.fragmentSrc);\n var webGLProgram = gl.createProgram();\n gl.attachShader(webGLProgram, glVertShader);\n gl.attachShader(webGLProgram, glFragShader);\n gl.linkProgram(webGLProgram);\n if (!gl.getProgramParameter(webGLProgram, gl.LINK_STATUS)) {\n logProgramError(gl, webGLProgram, glVertShader, glFragShader);\n }\n program.attributeData = getAttributeData(webGLProgram, gl);\n program.uniformData = getUniformData(webGLProgram, gl);\n // GLSL 1.00: bind attributes sorted by name in ascending order\n // GLSL 3.00: don't change the attribute locations that where chosen by the compiler\n // or assigned by the layout specifier in the shader source code\n if (!(/^[ \\t]*#[ \\t]*version[ \\t]+300[ \\t]+es[ \\t]*$/m).test(program.vertexSrc)) {\n var keys = Object.keys(program.attributeData);\n keys.sort(function (a, b) { return (a > b) ? 1 : -1; }); // eslint-disable-line no-confusing-arrow\n for (var i = 0; i < keys.length; i++) {\n program.attributeData[keys[i]].location = i;\n gl.bindAttribLocation(webGLProgram, i, keys[i]);\n }\n gl.linkProgram(webGLProgram);\n }\n gl.deleteShader(glVertShader);\n gl.deleteShader(glFragShader);\n var uniformData = {};\n for (var i in program.uniformData) {\n var data = program.uniformData[i];\n uniformData[i] = {\n location: gl.getUniformLocation(webGLProgram, i),\n value: defaultValue(data.type, data.size),\n };\n }\n var glProgram = new GLProgram(webGLProgram, uniformData);\n return glProgram;\n}\n\nvar UID = 0;\n// default sync data so we don't create a new one each time!\nvar defaultSyncData = { textureCount: 0, uboCount: 0 };\n/**\n * System plugin to the renderer to manage shaders.\n * @memberof PIXI\n */\nvar ShaderSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function ShaderSystem(renderer) {\n this.destroyed = false;\n this.renderer = renderer;\n // Validation check that this environment support `new Function`\n this.systemCheck();\n this.gl = null;\n this.shader = null;\n this.program = null;\n this.cache = {};\n this._uboCache = {};\n this.id = UID++;\n }\n /**\n * Overrideable function by `@pixi/unsafe-eval` to silence\n * throwing an error if platform doesn't support unsafe-evals.\n * @private\n */\n ShaderSystem.prototype.systemCheck = function () {\n if (!unsafeEvalSupported()) {\n throw new Error('Current environment does not allow unsafe-eval, '\n + 'please use @pixi/unsafe-eval module to enable support.');\n }\n };\n ShaderSystem.prototype.contextChange = function (gl) {\n this.gl = gl;\n this.reset();\n };\n /**\n * Changes the current shader to the one given in parameter.\n * @param shader - the new shader\n * @param dontSync - false if the shader should automatically sync its uniforms.\n * @returns the glProgram that belongs to the shader.\n */\n ShaderSystem.prototype.bind = function (shader, dontSync) {\n shader.disposeRunner.add(this);\n shader.uniforms.globals = this.renderer.globalUniforms;\n var program = shader.program;\n var glProgram = program.glPrograms[this.renderer.CONTEXT_UID] || this.generateProgram(shader);\n this.shader = shader;\n // TODO - some current Pixi plugins bypass this.. so it not safe to use yet..\n if (this.program !== program) {\n this.program = program;\n this.gl.useProgram(glProgram.program);\n }\n if (!dontSync) {\n defaultSyncData.textureCount = 0;\n defaultSyncData.uboCount = 0;\n this.syncUniformGroup(shader.uniformGroup, defaultSyncData);\n }\n return glProgram;\n };\n /**\n * Uploads the uniforms values to the currently bound shader.\n * @param uniforms - the uniforms values that be applied to the current shader\n */\n ShaderSystem.prototype.setUniforms = function (uniforms) {\n var shader = this.shader.program;\n var glProgram = shader.glPrograms[this.renderer.CONTEXT_UID];\n shader.syncUniforms(glProgram.uniformData, uniforms, this.renderer);\n };\n /* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n /**\n * Syncs uniforms on the group\n * @param group - the uniform group to sync\n * @param syncData - this is data that is passed to the sync function and any nested sync functions\n */\n ShaderSystem.prototype.syncUniformGroup = function (group, syncData) {\n var glProgram = this.getGlProgram();\n if (!group.static || group.dirtyId !== glProgram.uniformDirtyGroups[group.id]) {\n glProgram.uniformDirtyGroups[group.id] = group.dirtyId;\n this.syncUniforms(group, glProgram, syncData);\n }\n };\n /**\n * Overrideable by the @pixi/unsafe-eval package to use static syncUniforms instead.\n * @param group\n * @param glProgram\n * @param syncData\n */\n ShaderSystem.prototype.syncUniforms = function (group, glProgram, syncData) {\n var syncFunc = group.syncUniforms[this.shader.program.id] || this.createSyncGroups(group);\n syncFunc(glProgram.uniformData, group.uniforms, this.renderer, syncData);\n };\n ShaderSystem.prototype.createSyncGroups = function (group) {\n var id = this.getSignature(group, this.shader.program.uniformData, 'u');\n if (!this.cache[id]) {\n this.cache[id] = generateUniformsSync(group, this.shader.program.uniformData);\n }\n group.syncUniforms[this.shader.program.id] = this.cache[id];\n return group.syncUniforms[this.shader.program.id];\n };\n /**\n * Syncs uniform buffers\n * @param group - the uniform buffer group to sync\n * @param name - the name of the uniform buffer\n */\n ShaderSystem.prototype.syncUniformBufferGroup = function (group, name) {\n var glProgram = this.getGlProgram();\n if (!group.static || group.dirtyId !== 0 || !glProgram.uniformGroups[group.id]) {\n group.dirtyId = 0;\n var syncFunc = glProgram.uniformGroups[group.id]\n || this.createSyncBufferGroup(group, glProgram, name);\n // TODO wrap update in a cache??\n group.buffer.update();\n syncFunc(glProgram.uniformData, group.uniforms, this.renderer, defaultSyncData, group.buffer);\n }\n this.renderer.buffer.bindBufferBase(group.buffer, glProgram.uniformBufferBindings[name]);\n };\n /**\n * Will create a function that uploads a uniform buffer using the STD140 standard.\n * The upload function will then be cached for future calls\n * If a group is manually managed, then a simple upload function is generated\n * @param group - the uniform buffer group to sync\n * @param glProgram - the gl program to attach the uniform bindings to\n * @param name - the name of the uniform buffer (must exist on the shader)\n */\n ShaderSystem.prototype.createSyncBufferGroup = function (group, glProgram, name) {\n var gl = this.renderer.gl;\n this.renderer.buffer.bind(group.buffer);\n // bind them...\n var uniformBlockIndex = this.gl.getUniformBlockIndex(glProgram.program, name);\n glProgram.uniformBufferBindings[name] = this.shader.uniformBindCount;\n gl.uniformBlockBinding(glProgram.program, uniformBlockIndex, this.shader.uniformBindCount);\n this.shader.uniformBindCount++;\n var id = this.getSignature(group, this.shader.program.uniformData, 'ubo');\n var uboData = this._uboCache[id];\n if (!uboData) {\n uboData = this._uboCache[id] = generateUniformBufferSync(group, this.shader.program.uniformData);\n }\n if (group.autoManage) {\n var data = new Float32Array(uboData.size / 4);\n group.buffer.update(data);\n }\n glProgram.uniformGroups[group.id] = uboData.syncFunc;\n return glProgram.uniformGroups[group.id];\n };\n /**\n * Takes a uniform group and data and generates a unique signature for them.\n * @param group - The uniform group to get signature of\n * @param group.uniforms\n * @param uniformData - Uniform information generated by the shader\n * @param preFix\n * @returns Unique signature of the uniform group\n */\n ShaderSystem.prototype.getSignature = function (group, uniformData, preFix) {\n var uniforms = group.uniforms;\n var strings = [preFix + \"-\"];\n for (var i in uniforms) {\n strings.push(i);\n if (uniformData[i]) {\n strings.push(uniformData[i].type);\n }\n }\n return strings.join('-');\n };\n /**\n * Returns the underlying GLShade rof the currently bound shader.\n *\n * This can be handy for when you to have a little more control over the setting of your uniforms.\n * @returns The glProgram for the currently bound Shader for this context\n */\n ShaderSystem.prototype.getGlProgram = function () {\n if (this.shader) {\n return this.shader.program.glPrograms[this.renderer.CONTEXT_UID];\n }\n return null;\n };\n /**\n * Generates a glProgram version of the Shader provided.\n * @param shader - The shader that the glProgram will be based on.\n * @returns A shiny new glProgram!\n */\n ShaderSystem.prototype.generateProgram = function (shader) {\n var gl = this.gl;\n var program = shader.program;\n var glProgram = generateProgram(gl, program);\n program.glPrograms[this.renderer.CONTEXT_UID] = glProgram;\n return glProgram;\n };\n /** Resets ShaderSystem state, does not affect WebGL state. */\n ShaderSystem.prototype.reset = function () {\n this.program = null;\n this.shader = null;\n };\n /**\n * Disposes shader.\n * If disposing one equals with current shader, set current as null.\n * @param shader - Shader object\n */\n ShaderSystem.prototype.disposeShader = function (shader) {\n if (this.shader === shader) {\n this.shader = null;\n }\n };\n /** Destroys this System and removes all its textures. */\n ShaderSystem.prototype.destroy = function () {\n this.renderer = null;\n // TODO implement destroy method for ShaderSystem\n this.destroyed = true;\n };\n return ShaderSystem;\n}());\n\n/**\n * Maps gl blend combinations to WebGL.\n * @memberof PIXI\n * @function mapWebGLBlendModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {number[][]} [array=[]] - The array to output into.\n * @returns {number[][]} Mapped modes.\n */\nfunction mapWebGLBlendModesToPixi(gl, array) {\n if (array === void 0) { array = []; }\n // TODO - premultiply alpha would be different.\n // add a boolean for that!\n array[BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.ADD] = [gl.ONE, gl.ONE];\n array[BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.NONE] = [0, 0];\n // not-premultiplied blend modes\n array[BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE];\n array[BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n // composite operations\n array[BLEND_MODES.SRC_IN] = [gl.DST_ALPHA, gl.ZERO];\n array[BLEND_MODES.SRC_OUT] = [gl.ONE_MINUS_DST_ALPHA, gl.ZERO];\n array[BLEND_MODES.SRC_ATOP] = [gl.DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DST_OVER] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE];\n array[BLEND_MODES.DST_IN] = [gl.ZERO, gl.SRC_ALPHA];\n array[BLEND_MODES.DST_OUT] = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DST_ATOP] = [gl.ONE_MINUS_DST_ALPHA, gl.SRC_ALPHA];\n array[BLEND_MODES.XOR] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n // SUBTRACT from flash\n array[BLEND_MODES.SUBTRACT] = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD];\n return array;\n}\n\nvar BLEND = 0;\nvar OFFSET = 1;\nvar CULLING = 2;\nvar DEPTH_TEST = 3;\nvar WINDING = 4;\nvar DEPTH_MASK = 5;\n/**\n * System plugin to the renderer to manage WebGL state machines.\n * @memberof PIXI\n */\nvar StateSystem = /** @class */ (function () {\n function StateSystem() {\n this.gl = null;\n this.stateId = 0;\n this.polygonOffset = 0;\n this.blendMode = BLEND_MODES.NONE;\n this._blendEq = false;\n // map functions for when we set state..\n this.map = [];\n this.map[BLEND] = this.setBlend;\n this.map[OFFSET] = this.setOffset;\n this.map[CULLING] = this.setCullFace;\n this.map[DEPTH_TEST] = this.setDepthTest;\n this.map[WINDING] = this.setFrontFace;\n this.map[DEPTH_MASK] = this.setDepthMask;\n this.checks = [];\n this.defaultState = new State();\n this.defaultState.blend = true;\n }\n StateSystem.prototype.contextChange = function (gl) {\n this.gl = gl;\n this.blendModes = mapWebGLBlendModesToPixi(gl);\n this.set(this.defaultState);\n this.reset();\n };\n /**\n * Sets the current state\n * @param {*} state - The state to set.\n */\n StateSystem.prototype.set = function (state) {\n state = state || this.defaultState;\n // TODO maybe to an object check? ( this.state === state )?\n if (this.stateId !== state.data) {\n var diff = this.stateId ^ state.data;\n var i = 0;\n // order from least to most common\n while (diff) {\n if (diff & 1) {\n // state change!\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n diff = diff >> 1;\n i++;\n }\n this.stateId = state.data;\n }\n // based on the above settings we check for specific modes..\n // for example if blend is active we check and set the blend modes\n // or of polygon offset is active we check the poly depth.\n for (var i = 0; i < this.checks.length; i++) {\n this.checks[i](this, state);\n }\n };\n /**\n * Sets the state, when previous state is unknown.\n * @param {*} state - The state to set\n */\n StateSystem.prototype.forceState = function (state) {\n state = state || this.defaultState;\n for (var i = 0; i < this.map.length; i++) {\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n for (var i = 0; i < this.checks.length; i++) {\n this.checks[i](this, state);\n }\n this.stateId = state.data;\n };\n /**\n * Sets whether to enable or disable blending.\n * @param value - Turn on or off WebGl blending.\n */\n StateSystem.prototype.setBlend = function (value) {\n this.updateCheck(StateSystem.checkBlendMode, value);\n this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n };\n /**\n * Sets whether to enable or disable polygon offset fill.\n * @param value - Turn on or off webgl polygon offset testing.\n */\n StateSystem.prototype.setOffset = function (value) {\n this.updateCheck(StateSystem.checkPolygonOffset, value);\n this.gl[value ? 'enable' : 'disable'](this.gl.POLYGON_OFFSET_FILL);\n };\n /**\n * Sets whether to enable or disable depth test.\n * @param value - Turn on or off webgl depth testing.\n */\n StateSystem.prototype.setDepthTest = function (value) {\n this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n };\n /**\n * Sets whether to enable or disable depth mask.\n * @param value - Turn on or off webgl depth mask.\n */\n StateSystem.prototype.setDepthMask = function (value) {\n this.gl.depthMask(value);\n };\n /**\n * Sets whether to enable or disable cull face.\n * @param {boolean} value - Turn on or off webgl cull face.\n */\n StateSystem.prototype.setCullFace = function (value) {\n this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n };\n /**\n * Sets the gl front face.\n * @param {boolean} value - true is clockwise and false is counter-clockwise\n */\n StateSystem.prototype.setFrontFace = function (value) {\n this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']);\n };\n /**\n * Sets the blend mode.\n * @param {number} value - The blend mode to set to.\n */\n StateSystem.prototype.setBlendMode = function (value) {\n if (value === this.blendMode) {\n return;\n }\n this.blendMode = value;\n var mode = this.blendModes[value];\n var gl = this.gl;\n if (mode.length === 2) {\n gl.blendFunc(mode[0], mode[1]);\n }\n else {\n gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]);\n }\n if (mode.length === 6) {\n this._blendEq = true;\n gl.blendEquationSeparate(mode[4], mode[5]);\n }\n else if (this._blendEq) {\n this._blendEq = false;\n gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);\n }\n };\n /**\n * Sets the polygon offset.\n * @param {number} value - the polygon offset\n * @param {number} scale - the polygon offset scale\n */\n StateSystem.prototype.setPolygonOffset = function (value, scale) {\n this.gl.polygonOffset(value, scale);\n };\n // used\n /** Resets all the logic and disables the VAOs. */\n StateSystem.prototype.reset = function () {\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n this.forceState(this.defaultState);\n this._blendEq = true;\n this.blendMode = -1;\n this.setBlendMode(0);\n };\n /**\n * Checks to see which updates should be checked based on which settings have been activated.\n *\n * For example, if blend is enabled then we should check the blend modes each time the state is changed\n * or if polygon fill is activated then we need to check if the polygon offset changes.\n * The idea is that we only check what we have too.\n * @param func - the checking function to add or remove\n * @param value - should the check function be added or removed.\n */\n StateSystem.prototype.updateCheck = function (func, value) {\n var index = this.checks.indexOf(func);\n if (value && index === -1) {\n this.checks.push(func);\n }\n else if (!value && index !== -1) {\n this.checks.splice(index, 1);\n }\n };\n /**\n * A private little wrapper function that we call to check the blend mode.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n StateSystem.checkBlendMode = function (system, state) {\n system.setBlendMode(state.blendMode);\n };\n /**\n * A private little wrapper function that we call to check the polygon offset.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n StateSystem.checkPolygonOffset = function (system, state) {\n system.setPolygonOffset(1, state.polygonOffset);\n };\n /**\n * @ignore\n */\n StateSystem.prototype.destroy = function () {\n this.gl = null;\n };\n return StateSystem;\n}());\n\n/**\n * System plugin to the renderer to manage texture garbage collection on the GPU,\n * ensuring that it does not get clogged up with textures that are no longer being used.\n * @memberof PIXI\n */\nvar TextureGCSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function TextureGCSystem(renderer) {\n this.renderer = renderer;\n this.count = 0;\n this.checkCount = 0;\n this.maxIdle = settings.GC_MAX_IDLE;\n this.checkCountMax = settings.GC_MAX_CHECK_COUNT;\n this.mode = settings.GC_MODE;\n }\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n TextureGCSystem.prototype.postrender = function () {\n if (!this.renderer.renderingToScreen) {\n return;\n }\n this.count++;\n if (this.mode === GC_MODES.MANUAL) {\n return;\n }\n this.checkCount++;\n if (this.checkCount > this.checkCountMax) {\n this.checkCount = 0;\n this.run();\n }\n };\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n TextureGCSystem.prototype.run = function () {\n var tm = this.renderer.texture;\n var managedTextures = tm.managedTextures;\n var wasRemoved = false;\n for (var i = 0; i < managedTextures.length; i++) {\n var texture = managedTextures[i];\n // only supports non generated textures at the moment!\n if (!texture.framebuffer && this.count - texture.touched > this.maxIdle) {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n if (wasRemoved) {\n var j = 0;\n for (var i = 0; i < managedTextures.length; i++) {\n if (managedTextures[i] !== null) {\n managedTextures[j++] = managedTextures[i];\n }\n }\n managedTextures.length = j;\n }\n };\n /**\n * Removes all the textures within the specified displayObject and its children from the GPU\n * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.\n */\n TextureGCSystem.prototype.unload = function (displayObject) {\n var tm = this.renderer.texture;\n var texture = displayObject._texture;\n // only destroy non generated textures\n if (texture && !texture.framebuffer) {\n tm.destroyTexture(texture);\n }\n for (var i = displayObject.children.length - 1; i >= 0; i--) {\n this.unload(displayObject.children[i]);\n }\n };\n TextureGCSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return TextureGCSystem;\n}());\n\n/**\n * Returns a lookup table that maps each type-format pair to a compatible internal format.\n * @memberof PIXI\n * @function mapTypeAndFormatToInternalFormat\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @returns Lookup table.\n */\nfunction mapTypeAndFormatToInternalFormat(gl) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;\n var table;\n if ('WebGL2RenderingContext' in globalThis && gl instanceof globalThis.WebGL2RenderingContext) {\n table = (_a = {},\n _a[TYPES.UNSIGNED_BYTE] = (_b = {},\n _b[FORMATS.RGBA] = gl.RGBA8,\n _b[FORMATS.RGB] = gl.RGB8,\n _b[FORMATS.RG] = gl.RG8,\n _b[FORMATS.RED] = gl.R8,\n _b[FORMATS.RGBA_INTEGER] = gl.RGBA8UI,\n _b[FORMATS.RGB_INTEGER] = gl.RGB8UI,\n _b[FORMATS.RG_INTEGER] = gl.RG8UI,\n _b[FORMATS.RED_INTEGER] = gl.R8UI,\n _b[FORMATS.ALPHA] = gl.ALPHA,\n _b[FORMATS.LUMINANCE] = gl.LUMINANCE,\n _b[FORMATS.LUMINANCE_ALPHA] = gl.LUMINANCE_ALPHA,\n _b),\n _a[TYPES.BYTE] = (_c = {},\n _c[FORMATS.RGBA] = gl.RGBA8_SNORM,\n _c[FORMATS.RGB] = gl.RGB8_SNORM,\n _c[FORMATS.RG] = gl.RG8_SNORM,\n _c[FORMATS.RED] = gl.R8_SNORM,\n _c[FORMATS.RGBA_INTEGER] = gl.RGBA8I,\n _c[FORMATS.RGB_INTEGER] = gl.RGB8I,\n _c[FORMATS.RG_INTEGER] = gl.RG8I,\n _c[FORMATS.RED_INTEGER] = gl.R8I,\n _c),\n _a[TYPES.UNSIGNED_SHORT] = (_d = {},\n _d[FORMATS.RGBA_INTEGER] = gl.RGBA16UI,\n _d[FORMATS.RGB_INTEGER] = gl.RGB16UI,\n _d[FORMATS.RG_INTEGER] = gl.RG16UI,\n _d[FORMATS.RED_INTEGER] = gl.R16UI,\n _d[FORMATS.DEPTH_COMPONENT] = gl.DEPTH_COMPONENT16,\n _d),\n _a[TYPES.SHORT] = (_e = {},\n _e[FORMATS.RGBA_INTEGER] = gl.RGBA16I,\n _e[FORMATS.RGB_INTEGER] = gl.RGB16I,\n _e[FORMATS.RG_INTEGER] = gl.RG16I,\n _e[FORMATS.RED_INTEGER] = gl.R16I,\n _e),\n _a[TYPES.UNSIGNED_INT] = (_f = {},\n _f[FORMATS.RGBA_INTEGER] = gl.RGBA32UI,\n _f[FORMATS.RGB_INTEGER] = gl.RGB32UI,\n _f[FORMATS.RG_INTEGER] = gl.RG32UI,\n _f[FORMATS.RED_INTEGER] = gl.R32UI,\n _f[FORMATS.DEPTH_COMPONENT] = gl.DEPTH_COMPONENT24,\n _f),\n _a[TYPES.INT] = (_g = {},\n _g[FORMATS.RGBA_INTEGER] = gl.RGBA32I,\n _g[FORMATS.RGB_INTEGER] = gl.RGB32I,\n _g[FORMATS.RG_INTEGER] = gl.RG32I,\n _g[FORMATS.RED_INTEGER] = gl.R32I,\n _g),\n _a[TYPES.FLOAT] = (_h = {},\n _h[FORMATS.RGBA] = gl.RGBA32F,\n _h[FORMATS.RGB] = gl.RGB32F,\n _h[FORMATS.RG] = gl.RG32F,\n _h[FORMATS.RED] = gl.R32F,\n _h[FORMATS.DEPTH_COMPONENT] = gl.DEPTH_COMPONENT32F,\n _h),\n _a[TYPES.HALF_FLOAT] = (_j = {},\n _j[FORMATS.RGBA] = gl.RGBA16F,\n _j[FORMATS.RGB] = gl.RGB16F,\n _j[FORMATS.RG] = gl.RG16F,\n _j[FORMATS.RED] = gl.R16F,\n _j),\n _a[TYPES.UNSIGNED_SHORT_5_6_5] = (_k = {},\n _k[FORMATS.RGB] = gl.RGB565,\n _k),\n _a[TYPES.UNSIGNED_SHORT_4_4_4_4] = (_l = {},\n _l[FORMATS.RGBA] = gl.RGBA4,\n _l),\n _a[TYPES.UNSIGNED_SHORT_5_5_5_1] = (_m = {},\n _m[FORMATS.RGBA] = gl.RGB5_A1,\n _m),\n _a[TYPES.UNSIGNED_INT_2_10_10_10_REV] = (_o = {},\n _o[FORMATS.RGBA] = gl.RGB10_A2,\n _o[FORMATS.RGBA_INTEGER] = gl.RGB10_A2UI,\n _o),\n _a[TYPES.UNSIGNED_INT_10F_11F_11F_REV] = (_p = {},\n _p[FORMATS.RGB] = gl.R11F_G11F_B10F,\n _p),\n _a[TYPES.UNSIGNED_INT_5_9_9_9_REV] = (_q = {},\n _q[FORMATS.RGB] = gl.RGB9_E5,\n _q),\n _a[TYPES.UNSIGNED_INT_24_8] = (_r = {},\n _r[FORMATS.DEPTH_STENCIL] = gl.DEPTH24_STENCIL8,\n _r),\n _a[TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV] = (_s = {},\n _s[FORMATS.DEPTH_STENCIL] = gl.DEPTH32F_STENCIL8,\n _s),\n _a);\n }\n else {\n table = (_t = {},\n _t[TYPES.UNSIGNED_BYTE] = (_u = {},\n _u[FORMATS.RGBA] = gl.RGBA,\n _u[FORMATS.RGB] = gl.RGB,\n _u[FORMATS.ALPHA] = gl.ALPHA,\n _u[FORMATS.LUMINANCE] = gl.LUMINANCE,\n _u[FORMATS.LUMINANCE_ALPHA] = gl.LUMINANCE_ALPHA,\n _u),\n _t[TYPES.UNSIGNED_SHORT_5_6_5] = (_v = {},\n _v[FORMATS.RGB] = gl.RGB,\n _v),\n _t[TYPES.UNSIGNED_SHORT_4_4_4_4] = (_w = {},\n _w[FORMATS.RGBA] = gl.RGBA,\n _w),\n _t[TYPES.UNSIGNED_SHORT_5_5_5_1] = (_x = {},\n _x[FORMATS.RGBA] = gl.RGBA,\n _x),\n _t);\n }\n return table;\n}\n\n/**\n * Internal texture for WebGL context.\n * @memberof PIXI\n */\nvar GLTexture = /** @class */ (function () {\n function GLTexture(texture) {\n this.texture = texture;\n this.width = -1;\n this.height = -1;\n this.dirtyId = -1;\n this.dirtyStyleId = -1;\n this.mipmap = false;\n this.wrapMode = 33071;\n this.type = TYPES.UNSIGNED_BYTE;\n this.internalFormat = FORMATS.RGBA;\n this.samplerType = 0;\n }\n return GLTexture;\n}());\n\n/**\n * System plugin to the renderer to manage textures.\n * @memberof PIXI\n */\nvar TextureSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this system works for.\n */\n function TextureSystem(renderer) {\n this.renderer = renderer;\n // TODO set to max textures...\n this.boundTextures = [];\n this.currentLocation = -1;\n this.managedTextures = [];\n this._unknownBoundTextures = false;\n this.unknownTexture = new BaseTexture();\n this.hasIntegerTextures = false;\n }\n /** Sets up the renderer context and necessary buffers. */\n TextureSystem.prototype.contextChange = function () {\n var gl = this.gl = this.renderer.gl;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.webGLVersion = this.renderer.context.webGLVersion;\n this.internalFormats = mapTypeAndFormatToInternalFormat(gl);\n var maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this.boundTextures.length = maxTextures;\n for (var i = 0; i < maxTextures; i++) {\n this.boundTextures[i] = null;\n }\n // TODO move this.. to a nice make empty textures class..\n this.emptyTextures = {};\n var emptyTexture2D = new GLTexture(gl.createTexture());\n gl.bindTexture(gl.TEXTURE_2D, emptyTexture2D.texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));\n this.emptyTextures[gl.TEXTURE_2D] = emptyTexture2D;\n this.emptyTextures[gl.TEXTURE_CUBE_MAP] = new GLTexture(gl.createTexture());\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.emptyTextures[gl.TEXTURE_CUBE_MAP].texture);\n for (var i = 0; i < 6; i++) {\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n }\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n for (var i = 0; i < this.boundTextures.length; i++) {\n this.bind(null, i);\n }\n };\n /**\n * Bind a texture to a specific location\n *\n * If you want to unbind something, please use `unbind(texture)` instead of `bind(null, textureLocation)`\n * @param texture - Texture to bind\n * @param [location=0] - Location to bind at\n */\n TextureSystem.prototype.bind = function (texture, location) {\n if (location === void 0) { location = 0; }\n var gl = this.gl;\n texture = texture === null || texture === void 0 ? void 0 : texture.castToBaseTexture();\n // cannot bind partial texture\n // TODO: report a warning\n if (texture && texture.valid && !texture.parentTextureArray) {\n texture.touched = this.renderer.textureGC.count;\n var glTexture = texture._glTextures[this.CONTEXT_UID] || this.initTexture(texture);\n if (this.boundTextures[location] !== texture) {\n if (this.currentLocation !== location) {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n gl.bindTexture(texture.target, glTexture.texture);\n }\n if (glTexture.dirtyId !== texture.dirtyId) {\n if (this.currentLocation !== location) {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n this.updateTexture(texture);\n }\n else if (glTexture.dirtyStyleId !== texture.dirtyStyleId) {\n this.updateTextureStyle(texture);\n }\n this.boundTextures[location] = texture;\n }\n else {\n if (this.currentLocation !== location) {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n gl.bindTexture(gl.TEXTURE_2D, this.emptyTextures[gl.TEXTURE_2D].texture);\n this.boundTextures[location] = null;\n }\n };\n /** Resets texture location and bound textures Actual `bind(null, i)` calls will be performed at next `unbind()` call */\n TextureSystem.prototype.reset = function () {\n this._unknownBoundTextures = true;\n this.hasIntegerTextures = false;\n this.currentLocation = -1;\n for (var i = 0; i < this.boundTextures.length; i++) {\n this.boundTextures[i] = this.unknownTexture;\n }\n };\n /**\n * Unbind a texture.\n * @param texture - Texture to bind\n */\n TextureSystem.prototype.unbind = function (texture) {\n var _a = this, gl = _a.gl, boundTextures = _a.boundTextures;\n if (this._unknownBoundTextures) {\n this._unknownBoundTextures = false;\n // someone changed webGL state,\n // we have to be sure that our texture does not appear in multi-texture renderer samplers\n for (var i = 0; i < boundTextures.length; i++) {\n if (boundTextures[i] === this.unknownTexture) {\n this.bind(null, i);\n }\n }\n }\n for (var i = 0; i < boundTextures.length; i++) {\n if (boundTextures[i] === texture) {\n if (this.currentLocation !== i) {\n gl.activeTexture(gl.TEXTURE0 + i);\n this.currentLocation = i;\n }\n gl.bindTexture(texture.target, this.emptyTextures[texture.target].texture);\n boundTextures[i] = null;\n }\n }\n };\n /**\n * Ensures that current boundTextures all have FLOAT sampler type,\n * see {@link PIXI.SAMPLER_TYPES} for explanation.\n * @param maxTextures - number of locations to check\n */\n TextureSystem.prototype.ensureSamplerType = function (maxTextures) {\n var _a = this, boundTextures = _a.boundTextures, hasIntegerTextures = _a.hasIntegerTextures, CONTEXT_UID = _a.CONTEXT_UID;\n if (!hasIntegerTextures) {\n return;\n }\n for (var i = maxTextures - 1; i >= 0; --i) {\n var tex = boundTextures[i];\n if (tex) {\n var glTexture = tex._glTextures[CONTEXT_UID];\n if (glTexture.samplerType !== SAMPLER_TYPES.FLOAT) {\n this.renderer.texture.unbind(tex);\n }\n }\n }\n };\n /**\n * Initialize a texture\n * @private\n * @param texture - Texture to initialize\n */\n TextureSystem.prototype.initTexture = function (texture) {\n var glTexture = new GLTexture(this.gl.createTexture());\n // guarantee an update..\n glTexture.dirtyId = -1;\n texture._glTextures[this.CONTEXT_UID] = glTexture;\n this.managedTextures.push(texture);\n texture.on('dispose', this.destroyTexture, this);\n return glTexture;\n };\n TextureSystem.prototype.initTextureType = function (texture, glTexture) {\n var _a, _b;\n glTexture.internalFormat = (_b = (_a = this.internalFormats[texture.type]) === null || _a === void 0 ? void 0 : _a[texture.format]) !== null && _b !== void 0 ? _b : texture.format;\n if (this.webGLVersion === 2 && texture.type === TYPES.HALF_FLOAT) {\n // TYPES.HALF_FLOAT is WebGL1 HALF_FLOAT_OES\n // we have to convert it to WebGL HALF_FLOAT\n glTexture.type = this.gl.HALF_FLOAT;\n }\n else {\n glTexture.type = texture.type;\n }\n };\n /**\n * Update a texture\n * @private\n * @param {PIXI.BaseTexture} texture - Texture to initialize\n */\n TextureSystem.prototype.updateTexture = function (texture) {\n var glTexture = texture._glTextures[this.CONTEXT_UID];\n if (!glTexture) {\n return;\n }\n var renderer = this.renderer;\n this.initTextureType(texture, glTexture);\n if (texture.resource && texture.resource.upload(renderer, texture, glTexture)) {\n // texture is uploaded, dont do anything!\n if (glTexture.samplerType !== SAMPLER_TYPES.FLOAT) {\n this.hasIntegerTextures = true;\n }\n }\n else {\n // default, renderTexture-like logic\n var width = texture.realWidth;\n var height = texture.realHeight;\n var gl = renderer.gl;\n if (glTexture.width !== width\n || glTexture.height !== height\n || glTexture.dirtyId < 0) {\n glTexture.width = width;\n glTexture.height = height;\n gl.texImage2D(texture.target, 0, glTexture.internalFormat, width, height, 0, texture.format, glTexture.type, null);\n }\n }\n // lets only update what changes..\n if (texture.dirtyStyleId !== glTexture.dirtyStyleId) {\n this.updateTextureStyle(texture);\n }\n glTexture.dirtyId = texture.dirtyId;\n };\n /**\n * Deletes the texture from WebGL\n * @private\n * @param texture - the texture to destroy\n * @param [skipRemove=false] - Whether to skip removing the texture from the TextureManager.\n */\n TextureSystem.prototype.destroyTexture = function (texture, skipRemove) {\n var gl = this.gl;\n texture = texture.castToBaseTexture();\n if (texture._glTextures[this.CONTEXT_UID]) {\n this.unbind(texture);\n gl.deleteTexture(texture._glTextures[this.CONTEXT_UID].texture);\n texture.off('dispose', this.destroyTexture, this);\n delete texture._glTextures[this.CONTEXT_UID];\n if (!skipRemove) {\n var i = this.managedTextures.indexOf(texture);\n if (i !== -1) {\n removeItems(this.managedTextures, i, 1);\n }\n }\n }\n };\n /**\n * Update texture style such as mipmap flag\n * @private\n * @param {PIXI.BaseTexture} texture - Texture to update\n */\n TextureSystem.prototype.updateTextureStyle = function (texture) {\n var glTexture = texture._glTextures[this.CONTEXT_UID];\n if (!glTexture) {\n return;\n }\n if ((texture.mipmap === MIPMAP_MODES.POW2 || this.webGLVersion !== 2) && !texture.isPowerOfTwo) {\n glTexture.mipmap = false;\n }\n else {\n glTexture.mipmap = texture.mipmap >= 1;\n }\n if (this.webGLVersion !== 2 && !texture.isPowerOfTwo) {\n glTexture.wrapMode = WRAP_MODES.CLAMP;\n }\n else {\n glTexture.wrapMode = texture.wrapMode;\n }\n if (texture.resource && texture.resource.style(this.renderer, texture, glTexture)) ;\n else {\n this.setStyle(texture, glTexture);\n }\n glTexture.dirtyStyleId = texture.dirtyStyleId;\n };\n /**\n * Set style for texture\n * @private\n * @param texture - Texture to update\n * @param glTexture\n */\n TextureSystem.prototype.setStyle = function (texture, glTexture) {\n var gl = this.gl;\n if (glTexture.mipmap && texture.mipmap !== MIPMAP_MODES.ON_MANUAL) {\n gl.generateMipmap(texture.target);\n }\n gl.texParameteri(texture.target, gl.TEXTURE_WRAP_S, glTexture.wrapMode);\n gl.texParameteri(texture.target, gl.TEXTURE_WRAP_T, glTexture.wrapMode);\n if (glTexture.mipmap) {\n /* eslint-disable max-len */\n gl.texParameteri(texture.target, gl.TEXTURE_MIN_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);\n /* eslint-disable max-len */\n var anisotropicExt = this.renderer.context.extensions.anisotropicFiltering;\n if (anisotropicExt && texture.anisotropicLevel > 0 && texture.scaleMode === SCALE_MODES.LINEAR) {\n var level = Math.min(texture.anisotropicLevel, gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n gl.texParameterf(texture.target, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, level);\n }\n }\n else {\n gl.texParameteri(texture.target, gl.TEXTURE_MIN_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR : gl.NEAREST);\n }\n gl.texParameteri(texture.target, gl.TEXTURE_MAG_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR : gl.NEAREST);\n };\n TextureSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return TextureSystem;\n}());\n\nvar _systems = {\n __proto__: null,\n FilterSystem: FilterSystem,\n BatchSystem: BatchSystem,\n ContextSystem: ContextSystem,\n FramebufferSystem: FramebufferSystem,\n GeometrySystem: GeometrySystem,\n MaskSystem: MaskSystem,\n ScissorSystem: ScissorSystem,\n StencilSystem: StencilSystem,\n ProjectionSystem: ProjectionSystem,\n RenderTextureSystem: RenderTextureSystem,\n ShaderSystem: ShaderSystem,\n StateSystem: StateSystem,\n TextureGCSystem: TextureGCSystem,\n TextureSystem: TextureSystem\n};\n\nvar tempMatrix = new Matrix();\n/**\n * The AbstractRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer}\n * and {@link PIXI.Renderer} which can be used for rendering a PixiJS scene.\n * @abstract\n * @class\n * @extends PIXI.utils.EventEmitter\n * @memberof PIXI\n */\nvar AbstractRenderer = /** @class */ (function (_super) {\n __extends(AbstractRenderer, _super);\n /**\n * @param type - The renderer type.\n * @param {PIXI.IRendererOptions} [options] - The optional renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n */\n function AbstractRenderer(type, options) {\n if (type === void 0) { type = RENDERER_TYPE.UNKNOWN; }\n var _this = _super.call(this) || this;\n // Add the default render options\n options = Object.assign({}, settings.RENDER_OPTIONS, options);\n /**\n * The supplied constructor options.\n * @member {object}\n * @readonly\n */\n _this.options = options;\n /**\n * The type of the renderer.\n * @member {number}\n * @default PIXI.RENDERER_TYPE.UNKNOWN\n * @see PIXI.RENDERER_TYPE\n */\n _this.type = type;\n /**\n * Measurements of the screen. (0, 0, screenWidth, screenHeight).\n *\n * Its safe to use as filterArea or hitArea for the whole stage.\n * @member {PIXI.Rectangle}\n */\n _this.screen = new Rectangle(0, 0, options.width, options.height);\n /**\n * The canvas element that everything is drawn to.\n * @member {HTMLCanvasElement}\n */\n _this.view = options.view || settings.ADAPTER.createCanvas();\n /**\n * The resolution / device pixel ratio of the renderer.\n * @member {number}\n * @default PIXI.settings.RESOLUTION\n */\n _this.resolution = options.resolution || settings.RESOLUTION;\n /**\n * Pass-thru setting for the canvas' context `alpha` property. This is typically\n * not something you need to fiddle with. If you want transparency, use `backgroundAlpha`.\n * @member {boolean}\n */\n _this.useContextAlpha = options.useContextAlpha;\n /**\n * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.\n * @member {boolean}\n */\n _this.autoDensity = !!options.autoDensity;\n /**\n * The value of the preserveDrawingBuffer flag affects whether or not the contents of\n * the stencil buffer is retained after rendering.\n * @member {boolean}\n */\n _this.preserveDrawingBuffer = options.preserveDrawingBuffer;\n /**\n * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every\n * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect\n * to clear the canvas every frame. Disable this by setting this to false. For example, if\n * your game has a canvas filling background image you often don't need this set.\n * @member {boolean}\n * @default\n */\n _this.clearBeforeRender = options.clearBeforeRender;\n /**\n * The background color as a number.\n * @member {number}\n * @protected\n */\n _this._backgroundColor = 0x000000;\n /**\n * The background color as an [R, G, B, A] array.\n * @member {number[]}\n * @protected\n */\n _this._backgroundColorRgba = [0, 0, 0, 1];\n /**\n * The background color as a string.\n * @member {string}\n * @protected\n */\n _this._backgroundColorString = '#000000';\n _this.backgroundColor = options.backgroundColor || _this._backgroundColor; // run bg color setter\n _this.backgroundAlpha = options.backgroundAlpha;\n // @deprecated\n if (options.transparent !== undefined) {\n deprecation('6.0.0', 'Option transparent is deprecated, please use backgroundAlpha instead.');\n _this.useContextAlpha = options.transparent;\n _this.backgroundAlpha = options.transparent ? 0 : 1;\n }\n /**\n * The last root object that the renderer tried to render.\n * @member {PIXI.DisplayObject}\n * @protected\n */\n _this._lastObjectRendered = null;\n /**\n * Collection of plugins.\n * @readonly\n * @member {object}\n */\n _this.plugins = {};\n return _this;\n }\n /**\n * Initialize the plugins.\n * @protected\n * @param {object} staticMap - The dictionary of statically saved plugins.\n */\n AbstractRenderer.prototype.initPlugins = function (staticMap) {\n for (var o in staticMap) {\n this.plugins[o] = new (staticMap[o])(this);\n }\n };\n Object.defineProperty(AbstractRenderer.prototype, \"width\", {\n /**\n * Same as view.width, actual number of pixels in the canvas by horizontal.\n * @member {number}\n * @readonly\n * @default 800\n */\n get: function () {\n return this.view.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AbstractRenderer.prototype, \"height\", {\n /**\n * Same as view.height, actual number of pixels in the canvas by vertical.\n * @member {number}\n * @readonly\n * @default 600\n */\n get: function () {\n return this.view.height;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Resizes the screen and canvas as close as possible to the specified width and height.\n * Canvas dimensions are multiplied by resolution and rounded to the nearest integers.\n * The new canvas dimensions divided by the resolution become the new screen dimensions.\n * @param desiredScreenWidth - The desired width of the screen.\n * @param desiredScreenHeight - The desired height of the screen.\n */\n AbstractRenderer.prototype.resize = function (desiredScreenWidth, desiredScreenHeight) {\n this.view.width = Math.round(desiredScreenWidth * this.resolution);\n this.view.height = Math.round(desiredScreenHeight * this.resolution);\n var screenWidth = this.view.width / this.resolution;\n var screenHeight = this.view.height / this.resolution;\n this.screen.width = screenWidth;\n this.screen.height = screenHeight;\n if (this.autoDensity) {\n this.view.style.width = screenWidth + \"px\";\n this.view.style.height = screenHeight + \"px\";\n }\n /**\n * Fired after view has been resized.\n * @event PIXI.Renderer#resize\n * @param {number} screenWidth - The new width of the screen.\n * @param {number} screenHeight - The new height of the screen.\n */\n this.emit('resize', screenWidth, screenHeight);\n };\n /**\n * @ignore\n */\n AbstractRenderer.prototype.generateTexture = function (displayObject, options, resolution, region) {\n if (options === void 0) { options = {}; }\n // @deprecated parameters spread, use options instead\n if (typeof options === 'number') {\n deprecation('6.1.0', 'generateTexture options (scaleMode, resolution, region) are now object options.');\n options = { scaleMode: options, resolution: resolution, region: region };\n }\n var manualRegion = options.region, textureOptions = __rest(options, [\"region\"]);\n region = manualRegion || displayObject.getLocalBounds(null, true);\n // minimum texture size is 1x1, 0x0 will throw an error\n if (region.width === 0)\n { region.width = 1; }\n if (region.height === 0)\n { region.height = 1; }\n var renderTexture = RenderTexture.create(__assign({ width: region.width, height: region.height }, textureOptions));\n tempMatrix.tx = -region.x;\n tempMatrix.ty = -region.y;\n this.render(displayObject, {\n renderTexture: renderTexture,\n clear: false,\n transform: tempMatrix,\n skipUpdateTransform: !!displayObject.parent\n });\n return renderTexture;\n };\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n * @param [removeView=false] - Removes the Canvas element from the DOM.\n */\n AbstractRenderer.prototype.destroy = function (removeView) {\n for (var o in this.plugins) {\n this.plugins[o].destroy();\n this.plugins[o] = null;\n }\n if (removeView && this.view.parentNode) {\n this.view.parentNode.removeChild(this.view);\n }\n var thisAny = this;\n // null-ing all objects, that's a tradition!\n thisAny.plugins = null;\n thisAny.type = RENDERER_TYPE.UNKNOWN;\n thisAny.view = null;\n thisAny.screen = null;\n thisAny._tempDisplayObjectParent = null;\n thisAny.options = null;\n this._backgroundColorRgba = null;\n this._backgroundColorString = null;\n this._lastObjectRendered = null;\n };\n Object.defineProperty(AbstractRenderer.prototype, \"backgroundColor\", {\n /**\n * The background color to fill if not transparent\n * @member {number}\n */\n get: function () {\n return this._backgroundColor;\n },\n set: function (value) {\n this._backgroundColor = value;\n this._backgroundColorString = hex2string(value);\n hex2rgb(value, this._backgroundColorRgba);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AbstractRenderer.prototype, \"backgroundAlpha\", {\n /**\n * The background color alpha. Setting this to 0 will make the canvas transparent.\n * @member {number}\n */\n get: function () {\n return this._backgroundColorRgba[3];\n },\n set: function (value) {\n this._backgroundColorRgba[3] = value;\n },\n enumerable: false,\n configurable: true\n });\n return AbstractRenderer;\n}(EventEmitter));\n\nvar GLBuffer = /** @class */ (function () {\n function GLBuffer(buffer) {\n this.buffer = buffer || null;\n this.updateID = -1;\n this.byteLength = -1;\n this.refCount = 0;\n }\n return GLBuffer;\n}());\n\n/**\n * System plugin to the renderer to manage buffers.\n *\n * WebGL uses Buffers as a way to store objects to the GPU.\n * This system makes working with them a lot easier.\n *\n * Buffers are used in three main places in WebGL\n * - geometry information\n * - Uniform information (via uniform buffer objects - a WebGL 2 only feature)\n * - Transform feedback information. (WebGL 2 only feature)\n *\n * This system will handle the binding of buffers to the GPU as well as uploading\n * them. With this system, you never need to work directly with GPU buffers, but instead work with\n * the PIXI.Buffer class.\n * @class\n * @memberof PIXI\n */\nvar BufferSystem = /** @class */ (function () {\n /**\n * @param {PIXI.Renderer} renderer - The renderer this System works for.\n */\n function BufferSystem(renderer) {\n this.renderer = renderer;\n this.managedBuffers = {};\n this.boundBufferBases = {};\n }\n /**\n * @ignore\n */\n BufferSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n /** Sets up the renderer context and necessary buffers. */\n BufferSystem.prototype.contextChange = function () {\n this.disposeAll(true);\n this.gl = this.renderer.gl;\n // TODO fill out...\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n };\n /**\n * This binds specified buffer. On first run, it will create the webGL buffers for the context too\n * @param buffer - the buffer to bind to the renderer\n */\n BufferSystem.prototype.bind = function (buffer) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n var glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n gl.bindBuffer(buffer.type, glBuffer.buffer);\n };\n /**\n * Binds an uniform buffer to at the given index.\n *\n * A cache is used so a buffer will not be bound again if already bound.\n * @param buffer - the buffer to bind\n * @param index - the base index to bind it to.\n */\n BufferSystem.prototype.bindBufferBase = function (buffer, index) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n if (this.boundBufferBases[index] !== buffer) {\n var glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n this.boundBufferBases[index] = buffer;\n gl.bindBufferBase(gl.UNIFORM_BUFFER, index, glBuffer.buffer);\n }\n };\n /**\n * Binds a buffer whilst also binding its range.\n * This will make the buffer start from the offset supplied rather than 0 when it is read.\n * @param buffer - the buffer to bind\n * @param index - the base index to bind at, defaults to 0\n * @param offset - the offset to bind at (this is blocks of 256). 0 = 0, 1 = 256, 2 = 512 etc\n */\n BufferSystem.prototype.bindBufferRange = function (buffer, index, offset) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n offset = offset || 0;\n var glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n gl.bindBufferRange(gl.UNIFORM_BUFFER, index || 0, glBuffer.buffer, offset * 256, 256);\n };\n /**\n * Will ensure the data in the buffer is uploaded to the GPU.\n * @param {PIXI.Buffer} buffer - the buffer to update\n */\n BufferSystem.prototype.update = function (buffer) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n var glBuffer = buffer._glBuffers[CONTEXT_UID];\n if (buffer._updateID === glBuffer.updateID) {\n return;\n }\n glBuffer.updateID = buffer._updateID;\n gl.bindBuffer(buffer.type, glBuffer.buffer);\n if (glBuffer.byteLength >= buffer.data.byteLength) {\n // offset is always zero for now!\n gl.bufferSubData(buffer.type, 0, buffer.data);\n }\n else {\n var drawType = buffer.static ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW;\n glBuffer.byteLength = buffer.data.byteLength;\n gl.bufferData(buffer.type, buffer.data, drawType);\n }\n };\n /**\n * Disposes buffer\n * @param {PIXI.Buffer} buffer - buffer with data\n * @param {boolean} [contextLost=false] - If context was lost, we suppress deleteVertexArray\n */\n BufferSystem.prototype.dispose = function (buffer, contextLost) {\n if (!this.managedBuffers[buffer.id]) {\n return;\n }\n delete this.managedBuffers[buffer.id];\n var glBuffer = buffer._glBuffers[this.CONTEXT_UID];\n var gl = this.gl;\n buffer.disposeRunner.remove(this);\n if (!glBuffer) {\n return;\n }\n if (!contextLost) {\n gl.deleteBuffer(glBuffer.buffer);\n }\n delete buffer._glBuffers[this.CONTEXT_UID];\n };\n /**\n * dispose all WebGL resources of all managed buffers\n * @param {boolean} [contextLost=false] - If context was lost, we suppress `gl.delete` calls\n */\n BufferSystem.prototype.disposeAll = function (contextLost) {\n var all = Object.keys(this.managedBuffers);\n for (var i = 0; i < all.length; i++) {\n this.dispose(this.managedBuffers[all[i]], contextLost);\n }\n };\n /**\n * creates and attaches a GLBuffer object tied to the current context.\n * @param buffer\n * @protected\n */\n BufferSystem.prototype.createGLBuffer = function (buffer) {\n var _a = this, CONTEXT_UID = _a.CONTEXT_UID, gl = _a.gl;\n buffer._glBuffers[CONTEXT_UID] = new GLBuffer(gl.createBuffer());\n this.managedBuffers[buffer.id] = buffer;\n buffer.disposeRunner.add(this);\n return buffer._glBuffers[CONTEXT_UID];\n };\n return BufferSystem;\n}());\n\n/**\n * The Renderer draws the scene and all its content onto a WebGL enabled canvas.\n *\n * This renderer should be used for browsers that support WebGL.\n *\n * This renderer works by automatically managing WebGLBatchesm, so no need for Sprite Batches or Sprite Clouds.\n * Don't forget to add the view to your DOM or you will not see anything!\n *\n * Renderer is composed of systems that manage specific tasks. The following systems are added by default\n * whenever you create a renderer:\n *\n * | System | Description |\n * | ------------------------------------ | ----------------------------------------------------------------------------- |\n * | {@link PIXI.BatchSystem} | This manages object renderers that defer rendering until a flush. |\n * | {@link PIXI.ContextSystem} | This manages the WebGL context and extensions. |\n * | {@link PIXI.EventSystem} | This manages UI events. |\n * | {@link PIXI.FilterSystem} | This manages the filtering pipeline for post-processing effects. |\n * | {@link PIXI.FramebufferSystem} | This manages framebuffers, which are used for offscreen rendering. |\n * | {@link PIXI.GeometrySystem} | This manages geometries & buffers, which are used to draw object meshes. |\n * | {@link PIXI.MaskSystem} | This manages masking operations. |\n * | {@link PIXI.ProjectionSystem} | This manages the `projectionMatrix`, used by shaders to get NDC coordinates. |\n * | {@link PIXI.RenderTextureSystem} | This manages render-textures, which are an abstraction over framebuffers. |\n * | {@link PIXI.ScissorSystem} | This handles scissor masking, and is used internally by {@link MaskSystem} |\n * | {@link PIXI.ShaderSystem} | This manages shaders, programs that run on the GPU to calculate 'em pixels. |\n * | {@link PIXI.StateSystem} | This manages the WebGL state variables like blend mode, depth testing, etc. |\n * | {@link PIXI.StencilSystem} | This handles stencil masking, and is used internally by {@link MaskSystem} |\n * | {@link PIXI.TextureSystem} | This manages textures and their resources on the GPU. |\n * | {@link PIXI.TextureGCSystem} | This will automatically remove textures from the GPU if they are not used. |\n *\n * The breadth of the API surface provided by the renderer is contained within these systems.\n * @memberof PIXI\n */\nvar Renderer = /** @class */ (function (_super) {\n __extends(Renderer, _super);\n /**\n * @param {PIXI.IRendererOptions} [options] - The optional renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n */\n function Renderer(options) {\n var _this = _super.call(this, RENDERER_TYPE.WEBGL, options) || this;\n // the options will have been modified here in the super constructor with pixi's default settings..\n options = _this.options;\n _this.gl = null;\n _this.CONTEXT_UID = 0;\n _this.runners = {\n destroy: new Runner('destroy'),\n contextChange: new Runner('contextChange'),\n reset: new Runner('reset'),\n update: new Runner('update'),\n postrender: new Runner('postrender'),\n prerender: new Runner('prerender'),\n resize: new Runner('resize'),\n };\n _this.runners.contextChange.add(_this);\n _this.globalUniforms = new UniformGroup({\n projectionMatrix: new Matrix(),\n }, true);\n _this.addSystem(MaskSystem, 'mask')\n .addSystem(ContextSystem, 'context')\n .addSystem(StateSystem, 'state')\n .addSystem(ShaderSystem, 'shader')\n .addSystem(TextureSystem, 'texture')\n .addSystem(BufferSystem, 'buffer')\n .addSystem(GeometrySystem, 'geometry')\n .addSystem(FramebufferSystem, 'framebuffer')\n .addSystem(ScissorSystem, 'scissor')\n .addSystem(StencilSystem, 'stencil')\n .addSystem(ProjectionSystem, 'projection')\n .addSystem(TextureGCSystem, 'textureGC')\n .addSystem(FilterSystem, 'filter')\n .addSystem(RenderTextureSystem, 'renderTexture')\n .addSystem(BatchSystem, 'batch');\n _this.initPlugins(Renderer.__plugins);\n _this.multisample = undefined;\n /*\n * The options passed in to create a new WebGL context.\n */\n if (options.context) {\n _this.context.initFromContext(options.context);\n }\n else {\n _this.context.initFromOptions({\n alpha: !!_this.useContextAlpha,\n antialias: options.antialias,\n premultipliedAlpha: _this.useContextAlpha && _this.useContextAlpha !== 'notMultiplied',\n stencil: true,\n preserveDrawingBuffer: options.preserveDrawingBuffer,\n powerPreference: _this.options.powerPreference,\n });\n }\n _this.renderingToScreen = true;\n sayHello(_this.context.webGLVersion === 2 ? 'WebGL 2' : 'WebGL 1');\n _this.resize(_this.options.width, _this.options.height);\n return _this;\n }\n /**\n * Create renderer if WebGL is available. Overrideable\n * by the **@pixi/canvas-renderer** package to allow fallback.\n * throws error if WebGL is not available.\n * @param options\n * @private\n */\n Renderer.create = function (options) {\n if (isWebGLSupported()) {\n return new Renderer(options);\n }\n throw new Error('WebGL unsupported in this browser, use \"pixi.js-legacy\" for fallback canvas2d support.');\n };\n Renderer.prototype.contextChange = function () {\n var gl = this.gl;\n var samples;\n if (this.context.webGLVersion === 1) {\n var framebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n samples = gl.getParameter(gl.SAMPLES);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n }\n else {\n var framebuffer = gl.getParameter(gl.DRAW_FRAMEBUFFER_BINDING);\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n samples = gl.getParameter(gl.SAMPLES);\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebuffer);\n }\n if (samples >= MSAA_QUALITY.HIGH) {\n this.multisample = MSAA_QUALITY.HIGH;\n }\n else if (samples >= MSAA_QUALITY.MEDIUM) {\n this.multisample = MSAA_QUALITY.MEDIUM;\n }\n else if (samples >= MSAA_QUALITY.LOW) {\n this.multisample = MSAA_QUALITY.LOW;\n }\n else {\n this.multisample = MSAA_QUALITY.NONE;\n }\n };\n /**\n * Add a new system to the renderer.\n * @param ClassRef - Class reference\n * @param name - Property name for system, if not specified\n * will use a static `name` property on the class itself. This\n * name will be assigned as s property on the Renderer so make\n * sure it doesn't collide with properties on Renderer.\n * @returns Return instance of renderer\n */\n Renderer.prototype.addSystem = function (ClassRef, name) {\n var system = new ClassRef(this);\n if (this[name]) {\n throw new Error(\"Whoops! The name \\\"\" + name + \"\\\" is already in use\");\n }\n this[name] = system;\n for (var i in this.runners) {\n this.runners[i].add(system);\n }\n /**\n * Fired after rendering finishes.\n * @event PIXI.Renderer#postrender\n */\n /**\n * Fired before rendering starts.\n * @event PIXI.Renderer#prerender\n */\n /**\n * Fired when the WebGL context is set.\n * @event PIXI.Renderer#context\n * @param {WebGLRenderingContext} gl - WebGL context.\n */\n return this;\n };\n /**\n * @ignore\n */\n Renderer.prototype.render = function (displayObject, options) {\n var renderTexture;\n var clear;\n var transform;\n var skipUpdateTransform;\n if (options) {\n if (options instanceof RenderTexture) {\n deprecation('6.0.0', 'Renderer#render arguments changed, use options instead.');\n /* eslint-disable prefer-rest-params */\n renderTexture = options;\n clear = arguments[2];\n transform = arguments[3];\n skipUpdateTransform = arguments[4];\n /* eslint-enable prefer-rest-params */\n }\n else {\n renderTexture = options.renderTexture;\n clear = options.clear;\n transform = options.transform;\n skipUpdateTransform = options.skipUpdateTransform;\n }\n }\n // can be handy to know!\n this.renderingToScreen = !renderTexture;\n this.runners.prerender.emit();\n this.emit('prerender');\n // apply a transform at a GPU level\n this.projection.transform = transform;\n // no point rendering if our context has been blown up!\n if (this.context.isLost) {\n return;\n }\n if (!renderTexture) {\n this._lastObjectRendered = displayObject;\n }\n if (!skipUpdateTransform) {\n // update the scene graph\n var cacheParent = displayObject.enableTempParent();\n displayObject.updateTransform();\n displayObject.disableTempParent(cacheParent);\n // displayObject.hitArea = //TODO add a temp hit area\n }\n this.renderTexture.bind(renderTexture);\n this.batch.currentRenderer.start();\n if (clear !== undefined ? clear : this.clearBeforeRender) {\n this.renderTexture.clear();\n }\n displayObject.render(this);\n // apply transform..\n this.batch.currentRenderer.flush();\n if (renderTexture) {\n renderTexture.baseTexture.update();\n }\n this.runners.postrender.emit();\n // reset transform after render\n this.projection.transform = null;\n this.emit('postrender');\n };\n /**\n * @override\n * @ignore\n */\n Renderer.prototype.generateTexture = function (displayObject, options, resolution, region) {\n if (options === void 0) { options = {}; }\n var renderTexture = _super.prototype.generateTexture.call(this, displayObject, options, resolution, region);\n this.framebuffer.blit();\n return renderTexture;\n };\n /**\n * Resizes the WebGL view to the specified width and height.\n * @param desiredScreenWidth - The desired width of the screen.\n * @param desiredScreenHeight - The desired height of the screen.\n */\n Renderer.prototype.resize = function (desiredScreenWidth, desiredScreenHeight) {\n _super.prototype.resize.call(this, desiredScreenWidth, desiredScreenHeight);\n this.runners.resize.emit(this.screen.height, this.screen.width);\n };\n /**\n * Resets the WebGL state so you can render things however you fancy!\n * @returns Returns itself.\n */\n Renderer.prototype.reset = function () {\n this.runners.reset.emit();\n return this;\n };\n /** Clear the frame buffer. */\n Renderer.prototype.clear = function () {\n this.renderTexture.bind();\n this.renderTexture.clear();\n };\n /**\n * Removes everything from the renderer (event listeners, spritebatch, etc...)\n * @param [removeView=false] - Removes the Canvas element from the DOM.\n * See: https://github.com/pixijs/pixi.js/issues/2233\n */\n Renderer.prototype.destroy = function (removeView) {\n this.runners.destroy.emit();\n for (var r in this.runners) {\n this.runners[r].destroy();\n }\n // call base destroy\n _super.prototype.destroy.call(this, removeView);\n // TODO nullify all the managers..\n this.gl = null;\n };\n Object.defineProperty(Renderer.prototype, \"extract\", {\n /**\n * Please use `plugins.extract` instead.\n * @member {PIXI.Extract} extract\n * @deprecated since 6.0.0\n * @readonly\n */\n get: function () {\n deprecation('6.0.0', 'Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.');\n return this.plugins.extract;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @param pluginName - The name of the plugin.\n * @param ctor - The constructor function or class for the plugin.\n */\n Renderer.registerPlugin = function (pluginName, ctor) {\n deprecation('6.5.0', 'Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.');\n extensions$1.add({\n name: pluginName,\n type: ExtensionType.RendererPlugin,\n ref: ctor,\n });\n };\n /**\n * Collection of installed plugins. These are included by default in PIXI, but can be excluded\n * by creating a custom build. Consult the README for more information about creating custom\n * builds and excluding plugins.\n * @readonly\n * @property {PIXI.AccessibilityManager} accessibility Support tabbing interactive elements.\n * @property {PIXI.Extract} extract Extract image data from renderer.\n * @property {PIXI.InteractionManager} interaction Handles mouse, touch and pointer events.\n * @property {PIXI.ParticleRenderer} particle Renderer for ParticleContainer objects.\n * @property {PIXI.Prepare} prepare Pre-render display objects.\n * @property {PIXI.BatchRenderer} batch Batching of Sprite, Graphics and Mesh objects.\n * @property {PIXI.TilingSpriteRenderer} tilingSprite Renderer for TilingSprite objects.\n */\n Renderer.__plugins = {};\n return Renderer;\n}(AbstractRenderer));\n// Handle registration of extensions\nextensions$1.handleByMap(ExtensionType.RendererPlugin, Renderer.__plugins);\n\n/**\n * This helper function will automatically detect which renderer you should be using.\n * WebGL is the preferred renderer as it is a lot faster. If WebGL is not supported by\n * the browser then this function will return a canvas renderer.\n * @memberof PIXI\n * @function autoDetectRenderer\n * @param {PIXI.IRendererOptionsAuto} [options] - The optional renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {boolean} [options.forceCanvas=false] -\n * Force using {@link PIXI.CanvasRenderer}, even if WebGL is available. This option only is available when\n * using **pixi.js-legacy** or **@pixi/canvas-renderer** packages, otherwise it is ignored.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n * @returns {PIXI.Renderer|PIXI.CanvasRenderer}\n * Returns {@link PIXI.Renderer} if WebGL is available, otherwise {@link PIXI.CanvasRenderer}.\n */\nfunction autoDetectRenderer(options) {\n return Renderer.create(options);\n}\n\nvar $defaultVertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar $defaultFilterVertex = \"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n gl_Position = filterVertexPosition();\\n vTextureCoord = filterTextureCoord();\\n}\\n\";\n\n/**\n * Default vertex shader\n * @memberof PIXI\n * @member {string} defaultVertex\n */\n/**\n * Default filter vertex shader\n * @memberof PIXI\n * @member {string} defaultFilterVertex\n */\n// NOTE: This black magic is so that @microsoft/api-extractor does not complain! This explicitly specifies the types\n// of defaultVertex, defaultFilterVertex.\nvar defaultVertex$1 = $defaultVertex;\nvar defaultFilterVertex = $defaultFilterVertex;\n\n/**\n * Use the ISystem interface instead.\n * @deprecated since 6.1.0\n * @memberof PIXI\n */\nvar System = /** @class */ (function () {\n /**\n * @param renderer - Reference to Renderer\n */\n function System(renderer) {\n deprecation('6.1.0', 'System class is deprecated, implemement ISystem interface instead.');\n this.renderer = renderer;\n }\n /** Destroy and don't use after this. */\n System.prototype.destroy = function () {\n this.renderer = null;\n };\n return System;\n}());\n\n/**\n * Used by the batcher to draw batches.\n * Each one of these contains all information required to draw a bound geometry.\n * @memberof PIXI\n */\nvar BatchDrawCall = /** @class */ (function () {\n function BatchDrawCall() {\n this.texArray = null;\n this.blend = 0;\n this.type = DRAW_MODES.TRIANGLES;\n this.start = 0;\n this.size = 0;\n this.data = null;\n }\n return BatchDrawCall;\n}());\n\n/**\n * Used by the batcher to build texture batches.\n * Holds list of textures and their respective locations.\n * @memberof PIXI\n */\nvar BatchTextureArray = /** @class */ (function () {\n function BatchTextureArray() {\n this.elements = [];\n this.ids = [];\n this.count = 0;\n }\n BatchTextureArray.prototype.clear = function () {\n for (var i = 0; i < this.count; i++) {\n this.elements[i] = null;\n }\n this.count = 0;\n };\n return BatchTextureArray;\n}());\n\n/**\n * Flexible wrapper around `ArrayBuffer` that also provides typed array views on demand.\n * @memberof PIXI\n */\nvar ViewableBuffer = /** @class */ (function () {\n function ViewableBuffer(sizeOrBuffer) {\n if (typeof sizeOrBuffer === 'number') {\n this.rawBinaryData = new ArrayBuffer(sizeOrBuffer);\n }\n else if (sizeOrBuffer instanceof Uint8Array) {\n this.rawBinaryData = sizeOrBuffer.buffer;\n }\n else {\n this.rawBinaryData = sizeOrBuffer;\n }\n this.uint32View = new Uint32Array(this.rawBinaryData);\n this.float32View = new Float32Array(this.rawBinaryData);\n }\n Object.defineProperty(ViewableBuffer.prototype, \"int8View\", {\n /** View on the raw binary data as a `Int8Array`. */\n get: function () {\n if (!this._int8View) {\n this._int8View = new Int8Array(this.rawBinaryData);\n }\n return this._int8View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"uint8View\", {\n /** View on the raw binary data as a `Uint8Array`. */\n get: function () {\n if (!this._uint8View) {\n this._uint8View = new Uint8Array(this.rawBinaryData);\n }\n return this._uint8View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"int16View\", {\n /** View on the raw binary data as a `Int16Array`. */\n get: function () {\n if (!this._int16View) {\n this._int16View = new Int16Array(this.rawBinaryData);\n }\n return this._int16View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"uint16View\", {\n /** View on the raw binary data as a `Uint16Array`. */\n get: function () {\n if (!this._uint16View) {\n this._uint16View = new Uint16Array(this.rawBinaryData);\n }\n return this._uint16View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"int32View\", {\n /** View on the raw binary data as a `Int32Array`. */\n get: function () {\n if (!this._int32View) {\n this._int32View = new Int32Array(this.rawBinaryData);\n }\n return this._int32View;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns the view of the given type.\n * @param type - One of `int8`, `uint8`, `int16`,\n * `uint16`, `int32`, `uint32`, and `float32`.\n * @returns - typed array of given type\n */\n ViewableBuffer.prototype.view = function (type) {\n return this[type + \"View\"];\n };\n /** Destroys all buffer references. Do not use after calling this. */\n ViewableBuffer.prototype.destroy = function () {\n this.rawBinaryData = null;\n this._int8View = null;\n this._uint8View = null;\n this._int16View = null;\n this._uint16View = null;\n this._int32View = null;\n this.uint32View = null;\n this.float32View = null;\n };\n ViewableBuffer.sizeOf = function (type) {\n switch (type) {\n case 'int8':\n case 'uint8':\n return 1;\n case 'int16':\n case 'uint16':\n return 2;\n case 'int32':\n case 'uint32':\n case 'float32':\n return 4;\n default:\n throw new Error(type + \" isn't a valid view type\");\n }\n };\n return ViewableBuffer;\n}());\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * This is the default batch renderer. It buffers objects\n * with texture-based geometries and renders them in\n * batches. It uploads multiple textures to the GPU to\n * reduce to the number of draw calls.\n * @memberof PIXI\n */\nvar AbstractBatchRenderer = /** @class */ (function (_super) {\n __extends(AbstractBatchRenderer, _super);\n /**\n * This will hook onto the renderer's `contextChange`\n * and `prerender` signals.\n * @param {PIXI.Renderer} renderer - The renderer this works for.\n */\n function AbstractBatchRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.shaderGenerator = null;\n _this.geometryClass = null;\n _this.vertexSize = null;\n _this.state = State.for2d();\n _this.size = settings.SPRITE_BATCH_SIZE * 4;\n _this._vertexCount = 0;\n _this._indexCount = 0;\n _this._bufferedElements = [];\n _this._bufferedTextures = [];\n _this._bufferSize = 0;\n _this._shader = null;\n _this._packedGeometries = [];\n _this._packedGeometryPoolSize = 2;\n _this._flushId = 0;\n _this._aBuffers = {};\n _this._iBuffers = {};\n _this.MAX_TEXTURES = 1;\n _this.renderer.on('prerender', _this.onPrerender, _this);\n renderer.runners.contextChange.add(_this);\n _this._dcIndex = 0;\n _this._aIndex = 0;\n _this._iIndex = 0;\n _this._attributeBuffer = null;\n _this._indexBuffer = null;\n _this._tempBoundTextures = [];\n return _this;\n }\n /**\n * Handles the `contextChange` signal.\n *\n * It calculates `this.MAX_TEXTURES` and allocating the packed-geometry object pool.\n */\n AbstractBatchRenderer.prototype.contextChange = function () {\n var gl = this.renderer.gl;\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) {\n this.MAX_TEXTURES = 1;\n }\n else {\n // step 1: first check max textures the GPU can handle.\n this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), settings.SPRITE_MAX_TEXTURES);\n // step 2: check the maximum number of if statements the shader can have too..\n this.MAX_TEXTURES = checkMaxIfStatementsInShader(this.MAX_TEXTURES, gl);\n }\n this._shader = this.shaderGenerator.generateShader(this.MAX_TEXTURES);\n // we use the second shader as the first one depending on your browser\n // may omit aTextureId as it is not used by the shader so is optimized out.\n for (var i = 0; i < this._packedGeometryPoolSize; i++) {\n /* eslint-disable max-len */\n this._packedGeometries[i] = new (this.geometryClass)();\n }\n this.initFlushBuffers();\n };\n /** Makes sure that static and dynamic flush pooled objects have correct dimensions. */\n AbstractBatchRenderer.prototype.initFlushBuffers = function () {\n var _drawCallPool = AbstractBatchRenderer._drawCallPool, _textureArrayPool = AbstractBatchRenderer._textureArrayPool;\n // max draw calls\n var MAX_SPRITES = this.size / 4;\n // max texture arrays\n var MAX_TA = Math.floor(MAX_SPRITES / this.MAX_TEXTURES) + 1;\n while (_drawCallPool.length < MAX_SPRITES) {\n _drawCallPool.push(new BatchDrawCall());\n }\n while (_textureArrayPool.length < MAX_TA) {\n _textureArrayPool.push(new BatchTextureArray());\n }\n for (var i = 0; i < this.MAX_TEXTURES; i++) {\n this._tempBoundTextures[i] = null;\n }\n };\n /** Handles the `prerender` signal. It ensures that flushes start from the first geometry object again. */\n AbstractBatchRenderer.prototype.onPrerender = function () {\n this._flushId = 0;\n };\n /**\n * Buffers the \"batchable\" object. It need not be rendered immediately.\n * @param {PIXI.DisplayObject} element - the element to render when\n * using this renderer\n */\n AbstractBatchRenderer.prototype.render = function (element) {\n if (!element._texture.valid) {\n return;\n }\n if (this._vertexCount + (element.vertexData.length / 2) > this.size) {\n this.flush();\n }\n this._vertexCount += element.vertexData.length / 2;\n this._indexCount += element.indices.length;\n this._bufferedTextures[this._bufferSize] = element._texture.baseTexture;\n this._bufferedElements[this._bufferSize++] = element;\n };\n AbstractBatchRenderer.prototype.buildTexturesAndDrawCalls = function () {\n var _a = this, textures = _a._bufferedTextures, MAX_TEXTURES = _a.MAX_TEXTURES;\n var textureArrays = AbstractBatchRenderer._textureArrayPool;\n var batch = this.renderer.batch;\n var boundTextures = this._tempBoundTextures;\n var touch = this.renderer.textureGC.count;\n var TICK = ++BaseTexture._globalBatch;\n var countTexArrays = 0;\n var texArray = textureArrays[0];\n var start = 0;\n batch.copyBoundTextures(boundTextures, MAX_TEXTURES);\n for (var i = 0; i < this._bufferSize; ++i) {\n var tex = textures[i];\n textures[i] = null;\n if (tex._batchEnabled === TICK) {\n continue;\n }\n if (texArray.count >= MAX_TEXTURES) {\n batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES);\n this.buildDrawCalls(texArray, start, i);\n start = i;\n texArray = textureArrays[++countTexArrays];\n ++TICK;\n }\n tex._batchEnabled = TICK;\n tex.touched = touch;\n texArray.elements[texArray.count++] = tex;\n }\n if (texArray.count > 0) {\n batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES);\n this.buildDrawCalls(texArray, start, this._bufferSize);\n ++countTexArrays;\n ++TICK;\n }\n // Clean-up\n for (var i = 0; i < boundTextures.length; i++) {\n boundTextures[i] = null;\n }\n BaseTexture._globalBatch = TICK;\n };\n /**\n * Populating drawcalls for rendering\n * @param texArray\n * @param start\n * @param finish\n */\n AbstractBatchRenderer.prototype.buildDrawCalls = function (texArray, start, finish) {\n var _a = this, elements = _a._bufferedElements, _attributeBuffer = _a._attributeBuffer, _indexBuffer = _a._indexBuffer, vertexSize = _a.vertexSize;\n var drawCalls = AbstractBatchRenderer._drawCallPool;\n var dcIndex = this._dcIndex;\n var aIndex = this._aIndex;\n var iIndex = this._iIndex;\n var drawCall = drawCalls[dcIndex];\n drawCall.start = this._iIndex;\n drawCall.texArray = texArray;\n for (var i = start; i < finish; ++i) {\n var sprite = elements[i];\n var tex = sprite._texture.baseTexture;\n var spriteBlendMode = premultiplyBlendMode[tex.alphaMode ? 1 : 0][sprite.blendMode];\n elements[i] = null;\n if (start < i && drawCall.blend !== spriteBlendMode) {\n drawCall.size = iIndex - drawCall.start;\n start = i;\n drawCall = drawCalls[++dcIndex];\n drawCall.texArray = texArray;\n drawCall.start = iIndex;\n }\n this.packInterleavedGeometry(sprite, _attributeBuffer, _indexBuffer, aIndex, iIndex);\n aIndex += sprite.vertexData.length / 2 * vertexSize;\n iIndex += sprite.indices.length;\n drawCall.blend = spriteBlendMode;\n }\n if (start < finish) {\n drawCall.size = iIndex - drawCall.start;\n ++dcIndex;\n }\n this._dcIndex = dcIndex;\n this._aIndex = aIndex;\n this._iIndex = iIndex;\n };\n /**\n * Bind textures for current rendering\n * @param texArray\n */\n AbstractBatchRenderer.prototype.bindAndClearTexArray = function (texArray) {\n var textureSystem = this.renderer.texture;\n for (var j = 0; j < texArray.count; j++) {\n textureSystem.bind(texArray.elements[j], texArray.ids[j]);\n texArray.elements[j] = null;\n }\n texArray.count = 0;\n };\n AbstractBatchRenderer.prototype.updateGeometry = function () {\n var _a = this, packedGeometries = _a._packedGeometries, attributeBuffer = _a._attributeBuffer, indexBuffer = _a._indexBuffer;\n if (!settings.CAN_UPLOAD_SAME_BUFFER) { /* Usually on iOS devices, where the browser doesn't\n like uploads to the same buffer in a single frame. */\n if (this._packedGeometryPoolSize <= this._flushId) {\n this._packedGeometryPoolSize++;\n packedGeometries[this._flushId] = new (this.geometryClass)();\n }\n packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData);\n packedGeometries[this._flushId]._indexBuffer.update(indexBuffer);\n this.renderer.geometry.bind(packedGeometries[this._flushId]);\n this.renderer.geometry.updateBuffers();\n this._flushId++;\n }\n else {\n // lets use the faster option, always use buffer number 0\n packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData);\n packedGeometries[this._flushId]._indexBuffer.update(indexBuffer);\n this.renderer.geometry.updateBuffers();\n }\n };\n AbstractBatchRenderer.prototype.drawBatches = function () {\n var dcCount = this._dcIndex;\n var _a = this.renderer, gl = _a.gl, stateSystem = _a.state;\n var drawCalls = AbstractBatchRenderer._drawCallPool;\n var curTexArray = null;\n // Upload textures and do the draw calls\n for (var i = 0; i < dcCount; i++) {\n var _b = drawCalls[i], texArray = _b.texArray, type = _b.type, size = _b.size, start = _b.start, blend = _b.blend;\n if (curTexArray !== texArray) {\n curTexArray = texArray;\n this.bindAndClearTexArray(texArray);\n }\n this.state.blendMode = blend;\n stateSystem.set(this.state);\n gl.drawElements(type, size, gl.UNSIGNED_SHORT, start * 2);\n }\n };\n /** Renders the content _now_ and empties the current batch. */\n AbstractBatchRenderer.prototype.flush = function () {\n if (this._vertexCount === 0) {\n return;\n }\n this._attributeBuffer = this.getAttributeBuffer(this._vertexCount);\n this._indexBuffer = this.getIndexBuffer(this._indexCount);\n this._aIndex = 0;\n this._iIndex = 0;\n this._dcIndex = 0;\n this.buildTexturesAndDrawCalls();\n this.updateGeometry();\n this.drawBatches();\n // reset elements buffer for the next flush\n this._bufferSize = 0;\n this._vertexCount = 0;\n this._indexCount = 0;\n };\n /** Starts a new sprite batch. */\n AbstractBatchRenderer.prototype.start = function () {\n this.renderer.state.set(this.state);\n this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES);\n this.renderer.shader.bind(this._shader);\n if (settings.CAN_UPLOAD_SAME_BUFFER) {\n // bind buffer #0, we don't need others\n this.renderer.geometry.bind(this._packedGeometries[this._flushId]);\n }\n };\n /** Stops and flushes the current batch. */\n AbstractBatchRenderer.prototype.stop = function () {\n this.flush();\n };\n /** Destroys this `AbstractBatchRenderer`. It cannot be used again. */\n AbstractBatchRenderer.prototype.destroy = function () {\n for (var i = 0; i < this._packedGeometryPoolSize; i++) {\n if (this._packedGeometries[i]) {\n this._packedGeometries[i].destroy();\n }\n }\n this.renderer.off('prerender', this.onPrerender, this);\n this._aBuffers = null;\n this._iBuffers = null;\n this._packedGeometries = null;\n this._attributeBuffer = null;\n this._indexBuffer = null;\n if (this._shader) {\n this._shader.destroy();\n this._shader = null;\n }\n _super.prototype.destroy.call(this);\n };\n /**\n * Fetches an attribute buffer from `this._aBuffers` that can hold atleast `size` floats.\n * @param size - minimum capacity required\n * @returns - buffer than can hold atleast `size` floats\n */\n AbstractBatchRenderer.prototype.getAttributeBuffer = function (size) {\n // 8 vertices is enough for 2 quads\n var roundedP2 = nextPow2(Math.ceil(size / 8));\n var roundedSizeIndex = log2(roundedP2);\n var roundedSize = roundedP2 * 8;\n if (this._aBuffers.length <= roundedSizeIndex) {\n this._iBuffers.length = roundedSizeIndex + 1;\n }\n var buffer = this._aBuffers[roundedSize];\n if (!buffer) {\n this._aBuffers[roundedSize] = buffer = new ViewableBuffer(roundedSize * this.vertexSize * 4);\n }\n return buffer;\n };\n /**\n * Fetches an index buffer from `this._iBuffers` that can\n * have at least `size` capacity.\n * @param size - minimum required capacity\n * @returns - buffer that can fit `size` indices.\n */\n AbstractBatchRenderer.prototype.getIndexBuffer = function (size) {\n // 12 indices is enough for 2 quads\n var roundedP2 = nextPow2(Math.ceil(size / 12));\n var roundedSizeIndex = log2(roundedP2);\n var roundedSize = roundedP2 * 12;\n if (this._iBuffers.length <= roundedSizeIndex) {\n this._iBuffers.length = roundedSizeIndex + 1;\n }\n var buffer = this._iBuffers[roundedSizeIndex];\n if (!buffer) {\n this._iBuffers[roundedSizeIndex] = buffer = new Uint16Array(roundedSize);\n }\n return buffer;\n };\n /**\n * Takes the four batching parameters of `element`, interleaves\n * and pushes them into the batching attribute/index buffers given.\n *\n * It uses these properties: `vertexData` `uvs`, `textureId` and\n * `indicies`. It also uses the \"tint\" of the base-texture, if\n * present.\n * @param {PIXI.DisplayObject} element - element being rendered\n * @param attributeBuffer - attribute buffer.\n * @param indexBuffer - index buffer\n * @param aIndex - number of floats already in the attribute buffer\n * @param iIndex - number of indices already in `indexBuffer`\n */\n AbstractBatchRenderer.prototype.packInterleavedGeometry = function (element, attributeBuffer, indexBuffer, aIndex, iIndex) {\n var uint32View = attributeBuffer.uint32View, float32View = attributeBuffer.float32View;\n var packedVertices = aIndex / this.vertexSize;\n var uvs = element.uvs;\n var indicies = element.indices;\n var vertexData = element.vertexData;\n var textureId = element._texture.baseTexture._batchLocation;\n var alpha = Math.min(element.worldAlpha, 1.0);\n var argb = (alpha < 1.0\n && element._texture.baseTexture.alphaMode)\n ? premultiplyTint(element._tintRGB, alpha)\n : element._tintRGB + (alpha * 255 << 24);\n // lets not worry about tint! for now..\n for (var i = 0; i < vertexData.length; i += 2) {\n float32View[aIndex++] = vertexData[i];\n float32View[aIndex++] = vertexData[i + 1];\n float32View[aIndex++] = uvs[i];\n float32View[aIndex++] = uvs[i + 1];\n uint32View[aIndex++] = argb;\n float32View[aIndex++] = textureId;\n }\n for (var i = 0; i < indicies.length; i++) {\n indexBuffer[iIndex++] = packedVertices + indicies[i];\n }\n };\n /**\n * Pool of `BatchDrawCall` objects that `flush` used\n * to create \"batches\" of the objects being rendered.\n *\n * These are never re-allocated again.\n * Shared between all batch renderers because it can be only one \"flush\" working at the moment.\n * @member {PIXI.BatchDrawCall[]}\n */\n AbstractBatchRenderer._drawCallPool = [];\n /**\n * Pool of `BatchDrawCall` objects that `flush` used\n * to create \"batches\" of the objects being rendered.\n *\n * These are never re-allocated again.\n * Shared between all batch renderers because it can be only one \"flush\" working at the moment.\n * @member {PIXI.BatchTextureArray[]}\n */\n AbstractBatchRenderer._textureArrayPool = [];\n return AbstractBatchRenderer;\n}(ObjectRenderer));\n\n/**\n * Helper that generates batching multi-texture shader. Use it with your new BatchRenderer\n * @memberof PIXI\n */\nvar BatchShaderGenerator = /** @class */ (function () {\n /**\n * @param vertexSrc - Vertex shader\n * @param fragTemplate - Fragment shader template\n */\n function BatchShaderGenerator(vertexSrc, fragTemplate) {\n this.vertexSrc = vertexSrc;\n this.fragTemplate = fragTemplate;\n this.programCache = {};\n this.defaultGroupCache = {};\n if (fragTemplate.indexOf('%count%') < 0) {\n throw new Error('Fragment template must contain \"%count%\".');\n }\n if (fragTemplate.indexOf('%forloop%') < 0) {\n throw new Error('Fragment template must contain \"%forloop%\".');\n }\n }\n BatchShaderGenerator.prototype.generateShader = function (maxTextures) {\n if (!this.programCache[maxTextures]) {\n var sampleValues = new Int32Array(maxTextures);\n for (var i = 0; i < maxTextures; i++) {\n sampleValues[i] = i;\n }\n this.defaultGroupCache[maxTextures] = UniformGroup.from({ uSamplers: sampleValues }, true);\n var fragmentSrc = this.fragTemplate;\n fragmentSrc = fragmentSrc.replace(/%count%/gi, \"\" + maxTextures);\n fragmentSrc = fragmentSrc.replace(/%forloop%/gi, this.generateSampleSrc(maxTextures));\n this.programCache[maxTextures] = new Program(this.vertexSrc, fragmentSrc);\n }\n var uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: this.defaultGroupCache[maxTextures],\n };\n return new Shader(this.programCache[maxTextures], uniforms);\n };\n BatchShaderGenerator.prototype.generateSampleSrc = function (maxTextures) {\n var src = '';\n src += '\\n';\n src += '\\n';\n for (var i = 0; i < maxTextures; i++) {\n if (i > 0) {\n src += '\\nelse ';\n }\n if (i < maxTextures - 1) {\n src += \"if(vTextureId < \" + i + \".5)\";\n }\n src += '\\n{';\n src += \"\\n\\tcolor = texture2D(uSamplers[\" + i + \"], vTextureCoord);\";\n src += '\\n}';\n }\n src += '\\n';\n src += '\\n';\n return src;\n };\n return BatchShaderGenerator;\n}());\n\n/**\n * Geometry used to batch standard PIXI content (e.g. Mesh, Sprite, Graphics objects).\n * @memberof PIXI\n */\nvar BatchGeometry = /** @class */ (function (_super) {\n __extends(BatchGeometry, _super);\n /**\n * @param {boolean} [_static=false] - Optimization flag, where `false`\n * is updated every frame, `true` doesn't change frame-to-frame.\n */\n function BatchGeometry(_static) {\n if (_static === void 0) { _static = false; }\n var _this = _super.call(this) || this;\n _this._buffer = new Buffer(null, _static, false);\n _this._indexBuffer = new Buffer(null, _static, true);\n _this.addAttribute('aVertexPosition', _this._buffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', _this._buffer, 2, false, TYPES.FLOAT)\n .addAttribute('aColor', _this._buffer, 4, true, TYPES.UNSIGNED_BYTE)\n .addAttribute('aTextureId', _this._buffer, 1, true, TYPES.FLOAT)\n .addIndex(_this._indexBuffer);\n return _this;\n }\n return BatchGeometry;\n}(Geometry));\n\nvar defaultVertex = \"precision highp float;\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\nattribute vec4 aColor;\\nattribute float aTextureId;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform vec4 tint;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\nvarying float vTextureId;\\n\\nvoid main(void){\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vTextureId = aTextureId;\\n vColor = aColor * tint;\\n}\\n\";\n\nvar defaultFragment = \"varying vec2 vTextureCoord;\\nvarying vec4 vColor;\\nvarying float vTextureId;\\nuniform sampler2D uSamplers[%count%];\\n\\nvoid main(void){\\n vec4 color;\\n %forloop%\\n gl_FragColor = color * vColor;\\n}\\n\";\n\n/** @memberof PIXI */\nvar BatchPluginFactory = /** @class */ (function () {\n function BatchPluginFactory() {\n }\n /**\n * Create a new BatchRenderer plugin for Renderer. this convenience can provide an easy way\n * to extend BatchRenderer with all the necessary pieces.\n * @example\n * const fragment = `\n * varying vec2 vTextureCoord;\n * varying vec4 vColor;\n * varying float vTextureId;\n * uniform sampler2D uSamplers[%count%];\n *\n * void main(void){\n * vec4 color;\n * %forloop%\n * gl_FragColor = vColor * vec4(color.a - color.rgb, color.a);\n * }\n * `;\n * const InvertBatchRenderer = PIXI.BatchPluginFactory.create({ fragment });\n * PIXI.extensions.add({\n * name: 'invert',\n * ref: InvertBatchRenderer,\n * type: PIXI.ExtensionType.RendererPlugin,\n * });\n * const sprite = new PIXI.Sprite();\n * sprite.pluginName = 'invert';\n * @param {object} [options]\n * @param {string} [options.vertex=PIXI.BatchPluginFactory.defaultVertexSrc] - Vertex shader source\n * @param {string} [options.fragment=PIXI.BatchPluginFactory.defaultFragmentTemplate] - Fragment shader template\n * @param {number} [options.vertexSize=6] - Vertex size\n * @param {object} [options.geometryClass=PIXI.BatchGeometry]\n * @returns {*} New batch renderer plugin\n */\n BatchPluginFactory.create = function (options) {\n var _a = Object.assign({\n vertex: defaultVertex,\n fragment: defaultFragment,\n geometryClass: BatchGeometry,\n vertexSize: 6,\n }, options), vertex = _a.vertex, fragment = _a.fragment, vertexSize = _a.vertexSize, geometryClass = _a.geometryClass;\n return /** @class */ (function (_super) {\n __extends(BatchPlugin, _super);\n function BatchPlugin(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.shaderGenerator = new BatchShaderGenerator(vertex, fragment);\n _this.geometryClass = geometryClass;\n _this.vertexSize = vertexSize;\n return _this;\n }\n return BatchPlugin;\n }(AbstractBatchRenderer));\n };\n Object.defineProperty(BatchPluginFactory, \"defaultVertexSrc\", {\n /**\n * The default vertex shader source\n * @readonly\n */\n get: function () {\n return defaultVertex;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BatchPluginFactory, \"defaultFragmentTemplate\", {\n /**\n * The default fragment shader source\n * @readonly\n */\n get: function () {\n return defaultFragment;\n },\n enumerable: false,\n configurable: true\n });\n return BatchPluginFactory;\n}());\n// Setup the default BatchRenderer plugin, this is what\n// we'll actually export at the root level\nvar BatchRenderer = BatchPluginFactory.create();\nObject.assign(BatchRenderer, {\n extension: {\n name: 'batch',\n type: ExtensionType.RendererPlugin,\n },\n});\n\n/**\n * @memberof PIXI\n * @namespace resources\n * @see PIXI\n * @deprecated since 6.0.0\n */\nvar resources = {};\nvar _loop_1 = function (name) {\n Object.defineProperty(resources, name, {\n get: function () {\n deprecation('6.0.0', \"PIXI.systems.\" + name + \" has moved to PIXI.\" + name);\n return _resources[name];\n },\n });\n};\nfor (var name in _resources) {\n _loop_1(name);\n}\n/**\n * @memberof PIXI\n * @namespace systems\n * @see PIXI\n * @deprecated since 6.0.0\n */\nvar systems = {};\nvar _loop_2 = function (name) {\n Object.defineProperty(systems, name, {\n get: function () {\n deprecation('6.0.0', \"PIXI.resources.\" + name + \" has moved to PIXI.\" + name);\n return _systems[name];\n },\n });\n};\nfor (var name in _systems) {\n _loop_2(name);\n}\n\n/**\n * @namespace PIXI\n */\n/**\n * String of the current PIXI version.\n * @memberof PIXI\n */\nvar VERSION = '6.5.10';\n\nexport { AbstractBatchRenderer, AbstractMultiResource, AbstractRenderer, ArrayResource, Attribute, BaseImageResource, BaseRenderTexture, BaseTexture, BatchDrawCall, BatchGeometry, BatchPluginFactory, BatchRenderer, BatchShaderGenerator, BatchSystem, BatchTextureArray, Buffer, BufferResource, CanvasResource, ContextSystem, CubeResource, Filter, FilterState, FilterSystem, Framebuffer, FramebufferSystem, GLFramebuffer, GLProgram, GLTexture, Geometry, GeometrySystem, IGLUniformData, INSTALLED, ImageBitmapResource, ImageResource, MaskData, MaskSystem, ObjectRenderer, Program, ProjectionSystem, Quad, QuadUv, RenderTexture, RenderTexturePool, RenderTextureSystem, Renderer, Resource, SVGResource, ScissorSystem, Shader, ShaderSystem, SpriteMaskFilter, State, StateSystem, StencilSystem, System, Texture, TextureGCSystem, TextureMatrix, TextureSystem, TextureUvs, UniformGroup, VERSION, VideoResource, ViewableBuffer, autoDetectRenderer, autoDetectResource, checkMaxIfStatementsInShader, createUBOElements, defaultFilterVertex, defaultVertex$1 as defaultVertex, generateProgram, generateUniformBufferSync, getTestContext, getUBOData, resources, systems, uniformParsers };\n//# sourceMappingURL=core.mjs.map\n","/*!\n * @pixi/accessibility - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/accessibility is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { isMobile, removeItems } from '@pixi/utils';\nimport { ExtensionType } from '@pixi/core';\n\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.AccessibilityManager}.\n * @private\n * @function accessibleTarget\n * @memberof PIXI\n * @type {object}\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibleTarget\n * );\n */\nvar accessibleTarget = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n accessible: false,\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n * @member {?string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleTitle: null,\n /**\n * Sets the aria-label attribute of the shadow div\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleHint: null,\n /**\n * @member {number}\n * @memberof PIXI.DisplayObject#\n * @private\n * @todo Needs docs.\n */\n tabIndex: 0,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleActive: false,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleDiv: null,\n /**\n * Specify the type of div the accessible layer is. Screen readers treat the element differently\n * depending on this type. Defaults to button.\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'button'\n */\n accessibleType: 'button',\n /**\n * Specify the pointer-events the accessible div will use\n * Defaults to auto.\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'auto'\n */\n accessiblePointerEvents: 'auto',\n /**\n * Setting to false will prevent any children inside this container to\n * be accessible. Defaults to true.\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @default true\n */\n accessibleChildren: true,\n renderId: -1,\n};\n\n// add some extra variables to the container..\nDisplayObject.mixin(accessibleTarget);\nvar KEY_CODE_TAB = 9;\nvar DIV_TOUCH_SIZE = 100;\nvar DIV_TOUCH_POS_X = 0;\nvar DIV_TOUCH_POS_Y = 0;\nvar DIV_TOUCH_ZINDEX = 2;\nvar DIV_HOOK_SIZE = 1;\nvar DIV_HOOK_POS_X = -1000;\nvar DIV_HOOK_POS_Y = -1000;\nvar DIV_HOOK_ZINDEX = 2;\n/**\n * The Accessibility manager recreates the ability to tab and have content read by screen readers.\n * This is very important as it can possibly help people with disabilities access PixiJS content.\n *\n * A DisplayObject can be made accessible just like it can be made interactive. This manager will map the\n * events as if the mouse was being used, minimizing the effort required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.accessibility`\n * @class\n * @memberof PIXI\n */\nvar AccessibilityManager = /** @class */ (function () {\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n */\n function AccessibilityManager(renderer) {\n /** Setting this to true will visually show the divs. */\n this.debug = false;\n /** Internal variable, see isActive getter. */\n this._isActive = false;\n /** Internal variable, see isMobileAccessibility getter. */\n this._isMobileAccessibility = false;\n /** A simple pool for storing divs. */\n this.pool = [];\n /** This is a tick used to check if an object is no longer being rendered. */\n this.renderId = 0;\n /** The array of currently active accessible items. */\n this.children = [];\n /** Count to throttle div updates on android devices. */\n this.androidUpdateCount = 0;\n /** The frequency to update the div elements. */\n this.androidUpdateFrequency = 500; // 2fps\n this._hookDiv = null;\n if (isMobile.tablet || isMobile.phone) {\n this.createTouchHook();\n }\n // first we create a div that will sit over the PixiJS element. This is where the div overlays will go.\n var div = document.createElement('div');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.position = 'absolute';\n div.style.top = DIV_TOUCH_POS_X + \"px\";\n div.style.left = DIV_TOUCH_POS_Y + \"px\";\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n this.div = div;\n this.renderer = renderer;\n /**\n * pre-bind the functions\n * @type {Function}\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n /**\n * pre-bind the functions\n * @type {Function}\n * @private\n */\n this._onMouseMove = this._onMouseMove.bind(this);\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n globalThis.addEventListener('keydown', this._onKeyDown, false);\n }\n Object.defineProperty(AccessibilityManager.prototype, \"isActive\", {\n /**\n * Value of `true` if accessibility is currently active and accessibility layers are showing.\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isActive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AccessibilityManager.prototype, \"isMobileAccessibility\", {\n /**\n * Value of `true` if accessibility is enabled for touch devices.\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isMobileAccessibility;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates the touch hooks.\n * @private\n */\n AccessibilityManager.prototype.createTouchHook = function () {\n var _this = this;\n var hookDiv = document.createElement('button');\n hookDiv.style.width = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.height = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = DIV_HOOK_POS_X + \"px\";\n hookDiv.style.left = DIV_HOOK_POS_Y + \"px\";\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX.toString();\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'select to enable accessibility for this content';\n hookDiv.addEventListener('focus', function () {\n _this._isMobileAccessibility = true;\n _this.activate();\n _this.destroyTouchHook();\n });\n document.body.appendChild(hookDiv);\n this._hookDiv = hookDiv;\n };\n /**\n * Destroys the touch hooks.\n * @private\n */\n AccessibilityManager.prototype.destroyTouchHook = function () {\n if (!this._hookDiv) {\n return;\n }\n document.body.removeChild(this._hookDiv);\n this._hookDiv = null;\n };\n /**\n * Activating will cause the Accessibility layer to be shown.\n * This is called when a user presses the tab key.\n * @private\n */\n AccessibilityManager.prototype.activate = function () {\n var _a;\n if (this._isActive) {\n return;\n }\n this._isActive = true;\n globalThis.document.addEventListener('mousemove', this._onMouseMove, true);\n globalThis.removeEventListener('keydown', this._onKeyDown, false);\n this.renderer.on('postrender', this.update, this);\n (_a = this.renderer.view.parentNode) === null || _a === void 0 ? void 0 : _a.appendChild(this.div);\n };\n /**\n * Deactivating will cause the Accessibility layer to be hidden.\n * This is called when a user moves the mouse.\n * @private\n */\n AccessibilityManager.prototype.deactivate = function () {\n var _a;\n if (!this._isActive || this._isMobileAccessibility) {\n return;\n }\n this._isActive = false;\n globalThis.document.removeEventListener('mousemove', this._onMouseMove, true);\n globalThis.addEventListener('keydown', this._onKeyDown, false);\n this.renderer.off('postrender', this.update);\n (_a = this.div.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this.div);\n };\n /**\n * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n AccessibilityManager.prototype.updateAccessibleObjects = function (displayObject) {\n if (!displayObject.visible || !displayObject.accessibleChildren) {\n return;\n }\n if (displayObject.accessible && displayObject.interactive) {\n if (!displayObject._accessibleActive) {\n this.addChild(displayObject);\n }\n displayObject.renderId = this.renderId;\n }\n var children = displayObject.children;\n if (children) {\n for (var i = 0; i < children.length; i++) {\n this.updateAccessibleObjects(children[i]);\n }\n }\n };\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n * @private\n */\n AccessibilityManager.prototype.update = function () {\n /* On Android default web browser, tab order seems to be calculated by position rather than tabIndex,\n * moving buttons can cause focus to flicker between two buttons making it hard/impossible to navigate,\n * so I am just running update every half a second, seems to fix it.\n */\n var now = performance.now();\n if (isMobile.android.device && now < this.androidUpdateCount) {\n return;\n }\n this.androidUpdateCount = now + this.androidUpdateFrequency;\n if (!this.renderer.renderingToScreen) {\n return;\n }\n // update children...\n if (this.renderer._lastObjectRendered) {\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n }\n var _a = this.renderer.view.getBoundingClientRect(), left = _a.left, top = _a.top, width = _a.width, height = _a.height;\n var _b = this.renderer, viewWidth = _b.width, viewHeight = _b.height, resolution = _b.resolution;\n var sx = (width / viewWidth) * resolution;\n var sy = (height / viewHeight) * resolution;\n var div = this.div;\n div.style.left = left + \"px\";\n div.style.top = top + \"px\";\n div.style.width = viewWidth + \"px\";\n div.style.height = viewHeight + \"px\";\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n i--;\n }\n else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n if (child.hitArea) {\n div.style.left = (wt.tx + (hitArea.x * wt.a)) * sx + \"px\";\n div.style.top = (wt.ty + (hitArea.y * wt.d)) * sy + \"px\";\n div.style.width = hitArea.width * wt.a * sx + \"px\";\n div.style.height = hitArea.height * wt.d * sy + \"px\";\n }\n else {\n hitArea = child.getBounds();\n this.capHitArea(hitArea);\n div.style.left = hitArea.x * sx + \"px\";\n div.style.top = hitArea.y * sy + \"px\";\n div.style.width = hitArea.width * sx + \"px\";\n div.style.height = hitArea.height * sy + \"px\";\n // update button titles and hints if they exist and they've changed\n if (div.title !== child.accessibleTitle && child.accessibleTitle !== null) {\n div.title = child.accessibleTitle;\n }\n if (div.getAttribute('aria-label') !== child.accessibleHint\n && child.accessibleHint !== null) {\n div.setAttribute('aria-label', child.accessibleHint);\n }\n }\n // the title or index may have changed, if so lets update it!\n if (child.accessibleTitle !== div.title || child.tabIndex !== div.tabIndex) {\n div.title = child.accessibleTitle;\n div.tabIndex = child.tabIndex;\n if (this.debug)\n { this.updateDebugHTML(div); }\n }\n }\n }\n // increment the render id..\n this.renderId++;\n };\n /**\n * private function that will visually add the information to the\n * accessability div\n * @param {HTMLElement} div -\n */\n AccessibilityManager.prototype.updateDebugHTML = function (div) {\n div.innerHTML = \"type: \" + div.type + \"
title : \" + div.title + \"
tabIndex: \" + div.tabIndex;\n };\n /**\n * Adjust the hit area based on the bounds of a display object\n * @param {PIXI.Rectangle} hitArea - Bounds of the child\n */\n AccessibilityManager.prototype.capHitArea = function (hitArea) {\n if (hitArea.x < 0) {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n if (hitArea.y < 0) {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n var _a = this.renderer, viewWidth = _a.width, viewHeight = _a.height;\n if (hitArea.x + hitArea.width > viewWidth) {\n hitArea.width = viewWidth - hitArea.x;\n }\n if (hitArea.y + hitArea.height > viewHeight) {\n hitArea.height = viewHeight - hitArea.y;\n }\n };\n /**\n * Adds a DisplayObject to the accessibility manager\n * @private\n * @param {PIXI.DisplayObject} displayObject - The child to make accessible.\n */\n AccessibilityManager.prototype.addChild = function (displayObject) {\n // this.activate();\n var div = this.pool.pop();\n if (!div) {\n div = document.createElement('button');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.backgroundColor = this.debug ? 'rgba(255,255,255,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n div.style.borderStyle = 'none';\n // ARIA attributes ensure that button title and hint updates are announced properly\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n // Chrome doesn't need aria-live to work as intended; in fact it just gets more confused.\n div.setAttribute('aria-live', 'off');\n }\n else {\n div.setAttribute('aria-live', 'polite');\n }\n if (navigator.userAgent.match(/rv:.*Gecko\\//)) {\n // FireFox needs this to announce only the new button name\n div.setAttribute('aria-relevant', 'additions');\n }\n else {\n // required by IE, other browsers don't much care\n div.setAttribute('aria-relevant', 'text');\n }\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n // set pointer events\n div.style.pointerEvents = displayObject.accessiblePointerEvents;\n // set the type, this defaults to button!\n div.type = displayObject.accessibleType;\n if (displayObject.accessibleTitle && displayObject.accessibleTitle !== null) {\n div.title = displayObject.accessibleTitle;\n }\n else if (!displayObject.accessibleHint\n || displayObject.accessibleHint === null) {\n div.title = \"displayObject \" + displayObject.tabIndex;\n }\n if (displayObject.accessibleHint\n && displayObject.accessibleHint !== null) {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n if (this.debug)\n { this.updateDebugHTML(div); }\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n };\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n * @private\n * @param {MouseEvent} e - The click event.\n */\n AccessibilityManager.prototype._onClick = function (e) {\n var interactionManager = this.renderer.plugins.interaction;\n var displayObject = e.target.displayObject;\n var eventData = interactionManager.eventData;\n interactionManager.dispatchEvent(displayObject, 'click', eventData);\n interactionManager.dispatchEvent(displayObject, 'pointertap', eventData);\n interactionManager.dispatchEvent(displayObject, 'tap', eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseover)\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n AccessibilityManager.prototype._onFocus = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'assertive');\n }\n var interactionManager = this.renderer.plugins.interaction;\n var displayObject = e.target.displayObject;\n var eventData = interactionManager.eventData;\n interactionManager.dispatchEvent(displayObject, 'mouseover', eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseout)\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n AccessibilityManager.prototype._onFocusOut = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'polite');\n }\n var interactionManager = this.renderer.plugins.interaction;\n var displayObject = e.target.displayObject;\n var eventData = interactionManager.eventData;\n interactionManager.dispatchEvent(displayObject, 'mouseout', eventData);\n };\n /**\n * Is called when a key is pressed\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n AccessibilityManager.prototype._onKeyDown = function (e) {\n if (e.keyCode !== KEY_CODE_TAB) {\n return;\n }\n this.activate();\n };\n /**\n * Is called when the mouse moves across the renderer element\n * @private\n * @param {MouseEvent} e - The mouse event.\n */\n AccessibilityManager.prototype._onMouseMove = function (e) {\n if (e.movementX === 0 && e.movementY === 0) {\n return;\n }\n this.deactivate();\n };\n /** Destroys the accessibility manager */\n AccessibilityManager.prototype.destroy = function () {\n this.destroyTouchHook();\n this.div = null;\n globalThis.document.removeEventListener('mousemove', this._onMouseMove, true);\n globalThis.removeEventListener('keydown', this._onKeyDown);\n this.pool = null;\n this.children = null;\n this.renderer = null;\n };\n /** @ignore */\n AccessibilityManager.extension = {\n name: 'accessibility',\n type: [\n ExtensionType.RendererPlugin,\n ExtensionType.CanvasRendererPlugin ],\n };\n return AccessibilityManager;\n}());\n\nexport { AccessibilityManager, accessibleTarget };\n//# sourceMappingURL=accessibility.mjs.map\n","/*!\n * @pixi/interaction - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/interaction is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Point } from '@pixi/math';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { DisplayObject, TemporaryDisplayObject } from '@pixi/display';\nimport { EventEmitter } from '@pixi/utils';\nimport { ExtensionType } from '@pixi/core';\n\n/**\n * Holds all information related to an Interaction event\n * @memberof PIXI\n */\nvar InteractionData = /** @class */ (function () {\n function InteractionData() {\n /**\n * Pressure applied by the pointing device during the event. A Touch's force property\n * will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure\n */\n this.pressure = 0;\n /**\n * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle\n */\n this.rotationAngle = 0;\n /**\n * Twist of a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n */\n this.twist = 0;\n /**\n * Barrel pressure on a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n */\n this.tangentialPressure = 0;\n this.global = new Point();\n this.target = null;\n this.originalEvent = null;\n this.identifier = null;\n this.isPrimary = false;\n this.button = 0;\n this.buttons = 0;\n this.width = 0;\n this.height = 0;\n this.tiltX = 0;\n this.tiltY = 0;\n this.pointerType = null;\n this.pressure = 0;\n this.rotationAngle = 0;\n this.twist = 0;\n this.tangentialPressure = 0;\n }\n Object.defineProperty(InteractionData.prototype, \"pointerId\", {\n /**\n * The unique identifier of the pointer. It will be the same as `identifier`.\n * @readonly\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId\n */\n get: function () {\n return this.identifier;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n * @param displayObject - The DisplayObject that you would like the local\n * coords off\n * @param point - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param globalPos - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @returns - A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) {\n return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n };\n /**\n * Copies properties from normalized event data.\n * @param {Touch|MouseEvent|PointerEvent} event - The normalized event data\n */\n InteractionData.prototype.copyEvent = function (event) {\n // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite\n // it with \"false\" on later events when our shim for it on touch events might not be\n // accurate\n if ('isPrimary' in event && event.isPrimary) {\n this.isPrimary = true;\n }\n this.button = 'button' in event && event.button;\n // event.buttons is not available in all browsers (ie. Safari), but it does have a non-standard\n // event.which property instead, which conveys the same information.\n var buttons = 'buttons' in event && event.buttons;\n this.buttons = Number.isInteger(buttons) ? buttons : 'which' in event && event.which;\n this.width = 'width' in event && event.width;\n this.height = 'height' in event && event.height;\n this.tiltX = 'tiltX' in event && event.tiltX;\n this.tiltY = 'tiltY' in event && event.tiltY;\n this.pointerType = 'pointerType' in event && event.pointerType;\n this.pressure = 'pressure' in event && event.pressure;\n this.rotationAngle = 'rotationAngle' in event && event.rotationAngle;\n this.twist = ('twist' in event && event.twist) || 0;\n this.tangentialPressure = ('tangentialPressure' in event && event.tangentialPressure) || 0;\n };\n /** Resets the data for pooling. */\n InteractionData.prototype.reset = function () {\n // isPrimary is the only property that we really need to reset - everything else is\n // guaranteed to be overwritten\n this.isPrimary = false;\n };\n return InteractionData;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Event class that mimics native DOM events.\n * @memberof PIXI\n */\nvar InteractionEvent = /** @class */ (function () {\n function InteractionEvent() {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.target = null;\n this.currentTarget = null;\n this.type = null;\n this.data = null;\n }\n /** Prevents event from reaching any objects other than the current object. */\n InteractionEvent.prototype.stopPropagation = function () {\n this.stopped = true;\n this.stopPropagationHint = true;\n this.stopsPropagatingAt = this.currentTarget;\n };\n /** Resets the event. */\n InteractionEvent.prototype.reset = function () {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.currentTarget = null;\n this.target = null;\n };\n return InteractionEvent;\n}());\n\n/**\n * DisplayObjects with the {@link PIXI.interactiveTarget} mixin use this class to track interactions\n * @class\n * @private\n * @memberof PIXI\n */\nvar InteractionTrackingData = /** @class */ (function () {\n /**\n * @param {number} pointerId - Unique pointer id of the event\n * @private\n */\n function InteractionTrackingData(pointerId) {\n this._pointerId = pointerId;\n this._flags = InteractionTrackingData.FLAGS.NONE;\n }\n /**\n *\n * @private\n * @param {number} flag - The interaction flag to set\n * @param {boolean} yn - Should the flag be set or unset\n */\n InteractionTrackingData.prototype._doSet = function (flag, yn) {\n if (yn) {\n this._flags = this._flags | flag;\n }\n else {\n this._flags = this._flags & (~flag);\n }\n };\n Object.defineProperty(InteractionTrackingData.prototype, \"pointerId\", {\n /**\n * Unique pointer id of the event\n * @readonly\n * @private\n * @member {number}\n */\n get: function () {\n return this._pointerId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"flags\", {\n /**\n * State of the tracking data, expressed as bit flags\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags;\n },\n set: function (flags) {\n this._flags = flags;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"none\", {\n /**\n * Is the tracked event inactive (not over or down)?\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags === InteractionTrackingData.FLAGS.NONE;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"over\", {\n /**\n * Is the tracked event over the DisplayObject?\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.OVER) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.OVER, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"rightDown\", {\n /**\n * Did the right mouse button come down in the DisplayObject?\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.RIGHT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.RIGHT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"leftDown\", {\n /**\n * Did the left mouse button come down in the DisplayObject?\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.LEFT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.LEFT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n InteractionTrackingData.FLAGS = Object.freeze({\n NONE: 0,\n OVER: 1 << 0,\n LEFT_DOWN: 1 << 1,\n RIGHT_DOWN: 1 << 2,\n });\n return InteractionTrackingData;\n}());\n\n/**\n * Strategy how to search through stage tree for interactive objects\n * @memberof PIXI\n */\nvar TreeSearch = /** @class */ (function () {\n function TreeSearch() {\n this._tempPoint = new Point();\n }\n /**\n * Recursive implementation for findHit\n * @private\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - this indicates if the objects inside should be hit test against the point\n * @param interactive - Whether the displayObject is interactive\n * @returns - Returns true if the displayObject hit the point\n */\n TreeSearch.prototype.recursiveFindHit = function (interactionEvent, displayObject, func, hitTest, interactive) {\n var _a;\n if (!displayObject || !displayObject.visible) {\n return false;\n }\n var point = interactionEvent.data.global;\n // Took a little while to rework this function correctly! But now it is done and nice and optimized! ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimization once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimization is that an object is not hit test directly if a child has already been hit.\n interactive = displayObject.interactive || interactive;\n var hit = false;\n var interactiveParent = interactive;\n // Flag here can set to false if the event is outside the parents hitArea or mask\n var hitTestChildren = true;\n // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea\n // There is also no longer a need to hitTest children.\n if (displayObject.hitArea) {\n if (hitTest) {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {\n hitTest = false;\n hitTestChildren = false;\n }\n else {\n hit = true;\n }\n }\n interactiveParent = false;\n }\n // If there is a mask, no need to hitTest against anything else if the pointer is not within the mask.\n // We still want to hitTestChildren, however, to ensure a mouseout can still be generated.\n // https://github.com/pixijs/pixi.js/issues/5135\n else if (displayObject._mask) {\n if (hitTest) {\n var maskObject = (displayObject._mask.isMaskData\n ? displayObject._mask.maskObject : displayObject._mask);\n if (maskObject && !((_a = maskObject.containsPoint) === null || _a === void 0 ? void 0 : _a.call(maskObject, point))) {\n hitTest = false;\n }\n }\n }\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow PixiJS to completely ignore and bypass checking the displayObjects children.\n if (hitTestChildren && displayObject.interactiveChildren && displayObject.children) {\n var children = displayObject.children;\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n // time to get recursive.. if this function will return if something is hit..\n var childHit = this.recursiveFindHit(interactionEvent, child, func, hitTest, interactiveParent);\n if (childHit) {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent) {\n continue;\n }\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n if (childHit) {\n if (interactionEvent.target) {\n hitTest = false;\n }\n hit = true;\n }\n }\n }\n }\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive) {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit - but only if it was interactive, otherwise we need to keep\n // looking for an interactive child, just in case we hit one\n if (hitTest && !interactionEvent.target) {\n // already tested against hitArea if it is defined\n if (!displayObject.hitArea && displayObject.containsPoint) {\n if (displayObject.containsPoint(point)) {\n hit = true;\n }\n }\n }\n if (displayObject.interactive) {\n if (hit && !interactionEvent.target) {\n interactionEvent.target = displayObject;\n }\n if (func) {\n func(interactionEvent, displayObject, !!hit);\n }\n }\n }\n return hit;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n * @private\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - this indicates if the objects inside should be hit test against the point\n * @returns - Returns true if the displayObject hit the point\n */\n TreeSearch.prototype.findHit = function (interactionEvent, displayObject, func, hitTest) {\n this.recursiveFindHit(interactionEvent, displayObject, func, hitTest, false);\n };\n return TreeSearch;\n}());\n\n/**\n * Interface for classes that represent a hit area.\n *\n * It is implemented by the following classes:\n * - {@link PIXI.Circle}\n * - {@link PIXI.Ellipse}\n * - {@link PIXI.Polygon}\n * - {@link PIXI.RoundedRectangle}\n * @interface IHitArea\n * @memberof PIXI\n */\n/**\n * Checks whether the x and y coordinates given are contained within this area\n * @method\n * @name contains\n * @memberof PIXI.IHitArea#\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @returns {boolean} Whether the x/y coordinates are within this area\n */\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.InteractionManager} to automatically give all DisplayObjects these properties\n * @private\n * @name interactiveTarget\n * @type {object}\n * @memberof PIXI\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * DisplayObject.prototype,\n * PIXI.interactiveTarget\n * );\n */\nvar interactiveTarget = {\n interactive: false,\n interactiveChildren: true,\n hitArea: null,\n /**\n * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive\n * Setting this changes the 'cursor' property to `'pointer'`.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.buttonMode = true;\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n get buttonMode() {\n return this.cursor === 'pointer';\n },\n set buttonMode(value) {\n if (value) {\n this.cursor = 'pointer';\n }\n else if (this.cursor === 'pointer') {\n this.cursor = null;\n }\n },\n /**\n * This defines what cursor mode is used when the mouse cursor\n * is hovered over the displayObject.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.cursor = 'wait';\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n cursor: null,\n /**\n * Internal set of all active pointers, by identifier\n * @member {Map}\n * @memberof PIXI.DisplayObject#\n * @private\n */\n get trackedPointers() {\n if (this._trackedPointers === undefined)\n { this._trackedPointers = {}; }\n return this._trackedPointers;\n },\n /**\n * Map of all tracked pointers, by identifier. Use trackedPointers to access.\n * @private\n * @type {Map}\n */\n _trackedPointers: undefined,\n};\n\n// Mix interactiveTarget into DisplayObject.prototype\nDisplayObject.mixin(interactiveTarget);\nvar MOUSE_POINTER_ID = 1;\n// helpers for hitTest() - only used inside hitTest()\nvar hitTestEvent = {\n target: null,\n data: {\n global: null,\n },\n};\n/**\n * The interaction manager deals with mouse, touch and pointer events.\n *\n * Any DisplayObject can be interactive if its `interactive` property is set to true.\n *\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.interaction`\n * @memberof PIXI\n */\nvar InteractionManager = /** @class */ (function (_super) {\n __extends(InteractionManager, _super);\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n * @param options - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Maximum frequency (ms) at pointer over/out states will be checked.\n * @param {number} [options.useSystemTicker=true] - Whether to add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n */\n function InteractionManager(renderer, options) {\n var _this = _super.call(this) || this;\n options = options || {};\n _this.renderer = renderer;\n _this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n _this.interactionFrequency = options.interactionFrequency || 10;\n _this.mouse = new InteractionData();\n _this.mouse.identifier = MOUSE_POINTER_ID;\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n _this.mouse.global.set(-999999);\n _this.activeInteractionData = {};\n _this.activeInteractionData[MOUSE_POINTER_ID] = _this.mouse;\n _this.interactionDataPool = [];\n _this.eventData = new InteractionEvent();\n _this.interactionDOMElement = null;\n _this.moveWhenInside = false;\n _this.eventsAdded = false;\n _this.tickerAdded = false;\n _this.mouseOverRenderer = !('PointerEvent' in globalThis);\n _this.supportsTouchEvents = 'ontouchstart' in globalThis;\n _this.supportsPointerEvents = !!globalThis.PointerEvent;\n // this will make it so that you don't have to call bind all the time\n _this.onPointerUp = _this.onPointerUp.bind(_this);\n _this.processPointerUp = _this.processPointerUp.bind(_this);\n _this.onPointerCancel = _this.onPointerCancel.bind(_this);\n _this.processPointerCancel = _this.processPointerCancel.bind(_this);\n _this.onPointerDown = _this.onPointerDown.bind(_this);\n _this.processPointerDown = _this.processPointerDown.bind(_this);\n _this.onPointerMove = _this.onPointerMove.bind(_this);\n _this.processPointerMove = _this.processPointerMove.bind(_this);\n _this.onPointerOut = _this.onPointerOut.bind(_this);\n _this.processPointerOverOut = _this.processPointerOverOut.bind(_this);\n _this.onPointerOver = _this.onPointerOver.bind(_this);\n _this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer',\n };\n _this.currentCursorMode = null;\n _this.cursor = null;\n _this.resolution = 1;\n _this.delayedEvents = [];\n _this.search = new TreeSearch();\n _this._tempDisplayObject = new TemporaryDisplayObject();\n _this._eventListenerOptions = { capture: true, passive: false };\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display\n * object.\n * @event PIXI.InteractionManager#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n * @event PIXI.InteractionManager#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object.\n * @event PIXI.InteractionManager#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n * @event PIXI.InteractionManager#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object.\n * @event PIXI.InteractionManager#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n * @event PIXI.InteractionManager#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.InteractionManager#event:mousedown}.\n * @event PIXI.InteractionManager#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.InteractionManager#event:rightdown}.\n * @event PIXI.InteractionManager#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n * @event PIXI.InteractionManager#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n * @event PIXI.InteractionManager#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n * @event PIXI.InteractionManager#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n * @event PIXI.InteractionManager#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * Not always fired when some buttons are held down while others are released. In those cases,\n * use [mousedown]{@link PIXI.InteractionManager#event:mousedown} and\n * [mouseup]{@link PIXI.InteractionManager#event:mouseup} instead.\n * @event PIXI.InteractionManager#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event\n * @event PIXI.InteractionManager#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * @event PIXI.InteractionManager#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.InteractionManager#event:pointerdown}.\n * @event PIXI.InteractionManager#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object\n * @event PIXI.InteractionManager#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object\n * @event PIXI.InteractionManager#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object\n * @event PIXI.InteractionManager#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n * @event PIXI.InteractionManager#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n * @event PIXI.InteractionManager#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch\n * @event PIXI.InteractionManager#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n * @event PIXI.InteractionManager#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.InteractionManager#event:touchstart}.\n * @event PIXI.InteractionManager#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n * @event PIXI.InteractionManager#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display.\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.DisplayObject#event:mousedown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.DisplayObject#event:rightdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n _this._useSystemTicker = options.useSystemTicker !== undefined ? options.useSystemTicker : true;\n _this.setTargetElement(_this.renderer.view, _this.renderer.resolution);\n return _this;\n }\n Object.defineProperty(InteractionManager.prototype, \"useSystemTicker\", {\n /**\n * Should the InteractionManager automatically add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n * @default true\n */\n get: function () {\n return this._useSystemTicker;\n },\n set: function (useSystemTicker) {\n this._useSystemTicker = useSystemTicker;\n if (useSystemTicker) {\n this.addTickerListener();\n }\n else {\n this.removeTickerListener();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionManager.prototype, \"lastObjectRendered\", {\n /**\n * Last rendered object or temp object.\n * @readonly\n * @protected\n */\n get: function () {\n return this.renderer._lastObjectRendered || this._tempDisplayObject;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Hit tests a point against the display tree, returning the first interactive object that is hit.\n * @param globalPoint - A point to hit test with, in global space.\n * @param root - The root display object to start from. If omitted, defaults\n * to the last rendered root of the associated renderer.\n * @returns - The hit display object, if any.\n */\n InteractionManager.prototype.hitTest = function (globalPoint, root) {\n // clear the target for our hit test\n hitTestEvent.target = null;\n // assign the global point\n hitTestEvent.data.global = globalPoint;\n // ensure safety of the root\n if (!root) {\n root = this.lastObjectRendered;\n }\n // run the hit test\n this.processInteractive(hitTestEvent, root, null, true);\n // return our found object - it'll be null if we didn't hit anything\n return hitTestEvent.target;\n };\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to delegate\n * another DOM element to receive those events.\n * @param element - the DOM element which will receive mouse and touch events.\n * @param resolution - The resolution / device pixel ratio of the new element (relative to the canvas).\n */\n InteractionManager.prototype.setTargetElement = function (element, resolution) {\n if (resolution === void 0) { resolution = 1; }\n this.removeTickerListener();\n this.removeEvents();\n this.interactionDOMElement = element;\n this.resolution = resolution;\n this.addEvents();\n this.addTickerListener();\n };\n /** Adds the ticker listener. */\n InteractionManager.prototype.addTickerListener = function () {\n if (this.tickerAdded || !this.interactionDOMElement || !this._useSystemTicker) {\n return;\n }\n Ticker.system.add(this.tickerUpdate, this, UPDATE_PRIORITY.INTERACTION);\n this.tickerAdded = true;\n };\n /** Removes the ticker listener. */\n InteractionManager.prototype.removeTickerListener = function () {\n if (!this.tickerAdded) {\n return;\n }\n Ticker.system.remove(this.tickerUpdate, this);\n this.tickerAdded = false;\n };\n /** Registers all the DOM events. */\n InteractionManager.prototype.addEvents = function () {\n if (this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (globalThis.navigator.msPointerEnabled) {\n style.msContentZooming = 'none';\n style.msTouchAction = 'none';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = 'none';\n }\n /*\n * These events are added first, so that if pointer events are normalized, they are fired\n * in the same order as non-normalized events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents) {\n globalThis.document.addEventListener('pointermove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, this._eventListenerOptions);\n // pointerout is fired in addition to pointerup (for touch events) and pointercancel\n // we already handle those, so for the purposes of what we do in onPointerOut, we only\n // care about the pointerleave event\n this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, this._eventListenerOptions);\n globalThis.addEventListener('pointercancel', this.onPointerCancel, this._eventListenerOptions);\n globalThis.addEventListener('pointerup', this.onPointerUp, this._eventListenerOptions);\n }\n else {\n globalThis.document.addEventListener('mousemove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, this._eventListenerOptions);\n globalThis.addEventListener('mouseup', this.onPointerUp, this._eventListenerOptions);\n }\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, this._eventListenerOptions);\n }\n this.eventsAdded = true;\n };\n /** Removes all the DOM events that were previously registered. */\n InteractionManager.prototype.removeEvents = function () {\n if (!this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (globalThis.navigator.msPointerEnabled) {\n style.msContentZooming = '';\n style.msTouchAction = '';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = '';\n }\n if (this.supportsPointerEvents) {\n globalThis.document.removeEventListener('pointermove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, this._eventListenerOptions);\n globalThis.removeEventListener('pointercancel', this.onPointerCancel, this._eventListenerOptions);\n globalThis.removeEventListener('pointerup', this.onPointerUp, this._eventListenerOptions);\n }\n else {\n globalThis.document.removeEventListener('mousemove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, this._eventListenerOptions);\n globalThis.removeEventListener('mouseup', this.onPointerUp, this._eventListenerOptions);\n }\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, this._eventListenerOptions);\n }\n this.interactionDOMElement = null;\n this.eventsAdded = false;\n };\n /**\n * Updates the state of interactive objects if at least {@link interactionFrequency}\n * milliseconds have passed since the last invocation.\n *\n * Invoked by a throttled ticker update from {@link PIXI.Ticker.system}.\n * @param deltaTime - time delta since the last call\n */\n InteractionManager.prototype.tickerUpdate = function (deltaTime) {\n this._deltaTime += deltaTime;\n if (this._deltaTime < this.interactionFrequency) {\n return;\n }\n this._deltaTime = 0;\n this.update();\n };\n /** Updates the state of interactive objects. */\n InteractionManager.prototype.update = function () {\n if (!this.interactionDOMElement) {\n return;\n }\n // if the user move the mouse this check has already been done using the mouse move!\n if (this._didMove) {\n this._didMove = false;\n return;\n }\n this.cursor = null;\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n for (var k in this.activeInteractionData) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.activeInteractionData.hasOwnProperty(k)) {\n var interactionData = this.activeInteractionData[k];\n if (interactionData.originalEvent && interactionData.pointerType !== 'touch') {\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, interactionData.originalEvent, interactionData);\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, true);\n }\n }\n }\n this.setCursorMode(this.cursor);\n };\n /**\n * Sets the current cursor mode, handling any callbacks or CSS style changes.\n * @param mode - cursor mode, a key from the cursorStyles dictionary\n */\n InteractionManager.prototype.setCursorMode = function (mode) {\n mode = mode || 'default';\n var applyStyles = true;\n // offscreen canvas does not support setting styles, but cursor modes can be functions,\n // in order to handle pixi rendered cursors, so we can't bail\n if (globalThis.OffscreenCanvas && this.interactionDOMElement instanceof OffscreenCanvas) {\n applyStyles = false;\n }\n // if the mode didn't actually change, bail early\n if (this.currentCursorMode === mode) {\n return;\n }\n this.currentCursorMode = mode;\n var style = this.cursorStyles[mode];\n // only do things if there is a cursor style for it\n if (style) {\n switch (typeof style) {\n case 'string':\n // string styles are handled as cursor CSS\n if (applyStyles) {\n this.interactionDOMElement.style.cursor = style;\n }\n break;\n case 'function':\n // functions are just called, and passed the cursor mode\n style(mode);\n break;\n case 'object':\n // if it is an object, assume that it is a dictionary of CSS styles,\n // apply it to the interactionDOMElement\n if (applyStyles) {\n Object.assign(this.interactionDOMElement.style, style);\n }\n break;\n }\n }\n else if (applyStyles && typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) {\n // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry\n // for the mode, then assume that the dev wants it to be CSS for the cursor.\n this.interactionDOMElement.style.cursor = mode;\n }\n };\n /**\n * Dispatches an event on the display object that was interacted with.\n * @param displayObject - the display object in question\n * @param eventString - the name of the event (e.g, mousedown)\n * @param eventData - the event data object\n */\n InteractionManager.prototype.dispatchEvent = function (displayObject, eventString, eventData) {\n // Even if the event was stopped, at least dispatch any remaining events\n // for the same display object.\n if (!eventData.stopPropagationHint || displayObject === eventData.stopsPropagatingAt) {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n displayObject.emit(eventString, eventData);\n if (displayObject[eventString]) {\n displayObject[eventString](eventData);\n }\n }\n };\n /**\n * Puts a event on a queue to be dispatched later. This is used to guarantee correct\n * ordering of over/out events.\n * @param displayObject - the display object in question\n * @param eventString - the name of the event (e.g, mousedown)\n * @param eventData - the event data object\n */\n InteractionManager.prototype.delayDispatchEvent = function (displayObject, eventString, eventData) {\n this.delayedEvents.push({ displayObject: displayObject, eventString: eventString, eventData: eventData });\n };\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n * @param point - the point that the result will be stored in\n * @param x - the x coord of the position to map\n * @param y - the y coord of the position to map\n */\n InteractionManager.prototype.mapPositionToPoint = function (point, x, y) {\n var rect;\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement) {\n rect = {\n x: 0,\n y: 0,\n width: this.interactionDOMElement.width,\n height: this.interactionDOMElement.height,\n left: 0,\n top: 0\n };\n }\n else {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n var resolutionMultiplier = 1.0 / this.resolution;\n point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) * resolutionMultiplier;\n point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) * resolutionMultiplier;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n * @protected\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - indicates whether we want to calculate hits\n * or just iterate through all interactive objects\n */\n InteractionManager.prototype.processInteractive = function (interactionEvent, displayObject, func, hitTest) {\n var hit = this.search.findHit(interactionEvent, displayObject, func, hitTest);\n var delayedEvents = this.delayedEvents;\n if (!delayedEvents.length) {\n return hit;\n }\n // Reset the propagation hint, because we start deeper in the tree again.\n interactionEvent.stopPropagationHint = false;\n var delayedLen = delayedEvents.length;\n this.delayedEvents = [];\n for (var i = 0; i < delayedLen; i++) {\n var _a = delayedEvents[i], displayObject_1 = _a.displayObject, eventString = _a.eventString, eventData = _a.eventData;\n // When we reach the object we wanted to stop propagating at,\n // set the propagation hint.\n if (eventData.stopsPropagatingAt === displayObject_1) {\n eventData.stopPropagationHint = true;\n }\n this.dispatchEvent(displayObject_1, eventString, eventData);\n }\n return hit;\n };\n /**\n * Is called when the pointer button is pressed down on the renderer element\n * @param originalEvent - The DOM event of a pointer button being pressed down\n */\n InteractionManager.prototype.onPointerDown = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n /*\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n // Guaranteed that there will be at least one event in events, and all events must have the same pointer type\n if (this.autoPreventDefault && events[0].isNormalized) {\n var cancelable = originalEvent.cancelable || !('cancelable' in originalEvent);\n if (cancelable) {\n originalEvent.preventDefault();\n }\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerDown, true);\n this.emit('pointerdown', interactionEvent);\n if (event.pointerType === 'touch') {\n this.emit('touchstart', interactionEvent);\n }\n // emit a mouse event for \"pen\" pointers, the way a browser would emit a fallback event\n else if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n }\n };\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerDown = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (hit) {\n if (!displayObject.trackedPointers[id]) {\n displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n this.dispatchEvent(displayObject, 'pointerdown', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchstart', interactionEvent);\n }\n else if (data.pointerType === 'mouse' || data.pointerType === 'pen') {\n var isRightButton = data.button === 2;\n if (isRightButton) {\n displayObject.trackedPointers[id].rightDown = true;\n }\n else {\n displayObject.trackedPointers[id].leftDown = true;\n }\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n * @param originalEvent - The DOM event of a pointer button being released\n * @param cancelled - true if the pointer is cancelled\n * @param func - Function passed to {@link processInteractive}\n */\n InteractionManager.prototype.onPointerComplete = function (originalEvent, cancelled, func) {\n var events = this.normalizeToPointerData(originalEvent);\n var eventLen = events.length;\n // if the event wasn't targeting our canvas, then consider it to be pointerupoutside\n // in all cases (unless it was a pointercancel)\n var target = originalEvent.target;\n // if in shadow DOM use composedPath to access target\n if (originalEvent.composedPath && originalEvent.composedPath().length > 0) {\n target = originalEvent.composedPath()[0];\n }\n var eventAppend = target !== this.interactionDOMElement ? 'outside' : '';\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n // perform hit testing for events targeting our canvas or cancel events\n this.processInteractive(interactionEvent, this.lastObjectRendered, func, cancelled || !eventAppend);\n this.emit(cancelled ? 'pointercancel' : \"pointerup\" + eventAppend, interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? \"rightup\" + eventAppend : \"mouseup\" + eventAppend, interactionEvent);\n }\n else if (event.pointerType === 'touch') {\n this.emit(cancelled ? 'touchcancel' : \"touchend\" + eventAppend, interactionEvent);\n this.releaseInteractionDataForPointerId(event.pointerId);\n }\n }\n };\n /**\n * Is called when the pointer button is cancelled\n * @param event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerCancel = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, true, this.processPointerCancel);\n };\n /**\n * Processes the result of the pointer cancel check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n */\n InteractionManager.prototype.processPointerCancel = function (interactionEvent, displayObject) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (displayObject.trackedPointers[id] !== undefined) {\n delete displayObject.trackedPointers[id];\n this.dispatchEvent(displayObject, 'pointercancel', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchcancel', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n * @param event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerUp = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, false, this.processPointerUp);\n };\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerUp = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var trackingData = displayObject.trackedPointers[id];\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n // need to track mouse down status in the mouse block so that we can emit\n // event in a later block\n var isMouseTap = false;\n // Mouse only\n if (isMouse) {\n var isRightButton = data.button === 2;\n var flags = InteractionTrackingData.FLAGS;\n var test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN;\n var isDown = trackingData !== undefined && (trackingData.flags & test);\n if (hit) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent);\n if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent);\n // because we can confirm that the mousedown happened on this object, flag for later emit of pointertap\n isMouseTap = true;\n }\n }\n else if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent);\n }\n // update the down state of the tracking data\n if (trackingData) {\n if (isRightButton) {\n trackingData.rightDown = false;\n }\n else {\n trackingData.leftDown = false;\n }\n }\n }\n // Pointers and Touches, and Mouse\n if (hit) {\n this.dispatchEvent(displayObject, 'pointerup', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchend', interactionEvent); }\n if (trackingData) {\n // emit pointertap if not a mouse, or if the mouse block decided it was a tap\n if (!isMouse || isMouseTap) {\n this.dispatchEvent(displayObject, 'pointertap', interactionEvent);\n }\n if (isTouch) {\n this.dispatchEvent(displayObject, 'tap', interactionEvent);\n // touches are no longer over (if they ever were) when we get the touchend\n // so we should ensure that we don't keep pretending that they are\n trackingData.over = false;\n }\n }\n }\n else if (trackingData) {\n this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent); }\n }\n // Only remove the tracking data if there is no over/down state still associated with it\n if (trackingData && trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n };\n /**\n * Is called when the pointer moves across the renderer element\n * @param originalEvent - The DOM event of a pointer moving\n */\n InteractionManager.prototype.onPointerMove = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n if (events[0].pointerType === 'mouse' || events[0].pointerType === 'pen') {\n this._didMove = true;\n this.cursor = null;\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerMove, true);\n this.emit('pointermove', interactionEvent);\n if (event.pointerType === 'touch')\n { this.emit('touchmove', interactionEvent); }\n if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n { this.emit('mousemove', interactionEvent); }\n }\n if (events[0].pointerType === 'mouse') {\n this.setCursorMode(this.cursor);\n // TODO BUG for parents interactive object (border order issue)\n }\n };\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerMove = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n if (isMouse) {\n this.processPointerOverOut(interactionEvent, displayObject, hit);\n }\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'pointermove', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchmove', interactionEvent); }\n if (isMouse)\n { this.dispatchEvent(displayObject, 'mousemove', interactionEvent); }\n }\n };\n /**\n * Is called when the pointer is moved out of the renderer element\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out\n */\n InteractionManager.prototype.onPointerOut = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOut, so events will always be length 1\n var event = events[0];\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = false;\n this.setCursorMode(null);\n }\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, false);\n this.emit('pointerout', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseout', interactionEvent);\n }\n else {\n // we can get touchleave events after touchend, so we want to make sure we don't\n // introduce memory leaks\n this.releaseInteractionDataForPointerId(interactionData.identifier);\n }\n };\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be.\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerOverOut = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n var trackingData = displayObject.trackedPointers[id];\n // if we just moused over the display object, then we need to track that state\n if (hit && !trackingData) {\n trackingData = displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n if (trackingData === undefined)\n { return; }\n if (hit && this.mouseOverRenderer) {\n if (!trackingData.over) {\n trackingData.over = true;\n this.delayDispatchEvent(displayObject, 'pointerover', interactionEvent);\n if (isMouse) {\n this.delayDispatchEvent(displayObject, 'mouseover', interactionEvent);\n }\n }\n // only change the cursor if it has not already been changed (by something deeper in the\n // display tree)\n if (isMouse && this.cursor === null) {\n this.cursor = displayObject.cursor;\n }\n }\n else if (trackingData.over) {\n trackingData.over = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseout', interactionEvent);\n }\n // if there is no mouse down information for the pointer, then it is safe to delete\n if (trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n }\n };\n /**\n * Is called when the pointer is moved into the renderer element.\n * @param originalEvent - The DOM event of a pointer button being moved into the renderer view.\n */\n InteractionManager.prototype.onPointerOver = function (originalEvent) {\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOver, so events will always be length 1\n var event = events[0];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = true;\n }\n this.emit('pointerover', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseover', interactionEvent);\n }\n };\n /**\n * Get InteractionData for a given pointerId. Store that data as well.\n * @param event - Normalized pointer event, output from normalizeToPointerData.\n * @returns - Interaction data for the given pointer identifier.\n */\n InteractionManager.prototype.getInteractionDataForPointerId = function (event) {\n var pointerId = event.pointerId;\n var interactionData;\n if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse') {\n interactionData = this.mouse;\n }\n else if (this.activeInteractionData[pointerId]) {\n interactionData = this.activeInteractionData[pointerId];\n }\n else {\n interactionData = this.interactionDataPool.pop() || new InteractionData();\n interactionData.identifier = pointerId;\n this.activeInteractionData[pointerId] = interactionData;\n }\n // copy properties from the event, so that we can make sure that touch/pointer specific\n // data is available\n interactionData.copyEvent(event);\n return interactionData;\n };\n /**\n * Return unused InteractionData to the pool, for a given pointerId\n * @param pointerId - Identifier from a pointer event\n */\n InteractionManager.prototype.releaseInteractionDataForPointerId = function (pointerId) {\n var interactionData = this.activeInteractionData[pointerId];\n if (interactionData) {\n delete this.activeInteractionData[pointerId];\n interactionData.reset();\n this.interactionDataPool.push(interactionData);\n }\n };\n /**\n * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData\n * @param interactionEvent - The event to be configured\n * @param pointerEvent - The DOM event that will be paired with the InteractionEvent\n * @param interactionData - The InteractionData that will be paired\n * with the InteractionEvent\n * @returns - the interaction event that was passed in\n */\n InteractionManager.prototype.configureInteractionEventForDOMEvent = function (interactionEvent, pointerEvent, interactionData) {\n interactionEvent.data = interactionData;\n this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY);\n // Not really sure why this is happening, but it's how a previous version handled things\n if (pointerEvent.pointerType === 'touch') {\n pointerEvent.globalX = interactionData.global.x;\n pointerEvent.globalY = interactionData.global.y;\n }\n interactionData.originalEvent = pointerEvent;\n interactionEvent.reset();\n return interactionEvent;\n };\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event\n * @returns - An array containing a single normalized pointer event, in the case of a pointer\n * or mouse event, or a multiple normalized pointer events if there are multiple changed touches\n */\n InteractionManager.prototype.normalizeToPointerData = function (event) {\n var normalizedEvents = [];\n if (this.supportsTouchEvents && event instanceof TouchEvent) {\n for (var i = 0, li = event.changedTouches.length; i < li; i++) {\n var touch = event.changedTouches[i];\n if (typeof touch.button === 'undefined')\n { touch.button = event.touches.length ? 1 : 0; }\n if (typeof touch.buttons === 'undefined')\n { touch.buttons = event.touches.length ? 1 : 0; }\n if (typeof touch.isPrimary === 'undefined') {\n touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';\n }\n if (typeof touch.width === 'undefined')\n { touch.width = touch.radiusX || 1; }\n if (typeof touch.height === 'undefined')\n { touch.height = touch.radiusY || 1; }\n if (typeof touch.tiltX === 'undefined')\n { touch.tiltX = 0; }\n if (typeof touch.tiltY === 'undefined')\n { touch.tiltY = 0; }\n if (typeof touch.pointerType === 'undefined')\n { touch.pointerType = 'touch'; }\n if (typeof touch.pointerId === 'undefined')\n { touch.pointerId = touch.identifier || 0; }\n if (typeof touch.pressure === 'undefined')\n { touch.pressure = touch.force || 0.5; }\n if (typeof touch.twist === 'undefined')\n { touch.twist = 0; }\n if (typeof touch.tangentialPressure === 'undefined')\n { touch.tangentialPressure = 0; }\n // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven\n // support, and the fill ins are not quite the same\n // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top\n // left is not 0,0 on the page\n if (typeof touch.layerX === 'undefined')\n { touch.layerX = touch.offsetX = touch.clientX; }\n if (typeof touch.layerY === 'undefined')\n { touch.layerY = touch.offsetY = touch.clientY; }\n // mark the touch as normalized, just so that we know we did it\n touch.isNormalized = true;\n normalizedEvents.push(touch);\n }\n }\n // apparently PointerEvent subclasses MouseEvent, so yay\n else if (!globalThis.MouseEvent\n || (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof globalThis.PointerEvent)))) {\n var tempEvent = event;\n if (typeof tempEvent.isPrimary === 'undefined')\n { tempEvent.isPrimary = true; }\n if (typeof tempEvent.width === 'undefined')\n { tempEvent.width = 1; }\n if (typeof tempEvent.height === 'undefined')\n { tempEvent.height = 1; }\n if (typeof tempEvent.tiltX === 'undefined')\n { tempEvent.tiltX = 0; }\n if (typeof tempEvent.tiltY === 'undefined')\n { tempEvent.tiltY = 0; }\n if (typeof tempEvent.pointerType === 'undefined')\n { tempEvent.pointerType = 'mouse'; }\n if (typeof tempEvent.pointerId === 'undefined')\n { tempEvent.pointerId = MOUSE_POINTER_ID; }\n if (typeof tempEvent.pressure === 'undefined')\n { tempEvent.pressure = 0.5; }\n if (typeof tempEvent.twist === 'undefined')\n { tempEvent.twist = 0; }\n if (typeof tempEvent.tangentialPressure === 'undefined')\n { tempEvent.tangentialPressure = 0; }\n // mark the mouse event as normalized, just so that we know we did it\n tempEvent.isNormalized = true;\n normalizedEvents.push(tempEvent);\n }\n else {\n normalizedEvents.push(event);\n }\n return normalizedEvents;\n };\n /** Destroys the interaction manager. */\n InteractionManager.prototype.destroy = function () {\n this.removeEvents();\n this.removeTickerListener();\n this.removeAllListeners();\n this.renderer = null;\n this.mouse = null;\n this.eventData = null;\n this.interactionDOMElement = null;\n this.onPointerDown = null;\n this.processPointerDown = null;\n this.onPointerUp = null;\n this.processPointerUp = null;\n this.onPointerCancel = null;\n this.processPointerCancel = null;\n this.onPointerMove = null;\n this.processPointerMove = null;\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n this.onPointerOver = null;\n this.search = null;\n };\n /** @ignore */\n InteractionManager.extension = {\n name: 'interaction',\n type: [\n ExtensionType.RendererPlugin,\n ExtensionType.CanvasRendererPlugin ],\n };\n return InteractionManager;\n}(EventEmitter));\n\nexport { InteractionData, InteractionEvent, InteractionManager, InteractionTrackingData, interactiveTarget };\n//# sourceMappingURL=interaction.mjs.map\n","/*!\n * @pixi/extract - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/extract is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { MSAA_QUALITY } from '@pixi/constants';\nimport { CanvasRenderTarget } from '@pixi/utils';\nimport { Rectangle } from '@pixi/math';\nimport { ExtensionType, RenderTexture } from '@pixi/core';\n\nvar TEMP_RECT = new Rectangle();\nvar BYTES_PER_PIXEL = 4;\n/**\n * This class provides renderer-specific plugins for exporting content from a renderer.\n * For instance, these plugins can be used for saving an Image, Canvas element or for exporting the raw image data (pixels).\n *\n * Do not instantiate these plugins directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new app (will auto-add extract plugin to renderer)\n * const app = new PIXI.Application();\n *\n * // Draw a red circle\n * const graphics = new PIXI.Graphics()\n * .beginFill(0xFF0000)\n * .drawCircle(0, 0, 50);\n *\n * // Render the graphics as an HTMLImageElement\n * const image = app.renderer.plugins.extract.image(graphics);\n * document.body.appendChild(image);\n * @memberof PIXI\n */\nvar Extract = /** @class */ (function () {\n /**\n * @param renderer - A reference to the current renderer\n */\n function Extract(renderer) {\n this.renderer = renderer;\n }\n /**\n * Will return a HTML Image of the target\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param format - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @returns - HTML Image of the target\n */\n Extract.prototype.image = function (target, format, quality) {\n var image = new Image();\n image.src = this.base64(target, format, quality);\n return image;\n };\n /**\n * Will return a base64 encoded string of this target. It works by calling\n * `Extract.getCanvas` and then running toDataURL on that.\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param format - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @returns - A base64 encoded string of the texture.\n */\n Extract.prototype.base64 = function (target, format, quality) {\n return this.canvas(target).toDataURL(format, quality);\n };\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param frame - The frame the extraction is restricted to.\n * @returns - A Canvas element with the texture rendered on.\n */\n Extract.prototype.canvas = function (target, frame) {\n var _a = this._rawPixels(target, frame), pixels = _a.pixels, width = _a.width, height = _a.height, flipY = _a.flipY;\n var canvasBuffer = new CanvasRenderTarget(width, height, 1);\n // Add the pixels to the canvas\n var canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n Extract.arrayPostDivide(pixels, canvasData.data);\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n // Flipping pixels\n if (flipY) {\n var target_1 = new CanvasRenderTarget(canvasBuffer.width, canvasBuffer.height, 1);\n target_1.context.scale(1, -1);\n // We can't render to itself because we should be empty before render.\n target_1.context.drawImage(canvasBuffer.canvas, 0, -height);\n canvasBuffer.destroy();\n canvasBuffer = target_1;\n }\n // Send the canvas back\n return canvasBuffer.canvas;\n };\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param frame - The frame the extraction is restricted to.\n * @returns - One-dimensional array containing the pixel data of the entire texture\n */\n Extract.prototype.pixels = function (target, frame) {\n var pixels = this._rawPixels(target, frame).pixels;\n Extract.arrayPostDivide(pixels, pixels);\n return pixels;\n };\n Extract.prototype._rawPixels = function (target, frame) {\n var renderer = this.renderer;\n var resolution;\n var flipY = false;\n var renderTexture;\n var generated = false;\n if (target) {\n if (target instanceof RenderTexture) {\n renderTexture = target;\n }\n else {\n var multisample = renderer.context.webGLVersion >= 2 ? renderer.multisample : MSAA_QUALITY.NONE;\n renderTexture = this.renderer.generateTexture(target, { multisample: multisample });\n if (multisample !== MSAA_QUALITY.NONE) {\n // Resolve the multisampled texture to a non-multisampled texture\n var resolvedTexture = RenderTexture.create({\n width: renderTexture.width,\n height: renderTexture.height,\n });\n renderer.framebuffer.bind(renderTexture.framebuffer);\n renderer.framebuffer.blit(resolvedTexture.framebuffer);\n renderer.framebuffer.bind(null);\n renderTexture.destroy(true);\n renderTexture = resolvedTexture;\n }\n generated = true;\n }\n }\n if (renderTexture) {\n resolution = renderTexture.baseTexture.resolution;\n frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame;\n flipY = false;\n renderer.renderTexture.bind(renderTexture);\n }\n else {\n resolution = renderer.resolution;\n if (!frame) {\n frame = TEMP_RECT;\n frame.width = renderer.width;\n frame.height = renderer.height;\n }\n flipY = true;\n renderer.renderTexture.bind(null);\n }\n var width = Math.round(frame.width * resolution);\n var height = Math.round(frame.height * resolution);\n var pixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n // Read pixels to the array\n var gl = renderer.gl;\n gl.readPixels(Math.round(frame.x * resolution), Math.round(frame.y * resolution), width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);\n if (generated) {\n renderTexture.destroy(true);\n }\n return { pixels: pixels, width: width, height: height, flipY: flipY };\n };\n /** Destroys the extract. */\n Extract.prototype.destroy = function () {\n this.renderer = null;\n };\n /**\n * Takes premultiplied pixel data and produces regular pixel data\n * @private\n * @param pixels - array of pixel data\n * @param out - output array\n */\n Extract.arrayPostDivide = function (pixels, out) {\n for (var i = 0; i < pixels.length; i += 4) {\n var alpha = out[i + 3] = pixels[i + 3];\n if (alpha !== 0) {\n out[i] = Math.round(Math.min(pixels[i] * 255.0 / alpha, 255.0));\n out[i + 1] = Math.round(Math.min(pixels[i + 1] * 255.0 / alpha, 255.0));\n out[i + 2] = Math.round(Math.min(pixels[i + 2] * 255.0 / alpha, 255.0));\n }\n else {\n out[i] = pixels[i];\n out[i + 1] = pixels[i + 1];\n out[i + 2] = pixels[i + 2];\n }\n }\n };\n /** @ignore */\n Extract.extension = {\n name: 'extract',\n type: ExtensionType.RendererPlugin,\n };\n return Extract;\n}());\n\nexport { Extract };\n//# sourceMappingURL=extract.mjs.map\n","/*!\n * @pixi/loaders - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/loaders is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { extensions, ExtensionType, Texture } from '@pixi/core';\nimport { deprecation } from '@pixi/utils';\n\n/* jshint -W097 */\n/**\n * @memberof PIXI\n */\nvar SignalBinding = /** @class */ (function () {\n /**\n * SignalBinding constructor.\n * @constructs SignalBinding\n * @param {Function} fn - Event handler to be called.\n * @param {boolean} [once=false] - Should this listener be removed after dispatch\n * @param {object} [thisArg] - The context of the callback function.\n * @api private\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n function SignalBinding(fn, once, thisArg) {\n if (once === void 0) { once = false; }\n this._fn = fn;\n this._once = once;\n this._thisArg = thisArg;\n this._next = this._prev = this._owner = null;\n }\n SignalBinding.prototype.detach = function () {\n if (this._owner === null)\n { return false; }\n this._owner.detach(this);\n return true;\n };\n return SignalBinding;\n}());\n/**\n * @param self\n * @param node\n * @private\n */\nfunction _addSignalBinding(self, node) {\n if (!self._head) {\n self._head = node;\n self._tail = node;\n }\n else {\n self._tail._next = node;\n node._prev = self._tail;\n self._tail = node;\n }\n node._owner = self;\n return node;\n}\n/**\n * @memberof PIXI\n */\nvar Signal = /** @class */ (function () {\n /**\n * MiniSignal constructor.\n * @example\n * let mySignal = new Signal();\n * let binding = mySignal.add(onSignal);\n * mySignal.dispatch('foo', 'bar');\n * mySignal.detach(binding);\n */\n function Signal() {\n this._head = this._tail = undefined;\n }\n /**\n * Return an array of attached SignalBinding.\n * @param {boolean} [exists=false] - We only need to know if there are handlers.\n * @returns {PIXI.SignalBinding[] | boolean} Array of attached SignalBinding or Boolean if called with exists = true\n * @api public\n */\n Signal.prototype.handlers = function (exists) {\n if (exists === void 0) { exists = false; }\n var node = this._head;\n if (exists)\n { return !!node; }\n var ee = [];\n while (node) {\n ee.push(node);\n node = node._next;\n }\n return ee;\n };\n /**\n * Return true if node is a SignalBinding attached to this MiniSignal\n * @param {PIXI.SignalBinding} node - Node to check.\n * @returns {boolean} True if node is attache to mini-signal\n */\n Signal.prototype.has = function (node) {\n if (!(node instanceof SignalBinding)) {\n throw new Error('MiniSignal#has(): First arg must be a SignalBinding object.');\n }\n return node._owner === this;\n };\n /**\n * Dispaches a signal to all registered listeners.\n * @param {...any} args\n * @returns {boolean} Indication if we've emitted an event.\n */\n Signal.prototype.dispatch = function () {\n var arguments$1 = arguments;\n\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n var node = this._head;\n if (!node)\n { return false; }\n while (node) {\n if (node._once)\n { this.detach(node); }\n node._fn.apply(node._thisArg, args);\n node = node._next;\n }\n return true;\n };\n /**\n * Register a new listener.\n * @param {Function} fn - Callback function.\n * @param {object} [thisArg] - The context of the callback function.\n * @returns {PIXI.SignalBinding} The SignalBinding node that was added.\n */\n Signal.prototype.add = function (fn, thisArg) {\n if (thisArg === void 0) { thisArg = null; }\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#add(): First arg must be a Function.');\n }\n return _addSignalBinding(this, new SignalBinding(fn, false, thisArg));\n };\n /**\n * Register a new listener that will be executed only once.\n * @param {Function} fn - Callback function.\n * @param {object} [thisArg] - The context of the callback function.\n * @returns {PIXI.SignalBinding} The SignalBinding node that was added.\n */\n Signal.prototype.once = function (fn, thisArg) {\n if (thisArg === void 0) { thisArg = null; }\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#once(): First arg must be a Function.');\n }\n return _addSignalBinding(this, new SignalBinding(fn, true, thisArg));\n };\n /**\n * Remove binding object.\n * @param {PIXI.SignalBinding} node - The binding node that will be removed.\n * @returns {Signal} The instance on which this method was called.\n @api public */\n Signal.prototype.detach = function (node) {\n if (!(node instanceof SignalBinding)) {\n throw new Error('MiniSignal#detach(): First arg must be a SignalBinding object.');\n }\n if (node._owner !== this)\n { return this; } // todo: or error?\n if (node._prev)\n { node._prev._next = node._next; }\n if (node._next)\n { node._next._prev = node._prev; }\n if (node === this._head) { // first node\n this._head = node._next;\n if (node._next === null) {\n this._tail = null;\n }\n }\n else if (node === this._tail) { // last node\n this._tail = node._prev;\n this._tail._next = null;\n }\n node._owner = null;\n return this;\n };\n /**\n * Detach all listeners.\n * @returns {Signal} The instance on which this method was called.\n */\n Signal.prototype.detachAll = function () {\n var node = this._head;\n if (!node)\n { return this; }\n this._head = this._tail = null;\n while (node) {\n node._owner = null;\n node = node._next;\n }\n return this;\n };\n return Signal;\n}());\n\n/**\n * function from npm package `parseUri`, converted to TS to avoid leftpad incident\n * @param {string} str\n * @param [opts] - options\n * @param {boolean} [opts.strictMode] - type of parser\n */\nfunction parseUri(str, opts) {\n opts = opts || {};\n var o = {\n // eslint-disable-next-line max-len\n key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n // eslint-disable-next-line max-len\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n // eslint-disable-next-line max-len\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n };\n var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n var i = 14;\n while (i--)\n { uri[o.key[i]] = m[i] || ''; }\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function (_t0, t1, t2) {\n if (t1)\n { uri[o.q.name][t1] = t2; }\n });\n return uri;\n}\n\n// tests if CORS is supported in XHR, if not we need to use XDR\nvar useXdr;\nvar tempAnchor = null;\n// some status constants\nvar STATUS_NONE = 0;\nvar STATUS_OK = 200;\nvar STATUS_EMPTY = 204;\nvar STATUS_IE_BUG_EMPTY = 1223;\nvar STATUS_TYPE_OK = 2;\n// noop\nfunction _noop$1() { }\n/**\n * Quick helper to set a value on one of the extension maps. Ensures there is no\n * dot at the start of the extension.\n * @ignore\n * @param map - The map to set on.\n * @param extname - The extension (or key) to set.\n * @param val - The value to set.\n */\nfunction setExtMap(map, extname, val) {\n if (extname && extname.indexOf('.') === 0) {\n extname = extname.substring(1);\n }\n if (!extname) {\n return;\n }\n map[extname] = val;\n}\n/**\n * Quick helper to get string xhr type.\n * @ignore\n * @param xhr - The request to check.\n * @returns The type.\n */\nfunction reqType(xhr) {\n return xhr.toString().replace('object ', '');\n}\n/**\n * Manages the state and loading of a resource and all child resources.\n *\n * Can be extended in `GlobalMixins.LoaderResource`.\n * @memberof PIXI\n */\nvar LoaderResource = /** @class */ (function () {\n /**\n * @param {string} name - The name of the resource to load.\n * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass\n * an array of sources.\n * @param {object} [options] - The options for the load.\n * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @param {number} [options.timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @param {PIXI.LoaderResource.LOAD_TYPE} [options.loadType=LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @param {PIXI.LoaderResource.XHR_RESPONSE_TYPE} [options.xhrType=XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @param {PIXI.LoaderResource.IMetadata} [options.metadata] - Extra configuration for middleware\n * and the Resource object.\n */\n function LoaderResource(name, url, options) {\n /**\n * The `dequeue` method that will be used a storage place for the async queue dequeue method\n * used privately by the loader.\n * @private\n * @member {Function}\n */\n this._dequeue = _noop$1;\n /**\n * Used a storage place for the on load binding used privately by the loader.\n * @private\n * @member {Function}\n */\n this._onLoadBinding = null;\n /**\n * The timer for element loads to check if they timeout.\n * @private\n */\n this._elementTimer = 0;\n /**\n * The `complete` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundComplete = null;\n /**\n * The `_onError` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundOnError = null;\n /**\n * The `_onProgress` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundOnProgress = null;\n /**\n * The `_onTimeout` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundOnTimeout = null;\n this._boundXhrOnError = null;\n this._boundXhrOnTimeout = null;\n this._boundXhrOnAbort = null;\n this._boundXhrOnLoad = null;\n if (typeof name !== 'string' || typeof url !== 'string') {\n throw new Error('Both name and url are required for constructing a resource.');\n }\n options = options || {};\n this._flags = 0;\n // set data url flag, needs to be set early for some _determineX checks to work.\n this._setFlag(LoaderResource.STATUS_FLAGS.DATA_URL, url.indexOf('data:') === 0);\n this.name = name;\n this.url = url;\n this.extension = this._getExtension();\n this.data = null;\n this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin;\n this.timeout = options.timeout || 0;\n this.loadType = options.loadType || this._determineLoadType();\n // The type used to load the resource via XHR. If unset, determined automatically.\n this.xhrType = options.xhrType;\n // Extra info for middleware, and controlling specifics about how the resource loads.\n // Note that if you pass in a `loadElement`, the Resource class takes ownership of it.\n // Meaning it will modify it as it sees fit.\n this.metadata = options.metadata || {};\n // The error that occurred while loading (if any).\n this.error = null;\n // The XHR object that was used to load this resource. This is only set\n // when `loadType` is `LoaderResource.LOAD_TYPE.XHR`.\n this.xhr = null;\n // The child resources this resource owns.\n this.children = [];\n // The resource type.\n this.type = LoaderResource.TYPE.UNKNOWN;\n // The progress chunk owned by this resource.\n this.progressChunk = 0;\n // The `dequeue` method that will be used a storage place for the async queue dequeue method\n // used privately by the loader.\n this._dequeue = _noop$1;\n // Used a storage place for the on load binding used privately by the loader.\n this._onLoadBinding = null;\n // The timer for element loads to check if they timeout.\n this._elementTimer = 0;\n this._boundComplete = this.complete.bind(this);\n this._boundOnError = this._onError.bind(this);\n this._boundOnProgress = this._onProgress.bind(this);\n this._boundOnTimeout = this._onTimeout.bind(this);\n // xhr callbacks\n this._boundXhrOnError = this._xhrOnError.bind(this);\n this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this);\n this._boundXhrOnAbort = this._xhrOnAbort.bind(this);\n this._boundXhrOnLoad = this._xhrOnLoad.bind(this);\n // Dispatched when the resource beings to load.\n this.onStart = new Signal();\n // Dispatched each time progress of this resource load updates.\n // Not all resources types and loader systems can support this event\n // so sometimes it may not be available. If the resource\n // is being loaded on a modern browser, using XHR, and the remote server\n // properly sets Content-Length headers, then this will be available.\n this.onProgress = new Signal();\n // Dispatched once this resource has loaded, if there was an error it will\n // be in the `error` property.\n this.onComplete = new Signal();\n // Dispatched after this resource has had all the *after* middleware run on it.\n this.onAfterMiddleware = new Signal();\n }\n /**\n * Sets the load type to be used for a specific extension.\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {PIXI.LoaderResource.LOAD_TYPE} loadType - The load type to set it to.\n */\n LoaderResource.setExtensionLoadType = function (extname, loadType) {\n setExtMap(LoaderResource._loadTypeMap, extname, loadType);\n };\n /**\n * Sets the load type to be used for a specific extension.\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {PIXI.LoaderResource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to.\n */\n LoaderResource.setExtensionXhrType = function (extname, xhrType) {\n setExtMap(LoaderResource._xhrTypeMap, extname, xhrType);\n };\n Object.defineProperty(LoaderResource.prototype, \"isDataUrl\", {\n /**\n * When the resource starts to load.\n * @memberof PIXI.LoaderResource\n * @callback OnStartSignal\n * @param {PIXI.Resource} resource - The resource that the event happened on.\n */\n /**\n * When the resource reports loading progress.\n * @memberof PIXI.LoaderResource\n * @callback OnProgressSignal\n * @param {PIXI.Resource} resource - The resource that the event happened on.\n * @param {number} percentage - The progress of the load in the range [0, 1].\n */\n /**\n * When the resource finishes loading.\n * @memberof PIXI.LoaderResource\n * @callback OnCompleteSignal\n * @param {PIXI.Resource} resource - The resource that the event happened on.\n */\n /**\n * @memberof PIXI.LoaderResource\n * @typedef {object} IMetadata\n * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @property {string|string[]} [mimeType] - The mime type to use for the source element\n * of a video/audio elment. If the urls are an array, you can pass this as an array as well\n * where each index is the mime type to use for the corresponding url index.\n */\n /**\n * Stores whether or not this url is a data url.\n * @readonly\n * @member {boolean}\n */\n get: function () {\n return this._hasFlag(LoaderResource.STATUS_FLAGS.DATA_URL);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LoaderResource.prototype, \"isComplete\", {\n /**\n * Describes if this resource has finished loading. Is true when the resource has completely\n * loaded.\n * @readonly\n * @member {boolean}\n */\n get: function () {\n return this._hasFlag(LoaderResource.STATUS_FLAGS.COMPLETE);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LoaderResource.prototype, \"isLoading\", {\n /**\n * Describes if this resource is currently loading. Is true when the resource starts loading,\n * and is false again when complete.\n * @readonly\n * @member {boolean}\n */\n get: function () {\n return this._hasFlag(LoaderResource.STATUS_FLAGS.LOADING);\n },\n enumerable: false,\n configurable: true\n });\n /** Marks the resource as complete. */\n LoaderResource.prototype.complete = function () {\n this._clearEvents();\n this._finish();\n };\n /**\n * Aborts the loading of this resource, with an optional message.\n * @param {string} message - The message to use for the error\n */\n LoaderResource.prototype.abort = function (message) {\n // abort can be called multiple times, ignore subsequent calls.\n if (this.error) {\n return;\n }\n // store error\n this.error = new Error(message);\n // clear events before calling aborts\n this._clearEvents();\n // abort the actual loading\n if (this.xhr) {\n this.xhr.abort();\n }\n else if (this.xdr) {\n this.xdr.abort();\n }\n else if (this.data) {\n // single source\n if (this.data.src) {\n this.data.src = LoaderResource.EMPTY_GIF;\n }\n // multi-source\n else {\n while (this.data.firstChild) {\n this.data.removeChild(this.data.firstChild);\n }\n }\n }\n // done now.\n this._finish();\n };\n /**\n * Kicks off loading of this resource. This method is asynchronous.\n * @param {PIXI.LoaderResource.OnCompleteSignal} [cb] - Optional callback to call once the resource is loaded.\n */\n LoaderResource.prototype.load = function (cb) {\n var _this = this;\n if (this.isLoading) {\n return;\n }\n if (this.isComplete) {\n if (cb) {\n setTimeout(function () { return cb(_this); }, 1);\n }\n return;\n }\n else if (cb) {\n this.onComplete.once(cb);\n }\n this._setFlag(LoaderResource.STATUS_FLAGS.LOADING, true);\n this.onStart.dispatch(this);\n // if unset, determine the value\n if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') {\n this.crossOrigin = this._determineCrossOrigin(this.url);\n }\n switch (this.loadType) {\n case LoaderResource.LOAD_TYPE.IMAGE:\n this.type = LoaderResource.TYPE.IMAGE;\n this._loadElement('image');\n break;\n case LoaderResource.LOAD_TYPE.AUDIO:\n this.type = LoaderResource.TYPE.AUDIO;\n this._loadSourceElement('audio');\n break;\n case LoaderResource.LOAD_TYPE.VIDEO:\n this.type = LoaderResource.TYPE.VIDEO;\n this._loadSourceElement('video');\n break;\n case LoaderResource.LOAD_TYPE.XHR:\n /* falls through */\n default:\n if (typeof useXdr === 'undefined') {\n useXdr = !!(globalThis.XDomainRequest && !('withCredentials' in (new XMLHttpRequest())));\n }\n if (useXdr && this.crossOrigin) {\n this._loadXdr();\n }\n else {\n this._loadXhr();\n }\n break;\n }\n };\n /**\n * Checks if the flag is set.\n * @param flag - The flag to check.\n * @returns True if the flag is set.\n */\n LoaderResource.prototype._hasFlag = function (flag) {\n return (this._flags & flag) !== 0;\n };\n /**\n * (Un)Sets the flag.\n * @param flag - The flag to (un)set.\n * @param value - Whether to set or (un)set the flag.\n */\n LoaderResource.prototype._setFlag = function (flag, value) {\n this._flags = value ? (this._flags | flag) : (this._flags & ~flag);\n };\n /** Clears all the events from the underlying loading source. */\n LoaderResource.prototype._clearEvents = function () {\n clearTimeout(this._elementTimer);\n if (this.data && this.data.removeEventListener) {\n this.data.removeEventListener('error', this._boundOnError, false);\n this.data.removeEventListener('load', this._boundComplete, false);\n this.data.removeEventListener('progress', this._boundOnProgress, false);\n this.data.removeEventListener('canplaythrough', this._boundComplete, false);\n }\n if (this.xhr) {\n if (this.xhr.removeEventListener) {\n this.xhr.removeEventListener('error', this._boundXhrOnError, false);\n this.xhr.removeEventListener('timeout', this._boundXhrOnTimeout, false);\n this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false);\n this.xhr.removeEventListener('progress', this._boundOnProgress, false);\n this.xhr.removeEventListener('load', this._boundXhrOnLoad, false);\n }\n else {\n this.xhr.onerror = null;\n this.xhr.ontimeout = null;\n this.xhr.onprogress = null;\n this.xhr.onload = null;\n }\n }\n };\n /** Finalizes the load. */\n LoaderResource.prototype._finish = function () {\n if (this.isComplete) {\n throw new Error('Complete called again for an already completed resource.');\n }\n this._setFlag(LoaderResource.STATUS_FLAGS.COMPLETE, true);\n this._setFlag(LoaderResource.STATUS_FLAGS.LOADING, false);\n this.onComplete.dispatch(this);\n };\n /**\n * Loads this resources using an element that has a single source,\n * like an HTMLImageElement.\n * @private\n * @param type - The type of element to use.\n */\n LoaderResource.prototype._loadElement = function (type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n }\n else if (type === 'image' && typeof globalThis.Image !== 'undefined') {\n this.data = new Image();\n }\n else {\n this.data = document.createElement(type);\n }\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n if (!this.metadata.skipSource) {\n this.data.src = this.url;\n }\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n };\n /**\n * Loads this resources using an element that has multiple sources,\n * like an HTMLAudioElement or HTMLVideoElement.\n * @param type - The type of element to use.\n */\n LoaderResource.prototype._loadSourceElement = function (type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n }\n else if (type === 'audio' && typeof globalThis.Audio !== 'undefined') {\n this.data = new Audio();\n }\n else {\n this.data = document.createElement(type);\n }\n if (this.data === null) {\n this.abort(\"Unsupported element: \" + type);\n return;\n }\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n if (!this.metadata.skipSource) {\n // support for CocoonJS Canvas+ runtime, lacks document.createElement('source')\n if (navigator.isCocoonJS) {\n this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;\n }\n else if (Array.isArray(this.url)) {\n var mimeTypes = this.metadata.mimeType;\n for (var i = 0; i < this.url.length; ++i) {\n this.data.appendChild(this._createSource(type, this.url[i], Array.isArray(mimeTypes) ? mimeTypes[i] : mimeTypes));\n }\n }\n else {\n var mimeTypes = this.metadata.mimeType;\n this.data.appendChild(this._createSource(type, this.url, Array.isArray(mimeTypes) ? mimeTypes[0] : mimeTypes));\n }\n }\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n this.data.addEventListener('canplaythrough', this._boundComplete, false);\n this.data.load();\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n };\n /** Loads this resources using an XMLHttpRequest. */\n LoaderResource.prototype._loadXhr = function () {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n var xhr = this.xhr = new XMLHttpRequest();\n // send credentials when crossOrigin with credentials requested\n if (this.crossOrigin === 'use-credentials') {\n xhr.withCredentials = true;\n }\n // set the request type and url\n xhr.open('GET', this.url, true);\n xhr.timeout = this.timeout;\n // load json as text and parse it ourselves. We do this because some browsers\n // *cough* safari *cough* can't deal with it.\n if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.JSON\n || this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT) {\n xhr.responseType = LoaderResource.XHR_RESPONSE_TYPE.TEXT;\n }\n else {\n xhr.responseType = this.xhrType;\n }\n xhr.addEventListener('error', this._boundXhrOnError, false);\n xhr.addEventListener('timeout', this._boundXhrOnTimeout, false);\n xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n xhr.addEventListener('progress', this._boundOnProgress, false);\n xhr.addEventListener('load', this._boundXhrOnLoad, false);\n xhr.send();\n };\n /** Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross). */\n LoaderResource.prototype._loadXdr = function () {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n var xdr = this.xhr = new globalThis.XDomainRequest(); // eslint-disable-line no-undef\n // XDomainRequest has a few quirks. Occasionally it will abort requests\n // A way to avoid this is to make sure ALL callbacks are set even if not used\n // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n xdr.timeout = this.timeout || 5000; // XDR needs a timeout value or it breaks in IE9\n xdr.onerror = this._boundXhrOnError;\n xdr.ontimeout = this._boundXhrOnTimeout;\n xdr.onprogress = this._boundOnProgress;\n xdr.onload = this._boundXhrOnLoad;\n xdr.open('GET', this.url, true);\n // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // issue with the interface where some requests are lost if multiple\n // XDomainRequests are being sent at the same time.\n // Some info here: https://github.com/photonstorm/phaser/issues/1248\n setTimeout(function () { return xdr.send(); }, 1);\n };\n /**\n * Creates a source used in loading via an element.\n * @param type - The element type (video or audio).\n * @param url - The source URL to load from.\n * @param [mime] - The mime type of the video\n * @returns The source element.\n */\n LoaderResource.prototype._createSource = function (type, url, mime) {\n if (!mime) {\n mime = type + \"/\" + this._getExtension(url);\n }\n var source = document.createElement('source');\n source.src = url;\n source.type = mime;\n return source;\n };\n /**\n * Called if a load errors out.\n * @param event - The error event from the element that emits it.\n */\n LoaderResource.prototype._onError = function (event) {\n this.abort(\"Failed to load element using: \" + event.target.nodeName);\n };\n /**\n * Called if a load progress event fires for an element or xhr/xdr.\n * @param event - Progress event.\n */\n LoaderResource.prototype._onProgress = function (event) {\n if (event && event.lengthComputable) {\n this.onProgress.dispatch(this, event.loaded / event.total);\n }\n };\n /** Called if a timeout event fires for an element. */\n LoaderResource.prototype._onTimeout = function () {\n this.abort(\"Load timed out.\");\n };\n /** Called if an error event fires for xhr/xdr. */\n LoaderResource.prototype._xhrOnError = function () {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request failed. Status: \" + xhr.status + \", text: \\\"\" + xhr.statusText + \"\\\"\");\n };\n /** Called if an error event fires for xhr/xdr. */\n LoaderResource.prototype._xhrOnTimeout = function () {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request timed out.\");\n };\n /** Called if an abort event fires for xhr/xdr. */\n LoaderResource.prototype._xhrOnAbort = function () {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request was aborted by the user.\");\n };\n /** Called when data successfully loads from an xhr/xdr request. */\n LoaderResource.prototype._xhrOnLoad = function () {\n var xhr = this.xhr;\n var text = '';\n var status = typeof xhr.status === 'undefined' ? STATUS_OK : xhr.status; // XDR has no `.status`, assume 200.\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n if (xhr.responseType === '' || xhr.responseType === 'text' || typeof xhr.responseType === 'undefined') {\n text = xhr.responseText;\n }\n // status can be 0 when using the `file://` protocol so we also check if a response is set.\n // If it has a response, we assume 200; otherwise a 0 status code with no contents is an aborted request.\n if (status === STATUS_NONE && (text.length > 0 || xhr.responseType === LoaderResource.XHR_RESPONSE_TYPE.BUFFER)) {\n status = STATUS_OK;\n }\n // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n else if (status === STATUS_IE_BUG_EMPTY) {\n status = STATUS_EMPTY;\n }\n var statusType = (status / 100) | 0;\n if (statusType === STATUS_TYPE_OK) {\n // if text, just return it\n if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.TEXT) {\n this.data = text;\n this.type = LoaderResource.TYPE.TEXT;\n }\n // if json, parse into json object\n else if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.JSON) {\n try {\n this.data = JSON.parse(text);\n this.type = LoaderResource.TYPE.JSON;\n }\n catch (e) {\n this.abort(\"Error trying to parse loaded json: \" + e);\n return;\n }\n }\n // if xml, parse into an xml document or div element\n else if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT) {\n try {\n if (globalThis.DOMParser) {\n var domparser = new DOMParser();\n this.data = domparser.parseFromString(text, 'text/xml');\n }\n else {\n var div = document.createElement('div');\n div.innerHTML = text;\n this.data = div;\n }\n this.type = LoaderResource.TYPE.XML;\n }\n catch (e$1) {\n this.abort(\"Error trying to parse loaded xml: \" + e$1);\n return;\n }\n }\n // other types just return the response\n else {\n this.data = xhr.response || text;\n }\n }\n else {\n this.abort(\"[\" + xhr.status + \"] \" + xhr.statusText + \": \" + xhr.responseURL);\n return;\n }\n this.complete();\n };\n /**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * @private\n * @param url - The url to test.\n * @param [loc=globalThis.location] - The location object to test against.\n * @returns The crossOrigin value to use (or empty string for none).\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n LoaderResource.prototype._determineCrossOrigin = function (url, loc) {\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n }\n // A sandboxed iframe without the 'allow-same-origin' attribute will have a special\n // origin designed not to match globalThis.location.origin, and will always require\n // crossOrigin requests regardless of whether the location matches.\n if (globalThis.origin !== globalThis.location.origin) {\n return 'anonymous';\n }\n // default is globalThis.location\n loc = loc || globalThis.location;\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n }\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n var parsedUrl = parseUri(tempAnchor.href, { strictMode: true });\n var samePort = (!parsedUrl.port && loc.port === '') || (parsedUrl.port === loc.port);\n var protocol = parsedUrl.protocol ? parsedUrl.protocol + \":\" : '';\n // if cross origin\n if (parsedUrl.host !== loc.hostname || !samePort || protocol !== loc.protocol) {\n return 'anonymous';\n }\n return '';\n };\n /**\n * Determines the responseType of an XHR request based on the extension of the\n * resource being loaded.\n * @private\n * @returns {PIXI.LoaderResource.XHR_RESPONSE_TYPE} The responseType to use.\n */\n LoaderResource.prototype._determineXhrType = function () {\n return LoaderResource._xhrTypeMap[this.extension] || LoaderResource.XHR_RESPONSE_TYPE.TEXT;\n };\n /**\n * Determines the loadType of a resource based on the extension of the\n * resource being loaded.\n * @private\n * @returns {PIXI.LoaderResource.LOAD_TYPE} The loadType to use.\n */\n LoaderResource.prototype._determineLoadType = function () {\n return LoaderResource._loadTypeMap[this.extension] || LoaderResource.LOAD_TYPE.XHR;\n };\n /**\n * Extracts the extension (sans '.') of the file being loaded by the resource.\n * @param [url] - url to parse, `this.url` by default.\n * @returns The extension.\n */\n LoaderResource.prototype._getExtension = function (url) {\n if (url === void 0) { url = this.url; }\n var ext = '';\n if (this.isDataUrl) {\n var slashIndex = url.indexOf('/');\n ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex));\n }\n else {\n var queryStart = url.indexOf('?');\n var hashStart = url.indexOf('#');\n var index = Math.min(queryStart > -1 ? queryStart : url.length, hashStart > -1 ? hashStart : url.length);\n url = url.substring(0, index);\n ext = url.substring(url.lastIndexOf('.') + 1);\n }\n return ext.toLowerCase();\n };\n /**\n * Determines the mime type of an XHR request based on the responseType of\n * resource being loaded.\n * @param type - The type to get a mime type for.\n * @private\n * @returns The mime type to use.\n */\n LoaderResource.prototype._getMimeFromXhrType = function (type) {\n switch (type) {\n case LoaderResource.XHR_RESPONSE_TYPE.BUFFER:\n return 'application/octet-binary';\n case LoaderResource.XHR_RESPONSE_TYPE.BLOB:\n return 'application/blob';\n case LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT:\n return 'application/xml';\n case LoaderResource.XHR_RESPONSE_TYPE.JSON:\n return 'application/json';\n case LoaderResource.XHR_RESPONSE_TYPE.DEFAULT:\n case LoaderResource.XHR_RESPONSE_TYPE.TEXT:\n /* falls through */\n default:\n return 'text/plain';\n }\n };\n return LoaderResource;\n}());\n// eslint-disable-next-line @typescript-eslint/no-namespace\n(function (LoaderResource) {\n (function (STATUS_FLAGS) {\n /** None */\n STATUS_FLAGS[STATUS_FLAGS[\"NONE\"] = 0] = \"NONE\";\n /** Data URL */\n STATUS_FLAGS[STATUS_FLAGS[\"DATA_URL\"] = 1] = \"DATA_URL\";\n /** Complete */\n STATUS_FLAGS[STATUS_FLAGS[\"COMPLETE\"] = 2] = \"COMPLETE\";\n /** Loading */\n STATUS_FLAGS[STATUS_FLAGS[\"LOADING\"] = 4] = \"LOADING\";\n })(LoaderResource.STATUS_FLAGS || (LoaderResource.STATUS_FLAGS = {}));\n (function (TYPE) {\n /** Unknown */\n TYPE[TYPE[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /** JSON */\n TYPE[TYPE[\"JSON\"] = 1] = \"JSON\";\n /** XML */\n TYPE[TYPE[\"XML\"] = 2] = \"XML\";\n /** Image */\n TYPE[TYPE[\"IMAGE\"] = 3] = \"IMAGE\";\n /** Audio */\n TYPE[TYPE[\"AUDIO\"] = 4] = \"AUDIO\";\n /** Video */\n TYPE[TYPE[\"VIDEO\"] = 5] = \"VIDEO\";\n /** Plain text */\n TYPE[TYPE[\"TEXT\"] = 6] = \"TEXT\";\n })(LoaderResource.TYPE || (LoaderResource.TYPE = {}));\n (function (LOAD_TYPE) {\n /** Uses XMLHttpRequest to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"XHR\"] = 1] = \"XHR\";\n /** Uses an `Image` object to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"IMAGE\"] = 2] = \"IMAGE\";\n /** Uses an `Audio` object to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"AUDIO\"] = 3] = \"AUDIO\";\n /** Uses a `Video` object to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"VIDEO\"] = 4] = \"VIDEO\";\n })(LoaderResource.LOAD_TYPE || (LoaderResource.LOAD_TYPE = {}));\n (function (XHR_RESPONSE_TYPE) {\n /** string */\n XHR_RESPONSE_TYPE[\"DEFAULT\"] = \"text\";\n /** ArrayBuffer */\n XHR_RESPONSE_TYPE[\"BUFFER\"] = \"arraybuffer\";\n /** Blob */\n XHR_RESPONSE_TYPE[\"BLOB\"] = \"blob\";\n /** Document */\n XHR_RESPONSE_TYPE[\"DOCUMENT\"] = \"document\";\n /** Object */\n XHR_RESPONSE_TYPE[\"JSON\"] = \"json\";\n /** String */\n XHR_RESPONSE_TYPE[\"TEXT\"] = \"text\";\n })(LoaderResource.XHR_RESPONSE_TYPE || (LoaderResource.XHR_RESPONSE_TYPE = {}));\n LoaderResource._loadTypeMap = {\n // images\n gif: LoaderResource.LOAD_TYPE.IMAGE,\n png: LoaderResource.LOAD_TYPE.IMAGE,\n bmp: LoaderResource.LOAD_TYPE.IMAGE,\n jpg: LoaderResource.LOAD_TYPE.IMAGE,\n jpeg: LoaderResource.LOAD_TYPE.IMAGE,\n tif: LoaderResource.LOAD_TYPE.IMAGE,\n tiff: LoaderResource.LOAD_TYPE.IMAGE,\n webp: LoaderResource.LOAD_TYPE.IMAGE,\n tga: LoaderResource.LOAD_TYPE.IMAGE,\n avif: LoaderResource.LOAD_TYPE.IMAGE,\n svg: LoaderResource.LOAD_TYPE.IMAGE,\n 'svg+xml': LoaderResource.LOAD_TYPE.IMAGE,\n // audio\n mp3: LoaderResource.LOAD_TYPE.AUDIO,\n ogg: LoaderResource.LOAD_TYPE.AUDIO,\n wav: LoaderResource.LOAD_TYPE.AUDIO,\n // videos\n mp4: LoaderResource.LOAD_TYPE.VIDEO,\n webm: LoaderResource.LOAD_TYPE.VIDEO,\n };\n LoaderResource._xhrTypeMap = {\n // xml\n xhtml: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n html: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n htm: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n xml: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n tmx: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n svg: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component.\n // Since it is way less likely for people to be loading TypeScript files instead of Tiled files,\n // this should probably be fine.\n tsx: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n // images\n gif: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n png: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n bmp: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n jpg: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n jpeg: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n tif: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n tiff: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n webp: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n tga: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n avif: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n // json\n json: LoaderResource.XHR_RESPONSE_TYPE.JSON,\n // text\n text: LoaderResource.XHR_RESPONSE_TYPE.TEXT,\n txt: LoaderResource.XHR_RESPONSE_TYPE.TEXT,\n // fonts\n ttf: LoaderResource.XHR_RESPONSE_TYPE.BUFFER,\n otf: LoaderResource.XHR_RESPONSE_TYPE.BUFFER,\n };\n // We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif\n LoaderResource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n})(LoaderResource || (LoaderResource = {}));\n\n/**\n * Smaller version of the async library constructs.\n * @ignore\n */\nfunction _noop() {\n}\n/**\n * Ensures a function is only called once.\n * @ignore\n * @param {Function} fn - The function to wrap.\n * @returns {Function} The wrapping function.\n */\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n var arguments$1 = arguments;\n\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n };\n}\n/**\n * @private\n * @memberof PIXI\n */\nvar AsyncQueueItem = /** @class */ (function () {\n /**\n * @param data\n * @param callback\n * @private\n */\n function AsyncQueueItem(data, callback) {\n this.data = data;\n this.callback = callback;\n }\n return AsyncQueueItem;\n}());\n/**\n * @private\n * @memberof PIXI\n */\nvar AsyncQueue = /** @class */ (function () {\n /**\n * @param worker\n * @param concurrency\n * @private\n */\n function AsyncQueue(worker, concurrency) {\n var _this = this;\n if (concurrency === void 0) { concurrency = 1; }\n this.workers = 0;\n this.saturated = _noop;\n this.unsaturated = _noop;\n this.empty = _noop;\n this.drain = _noop;\n this.error = _noop;\n this.started = false;\n this.paused = false;\n this._tasks = [];\n this._insert = function (data, insertAtFront, callback) {\n if (callback && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n _this.started = true;\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (data == null && _this.idle()) {\n // call drain immediately if there are no tasks\n setTimeout(function () { return _this.drain(); }, 1);\n return;\n }\n var item = new AsyncQueueItem(data, typeof callback === 'function' ? callback : _noop);\n if (insertAtFront) {\n _this._tasks.unshift(item);\n }\n else {\n _this._tasks.push(item);\n }\n setTimeout(_this.process, 1);\n };\n this.process = function () {\n while (!_this.paused && _this.workers < _this.concurrency && _this._tasks.length) {\n var task = _this._tasks.shift();\n if (_this._tasks.length === 0) {\n _this.empty();\n }\n _this.workers += 1;\n if (_this.workers === _this.concurrency) {\n _this.saturated();\n }\n _this._worker(task.data, onlyOnce(_this._next(task)));\n }\n };\n this._worker = worker;\n if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n this.concurrency = concurrency;\n this.buffer = concurrency / 4.0;\n }\n /**\n * @param task\n * @private\n */\n AsyncQueue.prototype._next = function (task) {\n var _this = this;\n return function () {\n var arguments$1 = arguments;\n\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n _this.workers -= 1;\n task.callback.apply(task, args);\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (args[0] != null) {\n _this.error(args[0], task.data);\n }\n if (_this.workers <= (_this.concurrency - _this.buffer)) {\n _this.unsaturated();\n }\n if (_this.idle()) {\n _this.drain();\n }\n _this.process();\n };\n };\n // That was in object\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n AsyncQueue.prototype.push = function (data, callback) {\n this._insert(data, false, callback);\n };\n AsyncQueue.prototype.kill = function () {\n this.workers = 0;\n this.drain = _noop;\n this.started = false;\n this._tasks = [];\n };\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n AsyncQueue.prototype.unshift = function (data, callback) {\n this._insert(data, true, callback);\n };\n AsyncQueue.prototype.length = function () {\n return this._tasks.length;\n };\n AsyncQueue.prototype.running = function () {\n return this.workers;\n };\n AsyncQueue.prototype.idle = function () {\n return this._tasks.length + this.workers === 0;\n };\n AsyncQueue.prototype.pause = function () {\n if (this.paused === true) {\n return;\n }\n this.paused = true;\n };\n AsyncQueue.prototype.resume = function () {\n if (this.paused === false) {\n return;\n }\n this.paused = false;\n // Need to call this.process once per concurrent\n // worker to preserve full concurrency after pause\n for (var w = 1; w <= this.concurrency; w++) {\n this.process();\n }\n };\n /**\n * Iterates an array in series.\n * @param {Array.<*>} array - Array to iterate.\n * @param {Function} iterator - Function to call for each element.\n * @param {Function} callback - Function to call when done, or on error.\n * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1.\n */\n AsyncQueue.eachSeries = function (array, iterator, callback, deferNext) {\n var i = 0;\n var len = array.length;\n function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n return;\n }\n if (deferNext) {\n setTimeout(function () {\n iterator(array[i++], next);\n }, 1);\n }\n else {\n iterator(array[i++], next);\n }\n }\n next();\n };\n /**\n * Async queue implementation,\n * @param {Function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @returns {*} The async queue object.\n */\n AsyncQueue.queue = function (worker, concurrency) {\n return new AsyncQueue(worker, concurrency);\n };\n return AsyncQueue;\n}());\n\n// some constants\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n/**\n * The new loader, forked from Resource Loader by Chad Engler: https://github.com/englercj/resource-loader\n *\n * ```js\n * const loader = PIXI.Loader.shared; // PixiJS exposes a premade instance for you to use.\n * // or\n * const loader = new PIXI.Loader(); // You can also create your own if you want\n *\n * const sprites = {};\n *\n * // Chainable `add` to enqueue a resource\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.\n * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).\n * loader.pre(cachingMiddleware);\n *\n * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.\n * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).\n * loader.use(parsingMiddleware);\n *\n * // The `load` method loads the queue of resources, and calls the passed in callback called once all\n * // resources have loaded.\n * loader.load((loader, resources) => {\n * // resources is an object where the key is the name of the resource loaded and the value is the resource object.\n * // They have a couple default properties:\n * // - `url`: The URL that the resource was loaded from\n * // - `error`: The error that happened when trying to load (if any)\n * // - `data`: The raw data that was loaded\n * // also may contain other properties based on the middleware that runs.\n * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);\n * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);\n * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);\n * });\n *\n * // throughout the process multiple signals can be dispatched.\n * loader.onProgress.add(() => {}); // called once per loaded/errored file\n * loader.onError.add(() => {}); // called once per errored file\n * loader.onLoad.add(() => {}); // called once per loaded file\n * loader.onComplete.add(() => {}); // called once when the queued resources all load.\n * ```\n * @memberof PIXI\n */\nvar Loader = /** @class */ (function () {\n /**\n * @param baseUrl - The base url for all resources loaded by this loader.\n * @param concurrency - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n var _this = this;\n if (baseUrl === void 0) { baseUrl = ''; }\n if (concurrency === void 0) { concurrency = 10; }\n /** The progress percent of the loader going through the queue. */\n this.progress = 0;\n /** Loading state of the loader, true if it is currently loading resources. */\n this.loading = false;\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n * @example\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n */\n this.defaultQueryString = '';\n /** The middleware to run before loading each resource. */\n this._beforeMiddleware = [];\n /** The middleware to run after loading each resource. */\n this._afterMiddleware = [];\n /** The tracks the resources we are currently completing parsing for. */\n this._resourcesParsing = [];\n /**\n * The `_loadResource` function bound with this object context.\n * @param r - The resource to load\n * @param d - The dequeue function\n */\n this._boundLoadResource = function (r, d) { return _this._loadResource(r, d); };\n /** All the resources for this loader keyed by name. */\n this.resources = {};\n this.baseUrl = baseUrl;\n this._beforeMiddleware = [];\n this._afterMiddleware = [];\n this._resourcesParsing = [];\n this._boundLoadResource = function (r, d) { return _this._loadResource(r, d); };\n this._queue = AsyncQueue.queue(this._boundLoadResource, concurrency);\n this._queue.pause();\n this.resources = {};\n this.onProgress = new Signal();\n this.onError = new Signal();\n this.onLoad = new Signal();\n this.onStart = new Signal();\n this.onComplete = new Signal();\n for (var i = 0; i < Loader._plugins.length; ++i) {\n var plugin = Loader._plugins[i];\n var pre = plugin.pre, use = plugin.use;\n if (pre) {\n this.pre(pre);\n }\n if (use) {\n this.use(use);\n }\n }\n this._protected = false;\n }\n /**\n * Same as add, params have strict order\n * @private\n * @param name - The name of the resource to load.\n * @param url - The url for this resource, relative to the baseUrl of this loader.\n * @param options - The options for the load.\n * @param callback - Function to call when this specific resource completes loading.\n * @returns The loader itself.\n */\n Loader.prototype._add = function (name, url, options, callback) {\n // if loading already you can only add resources that have a parent.\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n }\n // check if resource already exists.\n if (this.resources[name]) {\n throw new Error(\"Resource named \\\"\" + name + \"\\\" already exists.\");\n }\n // add base url if this isn't an absolute url\n url = this._prepareUrl(url);\n // create the store the resource\n this.resources[name] = new LoaderResource(name, url, options);\n if (typeof callback === 'function') {\n this.resources[name].onAfterMiddleware.once(callback);\n }\n // if actively loading, make sure to adjust progress chunks for that parent and its children\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n for (var i = 0; i < parent.children.length; ++i) {\n if (!parent.children[i].isComplete) {\n incompleteChildren.push(parent.children[i]);\n }\n }\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n for (var i = 0; i < incompleteChildren.length; ++i) {\n incompleteChildren[i].progressChunk = eachChunk;\n }\n this.resources[name].progressChunk = eachChunk;\n }\n // add the resource to the queue\n this._queue.push(this.resources[name]);\n return this;\n };\n /* eslint-enable require-jsdoc,valid-jsdoc */\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n * @param fn - The middleware function to register.\n * @returns The loader itself.\n */\n Loader.prototype.pre = function (fn) {\n this._beforeMiddleware.push(fn);\n return this;\n };\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n * @param fn - The middleware function to register.\n * @returns The loader itself.\n */\n Loader.prototype.use = function (fn) {\n this._afterMiddleware.push(fn);\n return this;\n };\n /**\n * Resets the queue of the loader to prepare for a new load.\n * @returns The loader itself.\n */\n Loader.prototype.reset = function () {\n this.progress = 0;\n this.loading = false;\n this._queue.kill();\n this._queue.pause();\n // abort all resource loads\n for (var k in this.resources) {\n var res = this.resources[k];\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n if (res.isLoading) {\n res.abort('loader reset');\n }\n }\n this.resources = {};\n return this;\n };\n /**\n * Starts loading the queued resources.\n * @param cb - Optional callback that will be bound to the `complete` event.\n * @returns The loader itself.\n */\n Loader.prototype.load = function (cb) {\n deprecation('6.5.0', '@pixi/loaders is being replaced with @pixi/assets in the next major release.');\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n }\n // if the queue has already started we are done here\n if (this.loading) {\n return this;\n }\n if (this._queue.idle()) {\n this._onStart();\n this._onComplete();\n }\n else {\n // distribute progress chunks\n var numTasks = this._queue._tasks.length;\n var chunk = MAX_PROGRESS / numTasks;\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n }\n // notify we are starting\n this._onStart();\n // start loading\n this._queue.resume();\n }\n return this;\n };\n Object.defineProperty(Loader.prototype, \"concurrency\", {\n /**\n * The number of resources to load concurrently.\n * @default 10\n */\n get: function () {\n return this._queue.concurrency;\n },\n set: function (concurrency) {\n this._queue.concurrency = concurrency;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Prepares a url for usage based on the configuration of this object\n * @param url - The url to prepare.\n * @returns The prepared url.\n */\n Loader.prototype._prepareUrl = function (url) {\n var parsedUrl = parseUri(url, { strictMode: true });\n var result;\n // absolute url, just use it as is.\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n }\n // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length\n && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1\n && url.charAt(0) !== '/') {\n result = this.baseUrl + \"/\" + url;\n }\n else {\n result = this.baseUrl + url;\n }\n // if we need to add a default querystring, there is a bit more work\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n result = result.slice(0, result.length - hash.length);\n if (result.indexOf('?') !== -1) {\n result += \"&\" + this.defaultQueryString;\n }\n else {\n result += \"?\" + this.defaultQueryString;\n }\n result += hash;\n }\n return result;\n };\n /**\n * Loads a single resource.\n * @param resource - The resource to load.\n * @param dequeue - The function to call when we need to dequeue this item.\n */\n Loader.prototype._loadResource = function (resource, dequeue) {\n var _this = this;\n resource._dequeue = dequeue;\n // run before middleware\n AsyncQueue.eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this._onLoad(resource);\n }\n else {\n resource._onLoadBinding = resource.onComplete.once(_this._onLoad, _this);\n resource.load();\n }\n }, true);\n };\n /** Called once loading has started. */\n Loader.prototype._onStart = function () {\n this.progress = 0;\n this.loading = true;\n this.onStart.dispatch(this);\n };\n /** Called once each resource has loaded. */\n Loader.prototype._onComplete = function () {\n this.progress = MAX_PROGRESS;\n this.loading = false;\n this.onComplete.dispatch(this, this.resources);\n };\n /**\n * Called each time a resources is loaded.\n * @param resource - The resource that was loaded\n */\n Loader.prototype._onLoad = function (resource) {\n var _this = this;\n resource._onLoadBinding = null;\n // remove this resource from the async queue, and add it to our list of resources that are being parsed\n this._resourcesParsing.push(resource);\n resource._dequeue();\n // run all the after middleware for this resource\n AsyncQueue.eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n _this.progress = Math.min(MAX_PROGRESS, _this.progress + resource.progressChunk);\n _this.onProgress.dispatch(_this, resource);\n if (resource.error) {\n _this.onError.dispatch(resource.error, _this, resource);\n }\n else {\n _this.onLoad.dispatch(_this, resource);\n }\n _this._resourcesParsing.splice(_this._resourcesParsing.indexOf(resource), 1);\n // do completion check\n if (_this._queue.idle() && _this._resourcesParsing.length === 0) {\n _this._onComplete();\n }\n }, true);\n };\n /** Destroy the loader, removes references. */\n Loader.prototype.destroy = function () {\n if (!this._protected) {\n this.reset();\n }\n };\n Object.defineProperty(Loader, \"shared\", {\n /** A premade instance of the loader that can be used to load resources. */\n get: function () {\n var shared = Loader._shared;\n if (!shared) {\n shared = new Loader();\n shared._protected = true;\n Loader._shared = shared;\n }\n return shared;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @param plugin - The plugin to add\n * @returns Reference to PIXI.Loader for chaining\n */\n Loader.registerPlugin = function (plugin) {\n deprecation('6.5.0', 'Loader.registerPlugin() is deprecated, use extensions.add() instead.');\n extensions.add({\n type: ExtensionType.Loader,\n ref: plugin,\n });\n return Loader;\n };\n Loader._plugins = [];\n return Loader;\n}());\nextensions.handleByList(ExtensionType.Loader, Loader._plugins);\nLoader.prototype.add = function add(name, url, options, callback) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n return this;\n }\n // if an object is passed instead of params\n if (typeof name === 'object') {\n options = name;\n callback = url || options.callback || options.onComplete;\n url = options.url;\n name = options.name || options.key || options.url;\n }\n // case where no name is passed shift all args over by one.\n if (typeof url !== 'string') {\n callback = options;\n options = url;\n url = name;\n }\n // now that we shifted make sure we have a proper url.\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n }\n // options are optional so people might pass a function and no options\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n return this._add(name, url, options, callback);\n};\n\n/**\n * Application plugin for supporting loader option. Installing the LoaderPlugin\n * is not necessary if using **pixi.js** or **pixi.js-legacy**.\n * @example\n * import {AppLoaderPlugin} from '@pixi/loaders';\n * import {extensions} from '@pixi/core';\n * extensions.add(AppLoaderPlugin);\n * @memberof PIXI\n */\nvar AppLoaderPlugin = /** @class */ (function () {\n function AppLoaderPlugin() {\n }\n /**\n * Called on application constructor\n * @param options\n * @private\n */\n AppLoaderPlugin.init = function (options) {\n options = Object.assign({\n sharedLoader: false,\n }, options);\n this.loader = options.sharedLoader ? Loader.shared : new Loader();\n };\n /**\n * Called when application destroyed\n * @private\n */\n AppLoaderPlugin.destroy = function () {\n if (this.loader) {\n this.loader.destroy();\n this.loader = null;\n }\n };\n /** @ignore */\n AppLoaderPlugin.extension = ExtensionType.Application;\n return AppLoaderPlugin;\n}());\n\n/**\n * Loader plugin for handling Texture resources.\n * @memberof PIXI\n */\nvar TextureLoader = /** @class */ (function () {\n function TextureLoader() {\n }\n /** Handle SVG elements a text, render with SVGResource. */\n TextureLoader.add = function () {\n LoaderResource.setExtensionLoadType('svg', LoaderResource.LOAD_TYPE.XHR);\n LoaderResource.setExtensionXhrType('svg', LoaderResource.XHR_RESPONSE_TYPE.TEXT);\n };\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param resource\n * @param {Function} next\n */\n TextureLoader.use = function (resource, next) {\n // create a new texture if the data is an Image object\n if (resource.data && (resource.type === LoaderResource.TYPE.IMAGE || resource.extension === 'svg')) {\n var data = resource.data, url = resource.url, name = resource.name, metadata = resource.metadata;\n Texture.fromLoader(data, url, name, metadata).then(function (texture) {\n resource.texture = texture;\n next();\n })\n // TODO: handle errors in Texture.fromLoader\n // so we can pass them to the Loader\n .catch(next);\n }\n else {\n next();\n }\n };\n /** @ignore */\n TextureLoader.extension = ExtensionType.Loader;\n return TextureLoader;\n}());\n\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n/**\n * Encodes binary into base64.\n * @function encodeBinary\n * @param {string} input - The input data to encode.\n * @returns {string} The encoded base64 string\n */\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n }\n else {\n bytebuffer[jnx] = 0;\n }\n }\n // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n encodedCharIndexes[0] = bytebuffer[0] >> 2;\n // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n encodedCharIndexes[1] = ((bytebuffer[0] & 0x3) << 4) | (bytebuffer[1] >> 4);\n // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n encodedCharIndexes[2] = ((bytebuffer[1] & 0x0f) << 2) | (bytebuffer[2] >> 6);\n // index 3: forth 6 bits (6 least significant bits from input byte 3)\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f;\n // Determine whether padding happened, and adjust accordingly\n var paddingBytes = inx - (input.length - 1);\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n }\n // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n for (var jnx = 0; jnx < encodedCharIndexes.length; ++jnx) {\n output += _keyStr.charAt(encodedCharIndexes[jnx]);\n }\n }\n return output;\n}\n\n/**\n * A middleware for transforming XHR loaded Blobs into more useful objects\n * @ignore\n * @function parsing\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.parsing);\n * @param resource - Current Resource\n * @param next - Callback when complete\n */\nfunction parsing(resource, next) {\n if (!resource.data) {\n next();\n return;\n }\n // if this was an XHR load of a blob\n if (resource.xhr && resource.xhrType === LoaderResource.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!self.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type');\n // this is an image, convert the binary string into a data url\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = \"data:\" + type + \";base64,\" + encodeBinary(resource.xhr.responseText);\n resource.type = LoaderResource.TYPE.IMAGE;\n // wait until the image loads and then callback\n resource.data.onload = function () {\n resource.data.onload = null;\n next();\n };\n // next will be called on load\n return;\n }\n }\n // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var Url_1 = globalThis.URL || globalThis.webkitURL;\n var src_1 = Url_1.createObjectURL(resource.data);\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src_1;\n resource.type = LoaderResource.TYPE.IMAGE;\n // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n resource.data.onload = function () {\n Url_1.revokeObjectURL(src_1);\n resource.data.onload = null;\n next();\n };\n // next will be called on load.\n return;\n }\n }\n next();\n}\n\n/**\n * Parse any blob into more usable objects (e.g. Image).\n * @memberof PIXI\n */\nvar ParsingLoader = /** @class */ (function () {\n function ParsingLoader() {\n }\n /** @ignore */\n ParsingLoader.extension = ExtensionType.Loader;\n ParsingLoader.use = parsing;\n return ParsingLoader;\n}());\n\nextensions.add(TextureLoader, ParsingLoader);\n\nexport { AppLoaderPlugin, Loader, LoaderResource, TextureLoader };\n//# sourceMappingURL=loaders.mjs.map\n","/*!\n * @pixi/compressed-textures - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/compressed-textures is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { ViewableBuffer, BufferResource, ExtensionType, Texture, BaseTexture } from '@pixi/core';\nimport { LoaderResource } from '@pixi/loaders';\nimport { url } from '@pixi/utils';\nimport { settings } from '@pixi/settings';\nimport { MIPMAP_MODES, ALPHA_MODES, TYPES, FORMATS } from '@pixi/constants';\n\nvar _a$2;\n/**\n * WebGL internal formats, including compressed texture formats provided by extensions\n * @memberof PIXI\n * @static\n * @name INTERNAL_FORMATS\n * @enum {number}\n * @property {number} [COMPRESSED_RGB_S3TC_DXT1_EXT=0x83F0] -\n * @property {number} [COMPRESSED_RGBA_S3TC_DXT1_EXT=0x83F1] -\n * @property {number} [COMPRESSED_RGBA_S3TC_DXT3_EXT=0x83F2] -\n * @property {number} [COMPRESSED_RGBA_S3TC_DXT5_EXT=0x83F3] -\n * @property {number} [COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917] -\n * @property {number} [COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918] -\n * @property {number} [COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919] -\n * @property {number} [COMPRESSED_SRGB_S3TC_DXT1_EXT=35916] -\n * @property {number} [COMPRESSED_R11_EAC=0x9270] -\n * @property {number} [COMPRESSED_SIGNED_R11_EAC=0x9271] -\n * @property {number} [COMPRESSED_RG11_EAC=0x9272] -\n * @property {number} [COMPRESSED_SIGNED_RG11_EAC=0x9273] -\n * @property {number} [COMPRESSED_RGB8_ETC2=0x9274] -\n * @property {number} [COMPRESSED_RGBA8_ETC2_EAC=0x9278] -\n * @property {number} [COMPRESSED_SRGB8_ETC2=0x9275] -\n * @property {number} [COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=0x9279] -\n * @property {number} [COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=0x9276] -\n * @property {number} [COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=0x9277] -\n * @property {number} [COMPRESSED_RGB_PVRTC_4BPPV1_IMG=0x8C00] -\n * @property {number} [COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=0x8C02] -\n * @property {number} [COMPRESSED_RGB_PVRTC_2BPPV1_IMG=0x8C01] -\n * @property {number} [COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=0x8C03] -\n * @property {number} [COMPRESSED_RGB_ETC1_WEBGL=0x8D64] -\n * @property {number} [COMPRESSED_RGB_ATC_WEBGL=0x8C92] -\n * @property {number} [COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=0x8C92] -\n * @property {number} [COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=0x87EE] -\n * @property {number} [COMPRESSED_RGBA_ASTC_4x4_KHR=0x93B0] -\n */\nvar INTERNAL_FORMATS;\n(function (INTERNAL_FORMATS) {\n // WEBGL_compressed_texture_s3tc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_S3TC_DXT1_EXT\"] = 33776] = \"COMPRESSED_RGB_S3TC_DXT1_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_S3TC_DXT1_EXT\"] = 33777] = \"COMPRESSED_RGBA_S3TC_DXT1_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_S3TC_DXT3_EXT\"] = 33778] = \"COMPRESSED_RGBA_S3TC_DXT3_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_S3TC_DXT5_EXT\"] = 33779] = \"COMPRESSED_RGBA_S3TC_DXT5_EXT\";\n // WEBGL_compressed_texture_s3tc_srgb\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT\"] = 35917] = \"COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT\"] = 35918] = \"COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT\"] = 35919] = \"COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_S3TC_DXT1_EXT\"] = 35916] = \"COMPRESSED_SRGB_S3TC_DXT1_EXT\";\n // WEBGL_compressed_texture_etc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_R11_EAC\"] = 37488] = \"COMPRESSED_R11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SIGNED_R11_EAC\"] = 37489] = \"COMPRESSED_SIGNED_R11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RG11_EAC\"] = 37490] = \"COMPRESSED_RG11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SIGNED_RG11_EAC\"] = 37491] = \"COMPRESSED_SIGNED_RG11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB8_ETC2\"] = 37492] = \"COMPRESSED_RGB8_ETC2\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA8_ETC2_EAC\"] = 37496] = \"COMPRESSED_RGBA8_ETC2_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB8_ETC2\"] = 37493] = \"COMPRESSED_SRGB8_ETC2\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC\"] = 37497] = \"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2\"] = 37494] = \"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2\"] = 37495] = \"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2\";\n // WEBGL_compressed_texture_pvrtc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_PVRTC_4BPPV1_IMG\"] = 35840] = \"COMPRESSED_RGB_PVRTC_4BPPV1_IMG\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\"] = 35842] = \"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_PVRTC_2BPPV1_IMG\"] = 35841] = \"COMPRESSED_RGB_PVRTC_2BPPV1_IMG\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\"] = 35843] = \"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\";\n // WEBGL_compressed_texture_etc1\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_ETC1_WEBGL\"] = 36196] = \"COMPRESSED_RGB_ETC1_WEBGL\";\n // WEBGL_compressed_texture_atc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_ATC_WEBGL\"] = 35986] = \"COMPRESSED_RGB_ATC_WEBGL\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL\"] = 35986] = \"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\"] = 34798] = \"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\";\n // WEBGL_compressed_texture_astc\n /* eslint-disable-next-line camelcase */\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_ASTC_4x4_KHR\"] = 37808] = \"COMPRESSED_RGBA_ASTC_4x4_KHR\";\n})(INTERNAL_FORMATS || (INTERNAL_FORMATS = {}));\n/**\n * Maps the compressed texture formats in {@link PIXI.INTERNAL_FORMATS} to the number of bytes taken by\n * each texel.\n * @memberof PIXI\n * @static\n * @ignore\n */\nvar INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = (_a$2 = {},\n // WEBGL_compressed_texture_s3tc\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT] = 1,\n // WEBGL_compressed_texture_s3tc\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT] = 1,\n // WEBGL_compressed_texture_etc\n _a$2[INTERNAL_FORMATS.COMPRESSED_R11_EAC] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SIGNED_R11_EAC] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RG11_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SIGNED_RG11_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB8_ETC2] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA8_ETC2_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB8_ETC2] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5,\n // WEBGL_compressed_texture_pvrtc\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_PVRTC_2BPPV1_IMG] = 0.25,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG] = 0.25,\n // WEBGL_compressed_texture_etc1\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_ETC1_WEBGL] = 0.5,\n // @see https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_compressed_ATC_texture.txt\n // WEBGL_compressed_texture_atc\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_ATC_WEBGL] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL] = 1,\n // @see https://registry.khronos.org/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt\n // WEBGL_compressed_texture_astc\n /* eslint-disable-next-line camelcase */\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_ASTC_4x4_KHR] = 1,\n _a$2);\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) { throw t[1]; } return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) { throw new TypeError(\"Generator is already executing.\"); }\r\n while (_) { try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; }\r\n if (y = 0, t) { op = [op[0] & 2, t.value]; }\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) { _.ops.pop(); }\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } }\r\n if (op[0] & 5) { throw op[1]; } return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\n\n/**\n * Resource that fetches texture data over the network and stores it in a buffer.\n * @class\n * @extends PIXI.Resource\n * @memberof PIXI\n */\nvar BlobResource = /** @class */ (function (_super) {\n __extends(BlobResource, _super);\n /**\n * @param {string} source - the URL of the texture file\n * @param {PIXI.IBlobOptions} options\n * @param {boolean}[options.autoLoad] - whether to fetch the data immediately;\n * you can fetch it later via {@link BlobResource#load}\n * @param {boolean}[options.width] - the width in pixels.\n * @param {boolean}[options.height] - the height in pixels.\n */\n function BlobResource(source, options) {\n if (options === void 0) { options = { width: 1, height: 1, autoLoad: true }; }\n var _this = this;\n var origin;\n var data;\n if (typeof source === 'string') {\n origin = source;\n data = new Uint8Array();\n }\n else {\n origin = null;\n data = source;\n }\n _this = _super.call(this, data, options) || this;\n /**\n * The URL of the texture file\n * @member {string}\n */\n _this.origin = origin;\n /**\n * The viewable buffer on the data\n * @member {ViewableBuffer}\n */\n // HINT: BlobResource allows \"null\" sources, assuming the child class provides an alternative\n _this.buffer = data ? new ViewableBuffer(data) : null;\n // Allow autoLoad = \"undefined\" still load the resource by default\n if (_this.origin && options.autoLoad !== false) {\n _this.load();\n }\n if (data && data.length) {\n _this.loaded = true;\n _this.onBlobLoaded(_this.buffer.rawBinaryData);\n }\n return _this;\n }\n BlobResource.prototype.onBlobLoaded = function (_data) {\n // TODO: Override this method\n };\n /** Loads the blob */\n BlobResource.prototype.load = function () {\n return __awaiter(this, void 0, Promise, function () {\n var response, blob, arrayBuffer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fetch(this.origin)];\n case 1:\n response = _a.sent();\n return [4 /*yield*/, response.blob()];\n case 2:\n blob = _a.sent();\n return [4 /*yield*/, blob.arrayBuffer()];\n case 3:\n arrayBuffer = _a.sent();\n this.data = new Uint32Array(arrayBuffer);\n this.buffer = new ViewableBuffer(arrayBuffer);\n this.loaded = true;\n this.onBlobLoaded(arrayBuffer);\n this.update();\n return [2 /*return*/, this];\n }\n });\n });\n };\n return BlobResource;\n}(BufferResource));\n\n/**\n * Resource for compressed texture formats, as follows: S3TC/DXTn (& their sRGB formats), ATC, ASTC, ETC 1/2, PVRTC.\n *\n * Compressed textures improve performance when rendering is texture-bound. The texture data stays compressed in\n * graphics memory, increasing memory locality and speeding up texture fetches. These formats can also be used to store\n * more detail in the same amount of memory.\n *\n * For most developers, container file formats are a better abstraction instead of directly handling raw texture\n * data. PixiJS provides native support for the following texture file formats (via {@link PIXI.Loader}):\n *\n * **.dds** - the DirectDraw Surface file format stores DXTn (DXT-1,3,5) data. See {@link PIXI.DDSLoader}\n * **.ktx** - the Khronos Texture Container file format supports storing all the supported WebGL compression formats.\n * See {@link PIXI.KTXLoader}.\n * **.basis** - the BASIS supercompressed file format stores texture data in an internal format that is transcoded\n * to the compression format supported on the device at _runtime_. It also supports transcoding into a uncompressed\n * format as a fallback; you must install the `@pixi/basis-loader`, `@pixi/basis-transcoder` packages separately to\n * use these files. See {@link PIXI.BasisLoader}.\n *\n * The loaders for the aforementioned formats use `CompressedTextureResource` internally. It is strongly suggested that\n * they be used instead.\n *\n * ## Working directly with CompressedTextureResource\n *\n * Since `CompressedTextureResource` inherits `BlobResource`, you can provide it a URL pointing to a file containing\n * the raw texture data (with no file headers!):\n *\n * ```js\n * // The resource backing the texture data for your textures.\n * // NOTE: You can also provide a ArrayBufferView instead of a URL. This is used when loading data from a container file\n * // format such as KTX, DDS, or BASIS.\n * const compressedResource = new PIXI.CompressedTextureResource(\"bunny.dxt5\", {\n * format: PIXI.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n * width: 256,\n * height: 256\n * });\n *\n * // You can create a base-texture to the cache, so that future `Texture`s can be created using the `Texture.from` API.\n * const baseTexture = new PIXI.BaseTexture(compressedResource, { pmaMode: PIXI.ALPHA_MODES.NPM });\n *\n * // Create a Texture to add to the TextureCache\n * const texture = new PIXI.Texture(baseTexture);\n *\n * // Add baseTexture & texture to the global texture cache\n * PIXI.BaseTexture.addToCache(baseTexture, \"bunny.dxt5\");\n * PIXI.Texture.addToCache(texture, \"bunny.dxt5\");\n * ```\n * @memberof PIXI\n */\nvar CompressedTextureResource = /** @class */ (function (_super) {\n __extends(CompressedTextureResource, _super);\n /**\n * @param source - the buffer/URL holding the compressed texture data\n * @param options\n * @param {PIXI.INTERNAL_FORMATS} options.format - the compression format\n * @param {number} options.width - the image width in pixels.\n * @param {number} options.height - the image height in pixels.\n * @param {number} [options.level=1] - the mipmap levels stored in the compressed texture, including level 0.\n * @param {number} [options.levelBuffers] - the buffers for each mipmap level. `CompressedTextureResource` can allows you\n * to pass `null` for `source`, for cases where each level is stored in non-contiguous memory.\n */\n function CompressedTextureResource(source, options) {\n var _this = _super.call(this, source, options) || this;\n _this.format = options.format;\n _this.levels = options.levels || 1;\n _this._width = options.width;\n _this._height = options.height;\n _this._extension = CompressedTextureResource._formatToExtension(_this.format);\n if (options.levelBuffers || _this.buffer) {\n // ViewableBuffer doesn't support byteOffset :-( so allow source to be Uint8Array\n _this._levelBuffers = options.levelBuffers\n || CompressedTextureResource._createLevelBuffers(source instanceof Uint8Array ? source : _this.buffer.uint8View, _this.format, _this.levels, 4, 4, // PVRTC has 8x4 blocks in 2bpp mode\n _this.width, _this.height);\n }\n return _this;\n }\n /**\n * @override\n * @param renderer - A reference to the current renderer\n * @param _texture - the texture\n * @param _glTexture - texture instance for this webgl context\n */\n CompressedTextureResource.prototype.upload = function (renderer, _texture, _glTexture) {\n var gl = renderer.gl;\n var extension = renderer.context.extensions[this._extension];\n if (!extension) {\n throw new Error(this._extension + \" textures are not supported on the current machine\");\n }\n if (!this._levelBuffers) {\n // Do not try to upload data before BlobResource loads, unless the levelBuffers were provided directly!\n return false;\n }\n for (var i = 0, j = this.levels; i < j; i++) {\n var _a = this._levelBuffers[i], levelID = _a.levelID, levelWidth = _a.levelWidth, levelHeight = _a.levelHeight, levelBuffer = _a.levelBuffer;\n gl.compressedTexImage2D(gl.TEXTURE_2D, levelID, this.format, levelWidth, levelHeight, 0, levelBuffer);\n }\n return true;\n };\n /** @protected */\n CompressedTextureResource.prototype.onBlobLoaded = function () {\n this._levelBuffers = CompressedTextureResource._createLevelBuffers(this.buffer.uint8View, this.format, this.levels, 4, 4, // PVRTC has 8x4 blocks in 2bpp mode\n this.width, this.height);\n };\n /**\n * Returns the key (to ContextSystem#extensions) for the WebGL extension supporting the compression format\n * @private\n * @param format - the compression format to get the extension for.\n */\n CompressedTextureResource._formatToExtension = function (format) {\n if (format >= 0x83F0 && format <= 0x83F3) {\n return 's3tc';\n }\n else if (format >= 0x9270 && format <= 0x9279) {\n return 'etc';\n }\n else if (format >= 0x8C00 && format <= 0x8C03) {\n return 'pvrtc';\n }\n else if (format >= 0x8D64) {\n return 'etc1';\n }\n else if (format >= 0x8C92 && format <= 0x87EE) {\n return 'atc';\n }\n throw new Error('Invalid (compressed) texture format given!');\n };\n /**\n * Pre-creates buffer views for each mipmap level\n * @private\n * @param buffer -\n * @param format - compression formats\n * @param levels - mipmap levels\n * @param blockWidth -\n * @param blockHeight -\n * @param imageWidth - width of the image in pixels\n * @param imageHeight - height of the image in pixels\n */\n CompressedTextureResource._createLevelBuffers = function (buffer, format, levels, blockWidth, blockHeight, imageWidth, imageHeight) {\n // The byte-size of the first level buffer\n var buffers = new Array(levels);\n var offset = buffer.byteOffset;\n var levelWidth = imageWidth;\n var levelHeight = imageHeight;\n var alignedLevelWidth = (levelWidth + blockWidth - 1) & ~(blockWidth - 1);\n var alignedLevelHeight = (levelHeight + blockHeight - 1) & ~(blockHeight - 1);\n var levelSize = alignedLevelWidth * alignedLevelHeight * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];\n for (var i = 0; i < levels; i++) {\n buffers[i] = {\n levelID: i,\n levelWidth: levels > 1 ? levelWidth : alignedLevelWidth,\n levelHeight: levels > 1 ? levelHeight : alignedLevelHeight,\n levelBuffer: new Uint8Array(buffer.buffer, offset, levelSize)\n };\n offset += levelSize;\n // Calculate levelBuffer dimensions for next iteration\n levelWidth = (levelWidth >> 1) || 1;\n levelHeight = (levelHeight >> 1) || 1;\n alignedLevelWidth = (levelWidth + blockWidth - 1) & ~(blockWidth - 1);\n alignedLevelHeight = (levelHeight + blockHeight - 1) & ~(blockHeight - 1);\n levelSize = alignedLevelWidth * alignedLevelHeight * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];\n }\n return buffers;\n };\n return CompressedTextureResource;\n}(BlobResource));\n\n/* eslint-enable camelcase */\n/**\n * Loader plugin for handling compressed textures for all platforms.\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n */\nvar CompressedTextureLoader = /** @class */ (function () {\n function CompressedTextureLoader() {\n }\n /**\n * Called after a compressed-textures manifest is loaded.\n *\n * This will then load the correct compression format for the device. Your manifest should adhere\n * to the following schema:\n *\n * ```js\n * import { INTERNAL_FORMATS } from '@pixi/constants';\n *\n * type CompressedTextureManifest = {\n * textures: Array<{ src: string, format?: keyof INTERNAL_FORMATS}>,\n * cacheID: string;\n * };\n * ```\n *\n * This is an example of a .json manifest file\n *\n * ```json\n * {\n * \"cacheID\":\"asset\",\n * \"textures\":[\n * { \"src\":\"asset.fallback.png\" },\n * { \"format\":\"COMPRESSED_RGBA_S3TC_DXT5_EXT\", \"src\":\"asset.s3tc.ktx\" },\n * { \"format\":\"COMPRESSED_RGBA8_ETC2_EAC\", \"src\":\"asset.etc.ktx\" },\n * { \"format\":\"RGBA_PVRTC_4BPPV1_IMG\", \"src\":\"asset.pvrtc.ktx\" }\n * ]\n * }\n * ```\n */\n CompressedTextureLoader.use = function (resource, next) {\n var data = resource.data;\n var loader = this;\n if (resource.type === LoaderResource.TYPE.JSON\n && data\n && data.cacheID\n && data.textures) {\n var textures = data.textures;\n var textureURL = void 0;\n var fallbackURL = void 0;\n // Search for an extension that holds one the formats\n for (var i = 0, j = textures.length; i < j; i++) {\n var texture = textures[i];\n var url_1 = texture.src;\n var format = texture.format;\n if (!format) {\n fallbackURL = url_1;\n }\n if (CompressedTextureLoader.textureFormats[format]) {\n textureURL = url_1;\n break;\n }\n }\n textureURL = textureURL || fallbackURL;\n // Make sure we have a URL\n if (!textureURL) {\n next(new Error(\"Cannot load compressed-textures in \" + resource.url + \", make sure you provide a fallback\"));\n return;\n }\n if (textureURL === resource.url) {\n // Prevent infinite loops\n next(new Error('URL of compressed texture cannot be the same as the manifest\\'s URL'));\n return;\n }\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n var resourcePath = url.resolve(resource.url.replace(loader.baseUrl, ''), textureURL);\n var resourceName = data.cacheID;\n // The appropriate loader should register the texture\n loader.add(resourceName, resourcePath, loadOptions, function (res) {\n if (res.error) {\n next(res.error);\n return;\n }\n var _a = res.texture, texture = _a === void 0 ? null : _a, _b = res.textures, textures = _b === void 0 ? {} : _b;\n // Make sure texture/textures is assigned to parent resource\n Object.assign(resource, { texture: texture, textures: textures });\n // Pass along any error\n next();\n });\n }\n else {\n next();\n }\n };\n Object.defineProperty(CompressedTextureLoader, \"textureExtensions\", {\n /** Map of available texture extensions. */\n get: function () {\n if (!CompressedTextureLoader._textureExtensions) {\n // Auto-detect WebGL compressed-texture extensions\n var canvas = settings.ADAPTER.createCanvas();\n var gl = canvas.getContext('webgl');\n if (!gl) {\n console.warn('WebGL not available for compressed textures. Silently failing.');\n return {};\n }\n var extensions = {\n s3tc: gl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: gl.getExtension('WEBGL_compressed_texture_s3tc_srgb'),\n etc: gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: gl.getExtension('WEBGL_compressed_texture_astc')\n };\n CompressedTextureLoader._textureExtensions = extensions;\n }\n return CompressedTextureLoader._textureExtensions;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CompressedTextureLoader, \"textureFormats\", {\n /** Map of available texture formats. */\n get: function () {\n if (!CompressedTextureLoader._textureFormats) {\n var extensions = CompressedTextureLoader.textureExtensions;\n CompressedTextureLoader._textureFormats = {};\n // Assign all available compressed-texture formats\n for (var extensionName in extensions) {\n var extension = extensions[extensionName];\n if (!extension) {\n continue;\n }\n Object.assign(CompressedTextureLoader._textureFormats, Object.getPrototypeOf(extension));\n }\n }\n return CompressedTextureLoader._textureFormats;\n },\n enumerable: false,\n configurable: true\n });\n /** @ignore */\n CompressedTextureLoader.extension = ExtensionType.Loader;\n return CompressedTextureLoader;\n}());\n\n/**\n * Creates base-textures and textures for each compressed-texture resource and adds them into the global\n * texture cache. The first texture has two IDs - `${url}`, `${url}-1`; while the rest have an ID of the\n * form `${url}-i`.\n * @param url - the original address of the resources\n * @param resources - the resources backing texture data\n * @ignore\n */\nfunction registerCompressedTextures(url, resources, metadata) {\n var result = {\n textures: {},\n texture: null,\n };\n if (!resources) {\n return result;\n }\n var textures = resources.map(function (resource) {\n return (new Texture(new BaseTexture(resource, Object.assign({\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA\n }, metadata))));\n });\n textures.forEach(function (texture, i) {\n var baseTexture = texture.baseTexture;\n var cacheID = url + \"-\" + (i + 1);\n BaseTexture.addToCache(baseTexture, cacheID);\n Texture.addToCache(texture, cacheID);\n if (i === 0) {\n BaseTexture.addToCache(baseTexture, url);\n Texture.addToCache(texture, url);\n result.texture = texture;\n }\n result.textures[cacheID] = texture;\n });\n return result;\n}\n\nvar _a$1, _b$1;\nvar DDS_MAGIC_SIZE = 4;\nvar DDS_HEADER_SIZE = 124;\nvar DDS_HEADER_PF_SIZE = 32;\nvar DDS_HEADER_DX10_SIZE = 20;\n// DDS file format magic word\nvar DDS_MAGIC = 0x20534444;\n/**\n * DWORD offsets of the DDS file header fields (relative to file start).\n * @ignore\n */\nvar DDS_FIELDS = {\n SIZE: 1,\n FLAGS: 2,\n HEIGHT: 3,\n WIDTH: 4,\n MIPMAP_COUNT: 7,\n PIXEL_FORMAT: 19,\n};\n/**\n * DWORD offsets of the DDS PIXEL_FORMAT fields.\n * @ignore\n */\nvar DDS_PF_FIELDS = {\n SIZE: 0,\n FLAGS: 1,\n FOURCC: 2,\n RGB_BITCOUNT: 3,\n R_BIT_MASK: 4,\n G_BIT_MASK: 5,\n B_BIT_MASK: 6,\n A_BIT_MASK: 7\n};\n/**\n * DWORD offsets of the DDS_HEADER_DX10 fields.\n * @ignore\n */\nvar DDS_DX10_FIELDS = {\n DXGI_FORMAT: 0,\n RESOURCE_DIMENSION: 1,\n MISC_FLAG: 2,\n ARRAY_SIZE: 3,\n MISC_FLAGS2: 4\n};\n/**\n * @see https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format\n * @ignore\n */\n// This is way over-blown for us! Lend us a hand, and remove the ones that aren't used (but set the remaining\n// ones to their correct value)\nvar DXGI_FORMAT;\n(function (DXGI_FORMAT) {\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_UNKNOWN\"] = 0] = \"DXGI_FORMAT_UNKNOWN\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_TYPELESS\"] = 1] = \"DXGI_FORMAT_R32G32B32A32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_FLOAT\"] = 2] = \"DXGI_FORMAT_R32G32B32A32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_UINT\"] = 3] = \"DXGI_FORMAT_R32G32B32A32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_SINT\"] = 4] = \"DXGI_FORMAT_R32G32B32A32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_TYPELESS\"] = 5] = \"DXGI_FORMAT_R32G32B32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_FLOAT\"] = 6] = \"DXGI_FORMAT_R32G32B32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_UINT\"] = 7] = \"DXGI_FORMAT_R32G32B32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_SINT\"] = 8] = \"DXGI_FORMAT_R32G32B32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_TYPELESS\"] = 9] = \"DXGI_FORMAT_R16G16B16A16_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_FLOAT\"] = 10] = \"DXGI_FORMAT_R16G16B16A16_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_UNORM\"] = 11] = \"DXGI_FORMAT_R16G16B16A16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_UINT\"] = 12] = \"DXGI_FORMAT_R16G16B16A16_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_SNORM\"] = 13] = \"DXGI_FORMAT_R16G16B16A16_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_SINT\"] = 14] = \"DXGI_FORMAT_R16G16B16A16_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_TYPELESS\"] = 15] = \"DXGI_FORMAT_R32G32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_FLOAT\"] = 16] = \"DXGI_FORMAT_R32G32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_UINT\"] = 17] = \"DXGI_FORMAT_R32G32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_SINT\"] = 18] = \"DXGI_FORMAT_R32G32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G8X24_TYPELESS\"] = 19] = \"DXGI_FORMAT_R32G8X24_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D32_FLOAT_S8X24_UINT\"] = 20] = \"DXGI_FORMAT_D32_FLOAT_S8X24_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS\"] = 21] = \"DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_X32_TYPELESS_G8X24_UINT\"] = 22] = \"DXGI_FORMAT_X32_TYPELESS_G8X24_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10A2_TYPELESS\"] = 23] = \"DXGI_FORMAT_R10G10B10A2_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10A2_UNORM\"] = 24] = \"DXGI_FORMAT_R10G10B10A2_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10A2_UINT\"] = 25] = \"DXGI_FORMAT_R10G10B10A2_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R11G11B10_FLOAT\"] = 26] = \"DXGI_FORMAT_R11G11B10_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_TYPELESS\"] = 27] = \"DXGI_FORMAT_R8G8B8A8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_UNORM\"] = 28] = \"DXGI_FORMAT_R8G8B8A8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_UNORM_SRGB\"] = 29] = \"DXGI_FORMAT_R8G8B8A8_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_UINT\"] = 30] = \"DXGI_FORMAT_R8G8B8A8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_SNORM\"] = 31] = \"DXGI_FORMAT_R8G8B8A8_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_SINT\"] = 32] = \"DXGI_FORMAT_R8G8B8A8_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_TYPELESS\"] = 33] = \"DXGI_FORMAT_R16G16_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_FLOAT\"] = 34] = \"DXGI_FORMAT_R16G16_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_UNORM\"] = 35] = \"DXGI_FORMAT_R16G16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_UINT\"] = 36] = \"DXGI_FORMAT_R16G16_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_SNORM\"] = 37] = \"DXGI_FORMAT_R16G16_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_SINT\"] = 38] = \"DXGI_FORMAT_R16G16_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_TYPELESS\"] = 39] = \"DXGI_FORMAT_R32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D32_FLOAT\"] = 40] = \"DXGI_FORMAT_D32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_FLOAT\"] = 41] = \"DXGI_FORMAT_R32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_UINT\"] = 42] = \"DXGI_FORMAT_R32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_SINT\"] = 43] = \"DXGI_FORMAT_R32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R24G8_TYPELESS\"] = 44] = \"DXGI_FORMAT_R24G8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D24_UNORM_S8_UINT\"] = 45] = \"DXGI_FORMAT_D24_UNORM_S8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R24_UNORM_X8_TYPELESS\"] = 46] = \"DXGI_FORMAT_R24_UNORM_X8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_X24_TYPELESS_G8_UINT\"] = 47] = \"DXGI_FORMAT_X24_TYPELESS_G8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_TYPELESS\"] = 48] = \"DXGI_FORMAT_R8G8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_UNORM\"] = 49] = \"DXGI_FORMAT_R8G8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_UINT\"] = 50] = \"DXGI_FORMAT_R8G8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_SNORM\"] = 51] = \"DXGI_FORMAT_R8G8_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_SINT\"] = 52] = \"DXGI_FORMAT_R8G8_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_TYPELESS\"] = 53] = \"DXGI_FORMAT_R16_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_FLOAT\"] = 54] = \"DXGI_FORMAT_R16_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D16_UNORM\"] = 55] = \"DXGI_FORMAT_D16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_UNORM\"] = 56] = \"DXGI_FORMAT_R16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_UINT\"] = 57] = \"DXGI_FORMAT_R16_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_SNORM\"] = 58] = \"DXGI_FORMAT_R16_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_SINT\"] = 59] = \"DXGI_FORMAT_R16_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_TYPELESS\"] = 60] = \"DXGI_FORMAT_R8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_UNORM\"] = 61] = \"DXGI_FORMAT_R8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_UINT\"] = 62] = \"DXGI_FORMAT_R8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_SNORM\"] = 63] = \"DXGI_FORMAT_R8_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_SINT\"] = 64] = \"DXGI_FORMAT_R8_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_A8_UNORM\"] = 65] = \"DXGI_FORMAT_A8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R1_UNORM\"] = 66] = \"DXGI_FORMAT_R1_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R9G9B9E5_SHAREDEXP\"] = 67] = \"DXGI_FORMAT_R9G9B9E5_SHAREDEXP\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_B8G8_UNORM\"] = 68] = \"DXGI_FORMAT_R8G8_B8G8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_G8R8_G8B8_UNORM\"] = 69] = \"DXGI_FORMAT_G8R8_G8B8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC1_TYPELESS\"] = 70] = \"DXGI_FORMAT_BC1_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC1_UNORM\"] = 71] = \"DXGI_FORMAT_BC1_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC1_UNORM_SRGB\"] = 72] = \"DXGI_FORMAT_BC1_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC2_TYPELESS\"] = 73] = \"DXGI_FORMAT_BC2_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC2_UNORM\"] = 74] = \"DXGI_FORMAT_BC2_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC2_UNORM_SRGB\"] = 75] = \"DXGI_FORMAT_BC2_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC3_TYPELESS\"] = 76] = \"DXGI_FORMAT_BC3_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC3_UNORM\"] = 77] = \"DXGI_FORMAT_BC3_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC3_UNORM_SRGB\"] = 78] = \"DXGI_FORMAT_BC3_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC4_TYPELESS\"] = 79] = \"DXGI_FORMAT_BC4_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC4_UNORM\"] = 80] = \"DXGI_FORMAT_BC4_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC4_SNORM\"] = 81] = \"DXGI_FORMAT_BC4_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC5_TYPELESS\"] = 82] = \"DXGI_FORMAT_BC5_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC5_UNORM\"] = 83] = \"DXGI_FORMAT_BC5_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC5_SNORM\"] = 84] = \"DXGI_FORMAT_BC5_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B5G6R5_UNORM\"] = 85] = \"DXGI_FORMAT_B5G6R5_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B5G5R5A1_UNORM\"] = 86] = \"DXGI_FORMAT_B5G5R5A1_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8A8_UNORM\"] = 87] = \"DXGI_FORMAT_B8G8R8A8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8X8_UNORM\"] = 88] = \"DXGI_FORMAT_B8G8R8X8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM\"] = 89] = \"DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8A8_TYPELESS\"] = 90] = \"DXGI_FORMAT_B8G8R8A8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8A8_UNORM_SRGB\"] = 91] = \"DXGI_FORMAT_B8G8R8A8_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8X8_TYPELESS\"] = 92] = \"DXGI_FORMAT_B8G8R8X8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8X8_UNORM_SRGB\"] = 93] = \"DXGI_FORMAT_B8G8R8X8_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC6H_TYPELESS\"] = 94] = \"DXGI_FORMAT_BC6H_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC6H_UF16\"] = 95] = \"DXGI_FORMAT_BC6H_UF16\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC6H_SF16\"] = 96] = \"DXGI_FORMAT_BC6H_SF16\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC7_TYPELESS\"] = 97] = \"DXGI_FORMAT_BC7_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC7_UNORM\"] = 98] = \"DXGI_FORMAT_BC7_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC7_UNORM_SRGB\"] = 99] = \"DXGI_FORMAT_BC7_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_AYUV\"] = 100] = \"DXGI_FORMAT_AYUV\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y410\"] = 101] = \"DXGI_FORMAT_Y410\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y416\"] = 102] = \"DXGI_FORMAT_Y416\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_NV12\"] = 103] = \"DXGI_FORMAT_NV12\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P010\"] = 104] = \"DXGI_FORMAT_P010\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P016\"] = 105] = \"DXGI_FORMAT_P016\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_420_OPAQUE\"] = 106] = \"DXGI_FORMAT_420_OPAQUE\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_YUY2\"] = 107] = \"DXGI_FORMAT_YUY2\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y210\"] = 108] = \"DXGI_FORMAT_Y210\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y216\"] = 109] = \"DXGI_FORMAT_Y216\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_NV11\"] = 110] = \"DXGI_FORMAT_NV11\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_AI44\"] = 111] = \"DXGI_FORMAT_AI44\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_IA44\"] = 112] = \"DXGI_FORMAT_IA44\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P8\"] = 113] = \"DXGI_FORMAT_P8\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_A8P8\"] = 114] = \"DXGI_FORMAT_A8P8\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B4G4R4A4_UNORM\"] = 115] = \"DXGI_FORMAT_B4G4R4A4_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P208\"] = 116] = \"DXGI_FORMAT_P208\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_V208\"] = 117] = \"DXGI_FORMAT_V208\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_V408\"] = 118] = \"DXGI_FORMAT_V408\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE\"] = 119] = \"DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE\"] = 120] = \"DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_FORCE_UINT\"] = 121] = \"DXGI_FORMAT_FORCE_UINT\";\n})(DXGI_FORMAT || (DXGI_FORMAT = {}));\n/**\n * Possible values of the field {@link DDS_DX10_FIELDS.RESOURCE_DIMENSION}\n * @ignore\n */\nvar D3D10_RESOURCE_DIMENSION;\n(function (D3D10_RESOURCE_DIMENSION) {\n D3D10_RESOURCE_DIMENSION[D3D10_RESOURCE_DIMENSION[\"DDS_DIMENSION_TEXTURE1D\"] = 2] = \"DDS_DIMENSION_TEXTURE1D\";\n D3D10_RESOURCE_DIMENSION[D3D10_RESOURCE_DIMENSION[\"DDS_DIMENSION_TEXTURE2D\"] = 3] = \"DDS_DIMENSION_TEXTURE2D\";\n D3D10_RESOURCE_DIMENSION[D3D10_RESOURCE_DIMENSION[\"DDS_DIMENSION_TEXTURE3D\"] = 6] = \"DDS_DIMENSION_TEXTURE3D\";\n})(D3D10_RESOURCE_DIMENSION || (D3D10_RESOURCE_DIMENSION = {}));\nvar PF_FLAGS = 1;\n// PIXEL_FORMAT flags\nvar DDPF_ALPHA = 0x2;\nvar DDPF_FOURCC = 0x4;\nvar DDPF_RGB = 0x40;\nvar DDPF_YUV = 0x200;\nvar DDPF_LUMINANCE = 0x20000;\n// Four character codes for DXTn formats\nvar FOURCC_DXT1 = 0x31545844;\nvar FOURCC_DXT3 = 0x33545844;\nvar FOURCC_DXT5 = 0x35545844;\nvar FOURCC_DX10 = 0x30315844;\n// Cubemap texture flag (for DDS_DX10_FIELDS.MISC_FLAG)\nvar DDS_RESOURCE_MISC_TEXTURECUBE = 0x4;\n/**\n * Maps `FOURCC_*` formats to internal formats (see {@link PIXI.INTERNAL_FORMATS}).\n * @ignore\n */\nvar FOURCC_TO_FORMAT = (_a$1 = {},\n _a$1[FOURCC_DXT1] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n _a$1[FOURCC_DXT3] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n _a$1[FOURCC_DXT5] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n _a$1);\n/**\n * Maps {@link DXGI_FORMAT} to types/internal-formats (see {@link PIXI.TYPES}, {@link PIXI.INTERNAL_FORMATS})\n * @ignore\n */\nvar DXGI_TO_FORMAT = (_b$1 = {},\n // WEBGL_compressed_texture_s3tc\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC1_TYPELESS] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC2_TYPELESS] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC3_TYPELESS] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n // WEBGL_compressed_texture_s3tc_srgb\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM_SRGB] = INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM_SRGB] = INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM_SRGB] = INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,\n _b$1);\n/**\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n * @see https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide\n */\n/**\n * Parses the DDS file header, generates base-textures, and puts them into the texture cache.\n * @param arrayBuffer\n */\nfunction parseDDS(arrayBuffer) {\n var data = new Uint32Array(arrayBuffer);\n var magicWord = data[0];\n if (magicWord !== DDS_MAGIC) {\n throw new Error('Invalid DDS file magic word');\n }\n var header = new Uint32Array(arrayBuffer, 0, DDS_HEADER_SIZE / Uint32Array.BYTES_PER_ELEMENT);\n // DDS header fields\n var height = header[DDS_FIELDS.HEIGHT];\n var width = header[DDS_FIELDS.WIDTH];\n var mipmapCount = header[DDS_FIELDS.MIPMAP_COUNT];\n // PIXEL_FORMAT fields\n var pixelFormat = new Uint32Array(arrayBuffer, DDS_FIELDS.PIXEL_FORMAT * Uint32Array.BYTES_PER_ELEMENT, DDS_HEADER_PF_SIZE / Uint32Array.BYTES_PER_ELEMENT);\n var formatFlags = pixelFormat[PF_FLAGS];\n // File contains compressed texture(s)\n if (formatFlags & DDPF_FOURCC) {\n var fourCC = pixelFormat[DDS_PF_FIELDS.FOURCC];\n // File contains one DXTn compressed texture\n if (fourCC !== FOURCC_DX10) {\n var internalFormat_1 = FOURCC_TO_FORMAT[fourCC];\n var dataOffset_1 = DDS_MAGIC_SIZE + DDS_HEADER_SIZE;\n var texData = new Uint8Array(arrayBuffer, dataOffset_1);\n var resource = new CompressedTextureResource(texData, {\n format: internalFormat_1,\n width: width,\n height: height,\n levels: mipmapCount // CompressedTextureResource will separate the levelBuffers for us!\n });\n return [resource];\n }\n // FOURCC_DX10 indicates there is a 20-byte DDS_HEADER_DX10 after DDS_HEADER\n var dx10Offset = DDS_MAGIC_SIZE + DDS_HEADER_SIZE;\n var dx10Header = new Uint32Array(data.buffer, dx10Offset, DDS_HEADER_DX10_SIZE / Uint32Array.BYTES_PER_ELEMENT);\n var dxgiFormat = dx10Header[DDS_DX10_FIELDS.DXGI_FORMAT];\n var resourceDimension = dx10Header[DDS_DX10_FIELDS.RESOURCE_DIMENSION];\n var miscFlag = dx10Header[DDS_DX10_FIELDS.MISC_FLAG];\n var arraySize = dx10Header[DDS_DX10_FIELDS.ARRAY_SIZE];\n // Map dxgiFormat to PIXI.INTERNAL_FORMATS\n var internalFormat_2 = DXGI_TO_FORMAT[dxgiFormat];\n if (internalFormat_2 === undefined) {\n throw new Error(\"DDSParser cannot parse texture data with DXGI format \" + dxgiFormat);\n }\n if (miscFlag === DDS_RESOURCE_MISC_TEXTURECUBE) {\n // FIXME: Anybody excited about cubemap compressed textures?\n throw new Error('DDSParser does not support cubemap textures');\n }\n if (resourceDimension === D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D) {\n // FIXME: Anybody excited about 3D compressed textures?\n throw new Error('DDSParser does not supported 3D texture data');\n }\n // Uint8Array buffers of image data, including all mipmap levels in each image\n var imageBuffers = new Array();\n var dataOffset = DDS_MAGIC_SIZE\n + DDS_HEADER_SIZE\n + DDS_HEADER_DX10_SIZE;\n if (arraySize === 1) {\n // No need bothering with the imageSize calculation!\n imageBuffers.push(new Uint8Array(arrayBuffer, dataOffset));\n }\n else {\n // Calculate imageSize for each texture, and then locate each image's texture data\n var pixelSize = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[internalFormat_2];\n var imageSize = 0;\n var levelWidth = width;\n var levelHeight = height;\n for (var i = 0; i < mipmapCount; i++) {\n var alignedLevelWidth = Math.max(1, (levelWidth + 3) & ~3);\n var alignedLevelHeight = Math.max(1, (levelHeight + 3) & ~3);\n var levelSize = alignedLevelWidth * alignedLevelHeight * pixelSize;\n imageSize += levelSize;\n levelWidth = levelWidth >>> 1;\n levelHeight = levelHeight >>> 1;\n }\n var imageOffset = dataOffset;\n // NOTE: Cubemaps have 6-images per texture (but they aren't supported so ^_^)\n for (var i = 0; i < arraySize; i++) {\n imageBuffers.push(new Uint8Array(arrayBuffer, imageOffset, imageSize));\n imageOffset += imageSize;\n }\n }\n // Uint8Array -> CompressedTextureResource, and we're done!\n return imageBuffers.map(function (buffer) { return new CompressedTextureResource(buffer, {\n format: internalFormat_2,\n width: width,\n height: height,\n levels: mipmapCount\n }); });\n }\n if (formatFlags & DDPF_RGB) {\n // FIXME: We might want to allow uncompressed *.dds files?\n throw new Error('DDSParser does not support uncompressed texture data.');\n }\n if (formatFlags & DDPF_YUV) {\n // FIXME: Does anybody need this feature?\n throw new Error('DDSParser does not supported YUV uncompressed texture data.');\n }\n if (formatFlags & DDPF_LUMINANCE) {\n // FIXME: Microsoft says older DDS filers use this feature! Probably not worth the effort!\n throw new Error('DDSParser does not support single-channel (lumninance) texture data!');\n }\n if (formatFlags & DDPF_ALPHA) {\n // FIXME: I'm tired! See above =)\n throw new Error('DDSParser does not support single-channel (alpha) texture data!');\n }\n throw new Error('DDSParser failed to load a texture file due to an unknown reason!');\n}\n\nvar _a, _b, _c;\n/**\n * The 12-byte KTX file identifier\n * @see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/#2.1\n * @ignore\n */\nvar FILE_IDENTIFIER = [0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A];\n/**\n * The value stored in the \"endianness\" field.\n * @see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/#2.2\n * @ignore\n */\nvar ENDIANNESS = 0x04030201;\n/**\n * Byte offsets of the KTX file header fields\n * @ignore\n */\nvar KTX_FIELDS = {\n FILE_IDENTIFIER: 0,\n ENDIANNESS: 12,\n GL_TYPE: 16,\n GL_TYPE_SIZE: 20,\n GL_FORMAT: 24,\n GL_INTERNAL_FORMAT: 28,\n GL_BASE_INTERNAL_FORMAT: 32,\n PIXEL_WIDTH: 36,\n PIXEL_HEIGHT: 40,\n PIXEL_DEPTH: 44,\n NUMBER_OF_ARRAY_ELEMENTS: 48,\n NUMBER_OF_FACES: 52,\n NUMBER_OF_MIPMAP_LEVELS: 56,\n BYTES_OF_KEY_VALUE_DATA: 60\n};\n/**\n * Byte size of the file header fields in {@code KTX_FIELDS}\n * @ignore\n */\nvar FILE_HEADER_SIZE = 64;\n/**\n * Maps {@link PIXI.TYPES} to the bytes taken per component, excluding those ones that are bit-fields.\n * @ignore\n */\nvar TYPES_TO_BYTES_PER_COMPONENT = (_a = {},\n _a[TYPES.UNSIGNED_BYTE] = 1,\n _a[TYPES.UNSIGNED_SHORT] = 2,\n _a[TYPES.INT] = 4,\n _a[TYPES.UNSIGNED_INT] = 4,\n _a[TYPES.FLOAT] = 4,\n _a[TYPES.HALF_FLOAT] = 8,\n _a);\n/**\n * Number of components in each {@link PIXI.FORMATS}\n * @ignore\n */\nvar FORMATS_TO_COMPONENTS = (_b = {},\n _b[FORMATS.RGBA] = 4,\n _b[FORMATS.RGB] = 3,\n _b[FORMATS.RG] = 2,\n _b[FORMATS.RED] = 1,\n _b[FORMATS.LUMINANCE] = 1,\n _b[FORMATS.LUMINANCE_ALPHA] = 2,\n _b[FORMATS.ALPHA] = 1,\n _b);\n/**\n * Number of bytes per pixel in bit-field types in {@link PIXI.TYPES}\n * @ignore\n */\nvar TYPES_TO_BYTES_PER_PIXEL = (_c = {},\n _c[TYPES.UNSIGNED_SHORT_4_4_4_4] = 2,\n _c[TYPES.UNSIGNED_SHORT_5_5_5_1] = 2,\n _c[TYPES.UNSIGNED_SHORT_5_6_5] = 2,\n _c);\nfunction parseKTX(url, arrayBuffer, loadKeyValueData) {\n if (loadKeyValueData === void 0) { loadKeyValueData = false; }\n var dataView = new DataView(arrayBuffer);\n if (!validate(url, dataView)) {\n return null;\n }\n var littleEndian = dataView.getUint32(KTX_FIELDS.ENDIANNESS, true) === ENDIANNESS;\n var glType = dataView.getUint32(KTX_FIELDS.GL_TYPE, littleEndian);\n // const glTypeSize = dataView.getUint32(KTX_FIELDS.GL_TYPE_SIZE, littleEndian);\n var glFormat = dataView.getUint32(KTX_FIELDS.GL_FORMAT, littleEndian);\n var glInternalFormat = dataView.getUint32(KTX_FIELDS.GL_INTERNAL_FORMAT, littleEndian);\n var pixelWidth = dataView.getUint32(KTX_FIELDS.PIXEL_WIDTH, littleEndian);\n var pixelHeight = dataView.getUint32(KTX_FIELDS.PIXEL_HEIGHT, littleEndian) || 1; // \"pixelHeight = 0\" -> \"1\"\n var pixelDepth = dataView.getUint32(KTX_FIELDS.PIXEL_DEPTH, littleEndian) || 1; // ^^\n var numberOfArrayElements = dataView.getUint32(KTX_FIELDS.NUMBER_OF_ARRAY_ELEMENTS, littleEndian) || 1; // ^^\n var numberOfFaces = dataView.getUint32(KTX_FIELDS.NUMBER_OF_FACES, littleEndian);\n var numberOfMipmapLevels = dataView.getUint32(KTX_FIELDS.NUMBER_OF_MIPMAP_LEVELS, littleEndian);\n var bytesOfKeyValueData = dataView.getUint32(KTX_FIELDS.BYTES_OF_KEY_VALUE_DATA, littleEndian);\n // Whether the platform architecture is little endian. If littleEndian !== platformLittleEndian, then the\n // file contents must be endian-converted!\n // TODO: Endianness conversion\n // const platformLittleEndian = new Uint8Array((new Uint32Array([ENDIANNESS])).buffer)[0] === 0x01;\n if (pixelHeight === 0 || pixelDepth !== 1) {\n throw new Error('Only 2D textures are supported');\n }\n if (numberOfFaces !== 1) {\n throw new Error('CubeTextures are not supported by KTXLoader yet!');\n }\n if (numberOfArrayElements !== 1) {\n // TODO: Support splitting array-textures into multiple BaseTextures\n throw new Error('WebGL does not support array textures');\n }\n // TODO: 8x4 blocks for 2bpp pvrtc\n var blockWidth = 4;\n var blockHeight = 4;\n var alignedWidth = (pixelWidth + 3) & ~3;\n var alignedHeight = (pixelHeight + 3) & ~3;\n var imageBuffers = new Array(numberOfArrayElements);\n var imagePixels = pixelWidth * pixelHeight;\n if (glType === 0) {\n // Align to 16 pixels (4x4 blocks)\n imagePixels = alignedWidth * alignedHeight;\n }\n var imagePixelByteSize;\n if (glType !== 0) {\n // Uncompressed texture format\n if (TYPES_TO_BYTES_PER_COMPONENT[glType]) {\n imagePixelByteSize = TYPES_TO_BYTES_PER_COMPONENT[glType] * FORMATS_TO_COMPONENTS[glFormat];\n }\n else {\n imagePixelByteSize = TYPES_TO_BYTES_PER_PIXEL[glType];\n }\n }\n else {\n imagePixelByteSize = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[glInternalFormat];\n }\n if (imagePixelByteSize === undefined) {\n throw new Error('Unable to resolve the pixel format stored in the *.ktx file!');\n }\n var kvData = loadKeyValueData\n ? parseKvData(dataView, bytesOfKeyValueData, littleEndian)\n : null;\n var imageByteSize = imagePixels * imagePixelByteSize;\n var mipByteSize = imageByteSize;\n var mipWidth = pixelWidth;\n var mipHeight = pixelHeight;\n var alignedMipWidth = alignedWidth;\n var alignedMipHeight = alignedHeight;\n var imageOffset = FILE_HEADER_SIZE + bytesOfKeyValueData;\n for (var mipmapLevel = 0; mipmapLevel < numberOfMipmapLevels; mipmapLevel++) {\n var imageSize = dataView.getUint32(imageOffset, littleEndian);\n var elementOffset = imageOffset + 4;\n for (var arrayElement = 0; arrayElement < numberOfArrayElements; arrayElement++) {\n // TODO: Maybe support 3D textures? :-)\n // for (let zSlice = 0; zSlice < pixelDepth; zSlice)\n var mips = imageBuffers[arrayElement];\n if (!mips) {\n mips = imageBuffers[arrayElement] = new Array(numberOfMipmapLevels);\n }\n mips[mipmapLevel] = {\n levelID: mipmapLevel,\n // don't align mipWidth when texture not compressed! (glType not zero)\n levelWidth: numberOfMipmapLevels > 1 || glType !== 0 ? mipWidth : alignedMipWidth,\n levelHeight: numberOfMipmapLevels > 1 || glType !== 0 ? mipHeight : alignedMipHeight,\n levelBuffer: new Uint8Array(arrayBuffer, elementOffset, mipByteSize)\n };\n elementOffset += mipByteSize;\n }\n // HINT: Aligns to 4-byte boundary after jumping imageSize (in lieu of mipPadding)\n imageOffset += imageSize + 4; // (+4 to jump the imageSize field itself)\n imageOffset = imageOffset % 4 !== 0 ? imageOffset + 4 - (imageOffset % 4) : imageOffset;\n // Calculate mipWidth, mipHeight for _next_ iteration\n mipWidth = (mipWidth >> 1) || 1;\n mipHeight = (mipHeight >> 1) || 1;\n alignedMipWidth = (mipWidth + blockWidth - 1) & ~(blockWidth - 1);\n alignedMipHeight = (mipHeight + blockHeight - 1) & ~(blockHeight - 1);\n // Each mipmap level is 4-times smaller?\n mipByteSize = alignedMipWidth * alignedMipHeight * imagePixelByteSize;\n }\n // We use the levelBuffers feature of CompressedTextureResource b/c texture data is image-major, not level-major.\n if (glType !== 0) {\n return {\n uncompressed: imageBuffers.map(function (levelBuffers) {\n var buffer = levelBuffers[0].levelBuffer;\n var convertToInt = false;\n if (glType === TYPES.FLOAT) {\n buffer = new Float32Array(levelBuffers[0].levelBuffer.buffer, levelBuffers[0].levelBuffer.byteOffset, levelBuffers[0].levelBuffer.byteLength / 4);\n }\n else if (glType === TYPES.UNSIGNED_INT) {\n convertToInt = true;\n buffer = new Uint32Array(levelBuffers[0].levelBuffer.buffer, levelBuffers[0].levelBuffer.byteOffset, levelBuffers[0].levelBuffer.byteLength / 4);\n }\n else if (glType === TYPES.INT) {\n convertToInt = true;\n buffer = new Int32Array(levelBuffers[0].levelBuffer.buffer, levelBuffers[0].levelBuffer.byteOffset, levelBuffers[0].levelBuffer.byteLength / 4);\n }\n return {\n resource: new BufferResource(buffer, {\n width: levelBuffers[0].levelWidth,\n height: levelBuffers[0].levelHeight,\n }),\n type: glType,\n format: convertToInt ? convertFormatToInteger(glFormat) : glFormat,\n };\n }),\n kvData: kvData\n };\n }\n return {\n compressed: imageBuffers.map(function (levelBuffers) { return new CompressedTextureResource(null, {\n format: glInternalFormat,\n width: pixelWidth,\n height: pixelHeight,\n levels: numberOfMipmapLevels,\n levelBuffers: levelBuffers,\n }); }),\n kvData: kvData\n };\n}\n/**\n * Checks whether the arrayBuffer contains a valid *.ktx file.\n * @param url\n * @param dataView\n */\nfunction validate(url, dataView) {\n // NOTE: Do not optimize this into 3 32-bit integer comparison because the endianness\n // of the data is not specified.\n for (var i = 0; i < FILE_IDENTIFIER.length; i++) {\n if (dataView.getUint8(i) !== FILE_IDENTIFIER[i]) {\n console.error(url + \" is not a valid *.ktx file!\");\n return false;\n }\n }\n return true;\n}\nfunction convertFormatToInteger(format) {\n switch (format) {\n case FORMATS.RGBA: return FORMATS.RGBA_INTEGER;\n case FORMATS.RGB: return FORMATS.RGB_INTEGER;\n case FORMATS.RG: return FORMATS.RG_INTEGER;\n case FORMATS.RED: return FORMATS.RED_INTEGER;\n default: return format;\n }\n}\nfunction parseKvData(dataView, bytesOfKeyValueData, littleEndian) {\n var kvData = new Map();\n var bytesIntoKeyValueData = 0;\n while (bytesIntoKeyValueData < bytesOfKeyValueData) {\n var keyAndValueByteSize = dataView.getUint32(FILE_HEADER_SIZE + bytesIntoKeyValueData, littleEndian);\n var keyAndValueByteOffset = FILE_HEADER_SIZE + bytesIntoKeyValueData + 4;\n var valuePadding = 3 - ((keyAndValueByteSize + 3) % 4);\n // Bounds check\n if (keyAndValueByteSize === 0 || keyAndValueByteSize > bytesOfKeyValueData - bytesIntoKeyValueData) {\n console.error('KTXLoader: keyAndValueByteSize out of bounds');\n break;\n }\n // Note: keyNulByte can't be 0 otherwise the key is an empty string.\n var keyNulByte = 0;\n for (; keyNulByte < keyAndValueByteSize; keyNulByte++) {\n if (dataView.getUint8(keyAndValueByteOffset + keyNulByte) === 0x00) {\n break;\n }\n }\n if (keyNulByte === -1) {\n console.error('KTXLoader: Failed to find null byte terminating kvData key');\n break;\n }\n var key = new TextDecoder().decode(new Uint8Array(dataView.buffer, keyAndValueByteOffset, keyNulByte));\n var value = new DataView(dataView.buffer, keyAndValueByteOffset + keyNulByte + 1, keyAndValueByteSize - keyNulByte - 1);\n kvData.set(key, value);\n // 4 = the keyAndValueByteSize field itself\n // keyAndValueByteSize = the bytes taken by the key and value\n // valuePadding = extra padding to align with 4 bytes\n bytesIntoKeyValueData += 4 + keyAndValueByteSize + valuePadding;\n }\n return kvData;\n}\n\n// Set DDS files to be loaded as an ArrayBuffer\nLoaderResource.setExtensionXhrType('dds', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);\n/**\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n * @see https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide\n */\nvar DDSLoader = /** @class */ (function () {\n function DDSLoader() {\n }\n /**\n * Registers a DDS compressed texture\n * @see PIXI.Loader.loaderMiddleware\n * @param resource - loader resource that is checked to see if it is a DDS file\n * @param next - callback Function to call when done\n */\n DDSLoader.use = function (resource, next) {\n if (resource.extension === 'dds' && resource.data) {\n try {\n Object.assign(resource, registerCompressedTextures(resource.name || resource.url, parseDDS(resource.data), resource.metadata));\n }\n catch (err) {\n next(err);\n return;\n }\n }\n next();\n };\n /** @ignore */\n DDSLoader.extension = ExtensionType.Loader;\n return DDSLoader;\n}());\n\n// Set KTX files to be loaded as an ArrayBuffer\nLoaderResource.setExtensionXhrType('ktx', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);\n/**\n * Loader plugin for handling KTX texture container files.\n *\n * This KTX loader does not currently support the following features:\n * * cube textures\n * * 3D textures\n * * endianness conversion for big-endian machines\n * * embedded *.basis files\n *\n * It does supports the following features:\n * * multiple textures per file\n * * mipmapping (only for compressed formats)\n * * vendor-specific key/value data parsing (enable {@link PIXI.KTXLoader.loadKeyValueData})\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n */\nvar KTXLoader = /** @class */ (function () {\n function KTXLoader() {\n }\n /**\n * Called after a KTX file is loaded.\n *\n * This will parse the KTX file header and add a {@code BaseTexture} to the texture\n * cache.\n * @see PIXI.Loader.loaderMiddleware\n * @param resource - loader resource that is checked to see if it is a KTX file\n * @param next - callback Function to call when done\n */\n KTXLoader.use = function (resource, next) {\n if (resource.extension === 'ktx' && resource.data) {\n try {\n var url_1 = resource.name || resource.url;\n var _a = parseKTX(url_1, resource.data, this.loadKeyValueData), compressed = _a.compressed, uncompressed = _a.uncompressed, kvData_1 = _a.kvData;\n if (compressed) {\n var result = registerCompressedTextures(url_1, compressed, resource.metadata);\n if (kvData_1 && result.textures) {\n for (var textureId in result.textures) {\n result.textures[textureId].baseTexture.ktxKeyValueData = kvData_1;\n }\n }\n Object.assign(resource, result);\n }\n else if (uncompressed) {\n var textures_1 = {};\n uncompressed.forEach(function (image, i) {\n var texture = new Texture(new BaseTexture(image.resource, {\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,\n type: image.type,\n format: image.format,\n }));\n var cacheID = url_1 + \"-\" + (i + 1);\n if (kvData_1)\n { texture.baseTexture.ktxKeyValueData = kvData_1; }\n BaseTexture.addToCache(texture.baseTexture, cacheID);\n Texture.addToCache(texture, cacheID);\n if (i === 0) {\n textures_1[url_1] = texture;\n BaseTexture.addToCache(texture.baseTexture, url_1);\n Texture.addToCache(texture, url_1);\n }\n textures_1[cacheID] = texture;\n });\n Object.assign(resource, { textures: textures_1 });\n }\n }\n catch (err) {\n next(err);\n return;\n }\n }\n next();\n };\n /** @ignore */\n KTXLoader.extension = ExtensionType.Loader;\n /**\n * If set to `true`, {@link PIXI.KTXLoader} will parse key-value data in KTX textures. This feature relies\n * on the [Encoding Standard]{@link https://encoding.spec.whatwg.org}.\n *\n * The key-value data will be available on the base-textures as {@code PIXI.BaseTexture.ktxKeyValueData}. They\n * will hold a reference to the texture data buffer, so make sure to delete key-value data once you are done\n * using it.\n */\n KTXLoader.loadKeyValueData = false;\n return KTXLoader;\n}());\n\nexport { BlobResource, CompressedTextureLoader, CompressedTextureResource, DDSLoader, FORMATS_TO_COMPONENTS, INTERNAL_FORMATS, INTERNAL_FORMAT_TO_BYTES_PER_PIXEL, KTXLoader, TYPES_TO_BYTES_PER_COMPONENT, TYPES_TO_BYTES_PER_PIXEL, parseDDS, parseKTX };\n//# sourceMappingURL=compressed-textures.mjs.map\n","/*!\n * @pixi/particle-container - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/particle-container is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { hex2rgb, createIndicesForQuads, correctBlendMode, premultiplyRgba, premultiplyTint } from '@pixi/utils';\nimport { Geometry, Buffer, ExtensionType, ObjectRenderer, Shader, State } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles.\n *\n * The tradeoff of the ParticleContainer is that most advanced functionality will not work.\n * ParticleContainer implements the basic object transform (position, scale, rotation)\n * and some advanced functionality like tint (as of v4.5.6).\n *\n * Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use:\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = PIXI.Sprite.from(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be rendered at the speed of light.\n * @memberof PIXI\n */\nvar ParticleContainer = /** @class */ (function (_super) {\n __extends(ParticleContainer, _super);\n /**\n * @param maxSize - The maximum number of particles that can be rendered by the container.\n * Affects size of allocated buffers.\n * @param properties - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied.\n * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.tint=false] - When true, alpha and tint be uploaded and applied.\n * @param {number} [batchSize=16384] - Number of particles per batch. If less than maxSize, it uses maxSize instead.\n * @param {boolean} [autoResize=false] - If true, container allocates more batches in case\n * there are more than `maxSize` particles.\n */\n function ParticleContainer(maxSize, properties, batchSize, autoResize) {\n if (maxSize === void 0) { maxSize = 1500; }\n if (batchSize === void 0) { batchSize = 16384; }\n if (autoResize === void 0) { autoResize = false; }\n var _this = _super.call(this) || this;\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n var maxBatchSize = 16384;\n if (batchSize > maxBatchSize) {\n batchSize = maxBatchSize;\n }\n _this._properties = [false, true, false, false, false];\n _this._maxSize = maxSize;\n _this._batchSize = batchSize;\n _this._buffers = null;\n _this._bufferUpdateIDs = [];\n _this._updateID = 0;\n _this.interactiveChildren = false;\n _this.blendMode = BLEND_MODES.NORMAL;\n _this.autoResize = autoResize;\n _this.roundPixels = true;\n _this.baseTexture = null;\n _this.setProperties(properties);\n _this._tint = 0;\n _this.tintRgb = new Float32Array(4);\n _this.tint = 0xFFFFFF;\n return _this;\n }\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n * @param properties - The properties to be uploaded\n */\n ParticleContainer.prototype.setProperties = function (properties) {\n if (properties) {\n this._properties[0] = 'vertices' in properties || 'scale' in properties\n ? !!properties.vertices || !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'tint' in properties || 'alpha' in properties\n ? !!properties.tint || !!properties.alpha : this._properties[4];\n }\n };\n ParticleContainer.prototype.updateTransform = function () {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n };\n Object.defineProperty(ParticleContainer.prototype, \"tint\", {\n /**\n * The tint applied to the container. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n hex2rgb(value, this.tintRgb);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Renders the container using the WebGL renderer.\n * @param renderer - The WebGL renderer.\n */\n ParticleContainer.prototype.render = function (renderer) {\n var _this = this;\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n if (!this.baseTexture) {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.valid) {\n this.baseTexture.once('update', function () { return _this.onChildrenChange(0); });\n }\n }\n renderer.batch.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n };\n /**\n * Set the flag that static data should be updated to true\n * @param smallestChildIndex - The smallest child index.\n */\n ParticleContainer.prototype.onChildrenChange = function (smallestChildIndex) {\n var bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n while (this._bufferUpdateIDs.length < bufferIndex) {\n this._bufferUpdateIDs.push(0);\n }\n this._bufferUpdateIDs[bufferIndex] = ++this._updateID;\n };\n ParticleContainer.prototype.dispose = function () {\n if (this._buffers) {\n for (var i = 0; i < this._buffers.length; ++i) {\n this._buffers[i].destroy();\n }\n this._buffers = null;\n }\n };\n /**\n * Destroys the container\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n ParticleContainer.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.dispose();\n this._properties = null;\n this._buffers = null;\n this._bufferUpdateIDs = null;\n };\n return ParticleContainer;\n}(Container));\n\n/*\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n * @private\n * @memberof PIXI\n */\nvar ParticleBuffer = /** @class */ (function () {\n /**\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n function ParticleBuffer(properties, dynamicPropertyFlags, size) {\n this.geometry = new Geometry();\n this.indexBuffer = null;\n this.size = size;\n this.dynamicProperties = [];\n this.staticProperties = [];\n for (var i = 0; i < properties.length; ++i) {\n var property = properties[i];\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attributeName: property.attributeName,\n size: property.size,\n uploadFunction: property.uploadFunction,\n type: property.type || TYPES.FLOAT,\n offset: property.offset,\n };\n if (dynamicPropertyFlags[i]) {\n this.dynamicProperties.push(property);\n }\n else {\n this.staticProperties.push(property);\n }\n }\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this._updateID = 0;\n this.initBuffers();\n }\n /** Sets up the renderer context and necessary buffers. */\n ParticleBuffer.prototype.initBuffers = function () {\n var geometry = this.geometry;\n var dynamicOffset = 0;\n this.indexBuffer = new Buffer(createIndicesForQuads(this.size), true, true);\n geometry.addIndex(this.indexBuffer);\n this.dynamicStride = 0;\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = new Buffer(this.dynamicData, false, false);\n // static //\n var staticOffset = 0;\n this.staticStride = 0;\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n property.offset = staticOffset;\n staticOffset += property.size;\n this.staticStride += property.size;\n }\n var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = new Buffer(this.staticData, true, false);\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n geometry.addAttribute(property.attributeName, this.dynamicBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.dynamicStride * 4, property.offset * 4);\n }\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n geometry.addAttribute(property.attributeName, this.staticBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.staticStride * 4, property.offset * 4);\n }\n };\n /**\n * Uploads the dynamic properties.\n * @param children - The children to upload.\n * @param startIndex - The index to start at.\n * @param amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadDynamic = function (children, startIndex, amount) {\n for (var i = 0; i < this.dynamicProperties.length; i++) {\n var property = this.dynamicProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset);\n }\n this.dynamicBuffer._updateID++;\n };\n /**\n * Uploads the static properties.\n * @param children - The children to upload.\n * @param startIndex - The index to start at.\n * @param amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadStatic = function (children, startIndex, amount) {\n for (var i = 0; i < this.staticProperties.length; i++) {\n var property = this.staticProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset);\n }\n this.staticBuffer._updateID++;\n };\n /** Destroys the ParticleBuffer. */\n ParticleBuffer.prototype.destroy = function () {\n this.indexBuffer = null;\n this.dynamicProperties = null;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this.staticProperties = null;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n // all buffers are destroyed inside geometry\n this.geometry.destroy();\n };\n return ParticleBuffer;\n}());\n\nvar fragment = \"varying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void){\\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\\n gl_FragColor = color;\\n}\";\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\nattribute vec4 aColor;\\n\\nattribute vec2 aPositionCoord;\\nattribute float aRotation;\\n\\nuniform mat3 translationMatrix;\\nuniform vec4 uColor;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nvoid main(void){\\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\\n\\n vec2 v = vec2(x, y);\\n v = v + aPositionCoord;\\n\\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vColor = aColor * uColor;\\n}\\n\";\n\n/*\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n/**\n * Renderer for Particles that is designer for speed over feature set.\n * @memberof PIXI\n */\nvar ParticleRenderer = /** @class */ (function (_super) {\n __extends(ParticleRenderer, _super);\n /**\n * @param renderer - The renderer this sprite batch works for.\n */\n function ParticleRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n _this.shader = null;\n _this.properties = null;\n _this.tempMatrix = new Matrix();\n _this.properties = [\n // verticesData\n {\n attributeName: 'aVertexPosition',\n size: 2,\n uploadFunction: _this.uploadVertices,\n offset: 0,\n },\n // positionData\n {\n attributeName: 'aPositionCoord',\n size: 2,\n uploadFunction: _this.uploadPosition,\n offset: 0,\n },\n // rotationData\n {\n attributeName: 'aRotation',\n size: 1,\n uploadFunction: _this.uploadRotation,\n offset: 0,\n },\n // uvsData\n {\n attributeName: 'aTextureCoord',\n size: 2,\n uploadFunction: _this.uploadUvs,\n offset: 0,\n },\n // tintData\n {\n attributeName: 'aColor',\n size: 1,\n type: TYPES.UNSIGNED_BYTE,\n uploadFunction: _this.uploadTint,\n offset: 0,\n } ];\n _this.shader = Shader.from(vertex, fragment, {});\n _this.state = State.for2d();\n return _this;\n }\n /**\n * Renders the particle container object.\n * @param container - The container to render using this ParticleRenderer.\n */\n ParticleRenderer.prototype.render = function (container) {\n var children = container.children;\n var maxSize = container._maxSize;\n var batchSize = container._batchSize;\n var renderer = this.renderer;\n var totalChildren = children.length;\n if (totalChildren === 0) {\n return;\n }\n else if (totalChildren > maxSize && !container.autoResize) {\n totalChildren = maxSize;\n }\n var buffers = container._buffers;\n if (!buffers) {\n buffers = container._buffers = this.generateBuffers(container);\n }\n var baseTexture = children[0]._texture.baseTexture;\n var premultiplied = baseTexture.alphaMode > 0;\n // if the uvs have not updated then no point rendering just yet!\n this.state.blendMode = correctBlendMode(container.blendMode, premultiplied);\n renderer.state.set(this.state);\n var gl = renderer.gl;\n var m = container.worldTransform.copyTo(this.tempMatrix);\n m.prepend(renderer.globalUniforms.uniforms.projectionMatrix);\n this.shader.uniforms.translationMatrix = m.toArray(true);\n this.shader.uniforms.uColor = premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, premultiplied);\n this.shader.uniforms.uSampler = baseTexture;\n this.renderer.shader.bind(this.shader);\n var updateStatic = false;\n // now lets upload and render the buffers..\n for (var i = 0, j = 0; i < totalChildren; i += batchSize, j += 1) {\n var amount = (totalChildren - i);\n if (amount > batchSize) {\n amount = batchSize;\n }\n if (j >= buffers.length) {\n buffers.push(this._generateOneMoreBuffer(container));\n }\n var buffer = buffers[j];\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n var bid = container._bufferUpdateIDs[j] || 0;\n updateStatic = updateStatic || (buffer._updateID < bid);\n // we only upload the static content when we have to!\n if (updateStatic) {\n buffer._updateID = container._updateID;\n buffer.uploadStatic(children, i, amount);\n }\n // bind the buffer\n renderer.geometry.bind(buffer.geometry);\n gl.drawElements(gl.TRIANGLES, amount * 6, gl.UNSIGNED_SHORT, 0);\n }\n };\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties.\n * @param container - The container to render using this ParticleRenderer\n * @returns - The buffers\n */\n ParticleRenderer.prototype.generateBuffers = function (container) {\n var buffers = [];\n var size = container._maxSize;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n for (var i = 0; i < size; i += batchSize) {\n buffers.push(new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize));\n }\n return buffers;\n };\n /**\n * Creates one more particle buffer, because container has autoResize feature.\n * @param container - The container to render using this ParticleRenderer\n * @returns - The generated buffer\n */\n ParticleRenderer.prototype._generateOneMoreBuffer = function (container) {\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n return new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize);\n };\n /**\n * Uploads the vertices.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their vertices uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadVertices = function (children, startIndex, amount, array, stride, offset) {\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var texture = sprite._texture;\n var sx = sprite.scale.x;\n var sy = sprite.scale.y;\n var trim = texture.trim;\n var orig = texture.orig;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - (sprite.anchor.x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (sprite.anchor.y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w0 = (orig.width) * (1 - sprite.anchor.x);\n w1 = (orig.width) * -sprite.anchor.x;\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n array[offset + (stride * 2)] = w0 * sx;\n array[offset + (stride * 2) + 1] = h0 * sy;\n array[offset + (stride * 3)] = w1 * sx;\n array[offset + (stride * 3) + 1] = h0 * sy;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the position.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their positions uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadPosition = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spritePosition = children[startIndex + i].position;\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n array[offset + (stride * 2)] = spritePosition.x;\n array[offset + (stride * 2) + 1] = spritePosition.y;\n array[offset + (stride * 3)] = spritePosition.x;\n array[offset + (stride * 3) + 1] = spritePosition.y;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the rotation.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their rotation uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadRotation = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteRotation = children[startIndex + i].rotation;\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + (stride * 2)] = spriteRotation;\n array[offset + (stride * 3)] = spriteRotation;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the UVs.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their rotation uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadUvs = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var textureUvs = children[startIndex + i]._texture._uvs;\n if (textureUvs) {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n array[offset + (stride * 2)] = textureUvs.x2;\n array[offset + (stride * 2) + 1] = textureUvs.y2;\n array[offset + (stride * 3)] = textureUvs.x3;\n array[offset + (stride * 3) + 1] = textureUvs.y3;\n offset += stride * 4;\n }\n else {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n array[offset + (stride * 2)] = 0;\n array[offset + (stride * 2) + 1] = 0;\n array[offset + (stride * 3)] = 0;\n array[offset + (stride * 3) + 1] = 0;\n offset += stride * 4;\n }\n }\n };\n /**\n * Uploads the tint.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their rotation uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadTint = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var premultiplied = sprite._texture.baseTexture.alphaMode > 0;\n var alpha = sprite.alpha;\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && premultiplied\n ? premultiplyTint(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n array[offset] = argb;\n array[offset + stride] = argb;\n array[offset + (stride * 2)] = argb;\n array[offset + (stride * 3)] = argb;\n offset += stride * 4;\n }\n };\n /** Destroys the ParticleRenderer. */\n ParticleRenderer.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.shader) {\n this.shader.destroy();\n this.shader = null;\n }\n this.tempMatrix = null;\n };\n /** @ignore */\n ParticleRenderer.extension = {\n name: 'particle',\n type: ExtensionType.RendererPlugin,\n };\n return ParticleRenderer;\n}(ObjectRenderer));\n\nexport { ParticleContainer, ParticleRenderer };\n//# sourceMappingURL=particle-container.mjs.map\n","/*!\n * @pixi/graphics - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/graphics is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, BaseTexture, BatchDrawCall, BatchTextureArray, BatchGeometry, UniformGroup, Shader, State } from '@pixi/core';\nimport { SHAPES, Point, PI_2, Polygon, Rectangle, RoundedRectangle, Circle, Ellipse, Matrix } from '@pixi/math';\nimport { earcut, premultiplyTint, hex2rgb } from '@pixi/utils';\nimport { WRAP_MODES, DRAW_MODES, BLEND_MODES } from '@pixi/constants';\nimport { Bounds, Container } from '@pixi/display';\n\n/**\n * Supported line joints in `PIXI.LineStyle` for graphics.\n * @see PIXI.Graphics#lineStyle\n * @see https://graphicdesign.stackexchange.com/questions/59018/what-is-a-bevel-join-of-two-lines-exactly-illustrator\n * @name LINE_JOIN\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} MITER - 'miter': make a sharp corner where outer part of lines meet\n * @property {string} BEVEL - 'bevel': add a square butt at each end of line segment and fill the triangle at turn\n * @property {string} ROUND - 'round': add an arc at the joint\n */\nvar LINE_JOIN;\n(function (LINE_JOIN) {\n LINE_JOIN[\"MITER\"] = \"miter\";\n LINE_JOIN[\"BEVEL\"] = \"bevel\";\n LINE_JOIN[\"ROUND\"] = \"round\";\n})(LINE_JOIN || (LINE_JOIN = {}));\n/**\n * Support line caps in `PIXI.LineStyle` for graphics.\n * @see PIXI.Graphics#lineStyle\n * @name LINE_CAP\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} BUTT - 'butt': don't add any cap at line ends (leaves orthogonal edges)\n * @property {string} ROUND - 'round': add semicircle at ends\n * @property {string} SQUARE - 'square': add square at end (like `BUTT` except more length at end)\n */\nvar LINE_CAP;\n(function (LINE_CAP) {\n LINE_CAP[\"BUTT\"] = \"butt\";\n LINE_CAP[\"ROUND\"] = \"round\";\n LINE_CAP[\"SQUARE\"] = \"square\";\n})(LINE_CAP || (LINE_CAP = {}));\n/**\n * Graphics curves resolution settings. If `adaptive` flag is set to `true`,\n * the resolution is calculated based on the curve's length to ensure better visual quality.\n * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.\n * @static\n * @constant\n * @memberof PIXI\n * @name GRAPHICS_CURVES\n * @type {object}\n * @property {boolean} [adaptive=true] - flag indicating if the resolution should be adaptive\n * @property {number} [maxLength=10] - maximal length of a single segment of the curve (if adaptive = false, ignored)\n * @property {number} [minSegments=8] - minimal number of segments in the curve (if adaptive = false, ignored)\n * @property {number} [maxSegments=2048] - maximal number of segments in the curve (if adaptive = false, ignored)\n */\nvar GRAPHICS_CURVES = {\n adaptive: true,\n maxLength: 10,\n minSegments: 8,\n maxSegments: 2048,\n epsilon: 0.0001,\n _segmentsCount: function (length, defaultSegments) {\n if (defaultSegments === void 0) { defaultSegments = 20; }\n if (!this.adaptive || !length || isNaN(length)) {\n return defaultSegments;\n }\n var result = Math.ceil(length / this.maxLength);\n if (result < this.minSegments) {\n result = this.minSegments;\n }\n else if (result > this.maxSegments) {\n result = this.maxSegments;\n }\n return result;\n },\n};\n\n/**\n * Fill style object for Graphics.\n * @memberof PIXI\n */\nvar FillStyle = /** @class */ (function () {\n function FillStyle() {\n /**\n * The hex color value used when coloring the Graphics object.\n * @default 0xFFFFFF\n */\n this.color = 0xFFFFFF;\n /** The alpha value used when filling the Graphics object. */\n this.alpha = 1.0;\n /**\n * The texture to be used for the fill.\n * @default 0\n */\n this.texture = Texture.WHITE;\n /**\n * The transform applied to the texture.\n * @default null\n */\n this.matrix = null;\n /** If the current fill is visible. */\n this.visible = false;\n this.reset();\n }\n /** Clones the object */\n FillStyle.prototype.clone = function () {\n var obj = new FillStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n return obj;\n };\n /** Reset */\n FillStyle.prototype.reset = function () {\n this.color = 0xFFFFFF;\n this.alpha = 1;\n this.texture = Texture.WHITE;\n this.matrix = null;\n this.visible = false;\n };\n /** Destroy and don't use after this. */\n FillStyle.prototype.destroy = function () {\n this.texture = null;\n this.matrix = null;\n };\n return FillStyle;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nfunction fixOrientation(points, hole) {\n var _a, _b;\n if (hole === void 0) { hole = false; }\n var m = points.length;\n if (m < 6) {\n return;\n }\n var area = 0;\n for (var i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2) {\n var x2 = points[i];\n var y2 = points[i + 1];\n area += (x2 - x1) * (y2 + y1);\n x1 = x2;\n y1 = y2;\n }\n if ((!hole && area > 0) || (hole && area <= 0)) {\n var n = m / 2;\n for (var i = n + (n % 2); i < m; i += 2) {\n var i1 = m - i - 2;\n var i2 = m - i - 1;\n var i3 = i;\n var i4 = i + 1;\n _a = [points[i3], points[i1]], points[i1] = _a[0], points[i3] = _a[1];\n _b = [points[i4], points[i2]], points[i2] = _b[0], points[i4] = _b[1];\n }\n }\n}\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildPoly = {\n build: function (graphicsData) {\n graphicsData.points = graphicsData.shape.points.slice();\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var holes = graphicsData.holes;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n if (points.length >= 6) {\n fixOrientation(points, false);\n var holeArray = [];\n // Process holes..\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n fixOrientation(hole.points, true);\n holeArray.push(points.length / 2);\n points = points.concat(hole.points);\n }\n // sort color\n var triangles = earcut(points, holeArray, 2);\n if (!triangles) {\n return;\n }\n var vertPos = verts.length / 2;\n for (var i = 0; i < triangles.length; i += 3) {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n for (var i = 0; i < points.length; i++) {\n verts.push(points[i]);\n }\n }\n },\n};\n\n// for type only\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildCircle = {\n build: function (graphicsData) {\n // need to convert points to a nice regular data\n var points = graphicsData.points;\n var x;\n var y;\n var dx;\n var dy;\n var rx;\n var ry;\n if (graphicsData.type === SHAPES.CIRC) {\n var circle = graphicsData.shape;\n x = circle.x;\n y = circle.y;\n rx = ry = circle.radius;\n dx = dy = 0;\n }\n else if (graphicsData.type === SHAPES.ELIP) {\n var ellipse = graphicsData.shape;\n x = ellipse.x;\n y = ellipse.y;\n rx = ellipse.width;\n ry = ellipse.height;\n dx = dy = 0;\n }\n else {\n var roundedRect = graphicsData.shape;\n var halfWidth = roundedRect.width / 2;\n var halfHeight = roundedRect.height / 2;\n x = roundedRect.x + halfWidth;\n y = roundedRect.y + halfHeight;\n rx = ry = Math.max(0, Math.min(roundedRect.radius, Math.min(halfWidth, halfHeight)));\n dx = halfWidth - rx;\n dy = halfHeight - ry;\n }\n if (!(rx >= 0 && ry >= 0 && dx >= 0 && dy >= 0)) {\n points.length = 0;\n return;\n }\n // Choose a number of segments such that the maximum absolute deviation from the circle is approximately 0.029\n var n = Math.ceil(2.3 * Math.sqrt(rx + ry));\n var m = (n * 8) + (dx ? 4 : 0) + (dy ? 4 : 0);\n points.length = m;\n if (m === 0) {\n return;\n }\n if (n === 0) {\n points.length = 8;\n points[0] = points[6] = x + dx;\n points[1] = points[3] = y + dy;\n points[2] = points[4] = x - dx;\n points[5] = points[7] = y - dy;\n return;\n }\n var j1 = 0;\n var j2 = (n * 4) + (dx ? 2 : 0) + 2;\n var j3 = j2;\n var j4 = m;\n {\n var x0 = dx + rx;\n var y0 = dy;\n var x1 = x + x0;\n var x2 = x - x0;\n var y1 = y + y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j2] = y1;\n points[--j2] = x2;\n if (dy) {\n var y2 = y - y0;\n points[j3++] = x2;\n points[j3++] = y2;\n points[--j4] = y2;\n points[--j4] = x1;\n }\n }\n for (var i = 1; i < n; i++) {\n var a = Math.PI / 2 * (i / n);\n var x0 = dx + (Math.cos(a) * rx);\n var y0 = dy + (Math.sin(a) * ry);\n var x1 = x + x0;\n var x2 = x - x0;\n var y1 = y + y0;\n var y2 = y - y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j2] = y1;\n points[--j2] = x2;\n points[j3++] = x2;\n points[j3++] = y2;\n points[--j4] = y2;\n points[--j4] = x1;\n }\n {\n var x0 = dx;\n var y0 = dy + ry;\n var x1 = x + x0;\n var x2 = x - x0;\n var y1 = y + y0;\n var y2 = y - y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x1;\n if (dx) {\n points[j1++] = x2;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x2;\n }\n }\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n if (points.length === 0) {\n return;\n }\n var vertPos = verts.length / 2;\n var center = vertPos;\n var x;\n var y;\n if (graphicsData.type !== SHAPES.RREC) {\n var circle = graphicsData.shape;\n x = circle.x;\n y = circle.y;\n }\n else {\n var roundedRect = graphicsData.shape;\n x = roundedRect.x + (roundedRect.width / 2);\n y = roundedRect.y + (roundedRect.height / 2);\n }\n var matrix = graphicsData.matrix;\n // Push center (special point)\n verts.push(graphicsData.matrix ? (matrix.a * x) + (matrix.c * y) + matrix.tx : x, graphicsData.matrix ? (matrix.b * x) + (matrix.d * y) + matrix.ty : y);\n vertPos++;\n verts.push(points[0], points[1]);\n for (var i = 2; i < points.length; i += 2) {\n verts.push(points[i], points[i + 1]);\n // add some uvs\n indices.push(vertPos++, center, vertPos);\n }\n indices.push(center + 1, center, vertPos);\n },\n};\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRectangle = {\n build: function (graphicsData) {\n // --- //\n // need to convert points to a nice regular data\n //\n var rectData = graphicsData.shape;\n var x = rectData.x;\n var y = rectData.y;\n var width = rectData.width;\n var height = rectData.height;\n var points = graphicsData.points;\n points.length = 0;\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var vertPos = verts.length / 2;\n verts.push(points[0], points[1], points[2], points[3], points[6], points[7], points[4], points[5]);\n graphicsGeometry.indices.push(vertPos, vertPos + 1, vertPos + 2, vertPos + 1, vertPos + 2, vertPos + 3);\n },\n};\n\n/**\n * Calculate a single point for a quadratic bezier curve.\n * Utility function used by quadraticBezierCurve.\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} n1 - first number\n * @param {number} n2 - second number\n * @param {number} perc - percentage\n * @returns {number} the result\n */\nfunction getPt(n1, n2, perc) {\n var diff = n2 - n1;\n return n1 + (diff * perc);\n}\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @returns {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY, out) {\n if (out === void 0) { out = []; }\n var n = 20;\n var points = out;\n var xa = 0;\n var ya = 0;\n var xb = 0;\n var yb = 0;\n var x = 0;\n var y = 0;\n for (var i = 0, j = 0; i <= n; ++i) {\n j = i / n;\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n // Handle case when first curve points overlaps and earcut fails to triangulate\n if (i === 0 && points[points.length - 2] === x && points[points.length - 1] === y) {\n continue;\n }\n points.push(x, y);\n }\n return points;\n}\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRoundedRectangle = {\n build: function (graphicsData) {\n if (Graphics.nextRoundedRectBehavior) {\n buildCircle.build(graphicsData);\n return;\n }\n var rrectData = graphicsData.shape;\n var points = graphicsData.points;\n var x = rrectData.x;\n var y = rrectData.y;\n var width = rrectData.width;\n var height = rrectData.height;\n // Don't allow negative radius or greater than half the smallest width\n var radius = Math.max(0, Math.min(rrectData.radius, Math.min(width, height) / 2));\n points.length = 0;\n // No radius, do a simple rectangle\n if (!radius) {\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n }\n else {\n quadraticBezierCurve(x, y + radius, x, y, x + radius, y, points);\n quadraticBezierCurve(x + width - radius, y, x + width, y, x + width, y + radius, points);\n quadraticBezierCurve(x + width, y + height - radius, x + width, y + height, x + width - radius, y + height, points);\n quadraticBezierCurve(x + radius, y + height, x, y + height, x, y + height - radius, points);\n }\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n if (Graphics.nextRoundedRectBehavior) {\n buildCircle.triangulate(graphicsData, graphicsGeometry);\n return;\n }\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var vecPos = verts.length / 2;\n var triangles = earcut(points, null, 2);\n for (var i = 0, j = triangles.length; i < j; i += 3) {\n indices.push(triangles[i] + vecPos);\n // indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n // indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n for (var i = 0, j = points.length; i < j; i++) {\n verts.push(points[i], points[++i]);\n }\n },\n};\n\n/**\n * Buffers vertices to draw a square cap.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} x - X-coord of end point\n * @param {number} y - Y-coord of end point\n * @param {number} nx - X-coord of line normal pointing inside\n * @param {number} ny - Y-coord of line normal pointing inside\n * @param {number} innerWeight - Weight of inner points\n * @param {number} outerWeight - Weight of outer points\n * @param {boolean} clockwise - Whether the cap is drawn clockwise\n * @param {Array} verts - vertex buffer\n * @returns {number} - no. of vertices pushed\n */\nfunction square(x, y, nx, ny, innerWeight, outerWeight, clockwise, /* rotation for square (true at left end, false at right end) */ verts) {\n var ix = x - (nx * innerWeight);\n var iy = y - (ny * innerWeight);\n var ox = x + (nx * outerWeight);\n var oy = y + (ny * outerWeight);\n /* Rotate nx,ny for extension vector */\n var exx;\n var eyy;\n if (clockwise) {\n exx = ny;\n eyy = -nx;\n }\n else {\n exx = -ny;\n eyy = nx;\n }\n /* [i|0]x,y extended at cap */\n var eix = ix + exx;\n var eiy = iy + eyy;\n var eox = ox + exx;\n var eoy = oy + eyy;\n /* Square itself must be inserted clockwise*/\n verts.push(eix, eiy);\n verts.push(eox, eoy);\n return 2;\n}\n/**\n * Buffers vertices to draw an arc at the line joint or cap.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} cx - X-coord of center\n * @param {number} cy - Y-coord of center\n * @param {number} sx - X-coord of arc start\n * @param {number} sy - Y-coord of arc start\n * @param {number} ex - X-coord of arc end\n * @param {number} ey - Y-coord of arc end\n * @param {Array} verts - buffer of vertices\n * @param {boolean} clockwise - orientation of vertices\n * @returns {number} - no. of vertices pushed\n */\nfunction round(cx, cy, sx, sy, ex, ey, verts, clockwise) {\n var cx2p0x = sx - cx;\n var cy2p0y = sy - cy;\n var angle0 = Math.atan2(cx2p0x, cy2p0y);\n var angle1 = Math.atan2(ex - cx, ey - cy);\n if (clockwise && angle0 < angle1) {\n angle0 += Math.PI * 2;\n }\n else if (!clockwise && angle0 > angle1) {\n angle1 += Math.PI * 2;\n }\n var startAngle = angle0;\n var angleDiff = angle1 - angle0;\n var absAngleDiff = Math.abs(angleDiff);\n /* if (absAngleDiff >= PI_LBOUND && absAngleDiff <= PI_UBOUND)\n {\n const r1x = cx - nxtPx;\n const r1y = cy - nxtPy;\n\n if (r1x === 0)\n {\n if (r1y > 0)\n {\n angleDiff = -angleDiff;\n }\n }\n else if (r1x >= -GRAPHICS_CURVES.epsilon)\n {\n angleDiff = -angleDiff;\n }\n }*/\n var radius = Math.sqrt((cx2p0x * cx2p0x) + (cy2p0y * cy2p0y));\n var segCount = ((15 * absAngleDiff * Math.sqrt(radius) / Math.PI) >> 0) + 1;\n var angleInc = angleDiff / segCount;\n startAngle += angleInc;\n if (clockwise) {\n verts.push(cx, cy);\n verts.push(sx, sy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx, cy);\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n }\n verts.push(cx, cy);\n verts.push(ex, ey);\n }\n else {\n verts.push(sx, sy);\n verts.push(cx, cy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n verts.push(cx, cy);\n }\n verts.push(ex, ey);\n verts.push(cx, cy);\n }\n return segCount * 2;\n}\n/**\n * Builds a line to draw using the polygon method.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNonNativeLine(graphicsData, graphicsGeometry) {\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points.slice();\n var eps = graphicsGeometry.closePointEps;\n if (points.length === 0) {\n return;\n }\n // if the line width is an odd number add 0.5 to align to a whole pixel\n // commenting this out fixes #711 and #1620\n // if (graphicsData.lineWidth%2)\n // {\n // for (i = 0; i < points.length; i++)\n // {\n // points[i] += 0.5;\n // }\n // }\n var style = graphicsData.lineStyle;\n // get first and last point.. figure out the middle!\n var firstPoint = new Point(points[0], points[1]);\n var lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps\n && Math.abs(firstPoint.y - lastPoint.y) < eps;\n // if the first point is the last point - gonna have issues :)\n if (closedShape) {\n // need to clone as we are going to slightly modify the shape..\n points = points.slice();\n if (closedPath) {\n points.pop();\n points.pop();\n lastPoint.set(points[points.length - 2], points[points.length - 1]);\n }\n var midPointX = (firstPoint.x + lastPoint.x) * 0.5;\n var midPointY = (lastPoint.y + firstPoint.y) * 0.5;\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n var verts = graphicsGeometry.points;\n var length = points.length / 2;\n var indexCount = points.length;\n var indexStart = verts.length / 2;\n // Max. inner and outer width\n var width = style.width / 2;\n var widthSquared = width * width;\n var miterLimitSquared = style.miterLimit * style.miterLimit;\n /* Line segments of interest where (x1,y1) forms the corner. */\n var x0 = points[0];\n var y0 = points[1];\n var x1 = points[2];\n var y1 = points[3];\n var x2 = 0;\n var y2 = 0;\n /* perp[?](x|y) = the line normal with magnitude lineWidth. */\n var perpx = -(y0 - y1);\n var perpy = x0 - x1;\n var perp1x = 0;\n var perp1y = 0;\n var dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n var ratio = style.alignment; // 0.5;\n var innerWeight = (1 - ratio) * 2;\n var outerWeight = ratio * 2;\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x0 - (perpx * (innerWeight - outerWeight) * 0.5), y0 - (perpy * (innerWeight - outerWeight) * 0.5), x0 - (perpx * innerWeight), y0 - (perpy * innerWeight), x0 + (perpx * outerWeight), y0 + (perpy * outerWeight), verts, true) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x0, y0, perpx, perpy, innerWeight, outerWeight, true, verts);\n }\n }\n // Push first point (below & above vertices)\n verts.push(x0 - (perpx * innerWeight), y0 - (perpy * innerWeight));\n verts.push(x0 + (perpx * outerWeight), y0 + (perpy * outerWeight));\n for (var i = 1; i < length - 1; ++i) {\n x0 = points[(i - 1) * 2];\n y0 = points[((i - 1) * 2) + 1];\n x1 = points[i * 2];\n y1 = points[(i * 2) + 1];\n x2 = points[(i + 1) * 2];\n y2 = points[((i + 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n perp1x = -(y1 - y2);\n perp1y = x1 - x2;\n dist = Math.sqrt((perp1x * perp1x) + (perp1y * perp1y));\n perp1x /= dist;\n perp1y /= dist;\n perp1x *= width;\n perp1y *= width;\n /* d[x|y](0|1) = the component displacement between points p(0,1|1,2) */\n var dx0 = x1 - x0;\n var dy0 = y0 - y1;\n var dx1 = x1 - x2;\n var dy1 = y2 - y1;\n /* +ve if internal angle < 90 degree, -ve if internal angle > 90 degree. */\n var dot = (dx0 * dx1) + (dy0 * dy1);\n /* +ve if internal angle counterclockwise, -ve if internal angle clockwise. */\n var cross = (dy0 * dx1) - (dy1 * dx0);\n var clockwise = (cross < 0);\n /* Going nearly parallel? */\n /* atan(0.001) ~= 0.001 rad ~= 0.057 degree */\n if (Math.abs(cross) < 0.001 * Math.abs(dot)) {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n /* 180 degree corner? */\n if (dot >= 0) {\n if (style.join === LINE_JOIN.ROUND) {\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 4;\n }\n else {\n indexCount += 2;\n }\n verts.push(x1 - (perp1x * outerWeight), y1 - (perp1y * outerWeight));\n verts.push(x1 + (perp1x * innerWeight), y1 + (perp1y * innerWeight));\n }\n continue;\n }\n /* p[x|y] is the miter point. pdist is the distance between miter point and p1. */\n var c1 = ((-perpx + x0) * (-perpy + y1)) - ((-perpx + x1) * (-perpy + y0));\n var c2 = ((-perp1x + x2) * (-perp1y + y1)) - ((-perp1x + x1) * (-perp1y + y2));\n var px = ((dx0 * c2) - (dx1 * c1)) / cross;\n var py = ((dy1 * c1) - (dy0 * c2)) / cross;\n var pdist = ((px - x1) * (px - x1)) + ((py - y1) * (py - y1));\n /* Inner miter point */\n var imx = x1 + ((px - x1) * innerWeight);\n var imy = y1 + ((py - y1) * innerWeight);\n /* Outer miter point */\n var omx = x1 - ((px - x1) * outerWeight);\n var omy = y1 - ((py - y1) * outerWeight);\n /* Is the inside miter point too far away, creating a spike? */\n var smallerInsideSegmentSq = Math.min((dx0 * dx0) + (dy0 * dy0), (dx1 * dx1) + (dy1 * dy1));\n var insideWeight = clockwise ? innerWeight : outerWeight;\n var smallerInsideDiagonalSq = smallerInsideSegmentSq + (insideWeight * insideWeight * widthSquared);\n var insideMiterOk = pdist <= smallerInsideDiagonalSq;\n if (insideMiterOk) {\n if (style.join === LINE_JOIN.BEVEL || pdist / widthSquared > miterLimitSquared) {\n if (clockwise) /* rotating at inner angle */ {\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n }\n else /* rotating at outer angle */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(omx, omy); // outer miter point\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's outer vertex\n verts.push(omx, omy); // outer miter point\n }\n indexCount += 2;\n }\n else if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n verts.push(imx, imy);\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 4;\n verts.push(imx, imy);\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight));\n }\n else /* arc is inside */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(omx, omy);\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 4;\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight));\n verts.push(omx, omy);\n }\n }\n else {\n verts.push(imx, imy);\n verts.push(omx, omy);\n }\n }\n else // inside miter is NOT ok\n {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 2;\n }\n else /* arc is inside */ {\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 2;\n }\n }\n else if (style.join === LINE_JOIN.MITER && pdist / widthSquared <= miterLimitSquared) {\n if (clockwise) {\n verts.push(omx, omy); // inner miter point\n verts.push(omx, omy); // inner miter point\n }\n else {\n verts.push(imx, imy); // outer miter point\n verts.push(imx, imy); // outer miter point\n }\n indexCount += 2;\n }\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's inner vertex\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n indexCount += 2;\n }\n }\n x0 = points[(length - 2) * 2];\n y0 = points[((length - 2) * 2) + 1];\n x1 = points[(length - 1) * 2];\n y1 = points[((length - 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x1 - (perpx * (innerWeight - outerWeight) * 0.5), y1 - (perpy * (innerWeight - outerWeight) * 0.5), x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), verts, false) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x1, y1, perpx, perpy, innerWeight, outerWeight, false, verts);\n }\n }\n var indices = graphicsGeometry.indices;\n var eps2 = GRAPHICS_CURVES.epsilon * GRAPHICS_CURVES.epsilon;\n // indices.push(indexStart);\n for (var i = indexStart; i < indexCount + indexStart - 2; ++i) {\n x0 = verts[(i * 2)];\n y0 = verts[(i * 2) + 1];\n x1 = verts[(i + 1) * 2];\n y1 = verts[((i + 1) * 2) + 1];\n x2 = verts[(i + 2) * 2];\n y2 = verts[((i + 2) * 2) + 1];\n /* Skip zero area triangles */\n if (Math.abs((x0 * (y1 - y2)) + (x1 * (y2 - y0)) + (x2 * (y0 - y1))) < eps2) {\n continue;\n }\n indices.push(i, i + 1, i + 2);\n }\n}\n/**\n * Builds a line to draw using the gl.drawArrays(gl.LINES) method\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNativeLine(graphicsData, graphicsGeometry) {\n var i = 0;\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points;\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n if (points.length === 0)\n { return; }\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var length = points.length / 2;\n var startIndex = verts.length / 2;\n var currentIndex = startIndex;\n verts.push(points[0], points[1]);\n for (i = 1; i < length; i++) {\n verts.push(points[i * 2], points[(i * 2) + 1]);\n indices.push(currentIndex, currentIndex + 1);\n currentIndex++;\n }\n if (closedShape) {\n indices.push(currentIndex, startIndex);\n }\n}\n/**\n * Builds a line to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildLine(graphicsData, graphicsGeometry) {\n if (graphicsData.lineStyle.native) {\n buildNativeLine(graphicsData, graphicsGeometry);\n }\n else {\n buildNonNativeLine(graphicsData, graphicsGeometry);\n }\n}\n\n/**\n * Utilities for arc curves.\n * @private\n */\nvar ArcUtils = /** @class */ (function () {\n function ArcUtils() {\n }\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n * @private\n * @param x1 - The x-coordinate of the beginning of the arc\n * @param y1 - The y-coordinate of the beginning of the arc\n * @param x2 - The x-coordinate of the end of the arc\n * @param y2 - The y-coordinate of the end of the arc\n * @param radius - The radius of the arc\n * @param points -\n * @returns - If the arc length is valid, return center of circle, radius and other info otherwise `null`.\n */\n ArcUtils.curveTo = function (x1, y1, x2, y2, radius, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var a1 = fromY - y1;\n var b1 = fromX - x1;\n var a2 = y2 - y1;\n var b2 = x2 - x1;\n var mm = Math.abs((a1 * b2) - (b1 * a2));\n if (mm < 1.0e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n return null;\n }\n var dd = (a1 * a1) + (b1 * b1);\n var cc = (a2 * a2) + (b2 * b2);\n var tt = (a1 * a2) + (b1 * b2);\n var k1 = radius * Math.sqrt(dd) / mm;\n var k2 = radius * Math.sqrt(cc) / mm;\n var j1 = k1 * tt / dd;\n var j2 = k2 * tt / cc;\n var cx = (k1 * b2) + (k2 * b1);\n var cy = (k1 * a2) + (k2 * a1);\n var px = b1 * (k2 + j1);\n var py = a1 * (k2 + j1);\n var qx = b2 * (k1 + j2);\n var qy = a2 * (k1 + j2);\n var startAngle = Math.atan2(py - cy, px - cx);\n var endAngle = Math.atan2(qy - cy, qx - cx);\n return {\n cx: (cx + x1),\n cy: (cy + y1),\n radius: radius,\n startAngle: startAngle,\n endAngle: endAngle,\n anticlockwise: (b1 * a2 > b2 * a1),\n };\n };\n /* eslint-disable max-len */\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n * @private\n * @param _startX - Start x location of arc\n * @param _startY - Start y location of arc\n * @param cx - The x-coordinate of the center of the circle\n * @param cy - The y-coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param endAngle - The ending angle, in radians\n * @param _anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @param points - Collection of points to add to\n */\n ArcUtils.arc = function (_startX, _startY, cx, cy, radius, startAngle, endAngle, _anticlockwise, points) {\n var sweep = endAngle - startAngle;\n var n = GRAPHICS_CURVES._segmentsCount(Math.abs(sweep) * radius, Math.ceil(Math.abs(sweep) / PI_2) * 40);\n var theta = (sweep) / (n * 2);\n var theta2 = theta * 2;\n var cTheta = Math.cos(theta);\n var sTheta = Math.sin(theta);\n var segMinus = n - 1;\n var remainder = (segMinus % 1) / segMinus;\n for (var i = 0; i <= segMinus; ++i) {\n var real = i + (remainder * i);\n var angle = ((theta) + startAngle + (theta2 * real));\n var c = Math.cos(angle);\n var s = -Math.sin(angle);\n points.push((((cTheta * c) + (sTheta * s)) * radius) + cx, (((cTheta * -s) + (sTheta * c)) * radius) + cy);\n }\n };\n return ArcUtils;\n}());\n\n/**\n * Utilities for bezier curves\n * @private\n */\nvar BezierUtils = /** @class */ (function () {\n function BezierUtils() {\n }\n /**\n * Calculate length of bezier curve.\n * Analytical solution is impossible, since it involves an integral that does not integrate in general.\n * Therefore numerical solution is used.\n * @private\n * @param fromX - Starting point x\n * @param fromY - Starting point y\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - Length of bezier curve\n */\n BezierUtils.curveLength = function (fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {\n var n = 10;\n var result = 0.0;\n var t = 0.0;\n var t2 = 0.0;\n var t3 = 0.0;\n var nt = 0.0;\n var nt2 = 0.0;\n var nt3 = 0.0;\n var x = 0.0;\n var y = 0.0;\n var dx = 0.0;\n var dy = 0.0;\n var prevX = fromX;\n var prevY = fromY;\n for (var i = 1; i <= n; ++i) {\n t = i / n;\n t2 = t * t;\n t3 = t2 * t;\n nt = (1.0 - t);\n nt2 = nt * nt;\n nt3 = nt2 * nt;\n x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX);\n y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY);\n dx = prevX - x;\n dy = prevY - y;\n prevX = x;\n prevY = y;\n result += Math.sqrt((dx * dx) + (dy * dy));\n }\n return result;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Path array to push points into\n */\n BezierUtils.curveTo = function (cpX, cpY, cpX2, cpY2, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n points.length -= 2;\n var n = GRAPHICS_CURVES._segmentsCount(BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY));\n var dt = 0;\n var dt2 = 0;\n var dt3 = 0;\n var t2 = 0;\n var t3 = 0;\n points.push(fromX, fromY);\n for (var i = 1, j = 0; i <= n; ++i) {\n j = i / n;\n dt = (1 - j);\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n t2 = j * j;\n t3 = t2 * j;\n points.push((dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX), (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY));\n }\n };\n return BezierUtils;\n}());\n\n/**\n * Utilities for quadratic curves.\n * @private\n */\nvar QuadraticUtils = /** @class */ (function () {\n function QuadraticUtils() {\n }\n /**\n * Calculate length of quadratic curve\n * @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}\n * for the detailed explanation of math behind this.\n * @private\n * @param fromX - x-coordinate of curve start point\n * @param fromY - y-coordinate of curve start point\n * @param cpX - x-coordinate of curve control point\n * @param cpY - y-coordinate of curve control point\n * @param toX - x-coordinate of curve end point\n * @param toY - y-coordinate of curve end point\n * @returns - Length of quadratic curve\n */\n QuadraticUtils.curveLength = function (fromX, fromY, cpX, cpY, toX, toY) {\n var ax = fromX - (2.0 * cpX) + toX;\n var ay = fromY - (2.0 * cpY) + toY;\n var bx = (2.0 * cpX) - (2.0 * fromX);\n var by = (2.0 * cpY) - (2.0 * fromY);\n var a = 4.0 * ((ax * ax) + (ay * ay));\n var b = 4.0 * ((ax * bx) + (ay * by));\n var c = (bx * bx) + (by * by);\n var s = 2.0 * Math.sqrt(a + b + c);\n var a2 = Math.sqrt(a);\n var a32 = 2.0 * a * a2;\n var c2 = 2.0 * Math.sqrt(c);\n var ba = b / a2;\n return ((a32 * s)\n + (a2 * b * (s - c2))\n + (((4.0 * c * a) - (b * b))\n * Math.log(((2.0 * a2) + ba + s) / (ba + c2)))) / (4.0 * a32);\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @private\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Points to add segments to.\n */\n QuadraticUtils.curveTo = function (cpX, cpY, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var n = GRAPHICS_CURVES._segmentsCount(QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY));\n var xa = 0;\n var ya = 0;\n for (var i = 1; i <= n; ++i) {\n var j = i / n;\n xa = fromX + ((cpX - fromX) * j);\n ya = fromY + ((cpY - fromY) * j);\n points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j), ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n }\n };\n return QuadraticUtils;\n}());\n\n/**\n * A structure to hold interim batch objects for Graphics.\n * @memberof PIXI.graphicsUtils\n */\nvar BatchPart = /** @class */ (function () {\n function BatchPart() {\n this.reset();\n }\n /**\n * Begin batch part.\n * @param style\n * @param startIndex\n * @param attribStart\n */\n BatchPart.prototype.begin = function (style, startIndex, attribStart) {\n this.reset();\n this.style = style;\n this.start = startIndex;\n this.attribStart = attribStart;\n };\n /**\n * End batch part.\n * @param endIndex\n * @param endAttrib\n */\n BatchPart.prototype.end = function (endIndex, endAttrib) {\n this.attribSize = endAttrib - this.attribStart;\n this.size = endIndex - this.start;\n };\n BatchPart.prototype.reset = function () {\n this.style = null;\n this.size = 0;\n this.start = 0;\n this.attribStart = 0;\n this.attribSize = 0;\n };\n return BatchPart;\n}());\n\n/**\n * Generalized convenience utilities for Graphics.\n * @namespace graphicsUtils\n * @memberof PIXI\n */\nvar _a;\n/**\n * Map of fill commands for each shape type.\n * @memberof PIXI.graphicsUtils\n * @member {object} FILL_COMMANDS\n */\nvar FILL_COMMANDS = (_a = {},\n _a[SHAPES.POLY] = buildPoly,\n _a[SHAPES.CIRC] = buildCircle,\n _a[SHAPES.ELIP] = buildCircle,\n _a[SHAPES.RECT] = buildRectangle,\n _a[SHAPES.RREC] = buildRoundedRectangle,\n _a);\n/**\n * Batch pool, stores unused batches for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array} BATCH_POOL\n */\nvar BATCH_POOL = [];\n/**\n * Draw call pool, stores unused draw calls for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array} DRAW_CALL_POOL\n */\nvar DRAW_CALL_POOL = [];\n\n/**\n * A class to contain data useful for Graphics objects\n * @memberof PIXI\n */\nvar GraphicsData = /** @class */ (function () {\n /**\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param fillStyle - the width of the line to draw\n * @param lineStyle - the color of the line to draw\n * @param matrix - Transform matrix\n */\n function GraphicsData(shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n /** The collection of points. */\n this.points = [];\n /** The collection of holes. */\n this.holes = [];\n this.shape = shape;\n this.lineStyle = lineStyle;\n this.fillStyle = fillStyle;\n this.matrix = matrix;\n this.type = shape.type;\n }\n /**\n * Creates a new GraphicsData object with the same values as this one.\n * @returns - Cloned GraphicsData object\n */\n GraphicsData.prototype.clone = function () {\n return new GraphicsData(this.shape, this.fillStyle, this.lineStyle, this.matrix);\n };\n /** Destroys the Graphics data. */\n GraphicsData.prototype.destroy = function () {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n };\n return GraphicsData;\n}());\n\nvar tmpPoint = new Point();\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive\n * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.\n * @memberof PIXI\n */\nvar GraphicsGeometry = /** @class */ (function (_super) {\n __extends(GraphicsGeometry, _super);\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n function GraphicsGeometry() {\n var _this = _super.call(this) || this;\n /** Minimal distance between points that are considered different. Affects line tesselation. */\n _this.closePointEps = 1e-4;\n /** Padding to add to the bounds. */\n _this.boundsPadding = 0;\n _this.uvsFloat32 = null;\n _this.indicesUint16 = null;\n _this.batchable = false;\n /** An array of points to draw, 2 numbers per point */\n _this.points = [];\n /** The collection of colors */\n _this.colors = [];\n /** The UVs collection */\n _this.uvs = [];\n /** The indices of the vertices */\n _this.indices = [];\n /** Reference to the texture IDs. */\n _this.textureIds = [];\n /**\n * The collection of drawn shapes.\n * @member {PIXI.GraphicsData[]}\n */\n _this.graphicsData = [];\n /**\n * List of current draw calls drived from the batches.\n * @member {PIXI.BatchDrawCall[]}\n */\n _this.drawCalls = [];\n /** Batches need to regenerated if the geometry is updated. */\n _this.batchDirty = -1;\n /**\n * Intermediate abstract format sent to batch system.\n * Can be converted to drawCalls or to batchable objects.\n * @member {PIXI.graphicsUtils.BatchPart[]}\n */\n _this.batches = [];\n /** Used to detect if the graphics object has changed. */\n _this.dirty = 0;\n /** Used to check if the cache is dirty. */\n _this.cacheDirty = -1;\n /** Used to detect if we cleared the graphicsData. */\n _this.clearDirty = 0;\n /** Index of the last batched shape in the stack of calls. */\n _this.shapeIndex = 0;\n /** Cached bounds. */\n _this._bounds = new Bounds();\n /** The bounds dirty flag. */\n _this.boundsDirty = -1;\n return _this;\n }\n Object.defineProperty(GraphicsGeometry.prototype, \"bounds\", {\n /**\n * Get the current bounds of the graphic geometry.\n * @readonly\n */\n get: function () {\n this.updateBatches();\n if (this.boundsDirty !== this.dirty) {\n this.boundsDirty = this.dirty;\n this.calculateBounds();\n }\n return this._bounds;\n },\n enumerable: false,\n configurable: true\n });\n /** Call if you changed graphicsData manually. Empties all batch buffers. */\n GraphicsGeometry.prototype.invalidate = function () {\n this.boundsDirty = -1;\n this.dirty++;\n this.batchDirty++;\n this.shapeIndex = 0;\n this.points.length = 0;\n this.colors.length = 0;\n this.uvs.length = 0;\n this.indices.length = 0;\n this.textureIds.length = 0;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n for (var i = 0; i < this.batches.length; i++) {\n var batchPart = this.batches[i];\n batchPart.reset();\n BATCH_POOL.push(batchPart);\n }\n this.batches.length = 0;\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n * @returns - This GraphicsGeometry object. Good for chaining method calls\n */\n GraphicsGeometry.prototype.clear = function () {\n if (this.graphicsData.length > 0) {\n this.invalidate();\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param fillStyle - Defines style of the fill.\n * @param lineStyle - Defines style of the lines.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawShape = function (shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n var data = new GraphicsData(shape, fillStyle, lineStyle, matrix);\n this.graphicsData.push(data);\n this.dirty++;\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawHole = function (shape, matrix) {\n if (matrix === void 0) { matrix = null; }\n if (!this.graphicsData.length) {\n return null;\n }\n var data = new GraphicsData(shape, null, null, matrix);\n var lastShape = this.graphicsData[this.graphicsData.length - 1];\n data.lineStyle = lastShape.lineStyle;\n lastShape.holes.push(data);\n this.dirty++;\n return this;\n };\n /** Destroys the GraphicsGeometry object. */\n GraphicsGeometry.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n this.points.length = 0;\n this.points = null;\n this.colors.length = 0;\n this.colors = null;\n this.uvs.length = 0;\n this.uvs = null;\n this.indices.length = 0;\n this.indices = null;\n this.indexBuffer.destroy();\n this.indexBuffer = null;\n this.graphicsData.length = 0;\n this.graphicsData = null;\n this.drawCalls.length = 0;\n this.drawCalls = null;\n this.batches.length = 0;\n this.batches = null;\n this._bounds = null;\n };\n /**\n * Check to see if a point is contained within this geometry.\n * @param point - Point to check if it's contained.\n * @returns {boolean} `true` if the point is contained within geometry.\n */\n GraphicsGeometry.prototype.containsPoint = function (point) {\n var graphicsData = this.graphicsData;\n for (var i = 0; i < graphicsData.length; ++i) {\n var data = graphicsData[i];\n if (!data.fillStyle.visible) {\n continue;\n }\n // only deal with fills..\n if (data.shape) {\n if (data.matrix) {\n data.matrix.applyInverse(point, tmpPoint);\n }\n else {\n tmpPoint.copyFrom(point);\n }\n if (data.shape.contains(tmpPoint.x, tmpPoint.y)) {\n var hitHole = false;\n if (data.holes) {\n for (var i_1 = 0; i_1 < data.holes.length; i_1++) {\n var hole = data.holes[i_1];\n if (hole.shape.contains(tmpPoint.x, tmpPoint.y)) {\n hitHole = true;\n break;\n }\n }\n }\n if (!hitHole) {\n return true;\n }\n }\n }\n }\n return false;\n };\n /**\n * Generates intermediate batch data. Either gets converted to drawCalls\n * or used to convert to batch objects directly by the Graphics object.\n */\n GraphicsGeometry.prototype.updateBatches = function () {\n if (!this.graphicsData.length) {\n this.batchable = true;\n return;\n }\n if (!this.validateBatching()) {\n return;\n }\n this.cacheDirty = this.dirty;\n var uvs = this.uvs;\n var graphicsData = this.graphicsData;\n var batchPart = null;\n var currentStyle = null;\n if (this.batches.length > 0) {\n batchPart = this.batches[this.batches.length - 1];\n currentStyle = batchPart.style;\n }\n for (var i = this.shapeIndex; i < graphicsData.length; i++) {\n this.shapeIndex++;\n var data = graphicsData[i];\n var fillStyle = data.fillStyle;\n var lineStyle = data.lineStyle;\n var command = FILL_COMMANDS[data.type];\n // build out the shapes points..\n command.build(data);\n if (data.matrix) {\n this.transformPoints(data.points, data.matrix);\n }\n if (fillStyle.visible || lineStyle.visible) {\n this.processHoles(data.holes);\n }\n for (var j = 0; j < 2; j++) {\n var style = (j === 0) ? fillStyle : lineStyle;\n if (!style.visible)\n { continue; }\n var nextTexture = style.texture.baseTexture;\n var index_1 = this.indices.length;\n var attribIndex = this.points.length / 2;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n if (j === 0) {\n this.processFill(data);\n }\n else {\n this.processLine(data);\n }\n var size = (this.points.length / 2) - attribIndex;\n if (size === 0)\n { continue; }\n // close batch if style is different\n if (batchPart && !this._compareStyles(currentStyle, style)) {\n batchPart.end(index_1, attribIndex);\n batchPart = null;\n }\n // spawn new batch if its first batch or previous was closed\n if (!batchPart) {\n batchPart = BATCH_POOL.pop() || new BatchPart();\n batchPart.begin(style, index_1, attribIndex);\n this.batches.push(batchPart);\n currentStyle = style;\n }\n this.addUvs(this.points, uvs, style.texture, attribIndex, size, style.matrix);\n }\n }\n var index = this.indices.length;\n var attrib = this.points.length / 2;\n if (batchPart) {\n batchPart.end(index, attrib);\n }\n if (this.batches.length === 0) {\n // there are no visible styles in GraphicsData\n // its possible that someone wants Graphics just for the bounds\n this.batchable = true;\n return;\n }\n var need32 = attrib > 0xffff;\n // prevent allocation when length is same as buffer\n if (this.indicesUint16 && this.indices.length === this.indicesUint16.length\n && need32 === (this.indicesUint16.BYTES_PER_ELEMENT > 2)) {\n this.indicesUint16.set(this.indices);\n }\n else {\n this.indicesUint16 = need32 ? new Uint32Array(this.indices) : new Uint16Array(this.indices);\n }\n // TODO make this a const..\n this.batchable = this.isBatchable();\n if (this.batchable) {\n this.packBatches();\n }\n else {\n this.buildDrawCalls();\n }\n };\n /**\n * Affinity check\n * @param styleA\n * @param styleB\n */\n GraphicsGeometry.prototype._compareStyles = function (styleA, styleB) {\n if (!styleA || !styleB) {\n return false;\n }\n if (styleA.texture.baseTexture !== styleB.texture.baseTexture) {\n return false;\n }\n if (styleA.color + styleA.alpha !== styleB.color + styleB.alpha) {\n return false;\n }\n if (!!styleA.native !== !!styleB.native) {\n return false;\n }\n return true;\n };\n /** Test geometry for batching process. */\n GraphicsGeometry.prototype.validateBatching = function () {\n if (this.dirty === this.cacheDirty || !this.graphicsData.length) {\n return false;\n }\n for (var i = 0, l = this.graphicsData.length; i < l; i++) {\n var data = this.graphicsData[i];\n var fill = data.fillStyle;\n var line = data.lineStyle;\n if (fill && !fill.texture.baseTexture.valid)\n { return false; }\n if (line && !line.texture.baseTexture.valid)\n { return false; }\n }\n return true;\n };\n /** Offset the indices so that it works with the batcher. */\n GraphicsGeometry.prototype.packBatches = function () {\n this.batchDirty++;\n this.uvsFloat32 = new Float32Array(this.uvs);\n var batches = this.batches;\n for (var i = 0, l = batches.length; i < l; i++) {\n var batch = batches[i];\n for (var j = 0; j < batch.size; j++) {\n var index = batch.start + j;\n this.indicesUint16[index] = this.indicesUint16[index] - batch.attribStart;\n }\n }\n };\n /**\n * Checks to see if this graphics geometry can be batched.\n * Currently it needs to be small enough and not contain any native lines.\n */\n GraphicsGeometry.prototype.isBatchable = function () {\n // prevent heavy mesh batching\n if (this.points.length > 0xffff * 2) {\n return false;\n }\n var batches = this.batches;\n for (var i = 0; i < batches.length; i++) {\n if (batches[i].style.native) {\n return false;\n }\n }\n return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);\n };\n /** Converts intermediate batches data to drawCalls. */\n GraphicsGeometry.prototype.buildDrawCalls = function () {\n var TICK = ++BaseTexture._globalBatch;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n var colors = this.colors;\n var textureIds = this.textureIds;\n var currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n currentGroup.texArray.count = 0;\n currentGroup.start = 0;\n currentGroup.size = 0;\n currentGroup.type = DRAW_MODES.TRIANGLES;\n var textureCount = 0;\n var currentTexture = null;\n var textureId = 0;\n var native = false;\n var drawMode = DRAW_MODES.TRIANGLES;\n var index = 0;\n this.drawCalls.push(currentGroup);\n // TODO - this can be simplified\n for (var i = 0; i < this.batches.length; i++) {\n var data = this.batches[i];\n // TODO add some full on MAX_TEXTURE CODE..\n var MAX_TEXTURES = 8;\n // Forced cast for checking `native` without errors\n var style = data.style;\n var nextTexture = style.texture.baseTexture;\n if (native !== !!style.native) {\n native = !!style.native;\n drawMode = native ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES;\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n if (currentTexture !== nextTexture) {\n currentTexture = nextTexture;\n if (nextTexture._batchEnabled !== TICK) {\n if (textureCount === MAX_TEXTURES) {\n TICK++;\n textureCount = 0;\n if (currentGroup.size > 0) {\n currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n this.drawCalls.push(currentGroup);\n }\n currentGroup.start = index;\n currentGroup.size = 0;\n currentGroup.texArray.count = 0;\n currentGroup.type = drawMode;\n }\n // TODO add this to the render part..\n // Hack! Because texture has protected `touched`\n nextTexture.touched = 1; // touch;\n nextTexture._batchEnabled = TICK;\n nextTexture._batchLocation = textureCount;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n currentGroup.texArray.elements[currentGroup.texArray.count++] = nextTexture;\n textureCount++;\n }\n }\n currentGroup.size += data.size;\n index += data.size;\n textureId = nextTexture._batchLocation;\n this.addColors(colors, style.color, style.alpha, data.attribSize, data.attribStart);\n this.addTextureIds(textureIds, textureId, data.attribSize, data.attribStart);\n }\n BaseTexture._globalBatch = TICK;\n // upload..\n // merge for now!\n this.packAttributes();\n };\n /** Packs attributes to single buffer. */\n GraphicsGeometry.prototype.packAttributes = function () {\n var verts = this.points;\n var uvs = this.uvs;\n var colors = this.colors;\n var textureIds = this.textureIds;\n // verts are 2 positions.. so we * by 3 as there are 6 properties.. then 4 cos its bytes\n var glPoints = new ArrayBuffer(verts.length * 3 * 4);\n var f32 = new Float32Array(glPoints);\n var u32 = new Uint32Array(glPoints);\n var p = 0;\n for (var i = 0; i < verts.length / 2; i++) {\n f32[p++] = verts[i * 2];\n f32[p++] = verts[(i * 2) + 1];\n f32[p++] = uvs[i * 2];\n f32[p++] = uvs[(i * 2) + 1];\n u32[p++] = colors[i];\n f32[p++] = textureIds[i];\n }\n this._buffer.update(glPoints);\n this._indexBuffer.update(this.indicesUint16);\n };\n /**\n * Process fill part of Graphics.\n * @param data\n */\n GraphicsGeometry.prototype.processFill = function (data) {\n if (data.holes.length) {\n buildPoly.triangulate(data, this);\n }\n else {\n var command = FILL_COMMANDS[data.type];\n command.triangulate(data, this);\n }\n };\n /**\n * Process line part of Graphics.\n * @param data\n */\n GraphicsGeometry.prototype.processLine = function (data) {\n buildLine(data, this);\n for (var i = 0; i < data.holes.length; i++) {\n buildLine(data.holes[i], this);\n }\n };\n /**\n * Process the holes data.\n * @param holes\n */\n GraphicsGeometry.prototype.processHoles = function (holes) {\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n var command = FILL_COMMANDS[hole.type];\n command.build(hole);\n if (hole.matrix) {\n this.transformPoints(hole.points, hole.matrix);\n }\n }\n };\n /** Update the local bounds of the object. Expensive to use performance-wise. */\n GraphicsGeometry.prototype.calculateBounds = function () {\n var bounds = this._bounds;\n bounds.clear();\n bounds.addVertexData(this.points, 0, this.points.length);\n bounds.pad(this.boundsPadding, this.boundsPadding);\n };\n /**\n * Transform points using matrix.\n * @param points - Points to transform\n * @param matrix - Transform matrix\n */\n GraphicsGeometry.prototype.transformPoints = function (points, matrix) {\n for (var i = 0; i < points.length / 2; i++) {\n var x = points[(i * 2)];\n var y = points[(i * 2) + 1];\n points[(i * 2)] = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n points[(i * 2) + 1] = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n }\n };\n /**\n * Add colors.\n * @param colors - List of colors to add to\n * @param color - Color to add\n * @param alpha - Alpha to use\n * @param size - Number of colors to add\n * @param offset\n */\n GraphicsGeometry.prototype.addColors = function (colors, color, alpha, size, offset) {\n if (offset === void 0) { offset = 0; }\n // TODO use the premultiply bits Ivan added\n var rgb = (color >> 16) + (color & 0xff00) + ((color & 0xff) << 16);\n var rgba = premultiplyTint(rgb, alpha);\n colors.length = Math.max(colors.length, offset + size);\n for (var i = 0; i < size; i++) {\n colors[offset + i] = rgba;\n }\n };\n /**\n * Add texture id that the shader/fragment wants to use.\n * @param textureIds\n * @param id\n * @param size\n * @param offset\n */\n GraphicsGeometry.prototype.addTextureIds = function (textureIds, id, size, offset) {\n if (offset === void 0) { offset = 0; }\n textureIds.length = Math.max(textureIds.length, offset + size);\n for (var i = 0; i < size; i++) {\n textureIds[offset + i] = id;\n }\n };\n /**\n * Generates the UVs for a shape.\n * @param verts - Vertices\n * @param uvs - UVs\n * @param texture - Reference to Texture\n * @param start - Index buffer start index.\n * @param size - The size/length for index buffer.\n * @param matrix - Optional transform for all points.\n */\n GraphicsGeometry.prototype.addUvs = function (verts, uvs, texture, start, size, matrix) {\n if (matrix === void 0) { matrix = null; }\n var index = 0;\n var uvsStart = uvs.length;\n var frame = texture.frame;\n while (index < size) {\n var x = verts[(start + index) * 2];\n var y = verts[((start + index) * 2) + 1];\n if (matrix) {\n var nx = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n y = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n x = nx;\n }\n index++;\n uvs.push(x / frame.width, y / frame.height);\n }\n var baseTexture = texture.baseTexture;\n if (frame.width < baseTexture.width\n || frame.height < baseTexture.height) {\n this.adjustUvs(uvs, texture, uvsStart, size);\n }\n };\n /**\n * Modify uvs array according to position of texture region\n * Does not work with rotated or trimmed textures\n * @param uvs - array\n * @param texture - region\n * @param start - starting index for uvs\n * @param size - how many points to adjust\n */\n GraphicsGeometry.prototype.adjustUvs = function (uvs, texture, start, size) {\n var baseTexture = texture.baseTexture;\n var eps = 1e-6;\n var finish = start + (size * 2);\n var frame = texture.frame;\n var scaleX = frame.width / baseTexture.width;\n var scaleY = frame.height / baseTexture.height;\n var offsetX = frame.x / frame.width;\n var offsetY = frame.y / frame.height;\n var minX = Math.floor(uvs[start] + eps);\n var minY = Math.floor(uvs[start + 1] + eps);\n for (var i = start + 2; i < finish; i += 2) {\n minX = Math.min(minX, Math.floor(uvs[i] + eps));\n minY = Math.min(minY, Math.floor(uvs[i + 1] + eps));\n }\n offsetX -= minX;\n offsetY -= minY;\n for (var i = start; i < finish; i += 2) {\n uvs[i] = (uvs[i] + offsetX) * scaleX;\n uvs[i + 1] = (uvs[i + 1] + offsetY) * scaleY;\n }\n };\n /**\n * The maximum number of points to consider an object \"batchable\",\n * able to be batched by the renderer's batch system.\n\\\n */\n GraphicsGeometry.BATCHABLE_SIZE = 100;\n return GraphicsGeometry;\n}(BatchGeometry));\n\n/**\n * Represents the line style for Graphics.\n * @memberof PIXI\n */\nvar LineStyle = /** @class */ (function (_super) {\n __extends(LineStyle, _super);\n function LineStyle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /** The width (thickness) of any lines drawn. */\n _this.width = 0;\n /** The alignment of any lines drawn (0.5 = middle, 1 = outer, 0 = inner). WebGL only. */\n _this.alignment = 0.5;\n /** If true the lines will be draw using LINES instead of TRIANGLE_STRIP. */\n _this.native = false;\n /**\n * Line cap style.\n * @member {PIXI.LINE_CAP}\n * @default PIXI.LINE_CAP.BUTT\n */\n _this.cap = LINE_CAP.BUTT;\n /**\n * Line join style.\n * @member {PIXI.LINE_JOIN}\n * @default PIXI.LINE_JOIN.MITER\n */\n _this.join = LINE_JOIN.MITER;\n /** Miter limit. */\n _this.miterLimit = 10;\n return _this;\n }\n /** Clones the object. */\n LineStyle.prototype.clone = function () {\n var obj = new LineStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n obj.width = this.width;\n obj.alignment = this.alignment;\n obj.native = this.native;\n obj.cap = this.cap;\n obj.join = this.join;\n obj.miterLimit = this.miterLimit;\n return obj;\n };\n /** Reset the line style to default. */\n LineStyle.prototype.reset = function () {\n _super.prototype.reset.call(this);\n // Override default line style color\n this.color = 0x0;\n this.alignment = 0.5;\n this.width = 0;\n this.native = false;\n };\n return LineStyle;\n}(FillStyle));\n\nvar temp = new Float32Array(3);\n// a default shaders map used by graphics..\nvar DEFAULT_SHADERS = {};\n/**\n * The Graphics class is primarily used to render primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them. However, you can also use a Graphics\n * object to build a list of primitives to use as a mask, or as a complex hitArea.\n *\n * Please note that due to legacy naming conventions, the behavior of some functions in this class\n * can be confusing. Each call to `drawRect()`, `drawPolygon()`, etc. actually stores that primitive\n * in the Geometry class's GraphicsGeometry object for later use in rendering or hit testing - the\n * functions do not directly draw anything to the screen. Similarly, the `clear()` function doesn't\n * change the screen, it simply resets the list of primitives, which can be useful if you want to\n * rebuild the contents of an existing Graphics object.\n *\n * Once a GraphicsGeometry list is built, you can re-use it in other Geometry objects as\n * an optimization, by passing it into a new Geometry object's constructor. Because of this\n * ability, it's important to call `destroy()` on Geometry objects once you are done with them, to\n * properly dereference each GraphicsGeometry and prevent memory leaks.\n * @memberof PIXI\n */\nvar Graphics = /** @class */ (function (_super) {\n __extends(Graphics, _super);\n /**\n * @param geometry - Geometry to use, if omitted will create a new GraphicsGeometry instance.\n */\n function Graphics(geometry) {\n if (geometry === void 0) { geometry = null; }\n var _this = _super.call(this) || this;\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shared between multiple Graphics objects.\n */\n _this.shader = null;\n /** Renderer plugin for batching */\n _this.pluginName = 'batch';\n /**\n * Current path\n * @readonly\n */\n _this.currentPath = null;\n /** A collections of batches! These can be drawn by the renderer batch system. */\n _this.batches = [];\n /** Update dirty for limiting calculating tints for batches. */\n _this.batchTint = -1;\n /** Update dirty for limiting calculating batches.*/\n _this.batchDirty = -1;\n /** Copy of the object vertex data. */\n _this.vertexData = null;\n /** Current fill style. */\n _this._fillStyle = new FillStyle();\n /** Current line style. */\n _this._lineStyle = new LineStyle();\n /** Current shape transform matrix. */\n _this._matrix = null;\n /** Current hole mode is enabled. */\n _this._holeMode = false;\n /**\n * Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g.,\n * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.\n */\n _this.state = State.for2d();\n _this._geometry = geometry || new GraphicsGeometry();\n _this._geometry.refCount++;\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n _this._transformID = -1;\n // Set default\n _this.tint = 0xFFFFFF;\n _this.blendMode = BLEND_MODES.NORMAL;\n return _this;\n }\n Object.defineProperty(Graphics.prototype, \"geometry\", {\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh or Graphics objects.\n * @readonly\n */\n get: function () {\n return this._geometry;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that only the geometry of the object is cloned, not its transform (position,scale,etc)\n * @returns - A clone of the graphics object\n */\n Graphics.prototype.clone = function () {\n this.finishPoly();\n return new Graphics(this._geometry);\n };\n Object.defineProperty(Graphics.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. Note that, since each\n * primitive in the GraphicsGeometry list is rendered sequentially, modes\n * such as `PIXI.BLEND_MODES.ADD` and `PIXI.BLEND_MODES.MULTIPLY` will\n * be applied per-primitive.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"tint\", {\n /**\n * The tint applied to each graphic shape. This is a hex value. A value of\n * 0xFFFFFF will remove any tint effect.\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"fill\", {\n /**\n * The current fill style.\n * @readonly\n */\n get: function () {\n return this._fillStyle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"line\", {\n /**\n * The current line style.\n * @readonly\n */\n get: function () {\n return this._lineStyle;\n },\n enumerable: false,\n configurable: true\n });\n Graphics.prototype.lineStyle = function (options, color, alpha, alignment, native) {\n if (options === void 0) { options = null; }\n if (color === void 0) { color = 0x0; }\n if (alpha === void 0) { alpha = 1; }\n if (alignment === void 0) { alignment = 0.5; }\n if (native === void 0) { native = false; }\n // Support non-object params: (width, color, alpha, alignment, native)\n if (typeof options === 'number') {\n options = { width: options, color: color, alpha: alpha, alignment: alignment, native: native };\n }\n return this.lineTextureStyle(options);\n };\n /**\n * Like line style but support texture for line fill.\n * @param [options] - Collection of options for setting line style.\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to use\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style.\n * Default 0xFFFFFF if texture present.\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {PIXI.Matrix} [options.matrix=null] - Texture matrix to transform texture\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer).\n * WebGL only.\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @returns {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTextureStyle = function (options) {\n // Apply defaults\n options = Object.assign({\n width: 0,\n texture: Texture.WHITE,\n color: (options && options.texture) ? 0xFFFFFF : 0x0,\n alpha: 1,\n matrix: null,\n alignment: 0.5,\n native: false,\n cap: LINE_CAP.BUTT,\n join: LINE_JOIN.MITER,\n miterLimit: 10,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.width > 0 && options.alpha > 0;\n if (!visible) {\n this._lineStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._lineStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Start a polygon object internally.\n * @protected\n */\n Graphics.prototype.startPoly = function () {\n if (this.currentPath) {\n var points = this.currentPath.points;\n var len = this.currentPath.points.length;\n if (len > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n this.currentPath.points.push(points[len - 2], points[len - 1]);\n }\n }\n else {\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n }\n };\n /**\n * Finish the polygon object.\n * @protected\n */\n Graphics.prototype.finishPoly = function () {\n if (this.currentPath) {\n if (this.currentPath.points.length > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = null;\n }\n else {\n this.currentPath.points.length = 0;\n }\n }\n };\n /**\n * Moves the current drawing position to x, y.\n * @param x - the X coordinate to move to\n * @param y - the Y coordinate to move to\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.moveTo = function (x, y) {\n this.startPoly();\n this.currentPath.points[0] = x;\n this.currentPath.points[1] = y;\n return this;\n };\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n * @param x - the X coordinate to draw to\n * @param y - the Y coordinate to draw to\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTo = function (x, y) {\n if (!this.currentPath) {\n this.moveTo(0, 0);\n }\n // remove duplicates..\n var points = this.currentPath.points;\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n if (fromX !== x || fromY !== y) {\n points.push(x, y);\n }\n return this;\n };\n /**\n * Initialize the curve\n * @param x\n * @param y\n */\n Graphics.prototype._initCurve = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (this.currentPath) {\n if (this.currentPath.points.length === 0) {\n this.currentPath.points = [x, y];\n }\n }\n else {\n this.moveTo(x, y);\n }\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) {\n this._initCurve();\n var points = this.currentPath.points;\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n QuadraticUtils.curveTo(cpX, cpY, toX, toY, points);\n return this;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) {\n this._initCurve();\n BezierUtils.curveTo(cpX, cpY, cpX2, cpY2, toX, toY, this.currentPath.points);\n return this;\n };\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n * @param x1 - The x-coordinate of the first tangent point of the arc\n * @param y1 - The y-coordinate of the first tangent point of the arc\n * @param x2 - The x-coordinate of the end of the arc\n * @param y2 - The y-coordinate of the end of the arc\n * @param radius - The radius of the arc\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._initCurve(x1, y1);\n var points = this.currentPath.points;\n var result = ArcUtils.curveTo(x1, y1, x2, y2, radius, points);\n if (result) {\n var cx = result.cx, cy = result.cy, radius_1 = result.radius, startAngle = result.startAngle, endAngle = result.endAngle, anticlockwise = result.anticlockwise;\n this.arc(cx, cy, radius_1, startAngle, endAngle, anticlockwise);\n }\n return this;\n };\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n * @param cx - The x-coordinate of the center of the circle\n * @param cy - The y-coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param endAngle - The ending angle, in radians\n * @param anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arc = function (cx, cy, radius, startAngle, endAngle, anticlockwise) {\n if (anticlockwise === void 0) { anticlockwise = false; }\n if (startAngle === endAngle) {\n return this;\n }\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += PI_2;\n }\n else if (anticlockwise && startAngle <= endAngle) {\n startAngle += PI_2;\n }\n var sweep = endAngle - startAngle;\n if (sweep === 0) {\n return this;\n }\n var startX = cx + (Math.cos(startAngle) * radius);\n var startY = cy + (Math.sin(startAngle) * radius);\n var eps = this._geometry.closePointEps;\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n var points = this.currentPath ? this.currentPath.points : null;\n if (points) {\n // TODO: make a better fix.\n // We check how far our start is from the last existing point\n var xDiff = Math.abs(points[points.length - 2] - startX);\n var yDiff = Math.abs(points[points.length - 1] - startY);\n if (xDiff < eps && yDiff < eps) ;\n else {\n points.push(startX, startY);\n }\n }\n else {\n this.moveTo(startX, startY);\n points = this.currentPath.points;\n }\n ArcUtils.arc(startX, startY, cx, cy, radius, startAngle, endAngle, anticlockwise, points);\n return this;\n };\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n * @param color - the color of the fill\n * @param alpha - the alpha of the fill\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginFill = function (color, alpha) {\n if (color === void 0) { color = 0; }\n if (alpha === void 0) { alpha = 1; }\n return this.beginTextureFill({ texture: Texture.WHITE, color: color, alpha: alpha });\n };\n /**\n * Begin the texture fill\n * @param options - Object object.\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to fill\n * @param {number} [options.color=0xffffff] - Background to fill behind texture\n * @param {number} [options.alpha=1] - Alpha of fill\n * @param {PIXI.Matrix} [options.matrix=null] - Transform matrix\n * @returns {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginTextureFill = function (options) {\n // Apply defaults\n options = Object.assign({\n texture: Texture.WHITE,\n color: 0xFFFFFF,\n alpha: 1,\n matrix: null,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.alpha > 0;\n if (!visible) {\n this._fillStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._fillStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.endFill = function () {\n this.finishPoly();\n this._fillStyle.reset();\n return this;\n };\n /**\n * Draws a rectangle shape.\n * @param x - The X coord of the top-left of the rectangle\n * @param y - The Y coord of the top-left of the rectangle\n * @param width - The width of the rectangle\n * @param height - The height of the rectangle\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRect = function (x, y, width, height) {\n return this.drawShape(new Rectangle(x, y, width, height));\n };\n /**\n * Draw a rectangle shape with rounded/beveled corners.\n * @param x - The X coord of the top-left of the rectangle\n * @param y - The Y coord of the top-left of the rectangle\n * @param width - The width of the rectangle\n * @param height - The height of the rectangle\n * @param radius - Radius of the rectangle corners\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRoundedRect = function (x, y, width, height, radius) {\n return this.drawShape(new RoundedRectangle(x, y, width, height, radius));\n };\n /**\n * Draws a circle.\n * @param x - The X coordinate of the center of the circle\n * @param y - The Y coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawCircle = function (x, y, radius) {\n return this.drawShape(new Circle(x, y, radius));\n };\n /**\n * Draws an ellipse.\n * @param x - The X coordinate of the center of the ellipse\n * @param y - The Y coordinate of the center of the ellipse\n * @param width - The half width of the ellipse\n * @param height - The half height of the ellipse\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawEllipse = function (x, y, width, height) {\n return this.drawShape(new Ellipse(x, y, width, height));\n };\n /**\n * Draws a polygon using the given path.\n * @param {number[]|PIXI.IPointData[]|PIXI.Polygon} path - The path data used to construct the polygon.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawPolygon = function () {\n var arguments$1 = arguments;\n\n var path = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n path[_i] = arguments$1[_i];\n }\n var points;\n var closeStroke = true; // !!this._fillStyle;\n var poly = path[0];\n // check if data has points..\n if (poly.points) {\n closeStroke = poly.closeStroke;\n points = poly.points;\n }\n else if (Array.isArray(path[0])) {\n points = path[0];\n }\n else {\n points = path;\n }\n var shape = new Polygon(points);\n shape.closeStroke = closeStroke;\n this.drawShape(shape);\n return this;\n };\n /**\n * Draw any shape.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawShape = function (shape) {\n if (!this._holeMode) {\n this._geometry.drawShape(shape, this._fillStyle.clone(), this._lineStyle.clone(), this._matrix);\n }\n else {\n this._geometry.drawHole(shape, this._matrix);\n }\n return this;\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.clear = function () {\n this._geometry.clear();\n this._lineStyle.reset();\n this._fillStyle.reset();\n this._boundsID++;\n this._matrix = null;\n this._holeMode = false;\n this.currentPath = null;\n return this;\n };\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n * @returns - True if only 1 rect.\n */\n Graphics.prototype.isFastRect = function () {\n var data = this._geometry.graphicsData;\n return data.length === 1\n && data[0].shape.type === SHAPES.RECT\n && !data[0].matrix\n && !data[0].holes.length\n && !(data[0].lineStyle.visible && data[0].lineStyle.width);\n };\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n Graphics.prototype._render = function (renderer) {\n this.finishPoly();\n var geometry = this._geometry;\n // batch part..\n // batch it!\n geometry.updateBatches();\n if (geometry.batchable) {\n if (this.batchDirty !== geometry.batchDirty) {\n this._populateBatches();\n }\n this._renderBatched(renderer);\n }\n else {\n // no batching...\n renderer.batch.flush();\n this._renderDirect(renderer);\n }\n };\n /** Populating batches for rendering. */\n Graphics.prototype._populateBatches = function () {\n var geometry = this._geometry;\n var blendMode = this.blendMode;\n var len = geometry.batches.length;\n this.batchTint = -1;\n this._transformID = -1;\n this.batchDirty = geometry.batchDirty;\n this.batches.length = len;\n this.vertexData = new Float32Array(geometry.points);\n for (var i = 0; i < len; i++) {\n var gI = geometry.batches[i];\n var color = gI.style.color;\n var vertexData = new Float32Array(this.vertexData.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var uvs = new Float32Array(geometry.uvsFloat32.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var indices = new Uint16Array(geometry.indicesUint16.buffer, gI.start * 2, gI.size);\n var batch = {\n vertexData: vertexData,\n blendMode: blendMode,\n indices: indices,\n uvs: uvs,\n _batchRGB: hex2rgb(color),\n _tintRGB: color,\n _texture: gI.style.texture,\n alpha: gI.style.alpha,\n worldAlpha: 1\n };\n this.batches[i] = batch;\n }\n };\n /**\n * Renders the batches using the BathedRenderer plugin\n * @param renderer - The renderer\n */\n Graphics.prototype._renderBatched = function (renderer) {\n if (!this.batches.length) {\n return;\n }\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n this.calculateVertices();\n this.calculateTints();\n for (var i = 0, l = this.batches.length; i < l; i++) {\n var batch = this.batches[i];\n batch.worldAlpha = this.worldAlpha * batch.alpha;\n renderer.plugins[this.pluginName].render(batch);\n }\n };\n /**\n * Renders the graphics direct\n * @param renderer - The renderer\n */\n Graphics.prototype._renderDirect = function (renderer) {\n var shader = this._resolveDirectShader(renderer);\n var geometry = this._geometry;\n var tint = this.tint;\n var worldAlpha = this.worldAlpha;\n var uniforms = shader.uniforms;\n var drawCalls = geometry.drawCalls;\n // lets set the transfomr\n uniforms.translationMatrix = this.transform.worldTransform;\n // and then lets set the tint..\n uniforms.tint[0] = (((tint >> 16) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[1] = (((tint >> 8) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[2] = ((tint & 0xFF) / 255) * worldAlpha;\n uniforms.tint[3] = worldAlpha;\n // the first draw call, we can set the uniforms of the shader directly here.\n // this means that we can tack advantage of the sync function of pixi!\n // bind and sync uniforms..\n // there is a way to optimise this..\n renderer.shader.bind(shader);\n renderer.geometry.bind(geometry, shader);\n // set state..\n renderer.state.set(this.state);\n // then render the rest of them...\n for (var i = 0, l = drawCalls.length; i < l; i++) {\n this._renderDrawCallDirect(renderer, geometry.drawCalls[i]);\n }\n };\n /**\n * Renders specific DrawCall\n * @param renderer\n * @param drawCall\n */\n Graphics.prototype._renderDrawCallDirect = function (renderer, drawCall) {\n var texArray = drawCall.texArray, type = drawCall.type, size = drawCall.size, start = drawCall.start;\n var groupTextureCount = texArray.count;\n for (var j = 0; j < groupTextureCount; j++) {\n renderer.texture.bind(texArray.elements[j], j);\n }\n renderer.geometry.draw(type, size, start);\n };\n /**\n * Resolves shader for direct rendering\n * @param renderer - The renderer\n */\n Graphics.prototype._resolveDirectShader = function (renderer) {\n var shader = this.shader;\n var pluginName = this.pluginName;\n if (!shader) {\n // if there is no shader here, we can use the default shader.\n // and that only gets created if we actually need it..\n // but may be more than one plugins for graphics\n if (!DEFAULT_SHADERS[pluginName]) {\n var MAX_TEXTURES = renderer.plugins[pluginName].MAX_TEXTURES;\n var sampleValues = new Int32Array(MAX_TEXTURES);\n for (var i = 0; i < MAX_TEXTURES; i++) {\n sampleValues[i] = i;\n }\n var uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: UniformGroup.from({ uSamplers: sampleValues }, true),\n };\n var program = renderer.plugins[pluginName]._shader.program;\n DEFAULT_SHADERS[pluginName] = new Shader(program, uniforms);\n }\n shader = DEFAULT_SHADERS[pluginName];\n }\n return shader;\n };\n /** Retrieves the bounds of the graphic shape as a rectangle object. */\n Graphics.prototype._calculateBounds = function () {\n this.finishPoly();\n var geometry = this._geometry;\n // skipping when graphics is empty, like a container\n if (!geometry.graphicsData.length) {\n return;\n }\n var _a = geometry.bounds, minX = _a.minX, minY = _a.minY, maxX = _a.maxX, maxY = _a.maxY;\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Tests if a point is inside this graphics object\n * @param point - the point to test\n * @returns - the result of the test\n */\n Graphics.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, Graphics._TEMP_POINT);\n return this._geometry.containsPoint(Graphics._TEMP_POINT);\n };\n /** Recalculate the tint by applying tint to batches using Graphics tint. */\n Graphics.prototype.calculateTints = function () {\n if (this.batchTint !== this.tint) {\n this.batchTint = this.tint;\n var tintRGB = hex2rgb(this.tint, temp);\n for (var i = 0; i < this.batches.length; i++) {\n var batch = this.batches[i];\n var batchTint = batch._batchRGB;\n var r = (tintRGB[0] * batchTint[0]) * 255;\n var g = (tintRGB[1] * batchTint[1]) * 255;\n var b = (tintRGB[2] * batchTint[2]) * 255;\n // TODO Ivan, can this be done in one go?\n var color = (r << 16) + (g << 8) + (b | 0);\n batch._tintRGB = (color >> 16)\n + (color & 0xff00)\n + ((color & 0xff) << 16);\n }\n }\n };\n /** If there's a transform update or a change to the shape of the geometry, recalculate the vertices. */\n Graphics.prototype.calculateVertices = function () {\n var wtID = this.transform._worldID;\n if (this._transformID === wtID) {\n return;\n }\n this._transformID = wtID;\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var data = this._geometry.points; // batch.vertexDataOriginal;\n var vertexData = this.vertexData;\n var count = 0;\n for (var i = 0; i < data.length; i += 2) {\n var x = data[i];\n var y = data[i + 1];\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n };\n /**\n * Closes the current path.\n * @returns - Returns itself.\n */\n Graphics.prototype.closePath = function () {\n var currentPath = this.currentPath;\n if (currentPath) {\n // we don't need to add extra point in the end because buildLine will take care of that\n currentPath.closeStroke = true;\n // ensure that the polygon is completed, and is available for hit detection\n // (even if the graphics is not rendered yet)\n this.finishPoly();\n }\n return this;\n };\n /**\n * Apply a matrix to the positional data.\n * @param matrix - Matrix to use for transform current shape.\n * @returns - Returns itself.\n */\n Graphics.prototype.setMatrix = function (matrix) {\n this._matrix = matrix;\n return this;\n };\n /**\n * Begin adding holes to the last draw shape\n * IMPORTANT: holes must be fully inside a shape to work\n * Also weirdness ensues if holes overlap!\n * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,\n * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.\n * @returns - Returns itself.\n */\n Graphics.prototype.beginHole = function () {\n this.finishPoly();\n this._holeMode = true;\n return this;\n };\n /**\n * End adding holes to the last draw shape.\n * @returns - Returns itself.\n */\n Graphics.prototype.endHole = function () {\n this.finishPoly();\n this._holeMode = false;\n return this;\n };\n /**\n * Destroys the Graphics object.\n * @param options - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n Graphics.prototype.destroy = function (options) {\n this._geometry.refCount--;\n if (this._geometry.refCount === 0) {\n this._geometry.dispose();\n }\n this._matrix = null;\n this.currentPath = null;\n this._lineStyle.destroy();\n this._lineStyle = null;\n this._fillStyle.destroy();\n this._fillStyle = null;\n this._geometry = null;\n this.shader = null;\n this.vertexData = null;\n this.batches.length = 0;\n this.batches = null;\n _super.prototype.destroy.call(this, options);\n };\n /**\n * New rendering behavior for rounded rectangles: circular arcs instead of quadratic bezier curves.\n * In the next major release, we'll enable this by default.\n */\n Graphics.nextRoundedRectBehavior = false;\n /**\n * Temporary point to use for containsPoint.\n * @private\n */\n Graphics._TEMP_POINT = new Point();\n return Graphics;\n}(Container));\n\nvar graphicsUtils = {\n buildPoly: buildPoly,\n buildCircle: buildCircle,\n buildRectangle: buildRectangle,\n buildRoundedRectangle: buildRoundedRectangle,\n buildLine: buildLine,\n ArcUtils: ArcUtils,\n BezierUtils: BezierUtils,\n QuadraticUtils: QuadraticUtils,\n BatchPart: BatchPart,\n FILL_COMMANDS: FILL_COMMANDS,\n BATCH_POOL: BATCH_POOL,\n DRAW_CALL_POOL: DRAW_CALL_POOL\n};\n\nexport { FillStyle, GRAPHICS_CURVES, Graphics, GraphicsData, GraphicsGeometry, LINE_CAP, LINE_JOIN, LineStyle, graphicsUtils };\n//# sourceMappingURL=graphics.mjs.map\n","/*!\n * @pixi/sprite - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/sprite is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\nimport { Bounds, Container } from '@pixi/display';\nimport { Point, Rectangle, ObservablePoint } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\nvar indices = new Uint16Array([0, 1, 2, 0, 2, 3]);\n/**\n * The Sprite object is the base for all textured objects that are rendered to the screen\n *\n * A sprite can be created directly from an image like this:\n *\n * ```js\n * let sprite = PIXI.Sprite.from('assets/image.png');\n * ```\n *\n * The more efficient way to create sprites is using a {@link PIXI.Spritesheet},\n * as swapping base textures when rendering to the screen is inefficient.\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * let sprite = new PIXI.Sprite(sheet.textures[\"image.png\"]);\n * ...\n * }\n * ```\n * @memberof PIXI\n */\nvar Sprite = /** @class */ (function (_super) {\n __extends(Sprite, _super);\n /** @param texture - The texture for this sprite. */\n function Sprite(texture) {\n var _this = _super.call(this) || this;\n _this._anchor = new ObservablePoint(_this._onAnchorUpdate, _this, (texture ? texture.defaultAnchor.x : 0), (texture ? texture.defaultAnchor.y : 0));\n _this._texture = null;\n _this._width = 0;\n _this._height = 0;\n _this._tint = null;\n _this._tintRGB = null;\n _this.tint = 0xFFFFFF;\n _this.blendMode = BLEND_MODES.NORMAL;\n _this._cachedTint = 0xFFFFFF;\n _this.uvs = null;\n // call texture setter\n _this.texture = texture || Texture.EMPTY;\n _this.vertexData = new Float32Array(8);\n _this.vertexTrimmedData = null;\n _this._transformID = -1;\n _this._textureID = -1;\n _this._transformTrimmedID = -1;\n _this._textureTrimmedID = -1;\n // Batchable stuff..\n // TODO could make this a mixin?\n _this.indices = indices;\n _this.pluginName = 'batch';\n /**\n * Used to fast check if a sprite is.. a sprite!\n * @member {boolean}\n */\n _this.isSprite = true;\n _this._roundPixels = settings.ROUND_PIXELS;\n return _this;\n }\n /** When the texture is updated, this event will fire to update the scale and frame. */\n Sprite.prototype._onTextureUpdate = function () {\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n // so if _width is 0 then width was not set..\n if (this._width) {\n this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;\n }\n if (this._height) {\n this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;\n }\n };\n /** Called when the anchor position updates. */\n Sprite.prototype._onAnchorUpdate = function () {\n this._transformID = -1;\n this._transformTrimmedID = -1;\n };\n /** Calculates worldTransform * vertices, store it in vertexData. */\n Sprite.prototype.calculateVertices = function () {\n var texture = this._texture;\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID) {\n return;\n }\n // update texture UV here, because base texture can be changed without calling `_onTextureUpdate`\n if (this._textureID !== texture._updateID) {\n this.uvs = this._texture._uvs.uvsFloat32;\n }\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n // set the vertex data\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n };\n /**\n * Calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData.\n *\n * This is used to ensure that the true width and height of a trimmed texture is respected.\n */\n Sprite.prototype.calculateTrimmedVertices = function () {\n if (!this.vertexTrimmedData) {\n this.vertexTrimmedData = new Float32Array(8);\n }\n else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) {\n return;\n }\n this._transformTrimmedID = this.transform._worldID;\n this._textureTrimmedID = this._texture._updateID;\n // lets do some special trim code!\n var texture = this._texture;\n var vertexData = this.vertexTrimmedData;\n var orig = texture.orig;\n var anchor = this._anchor;\n // lets calculate the new untrimmed bounds..\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var w1 = -anchor._x * orig.width;\n var w0 = w1 + orig.width;\n var h1 = -anchor._y * orig.height;\n var h0 = h1 + orig.height;\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n };\n /**\n *\n * Renders the object using the WebGL renderer\n * @param renderer - The webgl renderer to use.\n */\n Sprite.prototype._render = function (renderer) {\n this.calculateVertices();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /** Updates the bounds of the sprite. */\n Sprite.prototype._calculateBounds = function () {\n var trim = this._texture.trim;\n var orig = this._texture.orig;\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height)) {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n };\n /**\n * Gets the local bounds of the sprite object.\n * @param rect - Optional output rectangle.\n * @returns The bounds.\n */\n Sprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n if (!this._localBounds) {\n this._localBounds = new Bounds();\n }\n this._localBounds.minX = this._texture.orig.width * -this._anchor._x;\n this._localBounds.minY = this._texture.orig.height * -this._anchor._y;\n this._localBounds.maxX = this._texture.orig.width * (1 - this._anchor._x);\n this._localBounds.maxY = this._texture.orig.height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._localBounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Tests if a point is inside this sprite\n * @param point - the point to test\n * @returns The result of the test\n */\n Sprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._texture.orig.width;\n var height = this._texture.orig.height;\n var x1 = -width * this.anchor.x;\n var y1 = 0;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n y1 = -height * this.anchor.y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n Sprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this._texture.off('update', this._onTextureUpdate, this);\n this._anchor = null;\n var destroyTexture = typeof options === 'boolean' ? options : options && options.texture;\n if (destroyTexture) {\n var destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture;\n this._texture.destroy(!!destroyBaseTexture);\n }\n this._texture = null;\n };\n // some helper functions..\n /**\n * Helper function that creates a new sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {object} [options] - See {@link PIXI.BaseTexture}'s constructor for options.\n * @returns The newly created sprite\n */\n Sprite.from = function (source, options) {\n var texture = (source instanceof Texture)\n ? source\n : Texture.from(source, options);\n return new Sprite(texture);\n };\n Object.defineProperty(Sprite.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n *\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n *\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}.\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"width\", {\n /** The width of the sprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"height\", {\n /** The height of the sprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}\n * and passed to the constructor.\n *\n * The default is `(0,0)`, this means the sprite's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n *\n * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n this._anchor.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"tint\", {\n /**\n * The tint applied to the sprite. This is a hex value.\n *\n * A value of 0xFFFFFF will remove any tint effect.\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"texture\", {\n /** The texture that the sprite is using. */\n get: function () {\n return this._texture;\n },\n set: function (value) {\n if (this._texture === value) {\n return;\n }\n if (this._texture) {\n this._texture.off('update', this._onTextureUpdate, this);\n }\n this._texture = value || Texture.EMPTY;\n this._cachedTint = 0xFFFFFF;\n this._textureID = -1;\n this._textureTrimmedID = -1;\n if (value) {\n // wait for the texture to load\n if (value.baseTexture.valid) {\n this._onTextureUpdate();\n }\n else {\n value.once('update', this._onTextureUpdate, this);\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return Sprite;\n}(Container));\n\nexport { Sprite };\n//# sourceMappingURL=sprite.mjs.map\n","/*!\n * @pixi/text - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/text is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Sprite } from '@pixi/sprite';\nimport { Texture } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { Rectangle } from '@pixi/math';\nimport { hex2string, hex2rgb, string2hex, trimCanvas, sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Constants that define the type of gradient on text.\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nvar TEXT_GRADIENT;\n(function (TEXT_GRADIENT) {\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_VERTICAL\"] = 0] = \"LINEAR_VERTICAL\";\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_HORIZONTAL\"] = 1] = \"LINEAR_HORIZONTAL\";\n})(TEXT_GRADIENT || (TEXT_GRADIENT = {}));\n\n// disabling eslint for now, going to rewrite this in v5\nvar defaultStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAlpha: 1,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: 'black',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: TEXT_GRADIENT.LINEAR_VERTICAL,\n fillGradientStops: [],\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n trim: false,\n whiteSpace: 'pre',\n wordWrap: false,\n wordWrapWidth: 100,\n leading: 0,\n};\nvar genericFontFamilies = [\n 'serif',\n 'sans-serif',\n 'monospace',\n 'cursive',\n 'fantasy',\n 'system-ui' ];\n/**\n * A TextStyle Object contains information to decorate a Text objects.\n *\n * An instance can be shared between multiple Text objects; then changing the style will update all text objects using it.\n *\n * A tool can be used to generate a text style [here](https://pixijs.io/pixi-text-style).\n *\n * @memberof PIXI\n */\nvar TextStyle = /** @class */ (function () {\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours\n * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', '800' or '900')\n * @param {number} [style.leading=0] - The space between lines\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Possible values \"miter\" (creates a sharp corner), \"round\" (creates a round corner) or \"bevel\"\n * (creates a squared corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {boolean} [style.trim=false] - Trim transparent borders\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {string} [style.whiteSpace='pre'] - Determines whether newlines & spaces are collapsed or preserved \"normal\"\n * (collapse, collapse), \"pre\" (preserve, preserve) | \"pre-line\" (preserve, collapse). It needs wordWrap to be set to true\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n function TextStyle(style) {\n this.styleID = 0;\n this.reset();\n deepCopyProperties(this, style, style);\n }\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return New cloned TextStyle object\n */\n TextStyle.prototype.clone = function () {\n var clonedProperties = {};\n deepCopyProperties(clonedProperties, this, defaultStyle);\n return new TextStyle(clonedProperties);\n };\n /** Resets all properties to the defaults specified in TextStyle.prototype._default */\n TextStyle.prototype.reset = function () {\n deepCopyProperties(this, defaultStyle, defaultStyle);\n };\n Object.defineProperty(TextStyle.prototype, \"align\", {\n /**\n * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text\n *\n * @member {string}\n */\n get: function () {\n return this._align;\n },\n set: function (align) {\n if (this._align !== align) {\n this._align = align;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"breakWords\", {\n /** Indicates if lines can be wrapped within words, it needs wordWrap to be set to true. */\n get: function () {\n return this._breakWords;\n },\n set: function (breakWords) {\n if (this._breakWords !== breakWords) {\n this._breakWords = breakWords;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadow\", {\n /** Set a drop shadow for the text. */\n get: function () {\n return this._dropShadow;\n },\n set: function (dropShadow) {\n if (this._dropShadow !== dropShadow) {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAlpha\", {\n /** Set alpha for the drop shadow. */\n get: function () {\n return this._dropShadowAlpha;\n },\n set: function (dropShadowAlpha) {\n if (this._dropShadowAlpha !== dropShadowAlpha) {\n this._dropShadowAlpha = dropShadowAlpha;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAngle\", {\n /** Set a angle of the drop shadow. */\n get: function () {\n return this._dropShadowAngle;\n },\n set: function (dropShadowAngle) {\n if (this._dropShadowAngle !== dropShadowAngle) {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowBlur\", {\n /** Set a shadow blur radius. */\n get: function () {\n return this._dropShadowBlur;\n },\n set: function (dropShadowBlur) {\n if (this._dropShadowBlur !== dropShadowBlur) {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowColor\", {\n /** A fill style to be used on the dropshadow e.g 'red', '#00FF00'. */\n get: function () {\n return this._dropShadowColor;\n },\n set: function (dropShadowColor) {\n var outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor) {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowDistance\", {\n /** Set a distance of the drop shadow. */\n get: function () {\n return this._dropShadowDistance;\n },\n set: function (dropShadowDistance) {\n if (this._dropShadowDistance !== dropShadowDistance) {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fill\", {\n /**\n * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.\n *\n * Can be an array to create a gradient eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n *\n * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n get: function () {\n return this._fill;\n },\n set: function (fill) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n // TODO: Not sure if getColor works properly with CanvasGradient and/or CanvasPattern, can't pass in\n // without casting here.\n var outputColor = getColor(fill);\n if (this._fill !== outputColor) {\n this._fill = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientType\", {\n /**\n * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.\n *\n * @see PIXI.TEXT_GRADIENT\n */\n get: function () {\n return this._fillGradientType;\n },\n set: function (fillGradientType) {\n if (this._fillGradientType !== fillGradientType) {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientStops\", {\n /**\n * If fill is an array of colours to create a gradient, this array can set the stop points\n * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n */\n get: function () {\n return this._fillGradientStops;\n },\n set: function (fillGradientStops) {\n if (!areArraysEqual(this._fillGradientStops, fillGradientStops)) {\n this._fillGradientStops = fillGradientStops;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontFamily\", {\n /** The font family. */\n get: function () {\n return this._fontFamily;\n },\n set: function (fontFamily) {\n if (this.fontFamily !== fontFamily) {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontSize\", {\n /**\n * The font size\n * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')\n */\n get: function () {\n return this._fontSize;\n },\n set: function (fontSize) {\n if (this._fontSize !== fontSize) {\n this._fontSize = fontSize;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontStyle\", {\n /**\n * The font style\n * ('normal', 'italic' or 'oblique')\n *\n * @member {string}\n */\n get: function () {\n return this._fontStyle;\n },\n set: function (fontStyle) {\n if (this._fontStyle !== fontStyle) {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontVariant\", {\n /**\n * The font variant\n * ('normal' or 'small-caps')\n *\n * @member {string}\n */\n get: function () {\n return this._fontVariant;\n },\n set: function (fontVariant) {\n if (this._fontVariant !== fontVariant) {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontWeight\", {\n /**\n * The font weight\n * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')\n *\n * @member {string}\n */\n get: function () {\n return this._fontWeight;\n },\n set: function (fontWeight) {\n if (this._fontWeight !== fontWeight) {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"letterSpacing\", {\n /** The amount of spacing between letters, default is 0. */\n get: function () {\n return this._letterSpacing;\n },\n set: function (letterSpacing) {\n if (this._letterSpacing !== letterSpacing) {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineHeight\", {\n /** The line height, a number that represents the vertical space that a letter uses. */\n get: function () {\n return this._lineHeight;\n },\n set: function (lineHeight) {\n if (this._lineHeight !== lineHeight) {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"leading\", {\n /** The space between lines. */\n get: function () {\n return this._leading;\n },\n set: function (leading) {\n if (this._leading !== leading) {\n this._leading = leading;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineJoin\", {\n /**\n * The lineJoin property sets the type of corner created, it can resolve spiked text issues.\n * Default is 'miter' (creates a sharp corner).\n *\n * @member {string}\n */\n get: function () {\n return this._lineJoin;\n },\n set: function (lineJoin) {\n if (this._lineJoin !== lineJoin) {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"miterLimit\", {\n /**\n * The miter limit to use when using the 'miter' lineJoin mode.\n *\n * This can reduce or increase the spikiness of rendered text.\n */\n get: function () {\n return this._miterLimit;\n },\n set: function (miterLimit) {\n if (this._miterLimit !== miterLimit) {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"padding\", {\n /**\n * Occasionally some fonts are cropped. Adding some padding will prevent this from happening\n * by adding padding to all sides of the text.\n */\n get: function () {\n return this._padding;\n },\n set: function (padding) {\n if (this._padding !== padding) {\n this._padding = padding;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"stroke\", {\n /**\n * A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n */\n get: function () {\n return this._stroke;\n },\n set: function (stroke) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var outputColor = getColor(stroke);\n if (this._stroke !== outputColor) {\n this._stroke = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"strokeThickness\", {\n /**\n * A number that represents the thickness of the stroke.\n *\n * @default 0\n */\n get: function () {\n return this._strokeThickness;\n },\n set: function (strokeThickness) {\n if (this._strokeThickness !== strokeThickness) {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"textBaseline\", {\n /**\n * The baseline of the text that is rendered.\n *\n * @member {string}\n */\n get: function () {\n return this._textBaseline;\n },\n set: function (textBaseline) {\n if (this._textBaseline !== textBaseline) {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"trim\", {\n /** Trim transparent borders. */\n get: function () {\n return this._trim;\n },\n set: function (trim) {\n if (this._trim !== trim) {\n this._trim = trim;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"whiteSpace\", {\n /**\n * How newlines and spaces should be handled.\n * Default is 'pre' (preserve, preserve).\n *\n * value | New lines | Spaces\n * --- | --- | ---\n * 'normal' | Collapse | Collapse\n * 'pre' | Preserve | Preserve\n * 'pre-line' | Preserve | Collapse\n *\n * @member {string}\n */\n get: function () {\n return this._whiteSpace;\n },\n set: function (whiteSpace) {\n if (this._whiteSpace !== whiteSpace) {\n this._whiteSpace = whiteSpace;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrap\", {\n /** Indicates if word wrap should be used. */\n get: function () {\n return this._wordWrap;\n },\n set: function (wordWrap) {\n if (this._wordWrap !== wordWrap) {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrapWidth\", {\n /** The width at which text will wrap, it needs wordWrap to be set to true. */\n get: function () {\n return this._wordWrapWidth;\n },\n set: function (wordWrapWidth) {\n if (this._wordWrapWidth !== wordWrapWidth) {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Generates a font style string to use for `TextMetrics.measureFont()`.\n *\n * @return Font style string, for passing to `TextMetrics.measureFont()`\n */\n TextStyle.prototype.toFontString = function () {\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n var fontSizeString = (typeof this.fontSize === 'number') ? this.fontSize + \"px\" : this.fontSize;\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = this.fontFamily;\n if (!Array.isArray(this.fontFamily)) {\n fontFamilies = this.fontFamily.split(',');\n }\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily = fontFamilies[i].trim();\n // Check if font already contains strings\n if (!(/([\\\"\\'])[^\\'\\\"]+\\1/).test(fontFamily) && genericFontFamilies.indexOf(fontFamily) < 0) {\n fontFamily = \"\\\"\" + fontFamily + \"\\\"\";\n }\n fontFamilies[i] = fontFamily;\n }\n return this.fontStyle + \" \" + this.fontVariant + \" \" + this.fontWeight + \" \" + fontSizeString + \" \" + fontFamilies.join(',');\n };\n return TextStyle;\n}());\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * @private\n * @param color\n * @return The color as a string.\n */\nfunction getSingleColor(color) {\n if (typeof color === 'number') {\n return hex2string(color);\n }\n else if (typeof color === 'string') {\n if (color.indexOf('0x') === 0) {\n color = color.replace('0x', '#');\n }\n }\n return color;\n}\nfunction getColor(color) {\n if (!Array.isArray(color)) {\n return getSingleColor(color);\n }\n else {\n for (var i = 0; i < color.length; ++i) {\n color[i] = getSingleColor(color[i]);\n }\n return color;\n }\n}\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param array1 - First array to compare\n * @param array2 - Second array to compare\n * @return Do the arrays contain the same values in the same order\n */\nfunction areArraysEqual(array1, array2) {\n if (!Array.isArray(array1) || !Array.isArray(array2)) {\n return false;\n }\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Utility function to ensure that object properties are copied by value, and not by reference\n * @private\n * @param target - Target object to copy properties into\n * @param source - Source object for the properties to copy\n * @param propertyObj - Object containing properties names we want to loop over\n */\nfunction deepCopyProperties(target, source, propertyObj) {\n for (var prop in propertyObj) {\n if (Array.isArray(source[prop])) {\n target[prop] = source[prop].slice();\n }\n else {\n target[prop] = source[prop];\n }\n }\n}\n\n// Default settings used for all getContext calls\nvar contextSettings = {\n // TextMetrics requires getImageData readback for measuring fonts.\n willReadFrequently: true,\n};\n/**\n * The TextMetrics object represents the measurement of a block of text with a specified style.\n *\n * ```js\n * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'})\n * let textMetrics = PIXI.TextMetrics.measureText('Your text', style)\n * ```\n * @memberof PIXI\n */\nvar TextMetrics = /** @class */ (function () {\n /**\n * @param text - the text that was measured\n * @param style - the style that was measured\n * @param width - the measured width of the text\n * @param height - the measured height of the text\n * @param lines - an array of the lines of text broken by new lines and wrapping if specified in style\n * @param lineWidths - an array of the line widths for each line matched to `lines`\n * @param lineHeight - the measured line height for this style\n * @param maxLineWidth - the maximum line width for all measured lines\n * @param {PIXI.IFontMetrics} fontProperties - the font properties object from TextMetrics.measureFont\n */\n function TextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) {\n this.text = text;\n this.style = style;\n this.width = width;\n this.height = height;\n this.lines = lines;\n this.lineWidths = lineWidths;\n this.lineHeight = lineHeight;\n this.maxLineWidth = maxLineWidth;\n this.fontProperties = fontProperties;\n }\n /**\n * Measures the supplied string of text and returns a Rectangle.\n * @param text - The text to measure.\n * @param style - The text style to use for measuring\n * @param wordWrap - Override for if word-wrap should be applied to the text.\n * @param canvas - optional specification of the canvas to use for measuring.\n * @returns Measured width and height of the text.\n */\n TextMetrics.measureText = function (text, style, wordWrap, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n wordWrap = (wordWrap === undefined || wordWrap === null) ? style.wordWrap : wordWrap;\n var font = style.toFontString();\n var fontProperties = TextMetrics.measureFont(font);\n // fallback in case UA disallow canvas data extraction\n // (toDataURI, getImageData functions)\n if (fontProperties.fontSize === 0) {\n fontProperties.fontSize = style.fontSize;\n fontProperties.ascent = style.fontSize;\n }\n var context = canvas.getContext('2d', contextSettings);\n context.font = font;\n var outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text;\n var lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n var lineWidths = new Array(lines.length);\n var maxLineWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n var lineWidth = context.measureText(lines[i]).width + ((lines[i].length - 1) * style.letterSpacing);\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n var width = maxLineWidth + style.strokeThickness;\n if (style.dropShadow) {\n width += style.dropShadowDistance;\n }\n var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness)\n + ((lines.length - 1) * (lineHeight + style.leading));\n if (style.dropShadow) {\n height += style.dropShadowDistance;\n }\n return new TextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties);\n };\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n * @param text - String to apply word wrapping to\n * @param style - the style to use when wrapping\n * @param canvas - optional specification of the canvas to use for measuring.\n * @returns New string with new lines applied where required\n */\n TextMetrics.wordWrap = function (text, style, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n var context = canvas.getContext('2d', contextSettings);\n var width = 0;\n var line = '';\n var lines = '';\n var cache = Object.create(null);\n var letterSpacing = style.letterSpacing, whiteSpace = style.whiteSpace;\n // How to handle whitespaces\n var collapseSpaces = TextMetrics.collapseSpaces(whiteSpace);\n var collapseNewlines = TextMetrics.collapseNewlines(whiteSpace);\n // whether or not spaces may be added to the beginning of lines\n var canPrependSpaces = !collapseSpaces;\n // There is letterSpacing after every char except the last one\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!\n // so for convenience the above needs to be compared to width + 1 extra letterSpace\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!_\n // ________________________________________________\n // And then the final space is simply no appended to each line\n var wordWrapWidth = style.wordWrapWidth + letterSpacing;\n // break text into words, spaces and newline chars\n var tokens = TextMetrics.tokenize(text);\n for (var i = 0; i < tokens.length; i++) {\n // get the word, space or newlineChar\n var token = tokens[i];\n // if word is a new line\n if (TextMetrics.isNewline(token)) {\n // keep the new line\n if (!collapseNewlines) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = !collapseSpaces;\n line = '';\n width = 0;\n continue;\n }\n // if we should collapse new lines\n // we simply convert it into a space\n token = ' ';\n }\n // if we should collapse repeated whitespaces\n if (collapseSpaces) {\n // check both this and the last tokens for spaces\n var currIsBreakingSpace = TextMetrics.isBreakingSpace(token);\n var lastIsBreakingSpace = TextMetrics.isBreakingSpace(line[line.length - 1]);\n if (currIsBreakingSpace && lastIsBreakingSpace) {\n continue;\n }\n }\n // get word width from cache if possible\n var tokenWidth = TextMetrics.getFromCache(token, letterSpacing, cache, context);\n // word is longer than desired bounds\n if (tokenWidth > wordWrapWidth) {\n // if we are not already at the beginning of a line\n if (line !== '') {\n // start newlines for overflow words\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n // break large word over multiple lines\n if (TextMetrics.canBreakWords(token, style.breakWords)) {\n // break word into characters\n var characters = TextMetrics.wordWrapSplit(token);\n // loop the characters\n for (var j = 0; j < characters.length; j++) {\n var char = characters[j];\n var k = 1;\n // we are not at the end of the token\n while (characters[j + k]) {\n var nextChar = characters[j + k];\n var lastChar = char[char.length - 1];\n // should not split chars\n if (!TextMetrics.canBreakChars(lastChar, nextChar, token, j, style.breakWords)) {\n // combine chars & move forward one\n char += nextChar;\n }\n else {\n break;\n }\n k++;\n }\n j += char.length - 1;\n var characterWidth = TextMetrics.getFromCache(char, letterSpacing, cache, context);\n if (characterWidth + width > wordWrapWidth) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n line += char;\n width += characterWidth;\n }\n }\n // run word out of the bounds\n else {\n // if there are words in this line already\n // finish that line and start a new one\n if (line.length > 0) {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n var isLastToken = i === tokens.length - 1;\n // give it its own line if it's not the end\n lines += TextMetrics.addLine(token, !isLastToken);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n }\n // word could fit\n else {\n // word won't fit because of existing words\n // start a new line\n if (tokenWidth + width > wordWrapWidth) {\n // if its a space we don't want it\n canPrependSpaces = false;\n // add a new line\n lines += TextMetrics.addLine(line);\n // start a new line\n line = '';\n width = 0;\n }\n // don't add spaces to the beginning of lines\n if (line.length > 0 || !TextMetrics.isBreakingSpace(token) || canPrependSpaces) {\n // add the word to the current line\n line += token;\n // update width counter\n width += tokenWidth;\n }\n }\n }\n lines += TextMetrics.addLine(line, false);\n return lines;\n };\n /**\n * Convienience function for logging each line added during the wordWrap method.\n * @param line - The line of text to add\n * @param newLine - Add new line character to end\n * @returns A formatted line\n */\n TextMetrics.addLine = function (line, newLine) {\n if (newLine === void 0) { newLine = true; }\n line = TextMetrics.trimRight(line);\n line = (newLine) ? line + \"\\n\" : line;\n return line;\n };\n /**\n * Gets & sets the widths of calculated characters in a cache object\n * @param key - The key\n * @param letterSpacing - The letter spacing\n * @param cache - The cache\n * @param context - The canvas context\n * @returns The from cache.\n */\n TextMetrics.getFromCache = function (key, letterSpacing, cache, context) {\n var width = cache[key];\n if (typeof width !== 'number') {\n var spacing = ((key.length) * letterSpacing);\n width = context.measureText(key).width + spacing;\n cache[key] = width;\n }\n return width;\n };\n /**\n * Determines whether we should collapse breaking spaces.\n * @param whiteSpace - The TextStyle property whiteSpace\n * @returns Should collapse\n */\n TextMetrics.collapseSpaces = function (whiteSpace) {\n return (whiteSpace === 'normal' || whiteSpace === 'pre-line');\n };\n /**\n * Determines whether we should collapse newLine chars.\n * @param whiteSpace - The white space\n * @returns should collapse\n */\n TextMetrics.collapseNewlines = function (whiteSpace) {\n return (whiteSpace === 'normal');\n };\n /**\n * Trims breaking whitespaces from string.\n * @param text - The text\n * @returns Trimmed string\n */\n TextMetrics.trimRight = function (text) {\n if (typeof text !== 'string') {\n return '';\n }\n for (var i = text.length - 1; i >= 0; i--) {\n var char = text[i];\n if (!TextMetrics.isBreakingSpace(char)) {\n break;\n }\n text = text.slice(0, -1);\n }\n return text;\n };\n /**\n * Determines if char is a newline.\n * @param char - The character\n * @returns True if newline, False otherwise.\n */\n TextMetrics.isNewline = function (char) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._newlines.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Determines if char is a breaking whitespace.\n *\n * It allows one to determine whether char should be a breaking whitespace\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n * @param char - The character\n * @param [_nextChar] - The next character\n * @returns True if whitespace, False otherwise.\n */\n TextMetrics.isBreakingSpace = function (char, _nextChar) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._breakingSpaces.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Splits a string into words, breaking-spaces and newLine characters\n * @param text - The text\n * @returns A tokenized array\n */\n TextMetrics.tokenize = function (text) {\n var tokens = [];\n var token = '';\n if (typeof text !== 'string') {\n return tokens;\n }\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n var nextChar = text[i + 1];\n if (TextMetrics.isBreakingSpace(char, nextChar) || TextMetrics.isNewline(char)) {\n if (token !== '') {\n tokens.push(token);\n token = '';\n }\n tokens.push(char);\n continue;\n }\n token += char;\n }\n if (token !== '') {\n tokens.push(token);\n }\n return tokens;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to customise which words should break\n * Examples are if the token is CJK or numbers.\n * It must return a boolean.\n * @param _token - The token\n * @param breakWords - The style attr break words\n * @returns Whether to break word or not\n */\n TextMetrics.canBreakWords = function (_token, breakWords) {\n return breakWords;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to determine whether a pair of characters\n * should be broken by newlines\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n * @param _char - The character\n * @param _nextChar - The next character\n * @param _token - The token/word the characters are from\n * @param _index - The index in the token of the char\n * @param _breakWords - The style attr break words\n * @returns whether to break word or not\n */\n TextMetrics.canBreakChars = function (_char, _nextChar, _token, _index, _breakWords) {\n return true;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It is called when a token (usually a word) has to be split into separate pieces\n * in order to determine the point to break a word.\n * It must return an array of characters.\n * @example\n * // Correctly splits emojis, eg \"🤪🤪\" will result in two element array, each with one emoji.\n * TextMetrics.wordWrapSplit = (token) => [...token];\n * @param token - The token to split\n * @returns The characters of the token\n */\n TextMetrics.wordWrapSplit = function (token) {\n return token.split('');\n };\n /**\n * Calculates the ascent, descent and fontSize of a given font-style\n * @param font - String representing the style of the font\n * @returns Font properties object\n */\n TextMetrics.measureFont = function (font) {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (TextMetrics._fonts[font]) {\n return TextMetrics._fonts[font];\n }\n var properties = {\n ascent: 0,\n descent: 0,\n fontSize: 0,\n };\n var canvas = TextMetrics._canvas;\n var context = TextMetrics._context;\n context.font = font;\n var metricsString = TextMetrics.METRICS_STRING + TextMetrics.BASELINE_SYMBOL;\n var width = Math.ceil(context.measureText(metricsString).width);\n var baseline = Math.ceil(context.measureText(TextMetrics.BASELINE_SYMBOL).width);\n var height = Math.ceil(TextMetrics.HEIGHT_MULTIPLIER * baseline);\n baseline = baseline * TextMetrics.BASELINE_MULTIPLIER | 0;\n canvas.width = width;\n canvas.height = height;\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n context.font = font;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText(metricsString, 0, baseline);\n var imagedata = context.getImageData(0, 0, width, height).data;\n var pixels = imagedata.length;\n var line = width * 4;\n var i = 0;\n var idx = 0;\n var stop = false;\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n }\n else {\n break;\n }\n }\n properties.ascent = baseline - i;\n idx = pixels - line;\n stop = false;\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx -= line;\n }\n else {\n break;\n }\n }\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n TextMetrics._fonts[font] = properties;\n return properties;\n };\n /**\n * Clear font metrics in metrics cache.\n * @param {string} [font] - font name. If font name not set then clear cache for all fonts.\n */\n TextMetrics.clearMetrics = function (font) {\n if (font === void 0) { font = ''; }\n if (font) {\n delete TextMetrics._fonts[font];\n }\n else {\n TextMetrics._fonts = {};\n }\n };\n Object.defineProperty(TextMetrics, \"_canvas\", {\n /**\n * Cached canvas element for measuring text\n * TODO: this should be private, but isn't because of backward compat, will fix later.\n * @ignore\n */\n get: function () {\n if (!TextMetrics.__canvas) {\n var canvas = void 0;\n try {\n // OffscreenCanvas2D measureText can be up to 40% faster.\n var c = new OffscreenCanvas(0, 0);\n var context = c.getContext('2d', contextSettings);\n if (context && context.measureText) {\n TextMetrics.__canvas = c;\n return c;\n }\n canvas = settings.ADAPTER.createCanvas();\n }\n catch (ex) {\n canvas = settings.ADAPTER.createCanvas();\n }\n canvas.width = canvas.height = 10;\n TextMetrics.__canvas = canvas;\n }\n return TextMetrics.__canvas;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextMetrics, \"_context\", {\n /**\n * TODO: this should be private, but isn't because of backward compat, will fix later.\n * @ignore\n */\n get: function () {\n if (!TextMetrics.__context) {\n TextMetrics.__context = TextMetrics._canvas.getContext('2d', contextSettings);\n }\n return TextMetrics.__context;\n },\n enumerable: false,\n configurable: true\n });\n return TextMetrics;\n}());\n/**\n * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}.\n * @typedef {object} FontMetrics\n * @property {number} ascent - The ascent distance\n * @property {number} descent - The descent distance\n * @property {number} fontSize - Font size from ascent to descent\n * @memberof PIXI.TextMetrics\n * @private\n */\n/**\n * Cache of {@see PIXI.TextMetrics.FontMetrics} objects.\n * @memberof PIXI.TextMetrics\n * @type {object}\n * @private\n */\nTextMetrics._fonts = {};\n/**\n * String used for calculate font metrics.\n * These characters are all tall to help calculate the height required for text.\n * @static\n * @memberof PIXI.TextMetrics\n * @name METRICS_STRING\n * @type {string}\n * @default |ÉqÅ\n */\nTextMetrics.METRICS_STRING = '|ÉqÅ';\n/**\n * Baseline symbol for calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_SYMBOL\n * @type {string}\n * @default M\n */\nTextMetrics.BASELINE_SYMBOL = 'M';\n/**\n * Baseline multiplier for calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_MULTIPLIER\n * @type {number}\n * @default 1.4\n */\nTextMetrics.BASELINE_MULTIPLIER = 1.4;\n/**\n * Height multiplier for setting height of canvas to calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name HEIGHT_MULTIPLIER\n * @type {number}\n * @default 2.00\n */\nTextMetrics.HEIGHT_MULTIPLIER = 2.0;\n/**\n * Cache of new line chars.\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._newlines = [\n 0x000A,\n 0x000D ];\n/**\n * Cache of breaking spaces.\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._breakingSpaces = [\n 0x0009,\n 0x0020,\n 0x2000,\n 0x2001,\n 0x2002,\n 0x2003,\n 0x2004,\n 0x2005,\n 0x2006,\n 0x2008,\n 0x2009,\n 0x200A,\n 0x205F,\n 0x3000 ];\n/**\n * A number, or a string containing a number.\n * @memberof PIXI\n * @typedef {object} IFontMetrics\n * @property {number} ascent - Font ascent\n * @property {number} descent - Font descent\n * @property {number} fontSize - Font size\n */\n\nvar defaultDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true,\n};\n/**\n * A Text Object will create a line or multiple lines of text.\n *\n * The text is created using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).\n *\n * The primary advantage of this class over BitmapText is that you have great control over the style of the text,\n * which you can change at runtime.\n *\n * The primary disadvantages is that each piece of text has it's own texture, which can use more memory.\n * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time.\n *\n * To split a line you can use '\\n' in your text string, or, on the `style` object,\n * change its `wordWrap` property to true and and give the `wordWrapWidth` property a value.\n *\n * A Text can be created directly from a string and a style object,\n * which can be generated [here](https://pixijs.io/pixi-text-style).\n *\n * ```js\n * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n * @memberof PIXI\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n /**\n * @param text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param canvas - The canvas element for drawing text\n */\n function Text(text, style, canvas) {\n var _this = this;\n var ownCanvas = false;\n if (!canvas) {\n canvas = settings.ADAPTER.createCanvas();\n ownCanvas = true;\n }\n canvas.width = 3;\n canvas.height = 3;\n var texture = Texture.from(canvas);\n texture.orig = new Rectangle();\n texture.trim = new Rectangle();\n _this = _super.call(this, texture) || this;\n _this._ownCanvas = ownCanvas;\n _this.canvas = canvas;\n _this.context = canvas.getContext('2d', {\n // required for trimming to work without warnings\n willReadFrequently: true,\n });\n _this._resolution = settings.RESOLUTION;\n _this._autoResolution = true;\n _this._text = null;\n _this._style = null;\n _this._styleListener = null;\n _this._font = '';\n _this.text = text;\n _this.style = style;\n _this.localStyleID = -1;\n return _this;\n }\n /**\n * Renders text to its canvas, and updates its texture.\n *\n * By default this is used internally to ensure the texture is correct before rendering,\n * but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text,\n * and then shared across multiple Sprites.\n * @param respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n Text.prototype.updateText = function (respectDirty) {\n var style = this._style;\n // check if style has changed..\n if (this.localStyleID !== style.styleID) {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n if (!this.dirty && respectDirty) {\n return;\n }\n this._font = this._style.toFontString();\n var context = this.context;\n var measured = TextMetrics.measureText(this._text || ' ', this._style, this._style.wordWrap, this.canvas);\n var width = measured.width;\n var height = measured.height;\n var lines = measured.lines;\n var lineHeight = measured.lineHeight;\n var lineWidths = measured.lineWidths;\n var maxLineWidth = measured.maxLineWidth;\n var fontProperties = measured.fontProperties;\n this.canvas.width = Math.ceil(Math.ceil((Math.max(1, width) + (style.padding * 2))) * this._resolution);\n this.canvas.height = Math.ceil(Math.ceil((Math.max(1, height) + (style.padding * 2))) * this._resolution);\n context.scale(this._resolution, this._resolution);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.font = this._font;\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n var linePositionX;\n var linePositionY;\n // require 2 passes if a shadow; the first to draw the drop shadow, the second to draw the text\n var passesCount = style.dropShadow ? 2 : 1;\n // For v4, we drew text at the colours of the drop shadow underneath the normal text. This gave the correct zIndex,\n // but features such as alpha and shadowblur did not look right at all, since we were using actual text as a shadow.\n //\n // For v5.0.0, we moved over to just use the canvas API for drop shadows, which made them look much nicer and more\n // visually please, but now because the stroke is drawn and then the fill, drop shadows would appear on both the fill\n // and the stroke; and fill drop shadows would appear over the top of the stroke.\n //\n // For v5.1.1, the new route is to revert to v4 style of drawing text first to get the drop shadows underneath normal\n // text, but instead drawing text in the correct location, we'll draw it off screen (-paddingY), and then adjust the\n // drop shadow so only that appears on screen (+paddingY). Now we'll have the correct draw order of the shadow\n // beneath the text, whilst also having the proper text shadow styling.\n for (var i = 0; i < passesCount; ++i) {\n var isShadowPass = style.dropShadow && i === 0;\n // we only want the drop shadow, so put text way off-screen\n var dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + (style.padding * 2)) : 0;\n var dsOffsetShadow = dsOffsetText * this._resolution;\n if (isShadowPass) {\n // On Safari, text with gradient and drop shadows together do not position correctly\n // if the scale of the canvas is not 1: https://bugs.webkit.org/show_bug.cgi?id=197689\n // Therefore we'll set the styles to be a plain black whilst generating this drop shadow\n context.fillStyle = 'black';\n context.strokeStyle = 'black';\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n var dropShadowBlur = style.dropShadowBlur * this._resolution;\n var dropShadowDistance = style.dropShadowDistance * this._resolution;\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * dropShadowDistance;\n context.shadowOffsetY = (Math.sin(style.dropShadowAngle) * dropShadowDistance) + dsOffsetShadow;\n }\n else {\n // set canvas text styles\n context.fillStyle = this._generateFillStyle(style, lines, measured);\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n context.strokeStyle = style.stroke;\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n var linePositionYShift = (lineHeight - fontProperties.fontSize) / 2;\n if (!Text.nextLineHeightBehavior || lineHeight - fontProperties.fontSize < 0) {\n linePositionYShift = 0;\n }\n // draw lines line by line\n for (var i_1 = 0; i_1 < lines.length; i_1++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = ((style.strokeThickness / 2) + (i_1 * lineHeight)) + fontProperties.ascent\n + linePositionYShift;\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[i_1];\n }\n else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[i_1]) / 2;\n }\n if (style.stroke && style.strokeThickness) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText, true);\n }\n if (style.fill) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText);\n }\n }\n }\n this.updateTexture();\n };\n /**\n * Render the text with letter-spacing.\n * @param text - The text to draw\n * @param x - Horizontal position to draw the text\n * @param y - Vertical position to draw the text\n * @param isStroke - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n */\n Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {\n if (isStroke === void 0) { isStroke = false; }\n var style = this._style;\n // letterSpacing of 0 means normal\n var letterSpacing = style.letterSpacing;\n // Checking that we can use moddern canvas2D api\n // https://developer.chrome.com/origintrials/#/view_trial/3585991203293757441\n // note: this is unstable API, Chrome less 94 use a `textLetterSpacing`, newest use a letterSpacing\n // eslint-disable-next-line max-len\n var supportLetterSpacing = Text.experimentalLetterSpacing\n && ('letterSpacing' in CanvasRenderingContext2D.prototype\n || 'textLetterSpacing' in CanvasRenderingContext2D.prototype);\n if (letterSpacing === 0 || supportLetterSpacing) {\n if (supportLetterSpacing) {\n this.context.letterSpacing = letterSpacing;\n this.context.textLetterSpacing = letterSpacing;\n }\n if (isStroke) {\n this.context.strokeText(text, x, y);\n }\n else {\n this.context.fillText(text, x, y);\n }\n return;\n }\n var currentPosition = x;\n // Using Array.from correctly splits characters whilst keeping emoji together.\n // This is not supported on IE as it requires ES6, so regular text splitting occurs.\n // This also doesn't account for emoji that are multiple emoji put together to make something else.\n // Handling all of this would require a big library itself.\n // https://medium.com/@giltayar/iterating-over-emoji-characters-the-es6-way-f06e4589516\n // https://github.com/orling/grapheme-splitter\n var stringArray = Array.from ? Array.from(text) : text.split('');\n var previousWidth = this.context.measureText(text).width;\n var currentWidth = 0;\n for (var i = 0; i < stringArray.length; ++i) {\n var currentChar = stringArray[i];\n if (isStroke) {\n this.context.strokeText(currentChar, currentPosition, y);\n }\n else {\n this.context.fillText(currentChar, currentPosition, y);\n }\n var textStr = '';\n for (var j = i + 1; j < stringArray.length; ++j) {\n textStr += stringArray[j];\n }\n currentWidth = this.context.measureText(textStr).width;\n currentPosition += previousWidth - currentWidth + letterSpacing;\n previousWidth = currentWidth;\n }\n };\n /** Updates texture size based on canvas size. */\n Text.prototype.updateTexture = function () {\n var canvas = this.canvas;\n if (this._style.trim) {\n var trimmed = trimCanvas(canvas);\n if (trimmed.data) {\n canvas.width = trimmed.width;\n canvas.height = trimmed.height;\n this.context.putImageData(trimmed.data, 0, 0);\n }\n }\n var texture = this._texture;\n var style = this._style;\n var padding = style.trim ? 0 : style.padding;\n var baseTexture = texture.baseTexture;\n texture.trim.width = texture._frame.width = canvas.width / this._resolution;\n texture.trim.height = texture._frame.height = canvas.height / this._resolution;\n texture.trim.x = -padding;\n texture.trim.y = -padding;\n texture.orig.width = texture._frame.width - (padding * 2);\n texture.orig.height = texture._frame.height - (padding * 2);\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n baseTexture.setRealSize(canvas.width, canvas.height, this._resolution);\n texture.updateUvs();\n this.dirty = false;\n };\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n Text.prototype._render = function (renderer) {\n if (this._autoResolution && this._resolution !== renderer.resolution) {\n this._resolution = renderer.resolution;\n this.dirty = true;\n }\n this.updateText(true);\n _super.prototype._render.call(this, renderer);\n };\n /** Updates the transform on all children of this container for rendering. */\n Text.prototype.updateTransform = function () {\n this.updateText(true);\n _super.prototype.updateTransform.call(this);\n };\n Text.prototype.getBounds = function (skipUpdate, rect) {\n this.updateText(true);\n if (this._textureID === -1) {\n // texture was updated: recalculate transforms\n skipUpdate = false;\n }\n return _super.prototype.getBounds.call(this, skipUpdate, rect);\n };\n /**\n * Gets the local bounds of the text object.\n * @param rect - The output rectangle.\n * @returns The bounds.\n */\n Text.prototype.getLocalBounds = function (rect) {\n this.updateText(true);\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /** Calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. */\n Text.prototype._calculateBounds = function () {\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n };\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n * @param style - The style.\n * @param lines - The lines of text.\n * @param metrics\n * @returns The fill style\n */\n Text.prototype._generateFillStyle = function (style, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = (this.canvas.width / this._resolution) - dropShadowCorrection - (padding * 2);\n var height = (this.canvas.height / this._resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n for (var i = 0; i < lines.length; i++) {\n var lastLineBottom = (metrics.lineHeight * (i - 1)) + textHeight;\n var thisLineTop = metrics.lineHeight * i;\n var thisLineGradientStart = thisLineTop;\n // Handle case where last & this line overlap\n if (i > 0 && lastLineBottom > thisLineTop) {\n thisLineGradientStart = (thisLineTop + lastLineBottom) / 2;\n }\n var thisLineBottom = thisLineTop + textHeight;\n var nextLineTop = metrics.lineHeight * (i + 1);\n var thisLineGradientEnd = thisLineBottom;\n // Handle case where this & next line overlap\n if (i + 1 < lines.length && nextLineTop < thisLineBottom) {\n thisLineGradientEnd = (thisLineBottom + nextLineTop) / 2;\n }\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = (thisLineGradientEnd - thisLineGradientStart) / height;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = Math.min(1, Math.max(0, (thisLineGradientStart / height) + (lineStop * gradStopLineHeight)));\n // There's potential for floating point precision issues at the seams between gradient repeats.\n globalStop = Number(globalStop.toFixed(5));\n gradient.addColorStop(globalStop, fill[j]);\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n };\n /**\n * Destroys this text object.\n *\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majority of the time the texture will not be shared with any other Sprites.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n Text.prototype.destroy = function (options) {\n if (typeof options === 'boolean') {\n options = { children: options };\n }\n options = Object.assign({}, defaultDestroyOptions, options);\n _super.prototype.destroy.call(this, options);\n // set canvas width and height to 0 to workaround memory leak in Safari < 13\n // https://stackoverflow.com/questions/52532614/total-canvas-memory-use-exceeds-the-maximum-limit-safari-12\n if (this._ownCanvas) {\n this.canvas.height = this.canvas.width = 0;\n }\n // make sure to reset the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n this._style = null;\n };\n Object.defineProperty(Text.prototype, \"width\", {\n /** The width of the Text, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"height\", {\n /** The height of the Text, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"style\", {\n /**\n * Set the style of the text.\n *\n * Set up an event listener to listen for changes on the style object and mark the text as dirty.\n */\n get: function () {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the ITextStyle\n // since the setter creates the TextStyle. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n return this._style;\n },\n set: function (style) {\n style = style || {};\n if (style instanceof TextStyle) {\n this._style = style;\n }\n else {\n this._style = new TextStyle(style);\n }\n this.localStyleID = -1;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"text\", {\n /** Set the copy for the text object. To split a line you can use '\\n'. */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"resolution\", {\n /**\n * The resolution / device pixel ratio of the canvas.\n *\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @default 1\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._autoResolution = false;\n if (this._resolution === value) {\n return;\n }\n this._resolution = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * New behavior for `lineHeight` that's meant to mimic HTML text. A value of `true` will\n * make sure the first baseline is offset by the `lineHeight` value if it is greater than `fontSize`.\n * A value of `false` will use the legacy behavior and not change the baseline of the first line.\n * In the next major release, we'll enable this by default.\n */\n Text.nextLineHeightBehavior = false;\n /**\n * New rendering behavior for letter-spacing which uses Chrome's new native API. This will\n * lead to more accurate letter-spacing results because it does not try to manually draw\n * each character. However, this Chrome API is experimental and may not serve all cases yet.\n */\n Text.experimentalLetterSpacing = false;\n return Text;\n}(Sprite));\n\nexport { TEXT_GRADIENT, Text, TextMetrics, TextStyle };\n//# sourceMappingURL=text.mjs.map\n","/*!\n * @pixi/prepare - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/prepare is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nimport { Texture, BaseTexture, ExtensionType } from '@pixi/core';\nimport { Graphics } from '@pixi/graphics';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { Container } from '@pixi/display';\nimport { Text, TextStyle, TextMetrics } from '@pixi/text';\nimport { deprecation } from '@pixi/utils';\n\n/**\n * Default number of uploads per frame using prepare plugin.\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @type {number}\n * @default 4\n */\nsettings.UPLOADS_PER_FRAME = 4;\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of items per frame.\n * @memberof PIXI\n */\nvar CountLimiter = /** @class */ (function () {\n /**\n * @param maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n function CountLimiter(maxItemsPerFrame) {\n this.maxItemsPerFrame = maxItemsPerFrame;\n this.itemsLeft = 0;\n }\n /** Resets any counting properties to start fresh on a new frame. */\n CountLimiter.prototype.beginFrame = function () {\n this.itemsLeft = this.maxItemsPerFrame;\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns If the item is allowed to be uploaded.\n */\n CountLimiter.prototype.allowedToUpload = function () {\n return this.itemsLeft-- > 0;\n };\n return CountLimiter;\n}());\n\n/**\n * Built-in hook to find multiple textures from objects like AnimatedSprites.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.Texture object was found.\n */\nfunction findMultipleBaseTextures(item, queue) {\n var result = false;\n // Objects with multiple textures\n if (item && item._textures && item._textures.length) {\n for (var i = 0; i < item._textures.length; i++) {\n if (item._textures[i] instanceof Texture) {\n var baseTexture = item._textures[i].baseTexture;\n if (queue.indexOf(baseTexture) === -1) {\n queue.push(baseTexture);\n result = true;\n }\n }\n }\n }\n return result;\n}\n/**\n * Built-in hook to find BaseTextures from Texture.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.Texture object was found.\n */\nfunction findBaseTexture(item, queue) {\n if (item.baseTexture instanceof BaseTexture) {\n var texture = item.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find textures from objects.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.Texture object was found.\n */\nfunction findTexture(item, queue) {\n if (item._texture && item._texture instanceof Texture) {\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to draw PIXI.Text to its texture.\n * @private\n * @param _helper - Not used by this upload handler\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction drawText(_helper, item) {\n if (item instanceof Text) {\n // updating text will return early if it is not dirty\n item.updateText(true);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to calculate a text style for a PIXI.Text object.\n * @private\n * @param _helper - Not used by this upload handler\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction calculateTextStyle(_helper, item) {\n if (item instanceof TextStyle) {\n var font = item.toFontString();\n TextMetrics.measureFont(font);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find Text objects.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns if a PIXI.Text object was found.\n */\nfunction findText(item, queue) {\n if (item instanceof Text) {\n // push the text style to prepare it - this can be really expensive\n if (queue.indexOf(item.style) === -1) {\n queue.push(item.style);\n }\n // also push the text object so that we can render it (to canvas/texture) if needed\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n // also push the Text's texture for upload to GPU\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find TextStyle objects.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.TextStyle object was found.\n */\nfunction findTextStyle(item, queue) {\n if (item instanceof TextStyle) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n return true;\n }\n return false;\n}\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * BasePrepare handles basic queuing functionality and is extended by\n * {@link PIXI.Prepare} and {@link PIXI.CanvasPrepare}\n * to provide preparation capabilities specific to their respective renderers.\n * @example\n * // Create a sprite\n * const sprite = PIXI.Sprite.from('something.png');\n *\n * // Load object into GPU\n * app.renderer.plugins.prepare.upload(sprite, () => {\n *\n * //Texture(s) has been uploaded to GPU\n * app.stage.addChild(sprite);\n *\n * })\n * @abstract\n * @memberof PIXI\n */\nvar BasePrepare = /** @class */ (function () {\n /**\n * @param {PIXI.AbstractRenderer} renderer - A reference to the current renderer\n */\n function BasePrepare(renderer) {\n var _this = this;\n this.limiter = new CountLimiter(settings.UPLOADS_PER_FRAME);\n this.renderer = renderer;\n this.uploadHookHelper = null;\n this.queue = [];\n this.addHooks = [];\n this.uploadHooks = [];\n this.completes = [];\n this.ticking = false;\n this.delayedTick = function () {\n // unlikely, but in case we were destroyed between tick() and delayedTick()\n if (!_this.queue) {\n return;\n }\n _this.prepareItems();\n };\n // hooks to find the correct texture\n this.registerFindHook(findText);\n this.registerFindHook(findTextStyle);\n this.registerFindHook(findMultipleBaseTextures);\n this.registerFindHook(findBaseTexture);\n this.registerFindHook(findTexture);\n // upload hooks\n this.registerUploadHook(drawText);\n this.registerUploadHook(calculateTextStyle);\n }\n /** @ignore */\n BasePrepare.prototype.upload = function (item, done) {\n var _this = this;\n if (typeof item === 'function') {\n done = item;\n item = null;\n }\n if (done) {\n deprecation('6.5.0', 'BasePrepare.upload callback is deprecated, use the return Promise instead.');\n }\n return new Promise(function (resolve) {\n // If a display object, search for items\n // that we could upload\n if (item) {\n _this.add(item);\n }\n // TODO: remove done callback and just use resolve\n var complete = function () {\n done === null || done === void 0 ? void 0 : done();\n resolve();\n };\n // Get the items for upload from the display\n if (_this.queue.length) {\n _this.completes.push(complete);\n if (!_this.ticking) {\n _this.ticking = true;\n Ticker.system.addOnce(_this.tick, _this, UPDATE_PRIORITY.UTILITY);\n }\n }\n else {\n complete();\n }\n });\n };\n /**\n * Handle tick update\n * @private\n */\n BasePrepare.prototype.tick = function () {\n setTimeout(this.delayedTick, 0);\n };\n /**\n * Actually prepare items. This is handled outside of the tick because it will take a while\n * and we do NOT want to block the current animation frame from rendering.\n * @private\n */\n BasePrepare.prototype.prepareItems = function () {\n this.limiter.beginFrame();\n // Upload the graphics\n while (this.queue.length && this.limiter.allowedToUpload()) {\n var item = this.queue[0];\n var uploaded = false;\n if (item && !item._destroyed) {\n for (var i = 0, len = this.uploadHooks.length; i < len; i++) {\n if (this.uploadHooks[i](this.uploadHookHelper, item)) {\n this.queue.shift();\n uploaded = true;\n break;\n }\n }\n }\n if (!uploaded) {\n this.queue.shift();\n }\n }\n // We're finished\n if (!this.queue.length) {\n this.ticking = false;\n var completes = this.completes.slice(0);\n this.completes.length = 0;\n for (var i = 0, len = completes.length; i < len; i++) {\n completes[i]();\n }\n }\n else {\n // if we are not finished, on the next rAF do this again\n Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY);\n }\n };\n /**\n * Adds hooks for finding items.\n * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`\n * function must return `true` if it was able to add item to the queue.\n * @returns Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerFindHook = function (addHook) {\n if (addHook) {\n this.addHooks.push(addHook);\n }\n return this;\n };\n /**\n * Adds hooks for uploading items.\n * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @returns Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerUploadHook = function (uploadHook) {\n if (uploadHook) {\n this.uploadHooks.push(uploadHook);\n }\n return this;\n };\n /**\n * Manually add an item to the uploading queue.\n * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to\n * add to the queue\n * @returns Instance of plugin for chaining.\n */\n BasePrepare.prototype.add = function (item) {\n // Add additional hooks for finding elements on special\n // types of objects that\n for (var i = 0, len = this.addHooks.length; i < len; i++) {\n if (this.addHooks[i](item, this.queue)) {\n break;\n }\n }\n // Get children recursively\n if (item instanceof Container) {\n for (var i = item.children.length - 1; i >= 0; i--) {\n this.add(item.children[i]);\n }\n }\n return this;\n };\n /** Destroys the plugin, don't use after this. */\n BasePrepare.prototype.destroy = function () {\n if (this.ticking) {\n Ticker.system.remove(this.tick, this);\n }\n this.ticking = false;\n this.addHooks = null;\n this.uploadHooks = null;\n this.renderer = null;\n this.completes = null;\n this.queue = null;\n this.limiter = null;\n this.uploadHookHelper = null;\n };\n return BasePrepare;\n}());\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n * @private\n * @param renderer - instance of the webgl renderer\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction uploadBaseTextures(renderer, item) {\n if (item instanceof BaseTexture) {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID]) {\n renderer.texture.bind(item);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n * @private\n * @param renderer - instance of the webgl renderer\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction uploadGraphics(renderer, item) {\n if (!(item instanceof Graphics)) {\n return false;\n }\n var geometry = item.geometry;\n // update dirty graphics to get batches\n item.finishPoly();\n geometry.updateBatches();\n var batches = geometry.batches;\n // upload all textures found in styles\n for (var i = 0; i < batches.length; i++) {\n var texture = batches[i].style.texture;\n if (texture) {\n uploadBaseTextures(renderer, texture.baseTexture);\n }\n }\n // if its not batchable - update vao for particular shader\n if (!geometry.batchable) {\n renderer.geometry.bind(geometry, item._resolveDirectShader(renderer));\n }\n return true;\n}\n/**\n * Built-in hook to find graphics.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue) {\n if (item instanceof Graphics) {\n queue.push(item);\n return true;\n }\n return false;\n}\n/**\n * The prepare plugin provides renderer-specific plugins for pre-rendering DisplayObjects. These plugins are useful for\n * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.\n *\n * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n * document.body.appendChild(app.view);\n *\n * // Don't start rendering right away\n * app.stop();\n *\n * // create a display object\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add to the stage\n * app.stage.addChild(rect);\n *\n * // Don't start rendering until the graphic is uploaded to the GPU\n * app.renderer.plugins.prepare.upload(app.stage, () => {\n * app.start();\n * });\n * @memberof PIXI\n */\nvar Prepare = /** @class */ (function (_super) {\n __extends(Prepare, _super);\n /**\n * @param {PIXI.Renderer} renderer - A reference to the current renderer\n */\n function Prepare(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.uploadHookHelper = _this.renderer;\n // Add textures and graphics to upload\n _this.registerFindHook(findGraphics);\n _this.registerUploadHook(uploadBaseTextures);\n _this.registerUploadHook(uploadGraphics);\n return _this;\n }\n /** @ignore */\n Prepare.extension = {\n name: 'prepare',\n type: ExtensionType.RendererPlugin,\n };\n return Prepare;\n}(BasePrepare));\n\n/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n * @memberof PIXI\n */\nvar TimeLimiter = /** @class */ (function () {\n /** @param maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame. */\n function TimeLimiter(maxMilliseconds) {\n this.maxMilliseconds = maxMilliseconds;\n this.frameStart = 0;\n }\n /** Resets any counting properties to start fresh on a new frame. */\n TimeLimiter.prototype.beginFrame = function () {\n this.frameStart = Date.now();\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns - If the item is allowed to be uploaded.\n */\n TimeLimiter.prototype.allowedToUpload = function () {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n };\n return TimeLimiter;\n}());\n\nexport { BasePrepare, CountLimiter, Prepare, TimeLimiter };\n//# sourceMappingURL=prepare.mjs.map\n","/*!\n * @pixi/spritesheet - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/spritesheet is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle } from '@pixi/math';\nimport { Texture, BaseTexture, ExtensionType } from '@pixi/core';\nimport { getResolutionOfUrl, deprecation, url } from '@pixi/utils';\nimport { LoaderResource } from '@pixi/loaders';\n\n/**\n * Utility class for maintaining reference to a collection\n * of Textures on a single Spritesheet.\n *\n * To access a sprite sheet from your code you may pass its JSON data file to Pixi's loader:\n *\n * ```js\n * PIXI.Loader.shared.add(\"images/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"images/spritesheet.json\"].spritesheet;\n * ...\n * }\n * ```\n *\n * Alternately, you may circumvent the loader by instantiating the Spritesheet directly:\n * ```js\n * const sheet = new PIXI.Spritesheet(texture, spritesheetData);\n * await sheet.parse();\n * console.log('Spritesheet ready to use!');\n * ```\n *\n * With the `sheet.textures` you can create Sprite objects,`sheet.animations` can be used to create an AnimatedSprite.\n *\n * Sprite sheets can be packed using tools like {@link https://codeandweb.com/texturepacker|TexturePacker},\n * {@link https://renderhjs.net/shoebox/|Shoebox} or {@link https://github.com/krzysztof-o/spritesheet.js|Spritesheet.js}.\n * Default anchor points (see {@link PIXI.Texture#defaultAnchor}) and grouping of animation sprites are currently only\n * supported by TexturePacker.\n * @memberof PIXI\n */\nvar Spritesheet = /** @class */ (function () {\n /**\n * @param texture - Reference to the source BaseTexture object.\n * @param {object} data - Spritesheet image data.\n * @param resolutionFilename - The filename to consider when determining\n * the resolution of the spritesheet. If not provided, the imageUrl will\n * be used on the BaseTexture.\n */\n function Spritesheet(texture, data, resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n /** For multi-packed spritesheets, this contains a reference to all the other spritesheets it depends on. */\n this.linkedSheets = [];\n this._texture = texture instanceof Texture ? texture : null;\n this.baseTexture = texture instanceof BaseTexture ? texture : this._texture.baseTexture;\n this.textures = {};\n this.animations = {};\n this.data = data;\n var resource = this.baseTexture.resource;\n this.resolution = this._updateResolution(resolutionFilename || (resource ? resource.url : null));\n this._frames = this.data.frames;\n this._frameKeys = Object.keys(this._frames);\n this._batchIndex = 0;\n this._callback = null;\n }\n /**\n * Generate the resolution from the filename or fallback\n * to the meta.scale field of the JSON data.\n * @param resolutionFilename - The filename to use for resolving\n * the default resolution.\n * @returns Resolution to use for spritesheet.\n */\n Spritesheet.prototype._updateResolution = function (resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n var scale = this.data.meta.scale;\n // Use a defaultValue of `null` to check if a url-based resolution is set\n var resolution = getResolutionOfUrl(resolutionFilename, null);\n // No resolution found via URL\n if (resolution === null) {\n // Use the scale value or default to 1\n resolution = scale !== undefined ? parseFloat(scale) : 1;\n }\n // For non-1 resolutions, update baseTexture\n if (resolution !== 1) {\n this.baseTexture.setResolution(resolution);\n }\n return resolution;\n };\n /** @ignore */\n Spritesheet.prototype.parse = function (callback) {\n var _this = this;\n if (callback) {\n deprecation('6.5.0', 'Spritesheet.parse callback is deprecated, use the return Promise instead.');\n }\n return new Promise(function (resolve) {\n _this._callback = function (textures) {\n callback === null || callback === void 0 ? void 0 : callback(textures);\n resolve(textures);\n };\n _this._batchIndex = 0;\n if (_this._frameKeys.length <= Spritesheet.BATCH_SIZE) {\n _this._processFrames(0);\n _this._processAnimations();\n _this._parseComplete();\n }\n else {\n _this._nextBatch();\n }\n });\n };\n /**\n * Process a batch of frames\n * @param initialFrameIndex - The index of frame to start.\n */\n Spritesheet.prototype._processFrames = function (initialFrameIndex) {\n var frameIndex = initialFrameIndex;\n var maxFrames = Spritesheet.BATCH_SIZE;\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) {\n var i = this._frameKeys[frameIndex];\n var data = this._frames[i];\n var rect = data.frame;\n if (rect) {\n var frame = null;\n var trim = null;\n var sourceSize = data.trimmed !== false && data.sourceSize\n ? data.sourceSize : data.frame;\n var orig = new Rectangle(0, 0, Math.floor(sourceSize.w) / this.resolution, Math.floor(sourceSize.h) / this.resolution);\n if (data.rotated) {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.h) / this.resolution, Math.floor(rect.w) / this.resolution);\n }\n else {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n // Check to see if the sprite is trimmed\n if (data.trimmed !== false && data.spriteSourceSize) {\n trim = new Rectangle(Math.floor(data.spriteSourceSize.x) / this.resolution, Math.floor(data.spriteSourceSize.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n this.textures[i] = new Texture(this.baseTexture, frame, orig, trim, data.rotated ? 2 : 0, data.anchor);\n // lets also add the frame to pixi's global cache for 'from' and 'fromLoader' functions\n Texture.addToCache(this.textures[i], i);\n }\n frameIndex++;\n }\n };\n /** Parse animations config. */\n Spritesheet.prototype._processAnimations = function () {\n var animations = this.data.animations || {};\n for (var animName in animations) {\n this.animations[animName] = [];\n for (var i = 0; i < animations[animName].length; i++) {\n var frameName = animations[animName][i];\n this.animations[animName].push(this.textures[frameName]);\n }\n }\n };\n /** The parse has completed. */\n Spritesheet.prototype._parseComplete = function () {\n var callback = this._callback;\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n };\n /** Begin the next batch of textures. */\n Spritesheet.prototype._nextBatch = function () {\n var _this = this;\n this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(function () {\n if (_this._batchIndex * Spritesheet.BATCH_SIZE < _this._frameKeys.length) {\n _this._nextBatch();\n }\n else {\n _this._processAnimations();\n _this._parseComplete();\n }\n }, 0);\n };\n /**\n * Destroy Spritesheet and don't use after this.\n * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well\n */\n Spritesheet.prototype.destroy = function (destroyBase) {\n var _a;\n if (destroyBase === void 0) { destroyBase = false; }\n for (var i in this.textures) {\n this.textures[i].destroy();\n }\n this._frames = null;\n this._frameKeys = null;\n this.data = null;\n this.textures = null;\n if (destroyBase) {\n (_a = this._texture) === null || _a === void 0 ? void 0 : _a.destroy();\n this.baseTexture.destroy();\n }\n this._texture = null;\n this.baseTexture = null;\n this.linkedSheets = [];\n };\n /** The maximum number of Textures to build per process. */\n Spritesheet.BATCH_SIZE = 1000;\n return Spritesheet;\n}());\n/**\n * Reference to Spritesheet object created.\n * @member {PIXI.Spritesheet} spritesheet\n * @memberof PIXI.LoaderResource\n * @instance\n */\n/**\n * Dictionary of textures from Spritesheet.\n * @member {Object} textures\n * @memberof PIXI.LoaderResource\n * @instance\n */\n\n/**\n * {@link PIXI.Loader} middleware for loading texture atlases that have been created with\n * TexturePacker or similar JSON-based spritesheet.\n *\n * This middleware automatically generates Texture resources.\n *\n * If you're using Webpack or other bundlers and plan on bundling the atlas' JSON,\n * use the {@link PIXI.Spritesheet} class to directly parse the JSON.\n *\n * The Loader's image Resource name is automatically appended with `\"_image\"`.\n * If a Resource with this name is already loaded, the Loader will skip parsing the\n * Spritesheet. The code below will generate an internal Loader Resource called `\"myatlas_image\"`.\n * @example\n * loader.add('myatlas', 'path/to/myatlas.json');\n * loader.load(() => {\n * loader.resources.myatlas; // atlas JSON resource\n * loader.resources.myatlas_image; // atlas Image resource\n * });\n * @memberof PIXI\n */\nvar SpritesheetLoader = /** @class */ (function () {\n function SpritesheetLoader() {\n }\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param resource\n * @param next\n */\n SpritesheetLoader.use = function (resource, next) {\n var _a, _b;\n // because this is middleware, it execute in loader context. `this` = loader\n var loader = this;\n var imageResourceName = resource.name + \"_image\";\n // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n if (!resource.data\n || resource.type !== LoaderResource.TYPE.JSON\n || !resource.data.frames\n || loader.resources[imageResourceName]) {\n next();\n return;\n }\n // Check and add the multi atlas\n // Heavily influenced and based on https://github.com/rocket-ua/pixi-tps-loader/blob/master/src/ResourceLoader.js\n // eslint-disable-next-line camelcase\n var multiPacks = (_b = (_a = resource.data) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.related_multi_packs;\n if (Array.isArray(multiPacks)) {\n var _loop_1 = function (item) {\n if (typeof item !== 'string') {\n return \"continue\";\n }\n var itemName = item.replace('.json', '');\n var itemUrl = url.resolve(resource.url.replace(loader.baseUrl, ''), item);\n // Check if the file wasn't already added as multipacks are redundant\n if (loader.resources[itemName]\n || Object.values(loader.resources).some(function (r) { return url.format(url.parse(r.url)) === itemUrl; })) {\n return \"continue\";\n }\n var options = {\n crossOrigin: resource.crossOrigin,\n loadType: LoaderResource.LOAD_TYPE.XHR,\n xhrType: LoaderResource.XHR_RESPONSE_TYPE.JSON,\n parentResource: resource,\n metadata: resource.metadata\n };\n loader.add(itemName, itemUrl, options);\n };\n for (var _i = 0, multiPacks_1 = multiPacks; _i < multiPacks_1.length; _i++) {\n var item = multiPacks_1[_i];\n _loop_1(item);\n }\n }\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource,\n };\n var resourcePath = SpritesheetLoader.getResourcePath(resource, loader.baseUrl);\n // load the image for this sheet\n loader.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) {\n if (res.error) {\n next(res.error);\n return;\n }\n var spritesheet = new Spritesheet(res.texture, resource.data, resource.url);\n spritesheet.parse().then(function () {\n resource.spritesheet = spritesheet;\n resource.textures = spritesheet.textures;\n next();\n });\n });\n };\n /**\n * Get the spritesheets root path\n * @param resource - Resource to check path\n * @param baseUrl - Base root url\n */\n SpritesheetLoader.getResourcePath = function (resource, baseUrl) {\n // Prepend url path unless the resource image is a data url\n if (resource.isDataUrl) {\n return resource.data.meta.image;\n }\n return url.resolve(resource.url.replace(baseUrl, ''), resource.data.meta.image);\n };\n /** @ignore */\n SpritesheetLoader.extension = ExtensionType.Loader;\n return SpritesheetLoader;\n}());\n\nexport { Spritesheet, SpritesheetLoader };\n//# sourceMappingURL=spritesheet.mjs.map\n","/*!\n * @pixi/sprite-tiling - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/sprite-tiling is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, TextureMatrix, Shader, ExtensionType, QuadUv, State, ObjectRenderer } from '@pixi/core';\nimport { Point, Rectangle, Transform, Matrix } from '@pixi/math';\nimport { Sprite } from '@pixi/sprite';\nimport { WRAP_MODES } from '@pixi/constants';\nimport { premultiplyTintToRgba, correctBlendMode } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\n/**\n * A tiling sprite is a fast way of rendering a tiling image.\n * @memberof PIXI\n */\nvar TilingSprite = /** @class */ (function (_super) {\n __extends(TilingSprite, _super);\n /**\n * @param texture - The texture of the tiling sprite.\n * @param width - The width of the tiling sprite.\n * @param height - The height of the tiling sprite.\n */\n function TilingSprite(texture, width, height) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n var _this = _super.call(this, texture) || this;\n _this.tileTransform = new Transform();\n // The width of the tiling sprite\n _this._width = width;\n // The height of the tiling sprite\n _this._height = height;\n _this.uvMatrix = _this.texture.uvMatrix || new TextureMatrix(texture);\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_render' method.\n * @default 'tilingSprite'\n */\n _this.pluginName = 'tilingSprite';\n _this.uvRespectAnchor = false;\n return _this;\n }\n Object.defineProperty(TilingSprite.prototype, \"clampMargin\", {\n /**\n * Changes frame clamping in corresponding textureTransform, shortcut\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n * @default 0.5\n * @member {number}\n */\n get: function () {\n return this.uvMatrix.clampMargin;\n },\n set: function (value) {\n this.uvMatrix.clampMargin = value;\n this.uvMatrix.update(true);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tileScale\", {\n /** The scaling of the image that is being tiled. */\n get: function () {\n return this.tileTransform.scale;\n },\n set: function (value) {\n this.tileTransform.scale.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tilePosition\", {\n /** The offset of the image that is being tiled. */\n get: function () {\n return this.tileTransform.position;\n },\n set: function (value) {\n this.tileTransform.position.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @protected\n */\n TilingSprite.prototype._onTextureUpdate = function () {\n if (this.uvMatrix) {\n this.uvMatrix.texture = this._texture;\n }\n this._cachedTint = 0xFFFFFF;\n };\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n TilingSprite.prototype._render = function (renderer) {\n // tweak our texture temporarily..\n var texture = this._texture;\n if (!texture || !texture.valid) {\n return;\n }\n this.tileTransform.updateLocalTransform();\n this.uvMatrix.update();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /** Updates the bounds of the tiling sprite. */\n TilingSprite.prototype._calculateBounds = function () {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Gets the local bounds of the sprite object.\n * @param rect - Optional output rectangle.\n * @returns The bounds.\n */\n TilingSprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._width * -this._anchor._x;\n this._bounds.minY = this._height * -this._anchor._y;\n this._bounds.maxX = this._width * (1 - this._anchor._x);\n this._bounds.maxY = this._height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._bounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Checks if a point is inside this tiling sprite.\n * @param point - The point to check.\n * @returns Whether or not the sprite contains the point.\n */\n TilingSprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._width;\n var height = this._height;\n var x1 = -width * this.anchor._x;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n var y1 = -height * this.anchor._y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n TilingSprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.tileTransform = null;\n this.uvMatrix = null;\n };\n /**\n * Helper function that creates a new tiling sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @static\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {object} options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {number} options.width - required width of the tiling sprite\n * @param {number} options.height - required height of the tiling sprite\n * @returns {PIXI.TilingSprite} The newly created texture\n */\n TilingSprite.from = function (source, options) {\n var texture = (source instanceof Texture)\n ? source\n : Texture.from(source, options);\n return new TilingSprite(texture, options.width, options.height);\n };\n Object.defineProperty(TilingSprite.prototype, \"width\", {\n /** The width of the sprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"height\", {\n /** The height of the TilingSprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n return TilingSprite;\n}(Sprite));\n\nvar fragmentSimpleSrc = \"#version 100\\n#define SHADER_NAME Tiling-Sprite-Simple-100\\n\\nprecision lowp float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\n\\nvoid main(void)\\n{\\n vec4 texSample = texture2D(uSampler, vTextureCoord);\\n gl_FragColor = texSample * uColor;\\n}\\n\";\n\nvar gl1VertexSrc = \"#version 100\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n\";\n\nvar gl1FragmentSrc = \"#version 100\\n#ifdef GL_EXT_shader_texture_lod\\n #extension GL_EXT_shader_texture_lod : enable\\n#endif\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n vec2 unclamped = coord;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n #ifdef GL_EXT_shader_texture_lod\\n vec4 texSample = unclamped == coord\\n ? texture2D(uSampler, coord) \\n : texture2DLodEXT(uSampler, coord, 0);\\n #else\\n vec4 texSample = texture2D(uSampler, coord);\\n #endif\\n\\n gl_FragColor = texSample * uColor;\\n}\\n\";\n\nvar gl2VertexSrc = \"#version 300 es\\n#define SHADER_NAME Tiling-Sprite-300\\n\\nprecision lowp float;\\n\\nin vec2 aVertexPosition;\\nin vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nout vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n\";\n\nvar gl2FragmentSrc = \"#version 300 es\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nin vec2 vTextureCoord;\\n\\nout vec4 fragmentColor;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n vec2 unclamped = coord;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\\n\\n fragmentColor = texSample * uColor;\\n}\\n\";\n\nvar tempMat = new Matrix();\n/**\n * WebGL renderer plugin for tiling sprites\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar TilingSpriteRenderer = /** @class */ (function (_super) {\n __extends(TilingSpriteRenderer, _super);\n /**\n * constructor for renderer\n * @param {PIXI.Renderer} renderer - The renderer this tiling awesomeness works for.\n */\n function TilingSpriteRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n // WebGL version is not available during initialization!\n renderer.runners.contextChange.add(_this);\n _this.quad = new QuadUv();\n /**\n * The WebGL state in which this renderer will work.\n * @member {PIXI.State}\n * @readonly\n */\n _this.state = State.for2d();\n return _this;\n }\n /** Creates shaders when context is initialized. */\n TilingSpriteRenderer.prototype.contextChange = function () {\n var renderer = this.renderer;\n var uniforms = { globals: renderer.globalUniforms };\n this.simpleShader = Shader.from(gl1VertexSrc, fragmentSimpleSrc, uniforms);\n this.shader = renderer.context.webGLVersion > 1\n ? Shader.from(gl2VertexSrc, gl2FragmentSrc, uniforms)\n : Shader.from(gl1VertexSrc, gl1FragmentSrc, uniforms);\n };\n /**\n * @param {PIXI.TilingSprite} ts - tilingSprite to be rendered\n */\n TilingSpriteRenderer.prototype.render = function (ts) {\n var renderer = this.renderer;\n var quad = this.quad;\n var vertices = quad.vertices;\n vertices[0] = vertices[6] = (ts._width) * -ts.anchor.x;\n vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n vertices[2] = vertices[4] = (ts._width) * (1.0 - ts.anchor.x);\n vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n var anchorX = ts.uvRespectAnchor ? ts.anchor.x : 0;\n var anchorY = ts.uvRespectAnchor ? ts.anchor.y : 0;\n vertices = quad.uvs;\n vertices[0] = vertices[6] = -anchorX;\n vertices[1] = vertices[3] = -anchorY;\n vertices[2] = vertices[4] = 1.0 - anchorX;\n vertices[5] = vertices[7] = 1.0 - anchorY;\n quad.invalidate();\n var tex = ts._texture;\n var baseTex = tex.baseTexture;\n var premultiplied = baseTex.alphaMode > 0;\n var lt = ts.tileTransform.localTransform;\n var uv = ts.uvMatrix;\n var isSimple = baseTex.isPowerOfTwo\n && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n // auto, force repeat wrapMode for big tiling textures\n if (isSimple) {\n if (!baseTex._glTextures[renderer.CONTEXT_UID]) {\n if (baseTex.wrapMode === WRAP_MODES.CLAMP) {\n baseTex.wrapMode = WRAP_MODES.REPEAT;\n }\n }\n else {\n isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP;\n }\n }\n var shader = isSimple ? this.simpleShader : this.shader;\n var w = tex.width;\n var h = tex.height;\n var W = ts._width;\n var H = ts._height;\n tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);\n // that part is the same as above:\n // tempMat.identity();\n // tempMat.scale(tex.width, tex.height);\n // tempMat.prepend(lt);\n // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n tempMat.invert();\n if (isSimple) {\n tempMat.prepend(uv.mapCoord);\n }\n else {\n shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n shader.uniforms.uClampFrame = uv.uClampFrame;\n shader.uniforms.uClampOffset = uv.uClampOffset;\n }\n shader.uniforms.uTransform = tempMat.toArray(true);\n shader.uniforms.uColor = premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, premultiplied);\n shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n shader.uniforms.uSampler = tex;\n renderer.shader.bind(shader);\n renderer.geometry.bind(quad);\n this.state.blendMode = correctBlendMode(ts.blendMode, premultiplied);\n renderer.state.set(this.state);\n renderer.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);\n };\n /** @ignore */\n TilingSpriteRenderer.extension = {\n name: 'tilingSprite',\n type: ExtensionType.RendererPlugin,\n };\n return TilingSpriteRenderer;\n}(ObjectRenderer));\n\nexport { TilingSprite, TilingSpriteRenderer };\n//# sourceMappingURL=sprite-tiling.mjs.map\n","/*!\n * @pixi/mesh - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mesh is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { State, Program, TextureMatrix, Shader, Buffer, Geometry } from '@pixi/core';\nimport { Point, Polygon, Matrix } from '@pixi/math';\nimport { DRAW_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { settings } from '@pixi/settings';\nimport { premultiplyTintToRgba } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.\n * @memberof PIXI\n */\nvar MeshBatchUvs = /** @class */ (function () {\n /**\n * @param uvBuffer - Buffer with normalized uv's\n * @param uvMatrix - Material UV matrix\n */\n function MeshBatchUvs(uvBuffer, uvMatrix) {\n this.uvBuffer = uvBuffer;\n this.uvMatrix = uvMatrix;\n this.data = null;\n this._bufferUpdateId = -1;\n this._textureUpdateId = -1;\n this._updateID = 0;\n }\n /**\n * Updates\n * @param forceUpdate - force the update\n */\n MeshBatchUvs.prototype.update = function (forceUpdate) {\n if (!forceUpdate\n && this._bufferUpdateId === this.uvBuffer._updateID\n && this._textureUpdateId === this.uvMatrix._updateID) {\n return;\n }\n this._bufferUpdateId = this.uvBuffer._updateID;\n this._textureUpdateId = this.uvMatrix._updateID;\n var data = this.uvBuffer.data;\n if (!this.data || this.data.length !== data.length) {\n this.data = new Float32Array(data.length);\n }\n this.uvMatrix.multiplyUvs(data, this.data);\n this._updateID++;\n };\n return MeshBatchUvs;\n}());\n\nvar tempPoint = new Point();\nvar tempPolygon = new Polygon();\n/**\n * Base mesh class.\n *\n * This class empowers you to have maximum flexibility to render any kind of WebGL visuals you can think of.\n * This class assumes a certain level of WebGL knowledge.\n * If you know a bit this should abstract enough away to make your life easier!\n *\n * Pretty much ALL WebGL can be broken down into the following:\n * - Geometry - The structure and data for the mesh. This can include anything from positions, uvs, normals, colors etc..\n * - Shader - This is the shader that PixiJS will render the geometry with (attributes in the shader must match the geometry)\n * - State - This is the state of WebGL required to render the mesh.\n *\n * Through a combination of the above elements you can render anything you want, 2D or 3D!\n * @memberof PIXI\n */\nvar Mesh = /** @class */ (function (_super) {\n __extends(Mesh, _super);\n /**\n * @param geometry - The geometry the mesh will use.\n * @param {PIXI.MeshMaterial} shader - The shader the mesh will use.\n * @param state - The state that the WebGL context is required to be in to render the mesh\n * if no state is provided, uses {@link PIXI.State.for2d} to create a 2D state for PixiJS.\n * @param drawMode - The drawMode, can be any of the {@link PIXI.DRAW_MODES} constants.\n */\n function Mesh(geometry, shader, state, drawMode) {\n if (drawMode === void 0) { drawMode = DRAW_MODES.TRIANGLES; }\n var _this = _super.call(this) || this;\n _this.geometry = geometry;\n _this.shader = shader;\n _this.state = state || State.for2d();\n _this.drawMode = drawMode;\n _this.start = 0;\n _this.size = 0;\n _this.uvs = null;\n _this.indices = null;\n _this.vertexData = new Float32Array(1);\n _this.vertexDirty = -1;\n _this._transformID = -1;\n _this._roundPixels = settings.ROUND_PIXELS;\n _this.batchUvs = null;\n return _this;\n }\n Object.defineProperty(Mesh.prototype, \"geometry\", {\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh objects.\n */\n get: function () {\n return this._geometry;\n },\n set: function (value) {\n if (this._geometry === value) {\n return;\n }\n if (this._geometry) {\n this._geometry.refCount--;\n if (this._geometry.refCount === 0) {\n this._geometry.dispose();\n }\n }\n this._geometry = value;\n if (this._geometry) {\n this._geometry.refCount++;\n }\n this.vertexDirty = -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"uvBuffer\", {\n /**\n * To change mesh uv's, change its uvBuffer data and increment its _updateID.\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"verticesBuffer\", {\n /**\n * To change mesh vertices, change its uvBuffer data and increment its _updateID.\n * Incrementing _updateID is optional because most of Mesh objects do it anyway.\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"material\", {\n get: function () {\n return this.shader;\n },\n /** Alias for {@link PIXI.Mesh#shader}. */\n set: function (value) {\n this.shader = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the Mesh. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n * @default PIXI.BLEND_MODES.NORMAL;\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"tint\", {\n /**\n * The multiply tint applied to the Mesh. This is a hex value. A value of\n * `0xFFFFFF` will remove any tint effect.\n *\n * Null for non-MeshMaterial shaders\n * @default 0xFFFFFF\n */\n get: function () {\n return 'tint' in this.shader ? this.shader.tint : null;\n },\n set: function (value) {\n this.shader.tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"texture\", {\n /** The texture that the Mesh uses. Null for non-MeshMaterial shaders */\n get: function () {\n return 'texture' in this.shader ? this.shader.texture : null;\n },\n set: function (value) {\n this.shader.texture = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Standard renderer draw.\n * @param renderer - Instance to renderer.\n */\n Mesh.prototype._render = function (renderer) {\n // set properties for batching..\n // TODO could use a different way to grab verts?\n var vertices = this.geometry.buffers[0].data;\n var shader = this.shader;\n // TODO benchmark check for attribute size..\n if (shader.batchable\n && this.drawMode === DRAW_MODES.TRIANGLES\n && vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n this._renderToBatch(renderer);\n }\n else {\n this._renderDefault(renderer);\n }\n };\n /**\n * Standard non-batching way of rendering.\n * @param renderer - Instance to renderer.\n */\n Mesh.prototype._renderDefault = function (renderer) {\n var shader = this.shader;\n shader.alpha = this.worldAlpha;\n if (shader.update) {\n shader.update();\n }\n renderer.batch.flush();\n // bind and sync uniforms..\n shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(true);\n renderer.shader.bind(shader);\n // set state..\n renderer.state.set(this.state);\n // bind the geometry...\n renderer.geometry.bind(this.geometry, shader);\n // then render it\n renderer.geometry.draw(this.drawMode, this.size, this.start, this.geometry.instanceCount);\n };\n /**\n * Rendering by using the Batch system.\n * @param renderer - Instance to renderer.\n */\n Mesh.prototype._renderToBatch = function (renderer) {\n var geometry = this.geometry;\n var shader = this.shader;\n if (shader.uvMatrix) {\n shader.uvMatrix.update();\n this.calculateUvs();\n }\n // set properties for batching..\n this.calculateVertices();\n this.indices = geometry.indexBuffer.data;\n this._tintRGB = shader._tintRGB;\n this._texture = shader.texture;\n var pluginName = this.material.pluginName;\n renderer.batch.setObjectRenderer(renderer.plugins[pluginName]);\n renderer.plugins[pluginName].render(this);\n };\n /** Updates vertexData field based on transform and vertices. */\n Mesh.prototype.calculateVertices = function () {\n var geometry = this.geometry;\n var verticesBuffer = geometry.buffers[0];\n var vertices = verticesBuffer.data;\n var vertexDirtyId = verticesBuffer._updateID;\n if (vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n if (this.vertexData.length !== vertices.length) {\n this.vertexData = new Float32Array(vertices.length);\n }\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n for (var i = 0; i < vertexData.length / 2; i++) {\n var x = vertices[(i * 2)];\n var y = vertices[(i * 2) + 1];\n vertexData[(i * 2)] = (a * x) + (c * y) + tx;\n vertexData[(i * 2) + 1] = (b * x) + (d * y) + ty;\n }\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n this.vertexDirty = vertexDirtyId;\n };\n /** Updates uv field based on from geometry uv's or batchUvs. */\n Mesh.prototype.calculateUvs = function () {\n var geomUvs = this.geometry.buffers[1];\n var shader = this.shader;\n if (!shader.uvMatrix.isSimple) {\n if (!this.batchUvs) {\n this.batchUvs = new MeshBatchUvs(geomUvs, shader.uvMatrix);\n }\n this.batchUvs.update();\n this.uvs = this.batchUvs.data;\n }\n else {\n this.uvs = geomUvs.data;\n }\n };\n /**\n * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.\n * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.\n */\n Mesh.prototype._calculateBounds = function () {\n this.calculateVertices();\n this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length);\n };\n /**\n * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.\n * @param point - The point to test.\n * @returns - The result of the test.\n */\n Mesh.prototype.containsPoint = function (point) {\n if (!this.getBounds().contains(point.x, point.y)) {\n return false;\n }\n this.worldTransform.applyInverse(point, tempPoint);\n var vertices = this.geometry.getBuffer('aVertexPosition').data;\n var points = tempPolygon.points;\n var indices = this.geometry.getIndex().data;\n var len = indices.length;\n var step = this.drawMode === 4 ? 3 : 1;\n for (var i = 0; i + 2 < len; i += step) {\n var ind0 = indices[i] * 2;\n var ind1 = indices[i + 1] * 2;\n var ind2 = indices[i + 2] * 2;\n points[0] = vertices[ind0];\n points[1] = vertices[ind0 + 1];\n points[2] = vertices[ind1];\n points[3] = vertices[ind1 + 1];\n points[4] = vertices[ind2];\n points[5] = vertices[ind2 + 1];\n if (tempPolygon.contains(tempPoint.x, tempPoint.y)) {\n return true;\n }\n }\n return false;\n };\n Mesh.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n if (this._cachedTexture) {\n this._cachedTexture.destroy();\n this._cachedTexture = null;\n }\n this.geometry = null;\n this.shader = null;\n this.state = null;\n this.uvs = null;\n this.indices = null;\n this.vertexData = null;\n };\n /** The maximum number of vertices to consider batchable. Generally, the complexity of the geometry. */\n Mesh.BATCHABLE_SIZE = 100;\n return Mesh;\n}(Container));\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform vec4 uColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\\n}\\n\";\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTextureMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\\n}\\n\";\n\n/**\n * Slightly opinionated default shader for PixiJS 2D objects.\n * @memberof PIXI\n */\nvar MeshMaterial = /** @class */ (function (_super) {\n __extends(MeshMaterial, _super);\n /**\n * @param uSampler - Texture that material uses to render.\n * @param options - Additional options\n * @param {number} [options.alpha=1] - Default alpha.\n * @param {number} [options.tint=0xFFFFFF] - Default tint.\n * @param {string} [options.pluginName='batch'] - Renderer plugin for batching.\n * @param {PIXI.Program} [options.program=0xFFFFFF] - Custom program.\n * @param {object} [options.uniforms] - Custom uniforms.\n */\n function MeshMaterial(uSampler, options) {\n var _this = this;\n var uniforms = {\n uSampler: uSampler,\n alpha: 1,\n uTextureMatrix: Matrix.IDENTITY,\n uColor: new Float32Array([1, 1, 1, 1]),\n };\n // Set defaults\n options = Object.assign({\n tint: 0xFFFFFF,\n alpha: 1,\n pluginName: 'batch',\n }, options);\n if (options.uniforms) {\n Object.assign(uniforms, options.uniforms);\n }\n _this = _super.call(this, options.program || Program.from(vertex, fragment), uniforms) || this;\n _this._colorDirty = false;\n _this.uvMatrix = new TextureMatrix(uSampler);\n _this.batchable = options.program === undefined;\n _this.pluginName = options.pluginName;\n _this.tint = options.tint;\n _this.alpha = options.alpha;\n return _this;\n }\n Object.defineProperty(MeshMaterial.prototype, \"texture\", {\n /** Reference to the texture being rendered. */\n get: function () {\n return this.uniforms.uSampler;\n },\n set: function (value) {\n if (this.uniforms.uSampler !== value) {\n if (!this.uniforms.uSampler.baseTexture.alphaMode !== !value.baseTexture.alphaMode) {\n this._colorDirty = true;\n }\n this.uniforms.uSampler = value;\n this.uvMatrix.texture = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"alpha\", {\n get: function () {\n return this._alpha;\n },\n /**\n * This gets automatically set by the object using this.\n * @default 1\n */\n set: function (value) {\n if (value === this._alpha)\n { return; }\n this._alpha = value;\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"tint\", {\n get: function () {\n return this._tint;\n },\n /**\n * Multiply tint for the material.\n * @default 0xFFFFFF\n */\n set: function (value) {\n if (value === this._tint)\n { return; }\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n /** Gets called automatically by the Mesh. Intended to be overridden for custom {@link MeshMaterial} objects. */\n MeshMaterial.prototype.update = function () {\n if (this._colorDirty) {\n this._colorDirty = false;\n var baseTexture = this.texture.baseTexture;\n premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode);\n }\n if (this.uvMatrix.update()) {\n this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord;\n }\n };\n return MeshMaterial;\n}(Shader));\n\n/**\n * Standard 2D geometry used in PixiJS.\n *\n * Geometry can be defined without passing in a style or data if required.\n *\n * ```js\n * const geometry = new PIXI.Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1], 2);\n * geometry.addIndex([0,1,2,1,3,2]);\n *\n * ```\n * @memberof PIXI\n */\nvar MeshGeometry = /** @class */ (function (_super) {\n __extends(MeshGeometry, _super);\n /**\n * @param {Float32Array|number[]} [vertices] - Positional data on geometry.\n * @param {Float32Array|number[]} [uvs] - Texture UVs.\n * @param {Uint16Array|number[]} [index] - IndexBuffer\n */\n function MeshGeometry(vertices, uvs, index) {\n var _this = _super.call(this) || this;\n var verticesBuffer = new Buffer(vertices);\n var uvsBuffer = new Buffer(uvs, true);\n var indexBuffer = new Buffer(index, true, true);\n _this.addAttribute('aVertexPosition', verticesBuffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', uvsBuffer, 2, false, TYPES.FLOAT)\n .addIndex(indexBuffer);\n _this._updateId = -1;\n return _this;\n }\n Object.defineProperty(MeshGeometry.prototype, \"vertexDirtyId\", {\n /**\n * If the vertex position is updated.\n * @readonly\n * @private\n */\n get: function () {\n return this.buffers[0]._updateID;\n },\n enumerable: false,\n configurable: true\n });\n return MeshGeometry;\n}(Geometry));\n\nexport { Mesh, MeshBatchUvs, MeshGeometry, MeshMaterial };\n//# sourceMappingURL=mesh.mjs.map\n","/*!\n * @pixi/text-bitmap - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/text-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle, Point, ObservablePoint } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { MeshGeometry, MeshMaterial, Mesh } from '@pixi/mesh';\nimport { hex2rgb, string2hex, getResolutionOfUrl, removeItems } from '@pixi/utils';\nimport { BaseTexture, Texture, Program, ExtensionType } from '@pixi/core';\nimport { TEXT_GRADIENT, TextStyle, TextMetrics } from '@pixi/text';\nimport { ALPHA_MODES, MIPMAP_MODES, BLEND_MODES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { LoaderResource } from '@pixi/loaders';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/* eslint-disable max-len */\n/**\n * Normalized parsed data from .fnt files.\n * @memberof PIXI\n */\nvar BitmapFontData = /** @class */ (function () {\n function BitmapFontData() {\n this.info = [];\n this.common = [];\n this.page = [];\n this.char = [];\n this.kerning = [];\n this.distanceField = [];\n }\n return BitmapFontData;\n}());\n\n/**\n * BitmapFont format that's Text-based.\n * @private\n */\nvar TextFormat = /** @class */ (function () {\n function TextFormat() {\n }\n /**\n * Check if resource refers to txt font data.\n * @param data\n * @returns - True if resource could be treated as font data, false otherwise.\n */\n TextFormat.test = function (data) {\n return typeof data === 'string' && data.indexOf('info face=') === 0;\n };\n /**\n * Convert text font data to a javascript object.\n * @param txt - Raw string data to be converted\n * @returns - Parsed font data\n */\n TextFormat.parse = function (txt) {\n // Retrieve data item\n var items = txt.match(/^[a-z]+\\s+.+$/gm);\n var rawData = {\n info: [],\n common: [],\n page: [],\n char: [],\n chars: [],\n kerning: [],\n kernings: [],\n distanceField: [],\n };\n for (var i in items) {\n // Extract item name\n var name = items[i].match(/^[a-z]+/gm)[0];\n // Extract item attribute list as string ex.: \"width=10\"\n var attributeList = items[i].match(/[a-zA-Z]+=([^\\s\"']+|\"([^\"]*)\")/gm);\n // Convert attribute list into an object\n var itemData = {};\n for (var i_1 in attributeList) {\n // Split key-value pairs\n var split = attributeList[i_1].split('=');\n var key = split[0];\n // Remove eventual quotes from value\n var strValue = split[1].replace(/\"/gm, '');\n // Try to convert value into float\n var floatValue = parseFloat(strValue);\n // Use string value case float value is NaN\n var value = isNaN(floatValue) ? strValue : floatValue;\n itemData[key] = value;\n }\n // Push current item to the resulting data\n rawData[name].push(itemData);\n }\n var font = new BitmapFontData();\n rawData.info.forEach(function (info) { return font.info.push({\n face: info.face,\n size: parseInt(info.size, 10),\n }); });\n rawData.common.forEach(function (common) { return font.common.push({\n lineHeight: parseInt(common.lineHeight, 10),\n }); });\n rawData.page.forEach(function (page) { return font.page.push({\n id: parseInt(page.id, 10),\n file: page.file,\n }); });\n rawData.char.forEach(function (char) { return font.char.push({\n id: parseInt(char.id, 10),\n page: parseInt(char.page, 10),\n x: parseInt(char.x, 10),\n y: parseInt(char.y, 10),\n width: parseInt(char.width, 10),\n height: parseInt(char.height, 10),\n xoffset: parseInt(char.xoffset, 10),\n yoffset: parseInt(char.yoffset, 10),\n xadvance: parseInt(char.xadvance, 10),\n }); });\n rawData.kerning.forEach(function (kerning) { return font.kerning.push({\n first: parseInt(kerning.first, 10),\n second: parseInt(kerning.second, 10),\n amount: parseInt(kerning.amount, 10),\n }); });\n rawData.distanceField.forEach(function (df) { return font.distanceField.push({\n distanceRange: parseInt(df.distanceRange, 10),\n fieldType: df.fieldType,\n }); });\n return font;\n };\n return TextFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n * @private\n */\nvar XMLFormat = /** @class */ (function () {\n function XMLFormat() {\n }\n /**\n * Check if resource refers to xml font data.\n * @param data\n * @returns - True if resource could be treated as font data, false otherwise.\n */\n XMLFormat.test = function (data) {\n return data instanceof XMLDocument\n && data.getElementsByTagName('page').length\n && data.getElementsByTagName('info')[0].getAttribute('face') !== null;\n };\n /**\n * Convert the XML into BitmapFontData that we can use.\n * @param xml\n * @returns - Data to use for BitmapFont\n */\n XMLFormat.parse = function (xml) {\n var data = new BitmapFontData();\n var info = xml.getElementsByTagName('info');\n var common = xml.getElementsByTagName('common');\n var page = xml.getElementsByTagName('page');\n var char = xml.getElementsByTagName('char');\n var kerning = xml.getElementsByTagName('kerning');\n var distanceField = xml.getElementsByTagName('distanceField');\n for (var i = 0; i < info.length; i++) {\n data.info.push({\n face: info[i].getAttribute('face'),\n size: parseInt(info[i].getAttribute('size'), 10),\n });\n }\n for (var i = 0; i < common.length; i++) {\n data.common.push({\n lineHeight: parseInt(common[i].getAttribute('lineHeight'), 10),\n });\n }\n for (var i = 0; i < page.length; i++) {\n data.page.push({\n id: parseInt(page[i].getAttribute('id'), 10) || 0,\n file: page[i].getAttribute('file'),\n });\n }\n for (var i = 0; i < char.length; i++) {\n var letter = char[i];\n data.char.push({\n id: parseInt(letter.getAttribute('id'), 10),\n page: parseInt(letter.getAttribute('page'), 10) || 0,\n x: parseInt(letter.getAttribute('x'), 10),\n y: parseInt(letter.getAttribute('y'), 10),\n width: parseInt(letter.getAttribute('width'), 10),\n height: parseInt(letter.getAttribute('height'), 10),\n xoffset: parseInt(letter.getAttribute('xoffset'), 10),\n yoffset: parseInt(letter.getAttribute('yoffset'), 10),\n xadvance: parseInt(letter.getAttribute('xadvance'), 10),\n });\n }\n for (var i = 0; i < kerning.length; i++) {\n data.kerning.push({\n first: parseInt(kerning[i].getAttribute('first'), 10),\n second: parseInt(kerning[i].getAttribute('second'), 10),\n amount: parseInt(kerning[i].getAttribute('amount'), 10),\n });\n }\n for (var i = 0; i < distanceField.length; i++) {\n data.distanceField.push({\n fieldType: distanceField[i].getAttribute('fieldType'),\n distanceRange: parseInt(distanceField[i].getAttribute('distanceRange'), 10),\n });\n }\n return data;\n };\n return XMLFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n * @private\n */\nvar XMLStringFormat = /** @class */ (function () {\n function XMLStringFormat() {\n }\n /**\n * Check if resource refers to text xml font data.\n * @param data\n * @returns - True if resource could be treated as font data, false otherwise.\n */\n XMLStringFormat.test = function (data) {\n if (typeof data === 'string' && data.indexOf('') > -1) {\n var xml = new globalThis.DOMParser().parseFromString(data, 'text/xml');\n return XMLFormat.test(xml);\n }\n return false;\n };\n /**\n * Convert the text XML into BitmapFontData that we can use.\n * @param xmlTxt\n * @returns - Data to use for BitmapFont\n */\n XMLStringFormat.parse = function (xmlTxt) {\n var xml = new globalThis.DOMParser().parseFromString(xmlTxt, 'text/xml');\n return XMLFormat.parse(xml);\n };\n return XMLStringFormat;\n}());\n\n// Registered formats, maybe make this extensible in the future?\nvar formats = [\n TextFormat,\n XMLFormat,\n XMLStringFormat ];\n/**\n * Auto-detect BitmapFont parsing format based on data.\n * @private\n * @param {any} data - Data to detect format\n * @returns {any} Format or null\n */\nfunction autoDetectFormat(data) {\n for (var i = 0; i < formats.length; i++) {\n if (formats[i].test(data)) {\n return formats[i];\n }\n }\n return null;\n}\n\n// TODO: Prevent code duplication b/w generateFillStyle & Text#generateFillStyle\n/**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n * @private\n * @param canvas\n * @param context\n * @param {object} style - The style.\n * @param resolution\n * @param {string[]} lines - The lines of text.\n * @param metrics\n * @returns {string|number|CanvasGradient} The fill style\n */\nfunction generateFillStyle(canvas, context, style, resolution, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = (canvas.width / resolution) - dropShadowCorrection - (padding * 2);\n var height = (canvas.height / resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // There's potential for floating point precision issues at the seams between gradient repeats.\n // The loop below generates the stops in order, so track the last generated one to prevent\n // floating point precision from making us go the teeniest bit backwards, resulting in\n // the first and last colors getting swapped.\n var lastIterationStop = 0;\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = textHeight / height;\n for (var i = 0; i < lines.length; i++) {\n var thisLineTop = metrics.lineHeight * i;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = (thisLineTop / height) + (lineStop * gradStopLineHeight);\n // Prevent color stop generation going backwards from floating point imprecision\n var clampedStop = Math.max(lastIterationStop, globalStop);\n clampedStop = Math.min(clampedStop, 1); // Cap at 1 as well for safety's sake to avoid a possible throw.\n gradient.addColorStop(clampedStop, fill[j]);\n lastIterationStop = clampedStop;\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n}\n\n// TODO: Prevent code duplication b/w drawGlyph & Text#updateText\n/**\n * Draws the glyph `metrics.text` on the given canvas.\n *\n * Ignored because not directly exposed.\n * @ignore\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {TextMetrics} metrics\n * @param {number} x\n * @param {number} y\n * @param {number} resolution\n * @param {TextStyle} style\n */\nfunction drawGlyph(canvas, context, metrics, x, y, resolution, style) {\n var char = metrics.text;\n var fontProperties = metrics.fontProperties;\n context.translate(x, y);\n context.scale(resolution, resolution);\n var tx = style.strokeThickness / 2;\n var ty = -(style.strokeThickness / 2);\n context.font = style.toFontString();\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n // set canvas text styles\n context.fillStyle = generateFillStyle(canvas, context, style, resolution, [char], metrics);\n context.strokeStyle = style.stroke;\n if (style.dropShadow) {\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n var dropShadowBlur = style.dropShadowBlur * resolution;\n var dropShadowDistance = style.dropShadowDistance * resolution;\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * dropShadowDistance;\n context.shadowOffsetY = Math.sin(style.dropShadowAngle) * dropShadowDistance;\n }\n else {\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n if (style.stroke && style.strokeThickness) {\n context.strokeText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n if (style.fill) {\n context.fillText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n context.setTransform(1, 0, 0, 1, 0, 0); // defaults needed for older browsers (e.g. Opera 29)\n context.fillStyle = 'rgba(0, 0, 0, 0)';\n}\n\n/**\n * Ponyfill for IE because it doesn't support `Array.from`\n * @param text\n * @private\n */\nfunction splitTextToCharacters(text) {\n return Array.from ? Array.from(text) : text.split('');\n}\n\n/**\n * Processes the passed character set data and returns a flattened array of all the characters.\n *\n * Ignored because not directly exposed.\n * @ignore\n * @param {string | string[] | string[][] } chars\n * @returns {string[]} the flattened array of characters\n */\nfunction resolveCharacters(chars) {\n // Split the chars string into individual characters\n if (typeof chars === 'string') {\n chars = [chars];\n }\n // Handle an array of characters+ranges\n var result = [];\n for (var i = 0, j = chars.length; i < j; i++) {\n var item = chars[i];\n // Handle range delimited by start/end chars\n if (Array.isArray(item)) {\n if (item.length !== 2) {\n throw new Error(\"[BitmapFont]: Invalid character range length, expecting 2 got \" + item.length + \".\");\n }\n var startCode = item[0].charCodeAt(0);\n var endCode = item[1].charCodeAt(0);\n if (endCode < startCode) {\n throw new Error('[BitmapFont]: Invalid character range.');\n }\n for (var i_1 = startCode, j_1 = endCode; i_1 <= j_1; i_1++) {\n result.push(String.fromCharCode(i_1));\n }\n }\n // Handle a character set string\n else {\n result.push.apply(result, splitTextToCharacters(item));\n }\n }\n if (result.length === 0) {\n throw new Error('[BitmapFont]: Empty set when resolving characters.');\n }\n return result;\n}\n\n/**\n * Ponyfill for IE because it doesn't support `codePointAt`\n * @param str\n * @private\n */\nfunction extractCharCode(str) {\n return str.codePointAt ? str.codePointAt(0) : str.charCodeAt(0);\n}\n\n/**\n * BitmapFont represents a typeface available for use with the BitmapText class. Use the `install`\n * method for adding a font to be used.\n * @memberof PIXI\n */\nvar BitmapFont = /** @class */ (function () {\n /**\n * @param data\n * @param textures\n * @param ownsTextures - Setting to `true` will destroy page textures\n * when the font is uninstalled.\n */\n function BitmapFont(data, textures, ownsTextures) {\n var _a, _b;\n var info = data.info[0];\n var common = data.common[0];\n var page = data.page[0];\n var distanceField = data.distanceField[0];\n var res = getResolutionOfUrl(page.file);\n var pageTextures = {};\n this._ownsTextures = ownsTextures;\n this.font = info.face;\n this.size = info.size;\n this.lineHeight = common.lineHeight / res;\n this.chars = {};\n this.pageTextures = pageTextures;\n // Convert the input Texture, Textures or object\n // into a page Texture lookup by \"id\"\n for (var i = 0; i < data.page.length; i++) {\n var _c = data.page[i], id = _c.id, file = _c.file;\n pageTextures[id] = textures instanceof Array\n ? textures[i] : textures[file];\n // only MSDF and SDF fonts need no-premultiplied-alpha\n if ((distanceField === null || distanceField === void 0 ? void 0 : distanceField.fieldType) && distanceField.fieldType !== 'none') {\n pageTextures[id].baseTexture.alphaMode = ALPHA_MODES.NO_PREMULTIPLIED_ALPHA;\n pageTextures[id].baseTexture.mipmap = MIPMAP_MODES.OFF;\n }\n }\n // parse letters\n for (var i = 0; i < data.char.length; i++) {\n var _d = data.char[i], id = _d.id, page_1 = _d.page;\n var _e = data.char[i], x = _e.x, y = _e.y, width = _e.width, height = _e.height, xoffset = _e.xoffset, yoffset = _e.yoffset, xadvance = _e.xadvance;\n x /= res;\n y /= res;\n width /= res;\n height /= res;\n xoffset /= res;\n yoffset /= res;\n xadvance /= res;\n var rect = new Rectangle(x + (pageTextures[page_1].frame.x / res), y + (pageTextures[page_1].frame.y / res), width, height);\n this.chars[id] = {\n xOffset: xoffset,\n yOffset: yoffset,\n xAdvance: xadvance,\n kerning: {},\n texture: new Texture(pageTextures[page_1].baseTexture, rect),\n page: page_1,\n };\n }\n // parse kernings\n for (var i = 0; i < data.kerning.length; i++) {\n var _f = data.kerning[i], first = _f.first, second = _f.second, amount = _f.amount;\n first /= res;\n second /= res;\n amount /= res;\n if (this.chars[second]) {\n this.chars[second].kerning[first] = amount;\n }\n }\n // Store distance field information\n this.distanceFieldRange = distanceField === null || distanceField === void 0 ? void 0 : distanceField.distanceRange;\n this.distanceFieldType = (_b = (_a = distanceField === null || distanceField === void 0 ? void 0 : distanceField.fieldType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : 'none';\n }\n /** Remove references to created glyph textures. */\n BitmapFont.prototype.destroy = function () {\n for (var id in this.chars) {\n this.chars[id].texture.destroy();\n this.chars[id].texture = null;\n }\n for (var id in this.pageTextures) {\n if (this._ownsTextures) {\n this.pageTextures[id].destroy(true);\n }\n this.pageTextures[id] = null;\n }\n // Set readonly null.\n this.chars = null;\n this.pageTextures = null;\n };\n /**\n * Register a new bitmap font.\n * @param data - The\n * characters map that could be provided as xml or raw string.\n * @param textures - List of textures for each page.\n * @param ownsTextures - Set to `true` to destroy page textures\n * when the font is uninstalled. By default fonts created with\n * `BitmapFont.from` or from the `BitmapFontLoader` are `true`.\n * @returns {PIXI.BitmapFont} Result font object with font, size, lineHeight\n * and char fields.\n */\n BitmapFont.install = function (data, textures, ownsTextures) {\n var fontData;\n if (data instanceof BitmapFontData) {\n fontData = data;\n }\n else {\n var format = autoDetectFormat(data);\n if (!format) {\n throw new Error('Unrecognized data format for font.');\n }\n fontData = format.parse(data);\n }\n // Single texture, convert to list\n if (textures instanceof Texture) {\n textures = [textures];\n }\n var font = new BitmapFont(fontData, textures, ownsTextures);\n BitmapFont.available[font.font] = font;\n return font;\n };\n /**\n * Remove bitmap font by name.\n * @param name - Name of the font to uninstall.\n */\n BitmapFont.uninstall = function (name) {\n var font = BitmapFont.available[name];\n if (!font) {\n throw new Error(\"No font found named '\" + name + \"'\");\n }\n font.destroy();\n delete BitmapFont.available[name];\n };\n /**\n * Generates a bitmap-font for the given style and character set. This does not support\n * kernings yet. With `style` properties, only the following non-layout properties are used:\n *\n * - {@link PIXI.TextStyle#dropShadow|dropShadow}\n * - {@link PIXI.TextStyle#dropShadowDistance|dropShadowDistance}\n * - {@link PIXI.TextStyle#dropShadowColor|dropShadowColor}\n * - {@link PIXI.TextStyle#dropShadowBlur|dropShadowBlur}\n * - {@link PIXI.TextStyle#dropShadowAngle|dropShadowAngle}\n * - {@link PIXI.TextStyle#fill|fill}\n * - {@link PIXI.TextStyle#fillGradientStops|fillGradientStops}\n * - {@link PIXI.TextStyle#fillGradientType|fillGradientType}\n * - {@link PIXI.TextStyle#fontFamily|fontFamily}\n * - {@link PIXI.TextStyle#fontSize|fontSize}\n * - {@link PIXI.TextStyle#fontVariant|fontVariant}\n * - {@link PIXI.TextStyle#fontWeight|fontWeight}\n * - {@link PIXI.TextStyle#lineJoin|lineJoin}\n * - {@link PIXI.TextStyle#miterLimit|miterLimit}\n * - {@link PIXI.TextStyle#stroke|stroke}\n * - {@link PIXI.TextStyle#strokeThickness|strokeThickness}\n * - {@link PIXI.TextStyle#textBaseline|textBaseline}\n * @param name - The name of the custom font to use with BitmapText.\n * @param textStyle - Style options to render with BitmapFont.\n * @param options - Setup options for font or name of the font.\n * @param {string|string[]|string[][]} [options.chars=PIXI.BitmapFont.ALPHANUMERIC] - characters included\n * in the font set. You can also use ranges. For example, `[['a', 'z'], ['A', 'Z'], \"!@#$%^&*()~{}[] \"]`.\n * Don't forget to include spaces ' ' in your character set!\n * @param {number} [options.resolution=1] - Render resolution for glyphs.\n * @param {number} [options.textureWidth=512] - Optional width of atlas, smaller values to reduce memory.\n * @param {number} [options.textureHeight=512] - Optional height of atlas, smaller values to reduce memory.\n * @param {number} [options.padding=4] - Padding between glyphs on texture atlas.\n * @returns Font generated by style options.\n * @example\n * PIXI.BitmapFont.from(\"TitleFont\", {\n * fontFamily: \"Arial\",\n * fontSize: 12,\n * strokeThickness: 2,\n * fill: \"purple\"\n * });\n *\n * const title = new PIXI.BitmapText(\"This is the title\", { fontName: \"TitleFont\" });\n */\n BitmapFont.from = function (name, textStyle, options) {\n if (!name) {\n throw new Error('[BitmapFont] Property `name` is required.');\n }\n var _a = Object.assign({}, BitmapFont.defaultOptions, options), chars = _a.chars, padding = _a.padding, resolution = _a.resolution, textureWidth = _a.textureWidth, textureHeight = _a.textureHeight;\n var charsList = resolveCharacters(chars);\n var style = textStyle instanceof TextStyle ? textStyle : new TextStyle(textStyle);\n var lineWidth = textureWidth;\n var fontData = new BitmapFontData();\n fontData.info[0] = {\n face: style.fontFamily,\n size: style.fontSize,\n };\n fontData.common[0] = {\n lineHeight: style.fontSize,\n };\n var positionX = 0;\n var positionY = 0;\n var canvas;\n var context;\n var baseTexture;\n var maxCharHeight = 0;\n var textures = [];\n for (var i = 0; i < charsList.length; i++) {\n if (!canvas) {\n canvas = settings.ADAPTER.createCanvas();\n canvas.width = textureWidth;\n canvas.height = textureHeight;\n context = canvas.getContext('2d');\n baseTexture = new BaseTexture(canvas, { resolution: resolution });\n textures.push(new Texture(baseTexture));\n fontData.page.push({\n id: textures.length - 1,\n file: '',\n });\n }\n // Measure glyph dimensions\n var character = charsList[i];\n var metrics = TextMetrics.measureText(character, style, false, canvas);\n var width = metrics.width;\n var height = Math.ceil(metrics.height);\n // This is ugly - but italics are given more space so they don't overlap\n var textureGlyphWidth = Math.ceil((style.fontStyle === 'italic' ? 2 : 1) * width);\n // Can't fit char anymore: next canvas please!\n if (positionY >= textureHeight - (height * resolution)) {\n if (positionY === 0) {\n // We don't want user debugging an infinite loop (or do we? :)\n throw new Error(\"[BitmapFont] textureHeight \" + textureHeight + \"px is too small \"\n + (\"(fontFamily: '\" + style.fontFamily + \"', fontSize: \" + style.fontSize + \"px, char: '\" + character + \"')\"));\n }\n --i;\n // Create new atlas once current has filled up\n canvas = null;\n context = null;\n baseTexture = null;\n positionY = 0;\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n maxCharHeight = Math.max(height + metrics.fontProperties.descent, maxCharHeight);\n // Wrap line once full row has been rendered\n if ((textureGlyphWidth * resolution) + positionX >= lineWidth) {\n if (positionX === 0) {\n // Avoid infinite loop (There can be some very wide char like '\\uFDFD'!)\n throw new Error(\"[BitmapFont] textureWidth \" + textureWidth + \"px is too small \"\n + (\"(fontFamily: '\" + style.fontFamily + \"', fontSize: \" + style.fontSize + \"px, char: '\" + character + \"')\"));\n }\n --i;\n positionY += maxCharHeight * resolution;\n positionY = Math.ceil(positionY);\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n drawGlyph(canvas, context, metrics, positionX, positionY, resolution, style);\n // Unique (numeric) ID mapping to this glyph\n var id = extractCharCode(metrics.text);\n // Create a texture holding just the glyph\n fontData.char.push({\n id: id,\n page: textures.length - 1,\n x: positionX / resolution,\n y: positionY / resolution,\n width: textureGlyphWidth,\n height: height,\n xoffset: 0,\n yoffset: 0,\n xadvance: Math.ceil(width\n - (style.dropShadow ? style.dropShadowDistance : 0)\n - (style.stroke ? style.strokeThickness : 0)),\n });\n positionX += (textureGlyphWidth + (2 * padding)) * resolution;\n positionX = Math.ceil(positionX);\n }\n if (!(options === null || options === void 0 ? void 0 : options.skipKerning)) {\n // Brute-force kerning info, this can be expensive b/c it's an O(n²),\n // but we're using measureText which is native and fast.\n for (var i = 0, len = charsList.length; i < len; i++) {\n var first = charsList[i];\n for (var j = 0; j < len; j++) {\n var second = charsList[j];\n var c1 = context.measureText(first).width;\n var c2 = context.measureText(second).width;\n var total = context.measureText(first + second).width;\n var amount = total - (c1 + c2);\n if (amount) {\n fontData.kerning.push({\n first: extractCharCode(first),\n second: extractCharCode(second),\n amount: amount,\n });\n }\n }\n }\n }\n var font = new BitmapFont(fontData, textures, true);\n // Make it easier to replace a font\n if (BitmapFont.available[name] !== undefined) {\n BitmapFont.uninstall(name);\n }\n BitmapFont.available[name] = font;\n return font;\n };\n /**\n * This character set includes all the letters in the alphabet (both lower- and upper- case).\n * @type {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.ALPHA })\n */\n BitmapFont.ALPHA = [['a', 'z'], ['A', 'Z'], ' '];\n /**\n * This character set includes all decimal digits (from 0 to 9).\n * @type {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.NUMERIC })\n */\n BitmapFont.NUMERIC = [['0', '9']];\n /**\n * This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`.\n * @type {string[][]}\n */\n BitmapFont.ALPHANUMERIC = [['a', 'z'], ['A', 'Z'], ['0', '9'], ' '];\n /**\n * This character set consists of all the ASCII table.\n * @member {string[][]}\n * @see http://www.asciitable.com/\n */\n BitmapFont.ASCII = [[' ', '~']];\n /**\n * Collection of default options when using `BitmapFont.from`.\n * @property {number} [resolution=1] -\n * @property {number} [textureWidth=512] -\n * @property {number} [textureHeight=512] -\n * @property {number} [padding=4] -\n * @property {string|string[]|string[][]} chars = PIXI.BitmapFont.ALPHANUMERIC\n */\n BitmapFont.defaultOptions = {\n resolution: 1,\n textureWidth: 512,\n textureHeight: 512,\n padding: 4,\n chars: BitmapFont.ALPHANUMERIC,\n };\n /** Collection of available/installed fonts. */\n BitmapFont.available = {};\n return BitmapFont;\n}());\n\nvar msdfFrag = \"// Pixi texture info\\r\\nvarying vec2 vTextureCoord;\\r\\nuniform sampler2D uSampler;\\r\\n\\r\\n// Tint\\r\\nuniform vec4 uColor;\\r\\n\\r\\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\\r\\nuniform float uFWidth;\\r\\n\\r\\nvoid main(void) {\\r\\n\\r\\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\\r\\n vec4 texColor = texture2D(uSampler, vTextureCoord);\\r\\n\\r\\n // MSDF\\r\\n float median = texColor.r + texColor.g + texColor.b -\\r\\n min(texColor.r, min(texColor.g, texColor.b)) -\\r\\n max(texColor.r, max(texColor.g, texColor.b));\\r\\n // SDF\\r\\n median = min(median, texColor.a);\\r\\n\\r\\n float screenPxDistance = uFWidth * (median - 0.5);\\r\\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\\r\\n if (median < 0.01) {\\r\\n alpha = 0.0;\\r\\n } else if (median > 0.99) {\\r\\n alpha = 1.0;\\r\\n }\\r\\n\\r\\n // NPM Textures, NPM outputs\\r\\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\\r\\n\\r\\n}\\r\\n\";\n\nvar msdfVert = \"// Mesh material default fragment\\r\\nattribute vec2 aVertexPosition;\\r\\nattribute vec2 aTextureCoord;\\r\\n\\r\\nuniform mat3 projectionMatrix;\\r\\nuniform mat3 translationMatrix;\\r\\nuniform mat3 uTextureMatrix;\\r\\n\\r\\nvarying vec2 vTextureCoord;\\r\\n\\r\\nvoid main(void)\\r\\n{\\r\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\r\\n\\r\\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\\r\\n}\\r\\n\";\n\n// If we ever need more than two pools, please make a Dict or something better.\nvar pageMeshDataDefaultPageMeshData = [];\nvar pageMeshDataMSDFPageMeshData = [];\nvar charRenderDataPool = [];\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font.\n *\n * The primary advantage of this class over Text is that all of your textures are pre-generated and loading,\n * meaning that rendering is fast, and changing text has no performance implications.\n *\n * Supporting character sets other than latin, such as CJK languages, may be impractical due to the number of characters.\n *\n * To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\n *\n * PixiJS can auto-generate fonts on-the-fly using BitmapFont or use fnt files provided by:\n * http://www.angelcode.com/products/bmfont/ for Windows or\n * http://www.bmglyph.com/ for Mac.\n *\n * You can also use SDF, MSDF and MTSDF BitmapFonts for vector-like scaling appearance provided by:\n * https://github.com/soimy/msdf-bmfont-xml for SDF and MSDF fnt files or\n * https://github.com/Chlumsky/msdf-atlas-gen for SDF, MSDF and MTSDF json files\n *\n * A BitmapText can only be created when the font is loaded.\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.BitmapText(\"text using a fancy font!\", {\n * fontName: \"Desyrel\",\n * fontSize: 35,\n * align: \"right\"\n * });\n * ```\n * @memberof PIXI\n */\nvar BitmapText = /** @class */ (function (_super) {\n __extends(BitmapText, _super);\n /**\n * @param text - A string that you would like the text to display.\n * @param style - The style parameters.\n * @param {string} style.fontName - The installed BitmapFont name.\n * @param {number} [style.fontSize] - The size of the font in pixels, e.g. 24. If undefined,\n *. this will default to the BitmapFont size.\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center', 'right' or 'justify'),\n * does not affect single line text.\n * @param {number} [style.tint=0xFFFFFF] - The tint color.\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters.\n * @param {number} [style.maxWidth=0] - The max width of the text before line wrapping.\n */\n function BitmapText(text, style) {\n if (style === void 0) { style = {}; }\n var _this = _super.call(this) || this;\n /**\n * Private tracker for the current tint.\n * @private\n */\n _this._tint = 0xFFFFFF;\n // Apply the defaults\n var _a = Object.assign({}, BitmapText.styleDefaults, style), align = _a.align, tint = _a.tint, maxWidth = _a.maxWidth, letterSpacing = _a.letterSpacing, fontName = _a.fontName, fontSize = _a.fontSize;\n if (!BitmapFont.available[fontName]) {\n throw new Error(\"Missing BitmapFont \\\"\" + fontName + \"\\\"\");\n }\n _this._activePagesMeshData = [];\n _this._textWidth = 0;\n _this._textHeight = 0;\n _this._align = align;\n _this._tint = tint;\n _this._font = undefined;\n _this._fontName = fontName;\n _this._fontSize = fontSize;\n _this.text = text;\n _this._maxWidth = maxWidth;\n _this._maxLineHeight = 0;\n _this._letterSpacing = letterSpacing;\n _this._anchor = new ObservablePoint(function () { _this.dirty = true; }, _this, 0, 0);\n _this._roundPixels = settings.ROUND_PIXELS;\n _this.dirty = true;\n _this._resolution = settings.RESOLUTION;\n _this._autoResolution = true;\n _this._textureCache = {};\n return _this;\n }\n /** Renders text and updates it when needed. This should only be called if the BitmapFont is regenerated. */\n BitmapText.prototype.updateText = function () {\n var _a;\n var data = BitmapFont.available[this._fontName];\n var fontSize = this.fontSize;\n var scale = fontSize / data.size;\n var pos = new Point();\n var chars = [];\n var lineWidths = [];\n var lineSpaces = [];\n var text = this._text.replace(/(?:\\r\\n|\\r)/g, '\\n') || ' ';\n var charsInput = splitTextToCharacters(text);\n var maxWidth = this._maxWidth * data.size / fontSize;\n var pageMeshDataPool = data.distanceFieldType === 'none'\n ? pageMeshDataDefaultPageMeshData : pageMeshDataMSDFPageMeshData;\n var prevCharCode = null;\n var lastLineWidth = 0;\n var maxLineWidth = 0;\n var line = 0;\n var lastBreakPos = -1;\n var lastBreakWidth = 0;\n var spacesRemoved = 0;\n var maxLineHeight = 0;\n var spaceCount = 0;\n for (var i = 0; i < charsInput.length; i++) {\n var char = charsInput[i];\n var charCode = extractCharCode(char);\n if ((/(?:\\s)/).test(char)) {\n lastBreakPos = i;\n lastBreakWidth = lastLineWidth;\n spaceCount++;\n }\n if (char === '\\r' || char === '\\n') {\n lineWidths.push(lastLineWidth);\n lineSpaces.push(-1);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n ++line;\n ++spacesRemoved;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n spaceCount = 0;\n continue;\n }\n var charData = data.chars[charCode];\n if (!charData) {\n continue;\n }\n if (prevCharCode && charData.kerning[prevCharCode]) {\n pos.x += charData.kerning[prevCharCode];\n }\n var charRenderData = charRenderDataPool.pop() || {\n texture: Texture.EMPTY,\n line: 0,\n charCode: 0,\n prevSpaces: 0,\n position: new Point(),\n };\n charRenderData.texture = charData.texture;\n charRenderData.line = line;\n charRenderData.charCode = charCode;\n charRenderData.position.x = pos.x + charData.xOffset + (this._letterSpacing / 2);\n charRenderData.position.y = pos.y + charData.yOffset;\n charRenderData.prevSpaces = spaceCount;\n chars.push(charRenderData);\n lastLineWidth = charRenderData.position.x\n + Math.max(charData.xAdvance - charData.xOffset, charData.texture.orig.width);\n pos.x += charData.xAdvance + this._letterSpacing;\n maxLineHeight = Math.max(maxLineHeight, (charData.yOffset + charData.texture.height));\n prevCharCode = charCode;\n if (lastBreakPos !== -1 && maxWidth > 0 && pos.x > maxWidth) {\n ++spacesRemoved;\n removeItems(chars, 1 + lastBreakPos - spacesRemoved, 1 + i - lastBreakPos);\n i = lastBreakPos;\n lastBreakPos = -1;\n lineWidths.push(lastBreakWidth);\n lineSpaces.push(chars.length > 0 ? chars[chars.length - 1].prevSpaces : 0);\n maxLineWidth = Math.max(maxLineWidth, lastBreakWidth);\n line++;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n spaceCount = 0;\n }\n }\n var lastChar = charsInput[charsInput.length - 1];\n if (lastChar !== '\\r' && lastChar !== '\\n') {\n if ((/(?:\\s)/).test(lastChar)) {\n lastLineWidth = lastBreakWidth;\n }\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n lineSpaces.push(-1);\n }\n var lineAlignOffsets = [];\n for (var i = 0; i <= line; i++) {\n var alignOffset = 0;\n if (this._align === 'right') {\n alignOffset = maxLineWidth - lineWidths[i];\n }\n else if (this._align === 'center') {\n alignOffset = (maxLineWidth - lineWidths[i]) / 2;\n }\n else if (this._align === 'justify') {\n alignOffset = lineSpaces[i] < 0 ? 0 : (maxLineWidth - lineWidths[i]) / lineSpaces[i];\n }\n lineAlignOffsets.push(alignOffset);\n }\n var lenChars = chars.length;\n var pagesMeshData = {};\n var newPagesMeshData = [];\n var activePagesMeshData = this._activePagesMeshData;\n pageMeshDataPool.push.apply(pageMeshDataPool, activePagesMeshData);\n for (var i = 0; i < lenChars; i++) {\n var texture = chars[i].texture;\n var baseTextureUid = texture.baseTexture.uid;\n if (!pagesMeshData[baseTextureUid]) {\n var pageMeshData = pageMeshDataPool.pop();\n if (!pageMeshData) {\n var geometry = new MeshGeometry();\n var material = void 0;\n var meshBlendMode = void 0;\n if (data.distanceFieldType === 'none') {\n material = new MeshMaterial(Texture.EMPTY);\n meshBlendMode = BLEND_MODES.NORMAL;\n }\n else {\n material = new MeshMaterial(Texture.EMPTY, { program: Program.from(msdfVert, msdfFrag), uniforms: { uFWidth: 0 } });\n meshBlendMode = BLEND_MODES.NORMAL_NPM;\n }\n var mesh = new Mesh(geometry, material);\n mesh.blendMode = meshBlendMode;\n pageMeshData = {\n index: 0,\n indexCount: 0,\n vertexCount: 0,\n uvsCount: 0,\n total: 0,\n mesh: mesh,\n vertices: null,\n uvs: null,\n indices: null,\n };\n }\n // reset data..\n pageMeshData.index = 0;\n pageMeshData.indexCount = 0;\n pageMeshData.vertexCount = 0;\n pageMeshData.uvsCount = 0;\n pageMeshData.total = 0;\n // TODO need to get page texture here somehow..\n var _textureCache = this._textureCache;\n _textureCache[baseTextureUid] = _textureCache[baseTextureUid] || new Texture(texture.baseTexture);\n pageMeshData.mesh.texture = _textureCache[baseTextureUid];\n pageMeshData.mesh.tint = this._tint;\n newPagesMeshData.push(pageMeshData);\n pagesMeshData[baseTextureUid] = pageMeshData;\n }\n pagesMeshData[baseTextureUid].total++;\n }\n // lets find any previously active pageMeshDatas that are no longer required for\n // the updated text (if any), removed and return them to the pool.\n for (var i = 0; i < activePagesMeshData.length; i++) {\n if (newPagesMeshData.indexOf(activePagesMeshData[i]) === -1) {\n this.removeChild(activePagesMeshData[i].mesh);\n }\n }\n // next lets add any new meshes, that have not yet been added to this BitmapText\n // we only add if its not already a child of this BitmapObject\n for (var i = 0; i < newPagesMeshData.length; i++) {\n if (newPagesMeshData[i].mesh.parent !== this) {\n this.addChild(newPagesMeshData[i].mesh);\n }\n }\n // active page mesh datas are set to be the new pages added.\n this._activePagesMeshData = newPagesMeshData;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n var total = pageMeshData.total;\n // lets only allocate new buffers if we can fit the new text in the current ones..\n // unless that is, we will be batching. Currently batching dose not respect the size property of mesh\n if (!(((_a = pageMeshData.indices) === null || _a === void 0 ? void 0 : _a.length) > 6 * total) || pageMeshData.vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n pageMeshData.vertices = new Float32Array(4 * 2 * total);\n pageMeshData.uvs = new Float32Array(4 * 2 * total);\n pageMeshData.indices = new Uint16Array(6 * total);\n }\n else {\n var total_1 = pageMeshData.total;\n var vertices = pageMeshData.vertices;\n // Clear the garbage at the end of the vertices buffer. This will prevent the bounds miscalculation.\n for (var i_1 = total_1 * 4 * 2; i_1 < vertices.length; i_1++) {\n vertices[i_1] = 0;\n }\n }\n // as a buffer maybe bigger than the current word, we set the size of the meshMaterial\n // to match the number of letters needed\n pageMeshData.mesh.size = 6 * total;\n }\n for (var i = 0; i < lenChars; i++) {\n var char = chars[i];\n var offset = char.position.x + (lineAlignOffsets[char.line] * (this._align === 'justify' ? char.prevSpaces : 1));\n if (this._roundPixels) {\n offset = Math.round(offset);\n }\n var xPos = offset * scale;\n var yPos = char.position.y * scale;\n var texture = char.texture;\n var pageMesh = pagesMeshData[texture.baseTexture.uid];\n var textureFrame = texture.frame;\n var textureUvs = texture._uvs;\n var index = pageMesh.index++;\n pageMesh.indices[(index * 6) + 0] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 1] = 1 + (index * 4);\n pageMesh.indices[(index * 6) + 2] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 3] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 4] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 5] = 3 + (index * 4);\n pageMesh.vertices[(index * 8) + 0] = xPos;\n pageMesh.vertices[(index * 8) + 1] = yPos;\n pageMesh.vertices[(index * 8) + 2] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 3] = yPos;\n pageMesh.vertices[(index * 8) + 4] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 5] = yPos + (textureFrame.height * scale);\n pageMesh.vertices[(index * 8) + 6] = xPos;\n pageMesh.vertices[(index * 8) + 7] = yPos + (textureFrame.height * scale);\n pageMesh.uvs[(index * 8) + 0] = textureUvs.x0;\n pageMesh.uvs[(index * 8) + 1] = textureUvs.y0;\n pageMesh.uvs[(index * 8) + 2] = textureUvs.x1;\n pageMesh.uvs[(index * 8) + 3] = textureUvs.y1;\n pageMesh.uvs[(index * 8) + 4] = textureUvs.x2;\n pageMesh.uvs[(index * 8) + 5] = textureUvs.y2;\n pageMesh.uvs[(index * 8) + 6] = textureUvs.x3;\n pageMesh.uvs[(index * 8) + 7] = textureUvs.y3;\n }\n this._textWidth = maxLineWidth * scale;\n this._textHeight = (pos.y + data.lineHeight) * scale;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n // apply anchor\n if (this.anchor.x !== 0 || this.anchor.y !== 0) {\n var vertexCount = 0;\n var anchorOffsetX = this._textWidth * this.anchor.x;\n var anchorOffsetY = this._textHeight * this.anchor.y;\n for (var i_2 = 0; i_2 < pageMeshData.total; i_2++) {\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n }\n }\n this._maxLineHeight = maxLineHeight * scale;\n var vertexBuffer = pageMeshData.mesh.geometry.getBuffer('aVertexPosition');\n var textureBuffer = pageMeshData.mesh.geometry.getBuffer('aTextureCoord');\n var indexBuffer = pageMeshData.mesh.geometry.getIndex();\n vertexBuffer.data = pageMeshData.vertices;\n textureBuffer.data = pageMeshData.uvs;\n indexBuffer.data = pageMeshData.indices;\n vertexBuffer.update();\n textureBuffer.update();\n indexBuffer.update();\n }\n for (var i = 0; i < chars.length; i++) {\n charRenderDataPool.push(chars[i]);\n }\n this._font = data;\n this.dirty = false;\n };\n BitmapText.prototype.updateTransform = function () {\n this.validate();\n this.containerUpdateTransform();\n };\n BitmapText.prototype._render = function (renderer) {\n if (this._autoResolution && this._resolution !== renderer.resolution) {\n this._resolution = renderer.resolution;\n this.dirty = true;\n }\n // Update the uniform\n var _a = BitmapFont.available[this._fontName], distanceFieldRange = _a.distanceFieldRange, distanceFieldType = _a.distanceFieldType, size = _a.size;\n if (distanceFieldType !== 'none') {\n // Inject the shader code with the correct value\n var _b = this.worldTransform, a = _b.a, b = _b.b, c = _b.c, d = _b.d;\n var dx = Math.sqrt((a * a) + (b * b));\n var dy = Math.sqrt((c * c) + (d * d));\n var worldScale = (Math.abs(dx) + Math.abs(dy)) / 2;\n var fontScale = this.fontSize / size;\n for (var _i = 0, _c = this._activePagesMeshData; _i < _c.length; _i++) {\n var mesh = _c[_i];\n mesh.mesh.shader.uniforms.uFWidth = worldScale * distanceFieldRange * fontScale * this._resolution;\n }\n }\n _super.prototype._render.call(this, renderer);\n };\n /**\n * Validates text before calling parent's getLocalBounds\n * @returns - The rectangular bounding area\n */\n BitmapText.prototype.getLocalBounds = function () {\n this.validate();\n return _super.prototype.getLocalBounds.call(this);\n };\n /**\n * Updates text when needed\n * @private\n */\n BitmapText.prototype.validate = function () {\n var font = BitmapFont.available[this._fontName];\n if (!font) {\n throw new Error(\"Missing BitmapFont \\\"\" + this._fontName + \"\\\"\");\n }\n if (this._font !== font) {\n this.dirty = true;\n }\n if (this.dirty) {\n this.updateText();\n }\n };\n Object.defineProperty(BitmapText.prototype, \"tint\", {\n /**\n * The tint of the BitmapText object.\n * @default 0xffffff\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n if (this._tint === value)\n { return; }\n this._tint = value;\n for (var i = 0; i < this._activePagesMeshData.length; i++) {\n this._activePagesMeshData[i].mesh.tint = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"align\", {\n /**\n * The alignment of the BitmapText object.\n * @member {string}\n * @default 'left'\n */\n get: function () {\n return this._align;\n },\n set: function (value) {\n if (this._align !== value) {\n this._align = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontName\", {\n /** The name of the BitmapFont. */\n get: function () {\n return this._fontName;\n },\n set: function (value) {\n if (!BitmapFont.available[value]) {\n throw new Error(\"Missing BitmapFont \\\"\" + value + \"\\\"\");\n }\n if (this._fontName !== value) {\n this._fontName = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontSize\", {\n /** The size of the font to display. */\n get: function () {\n var _a;\n return (_a = this._fontSize) !== null && _a !== void 0 ? _a : BitmapFont.available[this._fontName].size;\n },\n set: function (value) {\n if (this._fontSize !== value) {\n this._fontSize = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the text.\n *\n * The default is `(0,0)`, this means the text's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the text's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner.\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n if (typeof value === 'number') {\n this._anchor.set(value);\n }\n else {\n this._anchor.copyFrom(value);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"text\", {\n /** The text of the BitmapText object. */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxWidth\", {\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting the value to 0.\n */\n get: function () {\n return this._maxWidth;\n },\n set: function (value) {\n if (this._maxWidth === value) {\n return;\n }\n this._maxWidth = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxLineHeight\", {\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * i.e. when trying to vertically align.\n * @readonly\n */\n get: function () {\n this.validate();\n return this._maxLineHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textWidth\", {\n /**\n * The width of the overall text, different from fontSize,\n * which is defined in the style object.\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"letterSpacing\", {\n /** Additional space between characters. */\n get: function () {\n return this._letterSpacing;\n },\n set: function (value) {\n if (this._letterSpacing !== value) {\n this._letterSpacing = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"roundPixels\", {\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n * @default PIXI.settings.ROUND_PIXELS\n */\n get: function () {\n return this._roundPixels;\n },\n set: function (value) {\n if (value !== this._roundPixels) {\n this._roundPixels = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textHeight\", {\n /**\n * The height of the overall text, different from fontSize,\n * which is defined in the style object.\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"resolution\", {\n /**\n * The resolution / device pixel ratio of the canvas.\n *\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @default 1\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._autoResolution = false;\n if (this._resolution === value) {\n return;\n }\n this._resolution = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n BitmapText.prototype.destroy = function (options) {\n var _textureCache = this._textureCache;\n var data = BitmapFont.available[this._fontName];\n var pageMeshDataPool = data.distanceFieldType === 'none'\n ? pageMeshDataDefaultPageMeshData : pageMeshDataMSDFPageMeshData;\n pageMeshDataPool.push.apply(pageMeshDataPool, this._activePagesMeshData);\n for (var _i = 0, _a = this._activePagesMeshData; _i < _a.length; _i++) {\n var pageMeshData = _a[_i];\n this.removeChild(pageMeshData.mesh);\n }\n this._activePagesMeshData = [];\n // Release references to any cached textures in page pool\n pageMeshDataPool\n .filter(function (page) { return _textureCache[page.mesh.texture.baseTexture.uid]; })\n .forEach(function (page) {\n page.mesh.texture = Texture.EMPTY;\n });\n for (var id in _textureCache) {\n var texture = _textureCache[id];\n texture.destroy();\n delete _textureCache[id];\n }\n this._font = null;\n this._textureCache = null;\n _super.prototype.destroy.call(this, options);\n };\n BitmapText.styleDefaults = {\n align: 'left',\n tint: 0xFFFFFF,\n maxWidth: 0,\n letterSpacing: 0,\n };\n return BitmapText;\n}(Container));\n\n/**\n * {@link PIXI.Loader Loader} middleware for loading\n * bitmap-based fonts suitable for using with {@link PIXI.BitmapText}.\n * @memberof PIXI\n */\nvar BitmapFontLoader = /** @class */ (function () {\n function BitmapFontLoader() {\n }\n /**\n * Called when the plugin is installed.\n * @see PIXI.extensions.add\n */\n BitmapFontLoader.add = function () {\n LoaderResource.setExtensionXhrType('fnt', LoaderResource.XHR_RESPONSE_TYPE.TEXT);\n };\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param this\n * @param {PIXI.LoaderResource} resource\n * @param {Function} next\n */\n BitmapFontLoader.use = function (resource, next) {\n var format = autoDetectFormat(resource.data);\n // Resource was not recognised as any of the expected font data format\n if (!format) {\n next();\n return;\n }\n var baseUrl = BitmapFontLoader.getBaseUrl(this, resource);\n var data = format.parse(resource.data);\n var textures = {};\n // Handle completed, when the number of textures\n // load is the same number as references in the fnt file\n var completed = function (page) {\n textures[page.metadata.pageFile] = page.texture;\n if (Object.keys(textures).length === data.page.length) {\n resource.bitmapFont = BitmapFont.install(data, textures, true);\n next();\n }\n };\n for (var i = 0; i < data.page.length; ++i) {\n var pageFile = data.page[i].file;\n var url = baseUrl + pageFile;\n var exists = false;\n // incase the image is loaded outside\n // using the same loader, resource will be available\n for (var name in this.resources) {\n var bitmapResource = this.resources[name];\n if (bitmapResource.url === url) {\n bitmapResource.metadata.pageFile = pageFile;\n if (bitmapResource.texture) {\n completed(bitmapResource);\n }\n else {\n bitmapResource.onAfterMiddleware.add(completed);\n }\n exists = true;\n break;\n }\n }\n // texture is not loaded, we'll attempt to add\n // it to the load and add the texture to the list\n if (!exists) {\n // Standard loading options for images\n var options = {\n crossOrigin: resource.crossOrigin,\n loadType: LoaderResource.LOAD_TYPE.IMAGE,\n metadata: Object.assign({ pageFile: pageFile }, resource.metadata.imageMetadata),\n parentResource: resource,\n };\n this.add(url, options, completed);\n }\n }\n };\n /**\n * Get folder path from a resource.\n * @param loader\n * @param resource\n */\n BitmapFontLoader.getBaseUrl = function (loader, resource) {\n var resUrl = !resource.isDataUrl ? BitmapFontLoader.dirname(resource.url) : '';\n if (resource.isDataUrl) {\n if (resUrl === '.') {\n resUrl = '';\n }\n if (loader.baseUrl && resUrl) {\n // if baseurl has a trailing slash then add one to resUrl so the replace works below\n if (loader.baseUrl.charAt(loader.baseUrl.length - 1) === '/') {\n resUrl += '/';\n }\n }\n }\n // remove baseUrl from resUrl\n resUrl = resUrl.replace(loader.baseUrl, '');\n // if there is an resUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n if (resUrl && resUrl.charAt(resUrl.length - 1) !== '/') {\n resUrl += '/';\n }\n return resUrl;\n };\n /**\n * Replacement for NodeJS's path.dirname\n * @param {string} url - Path to get directory for\n */\n BitmapFontLoader.dirname = function (url) {\n var dir = url\n .replace(/\\\\/g, '/') // convert windows notation to UNIX notation, URL-safe because it's a forbidden character\n .replace(/\\/$/, '') // replace trailing slash\n .replace(/\\/[^\\/]*$/, ''); // remove everything after the last\n // File request is relative, use current directory\n if (dir === url) {\n return '.';\n }\n // Started with a slash\n else if (dir === '') {\n return '/';\n }\n return dir;\n };\n /** @ignore */\n BitmapFontLoader.extension = ExtensionType.Loader;\n return BitmapFontLoader;\n}());\n\nexport { BitmapFont, BitmapFontData, BitmapFontLoader, BitmapText, TextFormat, XMLFormat, XMLStringFormat, autoDetectFormat };\n//# sourceMappingURL=text-bitmap.mjs.map\n","/*!\n * @pixi/filter-alpha - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-alpha is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\\n}\\n\";\n\n/**\n * Simplest filter - applies alpha.\n *\n * Use this instead of Container's alpha property to avoid visual layering of individual elements.\n * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains.\n * If elements are not opaque, they will blend with each other anyway.\n *\n * Very handy if you want to use common features of all filters:\n *\n * 1. Assign a blendMode to this filter, blend all elements inside display object with background.\n *\n * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter.\n * @memberof PIXI.filters\n */\nvar AlphaFilter = /** @class */ (function (_super) {\n __extends(AlphaFilter, _super);\n /**\n * @param alpha - Amount of alpha from 0 to 1, where 0 is transparent\n */\n function AlphaFilter(alpha) {\n if (alpha === void 0) { alpha = 1.0; }\n var _this = _super.call(this, defaultVertex, fragment, { uAlpha: 1 }) || this;\n _this.alpha = alpha;\n return _this;\n }\n Object.defineProperty(AlphaFilter.prototype, \"alpha\", {\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return AlphaFilter;\n}(Filter));\n\nexport { AlphaFilter };\n//# sourceMappingURL=filter-alpha.mjs.map\n","/*!\n * @pixi/filter-blur - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { CLEAR_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertTemplate = \"\\n attribute vec2 aVertexPosition;\\n\\n uniform mat3 projectionMatrix;\\n\\n uniform float strength;\\n\\n varying vec2 vBlurTexCoords[%size%];\\n\\n uniform vec4 inputSize;\\n uniform vec4 outputFrame;\\n\\n vec4 filterVertexPosition( void )\\n {\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n }\\n\\n vec2 filterTextureCoord( void )\\n {\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n }\\n\\n void main(void)\\n {\\n gl_Position = filterVertexPosition();\\n\\n vec2 textureCoord = filterTextureCoord();\\n %blur%\\n }\";\nfunction generateBlurVertSource(kernelSize, x) {\n var halfLength = Math.ceil(kernelSize / 2);\n var vertSource = vertTemplate;\n var blurLoop = '';\n var template;\n if (x) {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);';\n }\n else {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);';\n }\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n blur = blur.replace('%sampleIndex%', i - (halfLength - 1) + \".0\");\n blurLoop += blur;\n blurLoop += '\\n';\n }\n vertSource = vertSource.replace('%blur%', blurLoop);\n vertSource = vertSource.replace('%size%', kernelSize.toString());\n return vertSource;\n}\n\nvar GAUSSIAN_VALUES = {\n 5: [0.153388, 0.221461, 0.250301],\n 7: [0.071303, 0.131514, 0.189879, 0.214607],\n 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448],\n};\nvar fragTemplate = [\n 'varying vec2 vBlurTexCoords[%size%];',\n 'uniform sampler2D uSampler;',\n 'void main(void)',\n '{',\n ' gl_FragColor = vec4(0.0);',\n ' %blur%',\n '}' ].join('\\n');\nfunction generateBlurFragSource(kernelSize) {\n var kernel = GAUSSIAN_VALUES[kernelSize];\n var halfLength = kernel.length;\n var fragSource = fragTemplate;\n var blurLoop = '';\n var template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n var value;\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n value = i;\n if (i >= halfLength) {\n value = kernelSize - i - 1;\n }\n blur = blur.replace('%value%', kernel[value].toString());\n blurLoop += blur;\n blurLoop += '\\n';\n }\n fragSource = fragSource.replace('%blur%', blurLoop);\n fragSource = fragSource.replace('%size%', kernelSize.toString());\n return fragSource;\n}\n\n/**\n * The BlurFilterPass applies a horizontal or vertical Gaussian blur to an object.\n * @memberof PIXI.filters\n */\nvar BlurFilterPass = /** @class */ (function (_super) {\n __extends(BlurFilterPass, _super);\n /**\n * @param horizontal - Do pass along the x-axis (`true`) or y-axis (`false`).\n * @param strength - The strength of the blur filter.\n * @param quality - The quality of the blur filter.\n * @param resolution - The resolution of the blur filter.\n * @param kernelSize - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilterPass(horizontal, strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = this;\n var vertSrc = generateBlurVertSource(kernelSize, horizontal);\n var fragSrc = generateBlurFragSource(kernelSize);\n _this = _super.call(this, \n // vertex shader\n vertSrc, \n // fragment shader\n fragSrc) || this;\n _this.horizontal = horizontal;\n _this.resolution = resolution;\n _this._quality = 0;\n _this.quality = quality;\n _this.blur = strength;\n return _this;\n }\n /**\n * Applies the filter.\n * @param filterManager - The manager.\n * @param input - The input target.\n * @param output - The output target.\n * @param clearMode - How to clear\n */\n BlurFilterPass.prototype.apply = function (filterManager, input, output, clearMode) {\n if (output) {\n if (this.horizontal) {\n this.uniforms.strength = (1 / output.width) * (output.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / output.height) * (output.height / input.height);\n }\n }\n else {\n if (this.horizontal) // eslint-disable-line\n {\n this.uniforms.strength = (1 / filterManager.renderer.width) * (filterManager.renderer.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / filterManager.renderer.height) * (filterManager.renderer.height / input.height); // eslint-disable-line\n }\n }\n // screen space!\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes;\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clearMode);\n }\n else {\n var renderTarget = filterManager.getFilterTexture();\n var renderer = filterManager.renderer;\n var flip = input;\n var flop = renderTarget;\n this.state.blend = false;\n filterManager.applyFilter(this, flip, flop, CLEAR_MODES.CLEAR);\n for (var i = 1; i < this.passes - 1; i++) {\n filterManager.bindAndClear(flip, CLEAR_MODES.BLIT);\n this.uniforms.uSampler = flop;\n var temp = flop;\n flop = flip;\n flip = temp;\n renderer.shader.bind(this);\n renderer.geometry.draw(5);\n }\n this.state.blend = true;\n filterManager.applyFilter(this, flop, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n };\n Object.defineProperty(BlurFilterPass.prototype, \"blur\", {\n /**\n * Sets the strength of both the blur.\n * @default 16\n */\n get: function () {\n return this.strength;\n },\n set: function (value) {\n this.padding = 1 + (Math.abs(value) * 2);\n this.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilterPass.prototype, \"quality\", {\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quality bluring but the lower the performance.\n * @default 4\n */\n get: function () {\n return this._quality;\n },\n set: function (value) {\n this._quality = value;\n this.passes = value;\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilterPass;\n}(Filter));\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n *\n * The strength of the blur can be set for the x-axis and y-axis separately.\n * @memberof PIXI.filters\n */\nvar BlurFilter = /** @class */ (function (_super) {\n __extends(BlurFilter, _super);\n /**\n * @param strength - The strength of the blur filter.\n * @param quality - The quality of the blur filter.\n * @param [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blur filter.\n * @param kernelSize - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilter(strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = _super.call(this) || this;\n _this.blurXFilter = new BlurFilterPass(true, strength, quality, resolution, kernelSize);\n _this.blurYFilter = new BlurFilterPass(false, strength, quality, resolution, kernelSize);\n _this.resolution = resolution;\n _this.quality = quality;\n _this.blur = strength;\n _this.repeatEdgePixels = false;\n return _this;\n }\n /**\n * Applies the filter.\n * @param filterManager - The manager.\n * @param input - The input target.\n * @param output - The output target.\n * @param clearMode - How to clear\n */\n BlurFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var xStrength = Math.abs(this.blurXFilter.strength);\n var yStrength = Math.abs(this.blurYFilter.strength);\n if (xStrength && yStrength) {\n var renderTarget = filterManager.getFilterTexture();\n this.blurXFilter.apply(filterManager, input, renderTarget, CLEAR_MODES.CLEAR);\n this.blurYFilter.apply(filterManager, renderTarget, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n else if (yStrength) {\n this.blurYFilter.apply(filterManager, input, output, clearMode);\n }\n else {\n this.blurXFilter.apply(filterManager, input, output, clearMode);\n }\n };\n BlurFilter.prototype.updatePadding = function () {\n if (this._repeatEdgePixels) {\n this.padding = 0;\n }\n else {\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n };\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"quality\", {\n /**\n * Sets the number of passes for blur. More passes means higher quality bluring.\n * @default 1\n */\n get: function () {\n return this.blurXFilter.quality;\n },\n set: function (value) {\n this.blurXFilter.quality = this.blurYFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurX\", {\n /**\n * Sets the strength of the blurX property\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurY\", {\n /**\n * Sets the strength of the blurY property\n * @default 2\n */\n get: function () {\n return this.blurYFilter.blur;\n },\n set: function (value) {\n this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blendMode\", {\n /**\n * Sets the blendmode of the filter\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this.blurYFilter.blendMode;\n },\n set: function (value) {\n this.blurYFilter.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"repeatEdgePixels\", {\n /**\n * If set to true the edge of the target will be clamped\n * @default false\n */\n get: function () {\n return this._repeatEdgePixels;\n },\n set: function (value) {\n this._repeatEdgePixels = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilter;\n}(Filter));\n\nexport { BlurFilter, BlurFilterPass };\n//# sourceMappingURL=filter-blur.mjs.map\n","/*!\n * @pixi/filter-color-matrix - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-color-matrix is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float m[20];\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n if (uAlpha == 0.0) {\\n gl_FragColor = c;\\n return;\\n }\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (c.a > 0.0) {\\n c.rgb /= c.a;\\n }\\n\\n vec4 result;\\n\\n result.r = (m[0] * c.r);\\n result.r += (m[1] * c.g);\\n result.r += (m[2] * c.b);\\n result.r += (m[3] * c.a);\\n result.r += m[4];\\n\\n result.g = (m[5] * c.r);\\n result.g += (m[6] * c.g);\\n result.g += (m[7] * c.b);\\n result.g += (m[8] * c.a);\\n result.g += m[9];\\n\\n result.b = (m[10] * c.r);\\n result.b += (m[11] * c.g);\\n result.b += (m[12] * c.b);\\n result.b += (m[13] * c.a);\\n result.b += m[14];\\n\\n result.a = (m[15] * c.r);\\n result.a += (m[16] * c.g);\\n result.a += (m[17] * c.b);\\n result.a += (m[18] * c.a);\\n result.a += m[19];\\n\\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\\n\\n // Premultiply alpha again.\\n rgb *= result.a;\\n\\n gl_FragColor = vec4(rgb, result.a);\\n}\\n\";\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n * let colorMatrix = new PIXI.filters.ColorMatrixFilter();\n * container.filters = [colorMatrix];\n * colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault \n * @memberof PIXI.filters\n */\nvar ColorMatrixFilter = /** @class */ (function (_super) {\n __extends(ColorMatrixFilter, _super);\n function ColorMatrixFilter() {\n var _this = this;\n var uniforms = {\n m: new Float32Array([1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0]),\n uAlpha: 1,\n };\n _this = _super.call(this, defaultFilterVertex, fragment, uniforms) || this;\n _this.alpha = 1;\n return _this;\n }\n /**\n * Transforms current matrix and set the new one\n * @param {number[]} matrix - 5x4 matrix\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype._loadMatrix = function (matrix, multiply) {\n if (multiply === void 0) { multiply = false; }\n var newMatrix = matrix;\n if (multiply) {\n this._multiply(newMatrix, this.uniforms.m, matrix);\n newMatrix = this._colorMatrix(newMatrix);\n }\n // set the new matrix\n this.uniforms.m = newMatrix;\n };\n /**\n * Multiplies two mat5's\n * @private\n * @param out - 5x4 matrix the receiving matrix\n * @param a - 5x4 matrix the first operand\n * @param b - 5x4 matrix the second operand\n * @returns {number[]} 5x4 matrix\n */\n ColorMatrixFilter.prototype._multiply = function (out, a, b) {\n // Red Channel\n out[0] = (a[0] * b[0]) + (a[1] * b[5]) + (a[2] * b[10]) + (a[3] * b[15]);\n out[1] = (a[0] * b[1]) + (a[1] * b[6]) + (a[2] * b[11]) + (a[3] * b[16]);\n out[2] = (a[0] * b[2]) + (a[1] * b[7]) + (a[2] * b[12]) + (a[3] * b[17]);\n out[3] = (a[0] * b[3]) + (a[1] * b[8]) + (a[2] * b[13]) + (a[3] * b[18]);\n out[4] = (a[0] * b[4]) + (a[1] * b[9]) + (a[2] * b[14]) + (a[3] * b[19]) + a[4];\n // Green Channel\n out[5] = (a[5] * b[0]) + (a[6] * b[5]) + (a[7] * b[10]) + (a[8] * b[15]);\n out[6] = (a[5] * b[1]) + (a[6] * b[6]) + (a[7] * b[11]) + (a[8] * b[16]);\n out[7] = (a[5] * b[2]) + (a[6] * b[7]) + (a[7] * b[12]) + (a[8] * b[17]);\n out[8] = (a[5] * b[3]) + (a[6] * b[8]) + (a[7] * b[13]) + (a[8] * b[18]);\n out[9] = (a[5] * b[4]) + (a[6] * b[9]) + (a[7] * b[14]) + (a[8] * b[19]) + a[9];\n // Blue Channel\n out[10] = (a[10] * b[0]) + (a[11] * b[5]) + (a[12] * b[10]) + (a[13] * b[15]);\n out[11] = (a[10] * b[1]) + (a[11] * b[6]) + (a[12] * b[11]) + (a[13] * b[16]);\n out[12] = (a[10] * b[2]) + (a[11] * b[7]) + (a[12] * b[12]) + (a[13] * b[17]);\n out[13] = (a[10] * b[3]) + (a[11] * b[8]) + (a[12] * b[13]) + (a[13] * b[18]);\n out[14] = (a[10] * b[4]) + (a[11] * b[9]) + (a[12] * b[14]) + (a[13] * b[19]) + a[14];\n // Alpha Channel\n out[15] = (a[15] * b[0]) + (a[16] * b[5]) + (a[17] * b[10]) + (a[18] * b[15]);\n out[16] = (a[15] * b[1]) + (a[16] * b[6]) + (a[17] * b[11]) + (a[18] * b[16]);\n out[17] = (a[15] * b[2]) + (a[16] * b[7]) + (a[17] * b[12]) + (a[18] * b[17]);\n out[18] = (a[15] * b[3]) + (a[16] * b[8]) + (a[17] * b[13]) + (a[18] * b[18]);\n out[19] = (a[15] * b[4]) + (a[16] * b[9]) + (a[17] * b[14]) + (a[18] * b[19]) + a[19];\n return out;\n };\n /**\n * Create a Float32 Array and normalize the offset component to 0-1\n * @param {number[]} matrix - 5x4 matrix\n * @returns {number[]} 5x4 matrix with all values between 0-1\n */\n ColorMatrixFilter.prototype._colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n var m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n return m;\n };\n /**\n * Adjusts brightness\n * @param b - value of the brigthness (0-1, where 0 is black)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.brightness = function (b, multiply) {\n var matrix = [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Sets each channel on the diagonal of the color matrix.\n * This can be used to achieve a tinting effect on Containers similar to the tint field of some\n * display objects like Sprite, Text, Graphics, and Mesh.\n * @param color - Color of the tint. This is a hex value.\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.tint = function (color, multiply) {\n var r = (color >> 16) & 0xff;\n var g = (color >> 8) & 0xff;\n var b = color & 0xff;\n var matrix = [\n r / 255, 0, 0, 0, 0,\n 0, g / 255, 0, 0, 0,\n 0, 0, b / 255, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the matrices in grey scales\n * @param scale - value of the grey (0-1, where 0 is black)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.greyscale = function (scale, multiply) {\n var matrix = [\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the black and white matrice.\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.blackAndWhite = function (multiply) {\n var matrix = [\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the hue property of the color\n * @param rotation - in degrees\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.hue = function (rotation, multiply) {\n rotation = (rotation || 0) / 180 * Math.PI;\n var cosR = Math.cos(rotation);\n var sinR = Math.sin(rotation);\n var sqrt = Math.sqrt;\n /* a good approximation for hue rotation\n This matrix is far better than the versions with magic luminance constants\n formerly used here, but also used in the starling framework (flash) and known from this\n old part of the internet: quasimondo.com/archives/000565.php\n\n This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n implementation as a shader not a general matrix:\n https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n\n This is the source for the code:\n see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n */\n var w = 1 / 3;\n var sqrW = sqrt(w); // weight is\n var a00 = cosR + ((1.0 - cosR) * w);\n var a01 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a02 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a10 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a11 = cosR + (w * (1.0 - cosR));\n var a12 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a20 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a21 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a22 = cosR + (w * (1.0 - cosR));\n var matrix = [\n a00, a01, a02, 0, 0,\n a10, a11, a12, 0, 0,\n a20, a21, a22, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the contrast matrix, increase the separation between dark and bright\n * Increase contrast : shadows darker and highlights brighter\n * Decrease contrast : bring the shadows up and the highlights down\n * @param amount - value of the contrast (0-1)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.contrast = function (amount, multiply) {\n var v = (amount || 0) + 1;\n var o = -0.5 * (v - 1);\n var matrix = [\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the saturation matrix, increase the separation between colors\n * Increase saturation : increase contrast, brightness, and sharpness\n * @param amount - The saturation amount (0-1)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.saturate = function (amount, multiply) {\n if (amount === void 0) { amount = 0; }\n var x = (amount * 2 / 3) + 1;\n var y = ((x - 1) * -0.5);\n var matrix = [\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /** Desaturate image (remove color) Call the saturate function */\n ColorMatrixFilter.prototype.desaturate = function () {\n this.saturate(-1);\n };\n /**\n * Negative image (inverse of classic rgb matrix)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.negative = function (multiply) {\n var matrix = [\n -1, 0, 0, 1, 0,\n 0, -1, 0, 1, 0,\n 0, 0, -1, 1, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Sepia image\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.sepia = function (multiply) {\n var matrix = [\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.technicolor = function (multiply) {\n var matrix = [\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Polaroid filter\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.polaroid = function (multiply) {\n var matrix = [\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Filter who transforms : Red -> Blue and Blue -> Red\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.toBGR = function (multiply) {\n var matrix = [\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.kodachrome = function (multiply) {\n var matrix = [\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Brown delicious browni filter (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.browni = function (multiply) {\n var matrix = [\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Vintage filter (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.vintage = function (multiply) {\n var matrix = [\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * We don't know exactly what it does, kind of gradient map, but funny to play with!\n * @param desaturation - Tone values.\n * @param toned - Tone values.\n * @param lightColor - Tone values, example: `0xFFE580`\n * @param darkColor - Tone values, example: `0xFFE580`\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.colorTone = function (desaturation, toned, lightColor, darkColor, multiply) {\n desaturation = desaturation || 0.2;\n toned = toned || 0.15;\n lightColor = lightColor || 0xFFE580;\n darkColor = darkColor || 0x338000;\n var lR = ((lightColor >> 16) & 0xFF) / 255;\n var lG = ((lightColor >> 8) & 0xFF) / 255;\n var lB = (lightColor & 0xFF) / 255;\n var dR = ((darkColor >> 16) & 0xFF) / 255;\n var dG = ((darkColor >> 8) & 0xFF) / 255;\n var dB = (darkColor & 0xFF) / 255;\n var matrix = [\n 0.3, 0.59, 0.11, 0, 0,\n lR, lG, lB, desaturation, 0,\n dR, dG, dB, toned, 0,\n lR - dR, lG - dG, lB - dB, 0, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Night effect\n * @param intensity - The intensity of the night effect.\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.night = function (intensity, multiply) {\n intensity = intensity || 0.1;\n var matrix = [\n intensity * (-2.0), -intensity, 0, 0, 0,\n -intensity, 0, intensity, 0, 0,\n 0, intensity, intensity * 2.0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Predator effect\n *\n * Erase the current matrix by setting a new indepent one\n * @param amount - how much the predator feels his future victim\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.predator = function (amount, multiply) {\n var matrix = [\n // row 1\n 11.224130630493164 * amount,\n -4.794486999511719 * amount,\n -2.8746118545532227 * amount,\n 0 * amount,\n 0.40342438220977783 * amount,\n // row 2\n -3.6330697536468506 * amount,\n 9.193157196044922 * amount,\n -2.951810836791992 * amount,\n 0 * amount,\n -1.316135048866272 * amount,\n // row 3\n -3.2184197902679443 * amount,\n -4.2375030517578125 * amount,\n 7.476448059082031 * amount,\n 0 * amount,\n 0.8044459223747253 * amount,\n // row 4\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * LSD effect\n *\n * Multiply the current matrix\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.lsd = function (multiply) {\n var matrix = [\n 2, -0.4, 0.5, 0, 0,\n -0.5, 2, -0.4, 0, 0,\n -0.4, -0.5, 3, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /** Erase the current matrix by setting the default one. */\n ColorMatrixFilter.prototype.reset = function () {\n var matrix = [\n 1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, false);\n };\n Object.defineProperty(ColorMatrixFilter.prototype, \"matrix\", {\n /**\n * The matrix of the color matrix filter\n * @member {number[]}\n * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n */\n get: function () {\n return this.uniforms.m;\n },\n set: function (value) {\n this.uniforms.m = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMatrixFilter.prototype, \"alpha\", {\n /**\n * The opacity value to use when mixing the original and resultant colors.\n *\n * When the value is 0, the original color is used without modification.\n * When the value is 1, the result color is used.\n * When in the range (0, 1) the color is interpolated between the original and result by this amount.\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorMatrixFilter;\n}(Filter));\n// Americanized alias\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n\nexport { ColorMatrixFilter };\n//# sourceMappingURL=filter-color-matrix.mjs.map\n","/*!\n * @pixi/filter-displacement - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-displacement is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Matrix, Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vFilterCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 scale;\\nuniform mat2 rotation;\\nuniform sampler2D uSampler;\\nuniform sampler2D mapSampler;\\n\\nuniform highp vec4 inputSize;\\nuniform vec4 inputClamp;\\n\\nvoid main(void)\\n{\\n vec4 map = texture2D(mapSampler, vFilterCoord);\\n\\n map -= 0.5;\\n map.xy = scale * inputSize.zw * (rotation * map.xy);\\n\\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\\n}\\n\";\n\nvar vertex = \"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 filterMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec2 vFilterCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n\\tgl_Position = filterVertexPosition();\\n\\tvTextureCoord = filterTextureCoord();\\n\\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\\n}\\n\";\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object.\n *\n * You can use this filter to apply all manor of crazy warping effects.\n * Currently the `r` property of the texture is used to offset the `x`\n * and the `g` property of the texture is used to offset the `y`.\n *\n * The way it works is it uses the values of the displacement map to look up the\n * correct pixels to output. This means it's not technically moving the original.\n * Instead, it's starting at the output and asking \"which pixel from the original goes here\".\n * For example, if a displacement map pixel has `red = 1` and the filter scale is `20`,\n * this filter will output the pixel approximately 20 pixels to the right of the original.\n * @memberof PIXI.filters\n */\nvar DisplacementFilter = /** @class */ (function (_super) {\n __extends(DisplacementFilter, _super);\n /**\n * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n * @param scale - The scale of the displacement\n */\n function DisplacementFilter(sprite, scale) {\n var _this = this;\n var maskMatrix = new Matrix();\n sprite.renderable = false;\n _this = _super.call(this, vertex, fragment, {\n mapSampler: sprite._texture,\n filterMatrix: maskMatrix,\n scale: { x: 1, y: 1 },\n rotation: new Float32Array([1, 0, 0, 1]),\n }) || this;\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n if (scale === null || scale === undefined) {\n scale = 20;\n }\n /**\n * scaleX, scaleY for displacements\n * @member {PIXI.Point}\n */\n _this.scale = new Point(scale, scale);\n return _this;\n }\n /**\n * Applies the filter.\n * @param filterManager - The manager.\n * @param input - The input target.\n * @param output - The output target.\n * @param clearMode - clearMode.\n */\n DisplacementFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n // fill maskMatrix with _normalized sprite texture coords_\n this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n this.uniforms.scale.x = this.scale.x;\n this.uniforms.scale.y = this.scale.y;\n // Extract rotation from world transform\n var wt = this.maskSprite.worldTransform;\n var lenX = Math.sqrt((wt.a * wt.a) + (wt.b * wt.b));\n var lenY = Math.sqrt((wt.c * wt.c) + (wt.d * wt.d));\n if (lenX !== 0 && lenY !== 0) {\n this.uniforms.rotation[0] = wt.a / lenX;\n this.uniforms.rotation[1] = wt.b / lenX;\n this.uniforms.rotation[2] = wt.c / lenY;\n this.uniforms.rotation[3] = wt.d / lenY;\n }\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n };\n Object.defineProperty(DisplacementFilter.prototype, \"map\", {\n /** The texture used for the displacement map. Must be power of 2 sized texture. */\n get: function () {\n return this.uniforms.mapSampler;\n },\n set: function (value) {\n this.uniforms.mapSampler = value;\n },\n enumerable: false,\n configurable: true\n });\n return DisplacementFilter;\n}(Filter));\n\nexport { DisplacementFilter };\n//# sourceMappingURL=filter-displacement.mjs.map\n","/*!\n * @pixi/filter-fxaa - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-fxaa is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"\\nattribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\\n out vec2 v_rgbNW, out vec2 v_rgbNE,\\n out vec2 v_rgbSW, out vec2 v_rgbSE,\\n out vec2 v_rgbM) {\\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\\n v_rgbM = vec2(fragCoord * inverseVP);\\n}\\n\\nvoid main(void) {\\n\\n gl_Position = filterVertexPosition();\\n\\n vFragCoord = aVertexPosition * outputFrame.zw;\\n\\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n}\\n\";\n\nvar fragment = \"varying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\nuniform sampler2D uSampler;\\nuniform highp vec4 inputSize;\\n\\n\\n/**\\n Basic FXAA implementation based on the code on geeks3d.com with the\\n modification that the texture2DLod stuff was removed since it's\\n unsupported by WebGL.\\n\\n --\\n\\n From:\\n https://github.com/mitsuhiko/webgl-meincraft\\n\\n Copyright (c) 2011 by Armin Ronacher.\\n\\n Some rights reserved.\\n\\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions are\\n met:\\n\\n * Redistributions of source code must retain the above copyright\\n notice, this list of conditions and the following disclaimer.\\n\\n * Redistributions in binary form must reproduce the above\\n copyright notice, this list of conditions and the following\\n disclaimer in the documentation and/or other materials provided\\n with the distribution.\\n\\n * The names of the contributors may not be used to endorse or\\n promote products derived from this software without specific\\n prior written permission.\\n\\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\n \\\"AS IS\\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n */\\n\\n#ifndef FXAA_REDUCE_MIN\\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\\n#endif\\n#ifndef FXAA_REDUCE_MUL\\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\\n#endif\\n#ifndef FXAA_SPAN_MAX\\n#define FXAA_SPAN_MAX 8.0\\n#endif\\n\\n//optimized version for mobile, where dependent\\n//texture reads can be a bottleneck\\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\\n vec2 v_rgbNW, vec2 v_rgbNE,\\n vec2 v_rgbSW, vec2 v_rgbSE,\\n vec2 v_rgbM) {\\n vec4 color;\\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\\n vec4 texColor = texture2D(tex, v_rgbM);\\n vec3 rgbM = texColor.xyz;\\n vec3 luma = vec3(0.299, 0.587, 0.114);\\n float lumaNW = dot(rgbNW, luma);\\n float lumaNE = dot(rgbNE, luma);\\n float lumaSW = dot(rgbSW, luma);\\n float lumaSE = dot(rgbSE, luma);\\n float lumaM = dot(rgbM, luma);\\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\\n\\n mediump vec2 dir;\\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\\n\\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\\n\\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\\n dir * rcpDirMin)) * inverseVP;\\n\\n vec3 rgbA = 0.5 * (\\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\\n\\n float lumaB = dot(rgbB, luma);\\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\\n color = vec4(rgbA, texColor.a);\\n else\\n color = vec4(rgbB, texColor.a);\\n return color;\\n}\\n\\nvoid main() {\\n\\n vec4 color;\\n\\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * Basic FXAA (Fast Approximate Anti-Aliasing) implementation based on the code on geeks3d.com\n * with the modification that the texture2DLod stuff was removed since it is unsupported by WebGL.\n * @see https://github.com/mitsuhiko/webgl-meincraft\n * @memberof PIXI.filters\n */\nvar FXAAFilter = /** @class */ (function (_super) {\n __extends(FXAAFilter, _super);\n function FXAAFilter() {\n // TODO - needs work\n return _super.call(this, vertex, fragment) || this;\n }\n return FXAAFilter;\n}(Filter));\n\nexport { FXAAFilter };\n//# sourceMappingURL=filter-fxaa.mjs.map\n","/*!\n * @pixi/filter-noise - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-noise is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform float uNoise;\\nuniform float uSeed;\\nuniform sampler2D uSampler;\\n\\nfloat rand(vec2 co)\\n{\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float randomValue = rand(gl_FragCoord.xy * uSeed);\\n float diff = (randomValue - 0.5) * uNoise;\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n }\\n\\n color.r += diff;\\n color.g += diff;\\n color.b += diff;\\n\\n // Premultiply alpha again.\\n color.rgb *= color.a;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * A Noise effect filter.\n *\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n * @memberof PIXI.filters\n * @author Vico @vicocotea\n */\nvar NoiseFilter = /** @class */ (function (_super) {\n __extends(NoiseFilter, _super);\n /**\n * @param {number} [noise=0.5] - The noise intensity, should be a normalized value in the range [0, 1].\n * @param {number} [seed] - A random seed for the noise generation. Default is `Math.random()`.\n */\n function NoiseFilter(noise, seed) {\n if (noise === void 0) { noise = 0.5; }\n if (seed === void 0) { seed = Math.random(); }\n var _this = _super.call(this, defaultFilterVertex, fragment, {\n uNoise: 0,\n uSeed: 0,\n }) || this;\n _this.noise = noise;\n _this.seed = seed;\n return _this;\n }\n Object.defineProperty(NoiseFilter.prototype, \"noise\", {\n /**\n * The amount of noise to apply, this value should be in the range (0, 1].\n * @default 0.5\n */\n get: function () {\n return this.uniforms.uNoise;\n },\n set: function (value) {\n this.uniforms.uNoise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NoiseFilter.prototype, \"seed\", {\n /** A seed value to apply to the random noise generation. `Math.random()` is a good value to use. */\n get: function () {\n return this.uniforms.uSeed;\n },\n set: function (value) {\n this.uniforms.uSeed = value;\n },\n enumerable: false,\n configurable: true\n });\n return NoiseFilter;\n}(Filter));\n\nexport { NoiseFilter };\n//# sourceMappingURL=filter-noise.mjs.map\n","/*!\n * @pixi/mixin-cache-as-bitmap - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { RenderTexture, BaseTexture, Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { DisplayObject } from '@pixi/display';\nimport { Matrix } from '@pixi/math';\nimport { uid } from '@pixi/utils';\nimport { settings } from '@pixi/settings';\nimport { MSAA_QUALITY } from '@pixi/constants';\n\nvar _tempMatrix = new Matrix();\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = null;\nDisplayObject.prototype._cacheAsBitmapResolution = null;\nDisplayObject.prototype._cacheAsBitmapMultisample = MSAA_QUALITY.NONE;\n// figured there's no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n * @private\n */\nvar CacheData = /** @class */ (function () {\n function CacheData() {\n this.textureCacheId = null;\n this.originalRender = null;\n this.originalRenderCanvas = null;\n this.originalCalculateBounds = null;\n this.originalGetLocalBounds = null;\n this.originalUpdateTransform = null;\n this.originalDestroy = null;\n this.originalMask = null;\n this.originalFilterArea = null;\n this.originalContainsPoint = null;\n this.sprite = null;\n }\n return CacheData;\n}());\nObject.defineProperties(DisplayObject.prototype, {\n /**\n * The resolution to use for cacheAsBitmap. By default this will use the renderer's resolution\n * but can be overriden for performance. Lower values will reduce memory usage at the expense\n * of render quality. A falsey value of `null` or `0` will default to the renderer's resolution.\n * If `cacheAsBitmap` is set to `true`, this will re-render with the new resolution.\n * @member {number} cacheAsBitmapResolution\n * @memberof PIXI.DisplayObject#\n * @default null\n */\n cacheAsBitmapResolution: {\n get: function () {\n return this._cacheAsBitmapResolution;\n },\n set: function (resolution) {\n if (resolution === this._cacheAsBitmapResolution) {\n return;\n }\n this._cacheAsBitmapResolution = resolution;\n if (this.cacheAsBitmap) {\n // Toggle to re-render at the new resolution\n this.cacheAsBitmap = false;\n this.cacheAsBitmap = true;\n }\n },\n },\n /**\n * The number of samples to use for cacheAsBitmap. If set to `null`, the renderer's\n * sample count is used.\n * If `cacheAsBitmap` is set to `true`, this will re-render with the new number of samples.\n * @member {number} cacheAsBitmapMultisample\n * @memberof PIXI.DisplayObject#\n * @default PIXI.MSAA_QUALITY.NONE\n */\n cacheAsBitmapMultisample: {\n get: function () {\n return this._cacheAsBitmapMultisample;\n },\n set: function (multisample) {\n if (multisample === this._cacheAsBitmapMultisample) {\n return;\n }\n this._cacheAsBitmapMultisample = multisample;\n if (this.cacheAsBitmap) {\n // Toggle to re-render with new multisample\n this.cacheAsBitmap = false;\n this.cacheAsBitmap = true;\n }\n },\n },\n /**\n * Set this to true if you want this display object to be cached as a bitmap.\n * This basically takes a snap shot of the display object as it is at that moment. It can\n * provide a performance benefit for complex static displayObjects.\n * To remove simply set this property to `false`\n *\n * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true\n * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n cacheAsBitmap: {\n get: function () {\n return this._cacheAsBitmap;\n },\n set: function (value) {\n if (this._cacheAsBitmap === value) {\n return;\n }\n this._cacheAsBitmap = value;\n var data;\n if (value) {\n if (!this._cacheData) {\n this._cacheData = new CacheData();\n }\n data = this._cacheData;\n data.originalRender = this.render;\n data.originalRenderCanvas = this.renderCanvas;\n data.originalUpdateTransform = this.updateTransform;\n data.originalCalculateBounds = this.calculateBounds;\n data.originalGetLocalBounds = this.getLocalBounds;\n data.originalDestroy = this.destroy;\n data.originalContainsPoint = this.containsPoint;\n data.originalMask = this._mask;\n data.originalFilterArea = this.filterArea;\n this.render = this._renderCached;\n this.renderCanvas = this._renderCachedCanvas;\n this.destroy = this._cacheAsBitmapDestroy;\n }\n else {\n data = this._cacheData;\n if (data.sprite) {\n this._destroyCachedDisplayObject();\n }\n this.render = data.originalRender;\n this.renderCanvas = data.originalRenderCanvas;\n this.calculateBounds = data.originalCalculateBounds;\n this.getLocalBounds = data.originalGetLocalBounds;\n this.destroy = data.originalDestroy;\n this.updateTransform = data.originalUpdateTransform;\n this.containsPoint = data.originalContainsPoint;\n this._mask = data.originalMask;\n this.filterArea = data.originalFilterArea;\n }\n },\n },\n});\n/**\n * Renders a cached version of the sprite with WebGL\n * @private\n * @method _renderCached\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCached = function _renderCached(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObject(renderer);\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._render(renderer);\n};\n/**\n * Prepares the WebGL renderer to cache the sprite\n * @private\n * @method _initCachedDisplayObject\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer) {\n var _a;\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n renderer.batch.flush();\n // this.filters= [];\n // next we find the dimensions of the untransformed object\n // this function also calls updatetransform on all its children as part of the measuring.\n // This means we don't need to update the transform again in this function\n // TODO pass an object to clone too? saves having to create a new one each time!\n var bounds = this.getLocalBounds(null, true).clone();\n // add some padding!\n if (this.filters && this.filters.length) {\n var padding = this.filters[0].padding;\n bounds.pad(padding);\n }\n bounds.ceil(settings.RESOLUTION);\n // for now we cache the current renderTarget that the WebGL renderer is currently using.\n // this could be more elegant..\n var cachedRenderTexture = renderer.renderTexture.current;\n var cachedSourceFrame = renderer.renderTexture.sourceFrame.clone();\n var cachedDestinationFrame = renderer.renderTexture.destinationFrame.clone();\n var cachedProjectionTransform = renderer.projection.transform;\n // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n // const stack = renderer.filterManager.filterStack;\n // this renderTexture will be used to store the cached DisplayObject\n var renderTexture = RenderTexture.create({\n width: bounds.width,\n height: bounds.height,\n resolution: this.cacheAsBitmapResolution || renderer.resolution,\n multisample: (_a = this.cacheAsBitmapMultisample) !== null && _a !== void 0 ? _a : renderer.multisample,\n });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = this.transform.localTransform.copyTo(_tempMatrix).invert().translate(-bounds.x, -bounds.y);\n // set all properties to there original so we can render to a texture\n this.render = this._cacheData.originalRender;\n renderer.render(this, { renderTexture: renderTexture, clear: true, transform: m, skipUpdateTransform: false });\n renderer.framebuffer.blit();\n // now restore the state be setting the new properties\n renderer.projection.transform = cachedProjectionTransform;\n renderer.renderTexture.bind(cachedRenderTexture, cachedSourceFrame, cachedDestinationFrame);\n // renderer.filterManager.filterStack = stack;\n this.render = this._renderCached;\n // the rest is the same as for Canvas\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n this.alpha = cacheAlpha;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.enableTempParent();\n this.updateTransform();\n this.disableTempParent(null);\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Renders a cached version of the sprite with canvas\n * @private\n * @method _renderCachedCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObjectCanvas(renderer);\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._renderCanvas(renderer);\n};\n// TODO this can be the same as the WebGL version.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n * @private\n * @method _initCachedDisplayObjectCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // get bounds actually transforms the object for us already!\n var bounds = this.getLocalBounds(null, true);\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n var cachedRenderTarget = renderer.context;\n var cachedProjectionTransform = renderer._projTransform;\n bounds.ceil(settings.RESOLUTION);\n var renderTexture = RenderTexture.create({ width: bounds.width, height: bounds.height });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = _tempMatrix;\n this.transform.localTransform.copyTo(m);\n m.invert();\n m.tx -= bounds.x;\n m.ty -= bounds.y;\n // m.append(this.transform.worldTransform.)\n // set all properties to there original so we can render to a texture\n this.renderCanvas = this._cacheData.originalRenderCanvas;\n renderer.render(this, { renderTexture: renderTexture, clear: true, transform: m, skipUpdateTransform: false });\n // now restore the state be setting the new properties\n renderer.context = cachedRenderTarget;\n renderer._projTransform = cachedProjectionTransform;\n this.renderCanvas = this._renderCachedCanvas;\n // the rest is the same as for WebGL\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n this.alpha = cacheAlpha;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Calculates the bounds of the cached sprite\n * @private\n * @method\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds() {\n this._bounds.clear();\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite._calculateBounds();\n this._bounds.updateID = this._boundsID;\n};\n/**\n * Gets the bounds of the cached sprite.\n * @private\n * @method\n * @returns {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() {\n return this._cacheData.sprite.getLocalBounds(null);\n};\n/**\n * Destroys the cached sprite.\n * @private\n * @method\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n BaseTexture.removeFromCache(this._cacheData.textureCacheId);\n Texture.removeFromCache(this._cacheData.textureCacheId);\n this._cacheData.textureCacheId = null;\n};\n/**\n * Destroys the cached object.\n * @private\n * @method\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * Used when destroying containers, see the Container.destroy method.\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options) {\n this.cacheAsBitmap = false;\n this.destroy(options);\n};\n\nexport { CacheData };\n//# sourceMappingURL=mixin-cache-as-bitmap.mjs.map\n","/*!\n * @pixi/mixin-get-child-by-name - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mixin-get-child-by-name is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject, Container } from '@pixi/display';\n\n/**\n * The instance name of the object.\n * @memberof PIXI.DisplayObject#\n * @member {string} name\n */\nDisplayObject.prototype.name = null;\n/**\n * Returns the display object in the container.\n *\n * Recursive searches are done in a preorder traversal.\n * @method getChildByName\n * @memberof PIXI.Container#\n * @param {string} name - Instance name.\n * @param {boolean}[deep=false] - Whether to search recursively\n * @returns {PIXI.DisplayObject} The child with the specified name.\n */\nContainer.prototype.getChildByName = function getChildByName(name, deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n if (this.children[i].name === name) {\n return this.children[i];\n }\n }\n if (deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n var child = this.children[i];\n if (!child.getChildByName) {\n continue;\n }\n var target = child.getChildByName(name, true);\n if (target) {\n return target;\n }\n }\n }\n return null;\n};\n//# sourceMappingURL=mixin-get-child-by-name.mjs.map\n","/*!\n * @pixi/mixin-get-global-position - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mixin-get-global-position is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { Point } from '@pixi/math';\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n * @method getGlobalPosition\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.\n * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @returns {PIXI.Point} The updated point.\n */\nDisplayObject.prototype.getGlobalPosition = function getGlobalPosition(point, skipUpdate) {\n if (point === void 0) { point = new Point(); }\n if (skipUpdate === void 0) { skipUpdate = false; }\n if (this.parent) {\n this.parent.toGlobal(this.position, point, skipUpdate);\n }\n else {\n point.x = this.position.x;\n point.y = this.position.y;\n }\n return point;\n};\n//# sourceMappingURL=mixin-get-global-position.mjs.map\n","/*!\n * @pixi/app - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/app is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { ExtensionType, extensions, autoDetectRenderer } from '@pixi/core';\nimport { Container } from '@pixi/display';\nimport { deprecation } from '@pixi/utils';\n\n/**\n * Middleware for for Application's resize functionality\n * @private\n * @class\n */\nvar ResizePlugin = /** @class */ (function () {\n function ResizePlugin() {\n }\n /**\n * Initialize the plugin with scope of application instance\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n ResizePlugin.init = function (options) {\n var _this = this;\n Object.defineProperty(this, 'resizeTo', \n /**\n * The HTML element or window to automatically resize the\n * renderer's view element to match width and height.\n * @member {Window|HTMLElement}\n * @name resizeTo\n * @memberof PIXI.Application#\n */\n {\n set: function (dom) {\n globalThis.removeEventListener('resize', this.queueResize);\n this._resizeTo = dom;\n if (dom) {\n globalThis.addEventListener('resize', this.queueResize);\n this.resize();\n }\n },\n get: function () {\n return this._resizeTo;\n },\n });\n /**\n * Resize is throttled, so it's safe to call this multiple times per frame and it'll\n * only be called once.\n * @memberof PIXI.Application#\n * @method queueResize\n * @private\n */\n this.queueResize = function () {\n if (!_this._resizeTo) {\n return;\n }\n _this.cancelResize();\n // // Throttle resize events per raf\n _this._resizeId = requestAnimationFrame(function () { return _this.resize(); });\n };\n /**\n * Cancel the resize queue.\n * @memberof PIXI.Application#\n * @method cancelResize\n * @private\n */\n this.cancelResize = function () {\n if (_this._resizeId) {\n cancelAnimationFrame(_this._resizeId);\n _this._resizeId = null;\n }\n };\n /**\n * Execute an immediate resize on the renderer, this is not\n * throttled and can be expensive to call many times in a row.\n * Will resize only if `resizeTo` property is set.\n * @memberof PIXI.Application#\n * @method resize\n */\n this.resize = function () {\n if (!_this._resizeTo) {\n return;\n }\n // clear queue resize\n _this.cancelResize();\n var width;\n var height;\n // Resize to the window\n if (_this._resizeTo === globalThis.window) {\n width = globalThis.innerWidth;\n height = globalThis.innerHeight;\n }\n // Resize to other HTML entities\n else {\n var _a = _this._resizeTo, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;\n width = clientWidth;\n height = clientHeight;\n }\n _this.renderer.resize(width, height);\n };\n // On resize\n this._resizeId = null;\n this._resizeTo = null;\n this.resizeTo = options.resizeTo || null;\n };\n /**\n * Clean up the ticker, scoped to application\n * @static\n * @private\n */\n ResizePlugin.destroy = function () {\n globalThis.removeEventListener('resize', this.queueResize);\n this.cancelResize();\n this.cancelResize = null;\n this.queueResize = null;\n this.resizeTo = null;\n this.resize = null;\n };\n /** @ignore */\n ResizePlugin.extension = ExtensionType.Application;\n return ResizePlugin;\n}());\n\n/**\n * Convenience class to create a new PIXI application.\n *\n * This class automatically creates the renderer, ticker and root container.\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.from('something.png'));\n * @class\n * @memberof PIXI\n */\nvar Application = /** @class */ (function () {\n /**\n * @param {PIXI.IApplicationOptions} [options] - The optional application and renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {boolean} [options.autoStart=true] - Automatically starts the rendering after the construction.\n * **Note**: Setting this parameter to false does NOT stop the shared ticker even if you set\n * `options.sharedTicker` to `true` in case that it is already started. Stop it by your own.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {boolean} [options.forceCanvas=false] -\n * Force using {@link PIXI.CanvasRenderer}, even if WebGL is available. This option only is available when\n * using **pixi.js-legacy** or **@pixi/canvas-renderer** packages, otherwise it is ignored.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {Window|HTMLElement} [options.resizeTo] - Element to automatically resize stage to.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.Loader.shared, `false` to create new Loader.\n * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.Ticker.shared, `false` to create new ticker.\n * If set to `false`, you cannot register a handler to occur before anything that runs on the shared ticker.\n * The system ticker will always run before both the shared ticker and the app ticker.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n */\n function Application(options) {\n var _this = this;\n /**\n * The root display container that's rendered.\n * @member {PIXI.Container}\n */\n this.stage = new Container();\n // The default options\n options = Object.assign({\n forceCanvas: false,\n }, options);\n this.renderer = autoDetectRenderer(options);\n // install plugins here\n Application._plugins.forEach(function (plugin) {\n plugin.init.call(_this, options);\n });\n }\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @static\n * @param {PIXI.IApplicationPlugin} plugin - Plugin being installed\n */\n Application.registerPlugin = function (plugin) {\n deprecation('6.5.0', 'Application.registerPlugin() is deprecated, use extensions.add()');\n extensions.add({\n type: ExtensionType.Application,\n ref: plugin,\n });\n };\n /** Render the current stage. */\n Application.prototype.render = function () {\n this.renderer.render(this.stage);\n };\n Object.defineProperty(Application.prototype, \"view\", {\n /**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */\n get: function () {\n return this.renderer.view;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Application.prototype, \"screen\", {\n /**\n * Reference to the renderer's screen rectangle. Its safe to use as `filterArea` or `hitArea` for the whole screen.\n * @member {PIXI.Rectangle}\n * @readonly\n */\n get: function () {\n return this.renderer.screen;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Destroy and don't use after this.\n * @param {boolean} [removeView=false] - Automatically remove canvas from DOM.\n * @param {object|boolean} [stageOptions] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [stageOptions.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'stageOptions' will be passed on to those calls.\n * @param {boolean} [stageOptions.texture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the texture of the child sprite\n * @param {boolean} [stageOptions.baseTexture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the base texture of the child sprite\n */\n Application.prototype.destroy = function (removeView, stageOptions) {\n var _this = this;\n // Destroy plugins in the opposite order\n // which they were constructed\n var plugins = Application._plugins.slice(0);\n plugins.reverse();\n plugins.forEach(function (plugin) {\n plugin.destroy.call(_this);\n });\n this.stage.destroy(stageOptions);\n this.stage = null;\n this.renderer.destroy(removeView);\n this.renderer = null;\n };\n /** Collection of installed plugins. */\n Application._plugins = [];\n return Application;\n}());\nextensions.handleByList(ExtensionType.Application, Application._plugins);\n\nextensions.add(ResizePlugin);\n\nexport { Application, ResizePlugin };\n//# sourceMappingURL=app.mjs.map\n","/*!\n * @pixi/mesh-extras - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mesh-extras is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { MeshGeometry, Mesh, MeshMaterial } from '@pixi/mesh';\nimport { WRAP_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * @memberof PIXI\n */\nvar PlaneGeometry = /** @class */ (function (_super) {\n __extends(PlaneGeometry, _super);\n /**\n * @param width - The width of the plane.\n * @param height - The height of the plane.\n * @param segWidth - Number of horizontal segments.\n * @param segHeight - Number of vertical segments.\n */\n function PlaneGeometry(width, height, segWidth, segHeight) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n if (segWidth === void 0) { segWidth = 10; }\n if (segHeight === void 0) { segHeight = 10; }\n var _this = _super.call(this) || this;\n _this.segWidth = segWidth;\n _this.segHeight = segHeight;\n _this.width = width;\n _this.height = height;\n _this.build();\n return _this;\n }\n /**\n * Refreshes plane coordinates\n * @private\n */\n PlaneGeometry.prototype.build = function () {\n var total = this.segWidth * this.segHeight;\n var verts = [];\n var uvs = [];\n var indices = [];\n var segmentsX = this.segWidth - 1;\n var segmentsY = this.segHeight - 1;\n var sizeX = (this.width) / segmentsX;\n var sizeY = (this.height) / segmentsY;\n for (var i = 0; i < total; i++) {\n var x = (i % this.segWidth);\n var y = ((i / this.segWidth) | 0);\n verts.push(x * sizeX, y * sizeY);\n uvs.push(x / segmentsX, y / segmentsY);\n }\n var totalSub = segmentsX * segmentsY;\n for (var i = 0; i < totalSub; i++) {\n var xpos = i % segmentsX;\n var ypos = (i / segmentsX) | 0;\n var value = (ypos * this.segWidth) + xpos;\n var value2 = (ypos * this.segWidth) + xpos + 1;\n var value3 = ((ypos + 1) * this.segWidth) + xpos;\n var value4 = ((ypos + 1) * this.segWidth) + xpos + 1;\n indices.push(value, value2, value3, value2, value4, value3);\n }\n this.buffers[0].data = new Float32Array(verts);\n this.buffers[1].data = new Float32Array(uvs);\n this.indexBuffer.data = new Uint16Array(indices);\n // ensure that the changes are uploaded\n this.buffers[0].update();\n this.buffers[1].update();\n this.indexBuffer.update();\n };\n return PlaneGeometry;\n}(MeshGeometry));\n\n/**\n * RopeGeometry allows you to draw a geometry across several points and then manipulate these points.\n *\n * ```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * const rope = new PIXI.RopeGeometry(100, points);\n * ```\n * @memberof PIXI\n */\nvar RopeGeometry = /** @class */ (function (_super) {\n __extends(RopeGeometry, _super);\n /**\n * @param width - The width (i.e., thickness) of the rope.\n * @param points - An array of {@link PIXI.Point} objects to construct this rope.\n * @param textureScale - By default the rope texture will be stretched to match\n * rope length. If textureScale is positive this value will be treated as a scaling\n * factor and the texture will preserve its aspect ratio instead. To create a tiling rope\n * set baseTexture.wrapMode to {@link PIXI.WRAP_MODES.REPEAT} and use a power of two texture,\n * then set textureScale=1 to keep the original texture pixel size.\n * In order to reduce alpha channel artifacts provide a larger texture and downsample -\n * i.e. set textureScale=0.5 to scale it down twice.\n */\n function RopeGeometry(width, points, textureScale) {\n if (width === void 0) { width = 200; }\n if (textureScale === void 0) { textureScale = 0; }\n var _this = _super.call(this, new Float32Array(points.length * 4), new Float32Array(points.length * 4), new Uint16Array((points.length - 1) * 6)) || this;\n _this.points = points;\n _this._width = width;\n _this.textureScale = textureScale;\n _this.build();\n return _this;\n }\n Object.defineProperty(RopeGeometry.prototype, \"width\", {\n /**\n * The width (i.e., thickness) of the rope.\n * @readonly\n */\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n /** Refreshes Rope indices and uvs */\n RopeGeometry.prototype.build = function () {\n var points = this.points;\n if (!points)\n { return; }\n var vertexBuffer = this.getBuffer('aVertexPosition');\n var uvBuffer = this.getBuffer('aTextureCoord');\n var indexBuffer = this.getIndex();\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1) {\n return;\n }\n // if the number of points has changed we will need to recreate the arraybuffers\n if (vertexBuffer.data.length / 4 !== points.length) {\n vertexBuffer.data = new Float32Array(points.length * 4);\n uvBuffer.data = new Float32Array(points.length * 4);\n indexBuffer.data = new Uint16Array((points.length - 1) * 6);\n }\n var uvs = uvBuffer.data;\n var indices = indexBuffer.data;\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n var amount = 0;\n var prev = points[0];\n var textureWidth = this._width * this.textureScale;\n var total = points.length; // - 1;\n for (var i = 0; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n if (this.textureScale > 0) {\n // calculate pixel distance from previous point\n var dx = prev.x - points[i].x;\n var dy = prev.y - points[i].y;\n var distance = Math.sqrt((dx * dx) + (dy * dy));\n prev = points[i];\n amount += distance / textureWidth;\n }\n else {\n // stretch texture\n amount = i / (total - 1);\n }\n uvs[index] = amount;\n uvs[index + 1] = 0;\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n }\n var indexCount = 0;\n for (var i = 0; i < total - 1; i++) {\n var index = i * 2;\n indices[indexCount++] = index;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 3;\n }\n // ensure that the changes are uploaded\n uvBuffer.update();\n indexBuffer.update();\n this.updateVertices();\n };\n /** refreshes vertices of Rope mesh */\n RopeGeometry.prototype.updateVertices = function () {\n var points = this.points;\n if (points.length < 1) {\n return;\n }\n var lastPoint = points[0];\n var nextPoint;\n var perpX = 0;\n var perpY = 0;\n var vertices = this.buffers[0].data;\n var total = points.length;\n for (var i = 0; i < total; i++) {\n var point = points[i];\n var index = i * 4;\n if (i < points.length - 1) {\n nextPoint = points[i + 1];\n }\n else {\n nextPoint = point;\n }\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n var perpLength = Math.sqrt((perpX * perpX) + (perpY * perpY));\n var num = this.textureScale > 0 ? this.textureScale * this._width / 2 : this._width / 2;\n perpX /= perpLength;\n perpY /= perpLength;\n perpX *= num;\n perpY *= num;\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n lastPoint = point;\n }\n this.buffers[0].update();\n };\n RopeGeometry.prototype.update = function () {\n if (this.textureScale > 0) {\n this.build(); // we need to update UVs\n }\n else {\n this.updateVertices();\n }\n };\n return RopeGeometry;\n}(MeshGeometry));\n\n/**\n * The rope allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.SimpleRope(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n * @memberof PIXI\n */\nvar SimpleRope = /** @class */ (function (_super) {\n __extends(SimpleRope, _super);\n /**\n * @param texture - The texture to use on the rope.\n * @param points - An array of {@link PIXI.Point} objects to construct this rope.\n * @param {number} textureScale - Optional. Positive values scale rope texture\n * keeping its aspect ratio. You can reduce alpha channel artifacts by providing a larger texture\n * and downsampling here. If set to zero, texture will be stretched instead.\n */\n function SimpleRope(texture, points, textureScale) {\n if (textureScale === void 0) { textureScale = 0; }\n var _this = this;\n var ropeGeometry = new RopeGeometry(texture.height, points, textureScale);\n var meshMaterial = new MeshMaterial(texture);\n if (textureScale > 0) {\n // attempt to set UV wrapping, will fail on non-power of two textures\n texture.baseTexture.wrapMode = WRAP_MODES.REPEAT;\n }\n _this = _super.call(this, ropeGeometry, meshMaterial) || this;\n /**\n * re-calculate vertices by rope points each frame\n * @member {boolean}\n */\n _this.autoUpdate = true;\n return _this;\n }\n SimpleRope.prototype._render = function (renderer) {\n var geometry = this.geometry;\n if (this.autoUpdate || geometry._width !== this.shader.texture.height) {\n geometry._width = this.shader.texture.height;\n geometry.update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleRope;\n}(Mesh));\n\n/**\n * The SimplePlane allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let SimplePlane = new PIXI.SimplePlane(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n * @memberof PIXI\n */\nvar SimplePlane = /** @class */ (function (_super) {\n __extends(SimplePlane, _super);\n /**\n * @param texture - The texture to use on the SimplePlane.\n * @param verticesX - The number of vertices in the x-axis\n * @param verticesY - The number of vertices in the y-axis\n */\n function SimplePlane(texture, verticesX, verticesY) {\n var _this = this;\n var planeGeometry = new PlaneGeometry(texture.width, texture.height, verticesX, verticesY);\n var meshMaterial = new MeshMaterial(Texture.WHITE);\n _this = _super.call(this, planeGeometry, meshMaterial) || this;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n _this.autoResize = true;\n return _this;\n }\n /**\n * Method used for overrides, to do something in case texture frame was changed.\n * Meshes based on plane can override it and change more details based on texture.\n */\n SimplePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n var geometry = this.geometry;\n var _a = this.shader.texture, width = _a.width, height = _a.height;\n if (this.autoResize && (geometry.width !== width || geometry.height !== height)) {\n geometry.width = this.shader.texture.width;\n geometry.height = this.shader.texture.height;\n geometry.build();\n }\n };\n Object.defineProperty(SimplePlane.prototype, \"texture\", {\n get: function () {\n return this.shader.texture;\n },\n set: function (value) {\n // Track texture same way sprite does.\n // For generated meshes like NineSlicePlane it can change the geometry.\n // Unfortunately, this method might not work if you directly change texture in material.\n if (this.shader.texture === value) {\n return;\n }\n this.shader.texture = value;\n this._textureID = -1;\n if (value.baseTexture.valid) {\n this.textureUpdated();\n }\n else {\n value.once('update', this.textureUpdated, this);\n }\n },\n enumerable: false,\n configurable: true\n });\n SimplePlane.prototype._render = function (renderer) {\n if (this._textureID !== this.shader.texture._updateID) {\n this.textureUpdated();\n }\n _super.prototype._render.call(this, renderer);\n };\n SimplePlane.prototype.destroy = function (options) {\n this.shader.texture.off('update', this.textureUpdated, this);\n _super.prototype.destroy.call(this, options);\n };\n return SimplePlane;\n}(Mesh));\n\n/**\n * The Simple Mesh class mimics Mesh in PixiJS v4, providing easy-to-use constructor arguments.\n * For more robust customization, use {@link PIXI.Mesh}.\n * @memberof PIXI\n */\nvar SimpleMesh = /** @class */ (function (_super) {\n __extends(SimpleMesh, _super);\n /**\n * @param texture - The texture to use\n * @param {Float32Array} [vertices] - if you want to specify the vertices\n * @param {Float32Array} [uvs] - if you want to specify the uvs\n * @param {Uint16Array} [indices] - if you want to specify the indices\n * @param drawMode - the drawMode, can be any of the Mesh.DRAW_MODES consts\n */\n function SimpleMesh(texture, vertices, uvs, indices, drawMode) {\n if (texture === void 0) { texture = Texture.EMPTY; }\n var _this = this;\n var geometry = new MeshGeometry(vertices, uvs, indices);\n geometry.getBuffer('aVertexPosition').static = false;\n var meshMaterial = new MeshMaterial(texture);\n _this = _super.call(this, geometry, meshMaterial, null, drawMode) || this;\n _this.autoUpdate = true;\n return _this;\n }\n Object.defineProperty(SimpleMesh.prototype, \"vertices\", {\n /**\n * Collection of vertices data.\n * @type {Float32Array}\n */\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n SimpleMesh.prototype._render = function (renderer) {\n if (this.autoUpdate) {\n this.geometry.getBuffer('aVertexPosition').update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleMesh;\n}(Mesh));\n\nvar DEFAULT_BORDER_SIZE = 10;\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.from('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n * ```\n *
\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * 
\n * @memberof PIXI\n */\nvar NineSlicePlane = /** @class */ (function (_super) {\n __extends(NineSlicePlane, _super);\n /**\n * @param texture - The texture to use on the NineSlicePlane.\n * @param {number} [leftWidth=10] - size of the left vertical bar (A)\n * @param {number} [topHeight=10] - size of the top horizontal bar (C)\n * @param {number} [rightWidth=10] - size of the right vertical bar (B)\n * @param {number} [bottomHeight=10] - size of the bottom horizontal bar (D)\n */\n function NineSlicePlane(texture, leftWidth, topHeight, rightWidth, bottomHeight) {\n if (leftWidth === void 0) { leftWidth = DEFAULT_BORDER_SIZE; }\n if (topHeight === void 0) { topHeight = DEFAULT_BORDER_SIZE; }\n if (rightWidth === void 0) { rightWidth = DEFAULT_BORDER_SIZE; }\n if (bottomHeight === void 0) { bottomHeight = DEFAULT_BORDER_SIZE; }\n var _this = _super.call(this, Texture.WHITE, 4, 4) || this;\n _this._origWidth = texture.orig.width;\n _this._origHeight = texture.orig.height;\n /** The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n _this._width = _this._origWidth;\n /** The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n _this._height = _this._origHeight;\n _this._leftWidth = leftWidth;\n _this._rightWidth = rightWidth;\n _this._topHeight = topHeight;\n _this._bottomHeight = bottomHeight;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n return _this;\n }\n NineSlicePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n this._refresh();\n };\n Object.defineProperty(NineSlicePlane.prototype, \"vertices\", {\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Updates the horizontal vertices. */\n NineSlicePlane.prototype.updateHorizontalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight * scale;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - (this._bottomHeight * scale);\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n };\n /** Updates the vertical vertices. */\n NineSlicePlane.prototype.updateVerticalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth * scale;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - (this._rightWidth * scale);\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n };\n /**\n * Returns the smaller of a set of vertical and horizontal scale of nine slice corners.\n * @returns Smaller number of vertical and horizontal scale.\n */\n NineSlicePlane.prototype._getMinScale = function () {\n var w = this._leftWidth + this._rightWidth;\n var scaleW = this._width > w ? 1.0 : this._width / w;\n var h = this._topHeight + this._bottomHeight;\n var scaleH = this._height > h ? 1.0 : this._height / h;\n var scale = Math.min(scaleW, scaleH);\n return scale;\n };\n Object.defineProperty(NineSlicePlane.prototype, \"width\", {\n /** The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"height\", {\n /** The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"leftWidth\", {\n /** The width of the left column. */\n get: function () {\n return this._leftWidth;\n },\n set: function (value) {\n this._leftWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"rightWidth\", {\n /** The width of the right column. */\n get: function () {\n return this._rightWidth;\n },\n set: function (value) {\n this._rightWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"topHeight\", {\n /** The height of the top row. */\n get: function () {\n return this._topHeight;\n },\n set: function (value) {\n this._topHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"bottomHeight\", {\n /** The height of the bottom row. */\n get: function () {\n return this._bottomHeight;\n },\n set: function (value) {\n this._bottomHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n /** Refreshes NineSlicePlane coords. All of them. */\n NineSlicePlane.prototype._refresh = function () {\n var texture = this.texture;\n var uvs = this.geometry.buffers[1].data;\n this._origWidth = texture.orig.width;\n this._origHeight = texture.orig.height;\n var _uvw = 1.0 / this._origWidth;\n var _uvh = 1.0 / this._origHeight;\n uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0;\n uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0;\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - (_uvw * this._rightWidth);\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - (_uvh * this._bottomHeight);\n this.updateHorizontalVertices();\n this.updateVerticalVertices();\n this.geometry.buffers[0].update();\n this.geometry.buffers[1].update();\n };\n return NineSlicePlane;\n}(SimplePlane));\n\nexport { NineSlicePlane, PlaneGeometry, RopeGeometry, SimpleMesh, SimplePlane, SimpleRope };\n//# sourceMappingURL=mesh-extras.mjs.map\n","/*!\n * @pixi/sprite-animated - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/sprite-animated is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n * let texture = PIXI.Texture.from(alienImages[i]);\n * textureArray.push(texture);\n * };\n *\n * let animatedSprite = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet}\n * containing the animation definitions:\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * animatedSprite = new PIXI.AnimatedSprite(sheet.animations[\"image_sequence\"]);\n * ...\n * }\n * ```\n * @memberof PIXI\n */\nvar AnimatedSprite = /** @class */ (function (_super) {\n __extends(AnimatedSprite, _super);\n /**\n * @param textures - An array of {@link PIXI.Texture} or frame\n * objects that make up the animation.\n * @param {boolean} [autoUpdate=true] - Whether to use PIXI.Ticker.shared to auto update animation time.\n */\n function AnimatedSprite(textures, autoUpdate) {\n if (autoUpdate === void 0) { autoUpdate = true; }\n var _this = _super.call(this, textures[0] instanceof Texture ? textures[0] : textures[0].texture) || this;\n _this._textures = null;\n _this._durations = null;\n _this._autoUpdate = autoUpdate;\n _this._isConnectedToTicker = false;\n _this.animationSpeed = 1;\n _this.loop = true;\n _this.updateAnchor = false;\n _this.onComplete = null;\n _this.onFrameChange = null;\n _this.onLoop = null;\n _this._currentTime = 0;\n _this._playing = false;\n _this._previousFrame = null;\n _this.textures = textures;\n return _this;\n }\n /** Stops the AnimatedSprite. */\n AnimatedSprite.prototype.stop = function () {\n if (!this._playing) {\n return;\n }\n this._playing = false;\n if (this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n };\n /** Plays the AnimatedSprite. */\n AnimatedSprite.prototype.play = function () {\n if (this._playing) {\n return;\n }\n this._playing = true;\n if (this._autoUpdate && !this._isConnectedToTicker) {\n Ticker.shared.add(this.update, this, UPDATE_PRIORITY.HIGH);\n this._isConnectedToTicker = true;\n }\n };\n /**\n * Stops the AnimatedSprite and goes to a specific frame.\n * @param frameNumber - Frame index to stop at.\n */\n AnimatedSprite.prototype.gotoAndStop = function (frameNumber) {\n this.stop();\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n /**\n * Goes to a specific frame and begins playing the AnimatedSprite.\n * @param frameNumber - Frame index to start at.\n */\n AnimatedSprite.prototype.gotoAndPlay = function (frameNumber) {\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n this.play();\n };\n /**\n * Updates the object transform for rendering.\n * @param deltaTime - Time since last tick.\n */\n AnimatedSprite.prototype.update = function (deltaTime) {\n if (!this._playing) {\n return;\n }\n var elapsed = this.animationSpeed * deltaTime;\n var previousFrame = this.currentFrame;\n if (this._durations !== null) {\n var lag = this._currentTime % 1 * this._durations[this.currentFrame];\n lag += elapsed / 60 * 1000;\n while (lag < 0) {\n this._currentTime--;\n lag += this._durations[this.currentFrame];\n }\n var sign = Math.sign(this.animationSpeed * deltaTime);\n this._currentTime = Math.floor(this._currentTime);\n while (lag >= this._durations[this.currentFrame]) {\n lag -= this._durations[this.currentFrame] * sign;\n this._currentTime += sign;\n }\n this._currentTime += lag / this._durations[this.currentFrame];\n }\n else {\n this._currentTime += elapsed;\n }\n if (this._currentTime < 0 && !this.loop) {\n this.gotoAndStop(0);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (this._currentTime >= this._textures.length && !this.loop) {\n this.gotoAndStop(this._textures.length - 1);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (previousFrame !== this.currentFrame) {\n if (this.loop && this.onLoop) {\n if (this.animationSpeed > 0 && this.currentFrame < previousFrame) {\n this.onLoop();\n }\n else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) {\n this.onLoop();\n }\n }\n this.updateTexture();\n }\n };\n /** Updates the displayed texture to match the current frame index. */\n AnimatedSprite.prototype.updateTexture = function () {\n var currentFrame = this.currentFrame;\n if (this._previousFrame === currentFrame) {\n return;\n }\n this._previousFrame = currentFrame;\n this._texture = this._textures[currentFrame];\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n this.uvs = this._texture._uvs.uvsFloat32;\n if (this.updateAnchor) {\n this._anchor.copyFrom(this._texture.defaultAnchor);\n }\n if (this.onFrameChange) {\n this.onFrameChange(this.currentFrame);\n }\n };\n /**\n * Stops the AnimatedSprite and destroys it.\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * @param {boolean} [options.children=false] - If set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well.\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well.\n */\n AnimatedSprite.prototype.destroy = function (options) {\n this.stop();\n _super.prototype.destroy.call(this, options);\n this.onComplete = null;\n this.onFrameChange = null;\n this.onLoop = null;\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of frame ids.\n * @param frames - The array of frames ids the AnimatedSprite will use as its texture frames.\n * @returns - The new animated sprite with the specified frames.\n */\n AnimatedSprite.fromFrames = function (frames) {\n var textures = [];\n for (var i = 0; i < frames.length; ++i) {\n textures.push(Texture.from(frames[i]));\n }\n return new AnimatedSprite(textures);\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of image ids.\n * @param images - The array of image urls the AnimatedSprite will use as its texture frames.\n * @returns The new animate sprite with the specified images as frames.\n */\n AnimatedSprite.fromImages = function (images) {\n var textures = [];\n for (var i = 0; i < images.length; ++i) {\n textures.push(Texture.from(images[i]));\n }\n return new AnimatedSprite(textures);\n };\n Object.defineProperty(AnimatedSprite.prototype, \"totalFrames\", {\n /**\n * The total number of frames in the AnimatedSprite. This is the same as number of textures\n * assigned to the AnimatedSprite.\n * @readonly\n * @default 0\n */\n get: function () {\n return this._textures.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"textures\", {\n /** The array of textures used for this AnimatedSprite. */\n get: function () {\n return this._textures;\n },\n set: function (value) {\n if (value[0] instanceof Texture) {\n this._textures = value;\n this._durations = null;\n }\n else {\n this._textures = [];\n this._durations = [];\n for (var i = 0; i < value.length; i++) {\n this._textures.push(value[i].texture);\n this._durations.push(value[i].time);\n }\n }\n this._previousFrame = null;\n this.gotoAndStop(0);\n this.updateTexture();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"currentFrame\", {\n /**\n * The AnimatedSprites current frame index.\n * @readonly\n */\n get: function () {\n var currentFrame = Math.floor(this._currentTime) % this._textures.length;\n if (currentFrame < 0) {\n currentFrame += this._textures.length;\n }\n return currentFrame;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"playing\", {\n /**\n * Indicates if the AnimatedSprite is currently playing.\n * @readonly\n */\n get: function () {\n return this._playing;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"autoUpdate\", {\n /** Whether to use PIXI.Ticker.shared to auto update animation time. */\n get: function () {\n return this._autoUpdate;\n },\n set: function (value) {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n if (!this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n else if (this._autoUpdate && !this._isConnectedToTicker && this._playing) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return AnimatedSprite;\n}(Sprite));\n\nexport { AnimatedSprite };\n//# sourceMappingURL=sprite-animated.mjs.map\n","/*!\n * pixi.js - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * pixi.js is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport '@pixi/polyfill';\nimport * as utils from '@pixi/utils';\nexport { utils };\nimport { AccessibilityManager } from '@pixi/accessibility';\nexport * from '@pixi/accessibility';\nimport { InteractionManager } from '@pixi/interaction';\nexport * from '@pixi/interaction';\nimport { extensions, BatchRenderer } from '@pixi/core';\nexport * from '@pixi/core';\nimport { Extract } from '@pixi/extract';\nexport * from '@pixi/extract';\nimport { AppLoaderPlugin } from '@pixi/loaders';\nexport * from '@pixi/loaders';\nimport { CompressedTextureLoader, DDSLoader, KTXLoader } from '@pixi/compressed-textures';\nexport * from '@pixi/compressed-textures';\nimport { ParticleRenderer } from '@pixi/particle-container';\nexport * from '@pixi/particle-container';\nimport { Prepare } from '@pixi/prepare';\nexport * from '@pixi/prepare';\nimport { SpritesheetLoader } from '@pixi/spritesheet';\nexport * from '@pixi/spritesheet';\nimport { TilingSpriteRenderer } from '@pixi/sprite-tiling';\nexport * from '@pixi/sprite-tiling';\nimport { BitmapFontLoader } from '@pixi/text-bitmap';\nexport * from '@pixi/text-bitmap';\nimport { TickerPlugin } from '@pixi/ticker';\nexport * from '@pixi/ticker';\nimport { AlphaFilter } from '@pixi/filter-alpha';\nimport { BlurFilter, BlurFilterPass } from '@pixi/filter-blur';\nimport { ColorMatrixFilter } from '@pixi/filter-color-matrix';\nimport { DisplacementFilter } from '@pixi/filter-displacement';\nimport { FXAAFilter } from '@pixi/filter-fxaa';\nimport { NoiseFilter } from '@pixi/filter-noise';\nimport '@pixi/mixin-cache-as-bitmap';\nimport '@pixi/mixin-get-child-by-name';\nimport '@pixi/mixin-get-global-position';\nexport * from '@pixi/app';\nexport * from '@pixi/constants';\nexport * from '@pixi/display';\nexport * from '@pixi/graphics';\nexport * from '@pixi/math';\nexport * from '@pixi/mesh';\nexport * from '@pixi/mesh-extras';\nexport * from '@pixi/runner';\nexport * from '@pixi/sprite';\nexport * from '@pixi/sprite-animated';\nexport * from '@pixi/text';\nexport * from '@pixi/settings';\n\nextensions.add(\n// Install renderer plugins\nAccessibilityManager, Extract, InteractionManager, ParticleRenderer, Prepare, BatchRenderer, TilingSpriteRenderer, \n// Install loader plugins\nBitmapFontLoader, CompressedTextureLoader, DDSLoader, KTXLoader, SpritesheetLoader, \n// Install application plugins\nTickerPlugin, AppLoaderPlugin);\n/**\n * This namespace contains WebGL-only display filters that can be applied\n * to DisplayObjects using the {@link PIXI.DisplayObject#filters filters} property.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters\n * can be downloaded {@link https://github.com/pixijs/pixi-filters here} from the\n * PixiJS Filters repository.\n *\n * All filters must extend {@link PIXI.Filter}.\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n *\n * // Draw a green rectangle\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add a blur filter\n * rect.filters = [new PIXI.filters.BlurFilter()];\n *\n * // Display rectangle\n * app.stage.addChild(rect);\n * document.body.appendChild(app.view);\n * @namespace PIXI.filters\n */\nvar filters = {\n AlphaFilter: AlphaFilter,\n BlurFilter: BlurFilter,\n BlurFilterPass: BlurFilterPass,\n ColorMatrixFilter: ColorMatrixFilter,\n DisplacementFilter: DisplacementFilter,\n FXAAFilter: FXAAFilter,\n NoiseFilter: NoiseFilter,\n};\n\nexport { filters };\n//# sourceMappingURL=pixi.mjs.map\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","/*!\n * @pixi/filter-old-film - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-old-film is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\n\\nuniform float sepia;\\nuniform float noise;\\nuniform float noiseSize;\\nuniform float scratch;\\nuniform float scratchDensity;\\nuniform float scratchWidth;\\nuniform float vignetting;\\nuniform float vignettingAlpha;\\nuniform float vignettingBlur;\\nuniform float seed;\\n\\nconst float SQRT_2 = 1.414213;\\nconst vec3 SEPIA_RGB = vec3(112.0 / 255.0, 66.0 / 255.0, 20.0 / 255.0);\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvec3 Overlay(vec3 src, vec3 dst)\\n{\\n // if (dst <= 0.5) then: 2 * src * dst\\n // if (dst > 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\\n}\\n\\n\\nvoid main()\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n vec3 color = gl_FragColor.rgb;\\n\\n if (sepia > 0.0)\\n {\\n float gray = (color.x + color.y + color.z) / 3.0;\\n vec3 grayscale = vec3(gray);\\n\\n color = Overlay(SEPIA_RGB, grayscale);\\n\\n color = grayscale + sepia * (color - grayscale);\\n }\\n\\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\\n\\n if (vignetting > 0.0)\\n {\\n float outter = SQRT_2 - vignetting * SQRT_2;\\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\\n dir.y *= dimensions.y / dimensions.x;\\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\\n }\\n\\n if (scratchDensity > seed && scratch != 0.0)\\n {\\n float phase = seed * 256.0;\\n float s = mod(floor(phase), 2.0);\\n float dist = 1.0 / scratchDensity;\\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\\n if (d < seed * 0.6 + 0.4)\\n {\\n highp float period = scratchDensity * 10.0;\\n\\n float xx = coord.x * period + phase;\\n float aa = abs(mod(xx, 0.5) * 4.0);\\n float bb = mod(floor(xx / 0.5), 2.0);\\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\\n\\n float kk = 2.0 * period;\\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\\n float dh = dw * kk;\\n\\n float tine = (yy - (2.0 - dh));\\n\\n if (tine > 0.0) {\\n float _sign = sign(scratch);\\n\\n tine = s * tine / period + scratch + 0.1;\\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\\n\\n color.rgb *= tine;\\n }\\n }\\n }\\n\\n if (noise > 0.0 && noiseSize > 0.0)\\n {\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\\n // float _noise = snoise(d) * 0.5;\\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\\n color += _noise * noise;\\n }\\n\\n gl_FragColor.rgb = color;\\n}\\n\";\n\n/**\n * The OldFilmFilter applies a Old film effect to an object.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/old-film.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-old-film|@pixi/filter-old-film}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar OldFilmFilter = /** @class */ (function (_super) {\n __extends(OldFilmFilter, _super);\n /**\n * @param {object|number} [options] - The optional parameters of old film effect.\n * When options is a number , it will be `seed`\n * @param {number} [options.sepia=0.3] - The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less, and a value of\n * `0` produces no sepia effect\n * @param {number} [options.noise=0.3] - Opacity/intensity of the noise effect between `0` and `1`\n * @param {number} [options.noiseSize=1.0] - The size of the noise particles\n * @param {number} [options.scratch=0.5] - How often scratches appear\n * @param {number} [options.scratchDensity=0.3] - The density of the number of scratches\n * @param {number} [options.scratchWidth=1.0] - The width of the scratches\n * @param {number} [options.vignetting=0.3] - The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @param {number} [options.vignettingAlpha=1.0] - Amount of opacity of vignette\n * @param {number} [options.vignettingBlur=0.3] - Blur intensity of the vignette\n * @param {number} [seed=0] - A see value to apply to the random noise generation\n */\n function OldFilmFilter(options, seed) {\n if (seed === void 0) { seed = 0; }\n var _this = _super.call(this, vertex, fragment) || this;\n /** A see value to apply to the random noise generation */\n _this.seed = 0;\n _this.uniforms.dimensions = new Float32Array(2);\n if (typeof options === 'number') {\n _this.seed = options;\n options = undefined;\n }\n else {\n _this.seed = seed;\n }\n Object.assign(_this, OldFilmFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n OldFilmFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a, _b;\n this.uniforms.dimensions[0] = (_a = input.filterFrame) === null || _a === void 0 ? void 0 : _a.width;\n this.uniforms.dimensions[1] = (_b = input.filterFrame) === null || _b === void 0 ? void 0 : _b.height;\n // named `seed` because in the most programming languages,\n // `random` used for \"the function for generating random value\".\n this.uniforms.seed = this.seed;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(OldFilmFilter.prototype, \"sepia\", {\n get: function () {\n return this.uniforms.sepia;\n },\n /**\n * The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less,\n * and a value of `0` produces no sepia effect\n * @default 0\n */\n set: function (value) {\n this.uniforms.sepia = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"noise\", {\n get: function () {\n return this.uniforms.noise;\n },\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0\n */\n set: function (value) {\n this.uniforms.noise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"noiseSize\", {\n get: function () {\n return this.uniforms.noiseSize;\n },\n /**\n * The size of the noise particles\n * @default 0\n */\n set: function (value) {\n this.uniforms.noiseSize = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"scratch\", {\n get: function () {\n return this.uniforms.scratch;\n },\n /**\n * How often scratches appear\n * @default 0\n */\n set: function (value) {\n this.uniforms.scratch = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"scratchDensity\", {\n get: function () {\n return this.uniforms.scratchDensity;\n },\n /**\n * The density of the number of scratches\n * @default 0\n */\n set: function (value) {\n this.uniforms.scratchDensity = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"scratchWidth\", {\n get: function () {\n return this.uniforms.scratchWidth;\n },\n /**\n * The width of the scratches\n * @default 0\n */\n set: function (value) {\n this.uniforms.scratchWidth = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"vignetting\", {\n get: function () {\n return this.uniforms.vignetting;\n },\n /**\n * The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignetting = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"vignettingAlpha\", {\n get: function () {\n return this.uniforms.vignettingAlpha;\n },\n /**\n * Amount of opacity of vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"vignettingBlur\", {\n get: function () {\n return this.uniforms.vignettingBlur;\n },\n /**\n * Blur intensity of the vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options */\n OldFilmFilter.defaults = {\n sepia: 0.3,\n noise: 0.3,\n noiseSize: 1.0,\n scratch: 0.5,\n scratchDensity: 0.3,\n scratchWidth: 1.0,\n vignetting: 0.3,\n vignettingAlpha: 1.0,\n vignettingBlur: 0.3,\n };\n return OldFilmFilter;\n}(Filter));\n\nexport { OldFilmFilter };\n//# sourceMappingURL=filter-old-film.esm.mjs.map\n","/*!\n * @pixi/filter-dot - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-dot is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform vec4 filterArea;\\nuniform sampler2D uSampler;\\n\\nuniform float angle;\\nuniform float scale;\\n\\nfloat pattern()\\n{\\n float s = sin(angle), c = cos(angle);\\n vec2 tex = vTextureCoord * filterArea.xy;\\n vec2 point = vec2(\\n c * tex.x - s * tex.y,\\n s * tex.x + c * tex.y\\n ) * scale;\\n return (sin(point.x) * sin(point.y)) * 4.0;\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float average = (color.r + color.g + color.b) / 3.0;\\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\\n}\\n\";\n\n// @author Mat Groves http://matgroves.com/ @Doormat23\n// original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js\n/**\n * This filter applies a dotscreen effect making display objects appear to be made out of\n * black and white halftone dots like an old printer.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/dot.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-dot|@pixi/filter-dot}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar DotFilter = /** @class */ (function (_super) {\n __extends(DotFilter, _super);\n /**\n * @param {number} [scale=1] - The scale of the effect.\n * @param {number} [angle=5] - The radius of the effect.\n */\n function DotFilter(scale, angle) {\n if (scale === void 0) { scale = 1; }\n if (angle === void 0) { angle = 5; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.scale = scale;\n _this.angle = angle;\n return _this;\n }\n Object.defineProperty(DotFilter.prototype, \"scale\", {\n /**\n * The scale of the effect.\n * @default 1\n */\n get: function () {\n return this.uniforms.scale;\n },\n set: function (value) {\n this.uniforms.scale = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DotFilter.prototype, \"angle\", {\n /**\n * The radius of the effect.\n * @default 5\n */\n get: function () {\n return this.uniforms.angle;\n },\n set: function (value) {\n this.uniforms.angle = value;\n },\n enumerable: false,\n configurable: true\n });\n return DotFilter;\n}(Filter));\n\nexport { DotFilter };\n//# sourceMappingURL=filter-dot.esm.mjs.map\n","/*!\n * @pixi/filter-reflection - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-reflection is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\n\\nuniform bool mirror;\\nuniform float boundary;\\nuniform vec2 amplitude;\\nuniform vec2 waveLength;\\nuniform vec2 alpha;\\nuniform float time;\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main(void)\\n{\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n vec2 coord = pixelCoord / dimensions;\\n\\n if (coord.y < boundary) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n\\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\\n float areaY = boundary * dimensions.y / filterArea.y;\\n float v = areaY + areaY - vTextureCoord.y;\\n float y = mirror ? v : vTextureCoord.y;\\n\\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\\n\\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\\n x = clamp(x, filterClamp.x, filterClamp.z);\\n\\n vec4 color = texture2D(uSampler, vec2(x, y));\\n\\n gl_FragColor = color * _alpha;\\n}\\n\";\n\n/**\n * Applies a reflection effect to simulate the reflection on water with waves.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/reflection.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-reflection|@pixi/filter-reflection}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ReflectionFilter = /** @class */ (function (_super) {\n __extends(ReflectionFilter, _super);\n /**\n * @param {object} [options] - The optional parameters of Reflection effect.\n * @param {number} [options.mirror=true] - `true` to reflect the image, `false` for waves-only\n * @param {number} [options.boundary=0.5] - Vertical position of the reflection point, default is 50% (middle)\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection.\n * @param {number} [options.amplitude=[0, 20]] - Starting and ending amplitude of waves\n * @param {number} [options.waveLength=[30, 100]] - Starting and ending length of waves\n * @param {number} [options.alpha=[1, 1]] - Starting and ending alpha values\n * @param {number} [options.time=0] - Time for animating position of waves\n */\n function ReflectionFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** Time for animating position of waves */\n _this.time = 0;\n _this.uniforms.amplitude = new Float32Array(2);\n _this.uniforms.waveLength = new Float32Array(2);\n _this.uniforms.alpha = new Float32Array(2);\n _this.uniforms.dimensions = new Float32Array(2);\n Object.assign(_this, ReflectionFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n ReflectionFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a, _b;\n this.uniforms.dimensions[0] = (_a = input.filterFrame) === null || _a === void 0 ? void 0 : _a.width;\n this.uniforms.dimensions[1] = (_b = input.filterFrame) === null || _b === void 0 ? void 0 : _b.height;\n this.uniforms.time = this.time;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(ReflectionFilter.prototype, \"mirror\", {\n get: function () {\n return this.uniforms.mirror;\n },\n /**\n * `true` to reflect the image, `false` for waves-only\n * @default true\n */\n set: function (value) {\n this.uniforms.mirror = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"boundary\", {\n get: function () {\n return this.uniforms.boundary;\n },\n /**\n * Vertical position of the reflection point, default is 50% (middle)\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection.\n * @default 0.5\n */\n set: function (value) {\n this.uniforms.boundary = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"amplitude\", {\n get: function () {\n return this.uniforms.amplitude;\n },\n /**\n * Starting and ending amplitude of waves\n * @member {number[]}\n * @default [0, 20]\n */\n set: function (value) {\n this.uniforms.amplitude[0] = value[0];\n this.uniforms.amplitude[1] = value[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"waveLength\", {\n get: function () {\n return this.uniforms.waveLength;\n },\n /**\n * Starting and ending length of waves\n * @member {number[]}\n * @default [30, 100]\n */\n set: function (value) {\n this.uniforms.waveLength[0] = value[0];\n this.uniforms.waveLength[1] = value[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"alpha\", {\n get: function () {\n return this.uniforms.alpha;\n },\n /**\n * Starting and ending alpha values\n * @member {number[]}\n * @default [1, 1]\n */\n set: function (value) {\n this.uniforms.alpha[0] = value[0];\n this.uniforms.alpha[1] = value[1];\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options */\n ReflectionFilter.defaults = {\n mirror: true,\n boundary: 0.5,\n amplitude: [0, 20],\n waveLength: [30, 100],\n alpha: [1, 1],\n time: 0,\n };\n return ReflectionFilter;\n}(Filter));\n\nexport { ReflectionFilter };\n//# sourceMappingURL=filter-reflection.esm.mjs.map\n","/*!\n * @pixi/filter-glitch - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-glitch is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, Filter } from '@pixi/core';\nimport { SCALE_MODES } from '@pixi/constants';\nimport { DEG_TO_RAD } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"// precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\nuniform float aspect;\\n\\nuniform sampler2D displacementMap;\\nuniform float offset;\\nuniform float sinDir;\\nuniform float cosDir;\\nuniform int fillMode;\\n\\nuniform float seed;\\nuniform vec2 red;\\nuniform vec2 green;\\nuniform vec2 blue;\\n\\nconst int TRANSPARENT = 0;\\nconst int ORIGINAL = 1;\\nconst int LOOP = 2;\\nconst int CLAMP = 3;\\nconst int MIRROR = 4;\\n\\nvoid main(void)\\n{\\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\\n\\n if (coord.x > 1.0 || coord.y > 1.0) {\\n return;\\n }\\n\\n float cx = coord.x - 0.5;\\n float cy = (coord.y - 0.5) * aspect;\\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\\n\\n // displacementMap: repeat\\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\\n\\n // displacementMap: mirror\\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\\n\\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\\n\\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\\n\\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\\n\\n if (fillMode == CLAMP) {\\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n } else {\\n if( coord.x > filterClamp.z ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.x -= filterClamp.z;\\n } else if (fillMode == MIRROR) {\\n coord.x = filterClamp.z * 2.0 - coord.x;\\n }\\n } else if( coord.x < filterClamp.x ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.x += filterClamp.z;\\n } else if (fillMode == MIRROR) {\\n coord.x *= -filterClamp.z;\\n }\\n }\\n\\n if( coord.y > filterClamp.w ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.y -= filterClamp.w;\\n } else if (fillMode == MIRROR) {\\n coord.y = filterClamp.w * 2.0 - coord.y;\\n }\\n } else if( coord.y < filterClamp.y ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.y += filterClamp.w;\\n } else if (fillMode == MIRROR) {\\n coord.y *= -filterClamp.w;\\n }\\n }\\n }\\n\\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\\n gl_FragColor.a = texture2D(uSampler, coord).a;\\n}\\n\";\n\n/**\n * The GlitchFilter applies a glitch effect to an object.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/glitch.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-glitch|@pixi/filter-glitch}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar GlitchFilter = /** @class */ (function (_super) {\n __extends(GlitchFilter, _super);\n /**\n * @param {object} [options] - The more optional parameters of the filter.\n * @param {number} [options.slices=5] - The maximum number of slices.\n * @param {number} [options.offset=100] - The maximum offset amount of slices.\n * @param {number} [options.direction=0] - The angle in degree of the offset of slices.\n * @param {number} [options.fillMode=0] - The fill mode of the space after the offset. Acceptable values:\n * - `0` {@link PIXI.filters.GlitchFilter.TRANSPARENT TRANSPARENT}\n * - `1` {@link PIXI.filters.GlitchFilter.ORIGINAL ORIGINAL}\n * - `2` {@link PIXI.filters.GlitchFilter.LOOP LOOP}\n * - `3` {@link PIXI.filters.GlitchFilter.CLAMP CLAMP}\n * - `4` {@link PIXI.filters.GlitchFilter.MIRROR MIRROR}\n * @param {number} [options.seed=0] - A seed value for randomizing glitch effect.\n * @param {boolean} [options.average=false] - `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n * @param {number} [options.minSize=8] - Minimum size of individual slice. Segment of total `sampleSize`\n * @param {number} [options.sampleSize=512] - The resolution of the displacement map texture.\n * @param {number[]} [options.red=[0,0]] - Red channel offset\n * @param {number[]} [options.green=[0,0]] - Green channel offset.\n * @param {number[]} [options.blue=[0,0]] - Blue channel offset.\n */\n function GlitchFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** The maximum offset value for each of the slices. */\n _this.offset = 100;\n /** The fill mode of the space after the offset. */\n _this.fillMode = GlitchFilter.TRANSPARENT;\n /**\n * `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n */\n _this.average = false;\n /**\n * A seed value for randomizing color offset. Animating\n * this value to `Math.random()` produces a twitching effect.\n */\n _this.seed = 0;\n /** Minimum size of slices as a portion of the `sampleSize` */\n _this.minSize = 8;\n /** Height of the displacement map canvas. */\n _this.sampleSize = 512;\n /** Internal number of slices */\n _this._slices = 0;\n _this._offsets = new Float32Array(1);\n _this._sizes = new Float32Array(1);\n /** direction is actually a setter for uniform.cosDir and uniform.sinDir.\n * Must be initialized to something different than the default value.\n */\n _this._direction = -1;\n _this.uniforms.dimensions = new Float32Array(2);\n _this._canvas = document.createElement('canvas');\n _this._canvas.width = 4;\n _this._canvas.height = _this.sampleSize;\n _this.texture = Texture.from(_this._canvas, { scaleMode: SCALE_MODES.NEAREST });\n Object.assign(_this, GlitchFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n GlitchFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n this.uniforms.aspect = height / width;\n this.uniforms.seed = this.seed;\n this.uniforms.offset = this.offset;\n this.uniforms.fillMode = this.fillMode;\n filterManager.applyFilter(this, input, output, clear);\n };\n /**\n * Randomize the slices size (heights).\n *\n * @private\n */\n GlitchFilter.prototype._randomizeSizes = function () {\n var arr = this._sizes;\n var last = this._slices - 1;\n var size = this.sampleSize;\n var min = Math.min(this.minSize / size, 0.9 / this._slices);\n if (this.average) {\n var count = this._slices;\n var rest = 1;\n for (var i = 0; i < last; i++) {\n var averageWidth = rest / (count - i);\n var w = Math.max(averageWidth * (1 - (Math.random() * 0.6)), min);\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n else {\n var rest = 1;\n var ratio = Math.sqrt(1 / this._slices);\n for (var i = 0; i < last; i++) {\n var w = Math.max(ratio * rest * Math.random(), min);\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n this.shuffle();\n };\n /**\n * Shuffle the sizes of the slices, advanced usage.\n */\n GlitchFilter.prototype.shuffle = function () {\n var arr = this._sizes;\n var last = this._slices - 1;\n // shuffle\n for (var i = last; i > 0; i--) {\n var rand = (Math.random() * i) >> 0;\n var temp = arr[i];\n arr[i] = arr[rand];\n arr[rand] = temp;\n }\n };\n /**\n * Randomize the values for offset from -1 to 1\n *\n * @private\n */\n GlitchFilter.prototype._randomizeOffsets = function () {\n for (var i = 0; i < this._slices; i++) {\n this._offsets[i] = Math.random() * (Math.random() < 0.5 ? -1 : 1);\n }\n };\n /**\n * Regenerating random size, offsets for slices.\n */\n GlitchFilter.prototype.refresh = function () {\n this._randomizeSizes();\n this._randomizeOffsets();\n this.redraw();\n };\n /**\n * Redraw displacement bitmap texture, advanced usage.\n */\n GlitchFilter.prototype.redraw = function () {\n var size = this.sampleSize;\n var texture = this.texture;\n var ctx = this._canvas.getContext('2d');\n ctx.clearRect(0, 0, 8, size);\n var offset;\n var y = 0;\n for (var i = 0; i < this._slices; i++) {\n offset = Math.floor(this._offsets[i] * 256);\n var height = this._sizes[i] * size;\n var red = offset > 0 ? offset : 0;\n var green = offset < 0 ? -offset : 0;\n ctx.fillStyle = \"rgba(\" + red + \", \" + green + \", 0, 1)\";\n ctx.fillRect(0, y >> 0, size, height + 1 >> 0);\n y += height;\n }\n texture.baseTexture.update();\n this.uniforms.displacementMap = texture;\n };\n Object.defineProperty(GlitchFilter.prototype, \"sizes\", {\n get: function () {\n return this._sizes;\n },\n /**\n * Manually custom slices size (height) of displacement bitmap\n *\n * @member {number[]|Float32Array}\n */\n set: function (sizes) {\n var len = Math.min(this._slices, sizes.length);\n for (var i = 0; i < len; i++) {\n this._sizes[i] = sizes[i];\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"offsets\", {\n get: function () {\n return this._offsets;\n },\n /**\n * Manually set custom slices offset of displacement bitmap, this is\n * a collection of values from -1 to 1. To change the max offset value\n * set `offset`.\n *\n * @member {number[]|Float32Array}\n */\n set: function (offsets) {\n var len = Math.min(this._slices, offsets.length);\n for (var i = 0; i < len; i++) {\n this._offsets[i] = offsets[i];\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"slices\", {\n /**\n * The count of slices.\n * @default 5\n */\n get: function () {\n return this._slices;\n },\n set: function (value) {\n if (this._slices === value) {\n return;\n }\n this._slices = value;\n this.uniforms.slices = value;\n this._sizes = this.uniforms.slicesWidth = new Float32Array(value);\n this._offsets = this.uniforms.slicesOffset = new Float32Array(value);\n this.refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"direction\", {\n /**\n * The angle in degree of the offset of slices.\n * @default 0\n */\n get: function () {\n return this._direction;\n },\n set: function (value) {\n if (this._direction === value) {\n return;\n }\n this._direction = value;\n var radians = value * DEG_TO_RAD;\n this.uniforms.sinDir = Math.sin(radians);\n this.uniforms.cosDir = Math.cos(radians);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"red\", {\n /**\n * Red channel offset.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.red;\n },\n set: function (value) {\n this.uniforms.red = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"green\", {\n /**\n * Green channel offset.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.green;\n },\n set: function (value) {\n this.uniforms.green = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"blue\", {\n /**\n * Blue offset.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.blue;\n },\n set: function (value) {\n this.uniforms.blue = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Removes all references\n */\n GlitchFilter.prototype.destroy = function () {\n var _a;\n (_a = this.texture) === null || _a === void 0 ? void 0 : _a.destroy(true);\n this.texture\n = this._canvas\n = this.red\n = this.green\n = this.blue\n = this._sizes\n = this._offsets = null;\n };\n /** Default constructor options. */\n GlitchFilter.defaults = {\n slices: 5,\n offset: 100,\n direction: 0,\n fillMode: 0,\n average: false,\n seed: 0,\n red: [0, 0],\n green: [0, 0],\n blue: [0, 0],\n minSize: 8,\n sampleSize: 512,\n };\n /** Fill mode as transparent */\n GlitchFilter.TRANSPARENT = 0;\n /** Fill mode as original */\n GlitchFilter.ORIGINAL = 1;\n /** Fill mode as loop */\n GlitchFilter.LOOP = 2;\n /** Fill mode as clamp */\n GlitchFilter.CLAMP = 3;\n /** Fill mode as mirror */\n GlitchFilter.MIRROR = 4;\n return GlitchFilter;\n}(Filter));\n\nexport { GlitchFilter };\n//# sourceMappingURL=filter-glitch.esm.mjs.map\n","/*!\n * @pixi/filter-rgb-split - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-rgb-split is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec2 red;\\nuniform vec2 green;\\nuniform vec2 blue;\\n\\nvoid main(void)\\n{\\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\\n}\\n\";\n\n/**\n * An RGB Split Filter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/rgb.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-rgb-split|@pixi/filter-rgb-split}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar RGBSplitFilter = /** @class */ (function (_super) {\n __extends(RGBSplitFilter, _super);\n /**\n * @param {PIXI.Point | number[]} [red=[-10,0]] - Red channel offset\n * @param {PIXI.Point | number[]} [green=[0, 10]] - Green channel offset\n * @param {PIXI.Point | number[]} [blue=[0, 0]] - Blue channel offset\n */\n function RGBSplitFilter(red, green, blue) {\n if (red === void 0) { red = [-10, 0]; }\n if (green === void 0) { green = [0, 10]; }\n if (blue === void 0) { blue = [0, 0]; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.red = red;\n _this.green = green;\n _this.blue = blue;\n return _this;\n }\n Object.defineProperty(RGBSplitFilter.prototype, \"red\", {\n /**\n * Red channel offset.\n *\n * @member {PIXI.Point | number[]}\n */\n get: function () {\n return this.uniforms.red;\n },\n set: function (value) {\n this.uniforms.red = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RGBSplitFilter.prototype, \"green\", {\n /**\n * Green channel offset.\n *\n * @member {PIXI.Point | number[]}\n */\n get: function () {\n return this.uniforms.green;\n },\n set: function (value) {\n this.uniforms.green = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RGBSplitFilter.prototype, \"blue\", {\n /**\n * Blue offset.\n *\n * @member {PIXI.Point | number[]}\n */\n get: function () {\n return this.uniforms.blue;\n },\n set: function (value) {\n this.uniforms.blue = value;\n },\n enumerable: false,\n configurable: true\n });\n return RGBSplitFilter;\n}(Filter));\n\nexport { RGBSplitFilter };\n//# sourceMappingURL=filter-rgb-split.esm.mjs.map\n","/*!\n * @pixi/filter-godray - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-godray is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point, DEG_TO_RAD } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar perlin = \"vec3 mod289(vec3 x)\\n{\\n return x - floor(x * (1.0 / 289.0)) * 289.0;\\n}\\nvec4 mod289(vec4 x)\\n{\\n return x - floor(x * (1.0 / 289.0)) * 289.0;\\n}\\nvec4 permute(vec4 x)\\n{\\n return mod289(((x * 34.0) + 1.0) * x);\\n}\\nvec4 taylorInvSqrt(vec4 r)\\n{\\n return 1.79284291400159 - 0.85373472095314 * r;\\n}\\nvec3 fade(vec3 t)\\n{\\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\\n}\\n// Classic Perlin noise, periodic variant\\nfloat pnoise(vec3 P, vec3 rep)\\n{\\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\\n Pi0 = mod289(Pi0);\\n Pi1 = mod289(Pi1);\\n vec3 Pf0 = fract(P); // Fractional part for interpolation\\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\\n vec4 iz0 = Pi0.zzzz;\\n vec4 iz1 = Pi1.zzzz;\\n vec4 ixy = permute(permute(ix) + iy);\\n vec4 ixy0 = permute(ixy + iz0);\\n vec4 ixy1 = permute(ixy + iz1);\\n vec4 gx0 = ixy0 * (1.0 / 7.0);\\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\\n gx0 = fract(gx0);\\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\\n vec4 sz0 = step(gz0, vec4(0.0));\\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\\n vec4 gx1 = ixy1 * (1.0 / 7.0);\\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\\n gx1 = fract(gx1);\\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\\n vec4 sz1 = step(gz1, vec4(0.0));\\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\\n g000 *= norm0.x;\\n g010 *= norm0.y;\\n g100 *= norm0.z;\\n g110 *= norm0.w;\\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\\n g001 *= norm1.x;\\n g011 *= norm1.y;\\n g101 *= norm1.z;\\n g111 *= norm1.w;\\n float n000 = dot(g000, Pf0);\\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\\n float n111 = dot(g111, Pf1);\\n vec3 fade_xyz = fade(Pf0);\\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\\n return 2.2 * n_xyz;\\n}\\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain)\\n{\\n float sum = 0.0;\\n float sc = 1.0;\\n float totalgain = 1.0;\\n for (float i = 0.0; i < 6.0; i++)\\n {\\n sum += totalgain * pnoise(P * sc, rep);\\n sc *= lacunarity;\\n totalgain *= gain;\\n }\\n return abs(sum);\\n}\\n\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\n\\nuniform vec2 light;\\nuniform bool parallel;\\nuniform float aspect;\\n\\nuniform float gain;\\nuniform float lacunarity;\\nuniform float time;\\nuniform float alpha;\\n\\n${perlin}\\n\\nvoid main(void) {\\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\\n\\n float d;\\n\\n if (parallel) {\\n float _cos = light.x;\\n float _sin = light.y;\\n d = (_cos * coord.x) + (_sin * coord.y * aspect);\\n } else {\\n float dx = coord.x - light.x / dimensions.x;\\n float dy = (coord.y - light.y / dimensions.y) * aspect;\\n float dis = sqrt(dx * dx + dy * dy) + 0.00001;\\n d = dy / dis;\\n }\\n\\n vec3 dir = vec3(d, d, 0.0);\\n\\n float noise = turb(dir + vec3(time, 0.0, 62.1 + time) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain);\\n noise = mix(noise, 0.0, 0.3);\\n //fade vertically.\\n vec4 mist = vec4(noise, noise, noise, 1.0) * (1.0 - coord.y);\\n mist.a = 1.0;\\n // apply user alpha\\n mist *= alpha;\\n\\n gl_FragColor = texture2D(uSampler, vTextureCoord) + mist;\\n\\n}\\n\";\n\n/**\n * GordayFilter, {@link https://codepen.io/alaingalvan originally} by Alain Galvan\n *\n *\n *\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/godray.gif)\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-godray|@pixi/filter-godray}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * displayObject.filters = [new GodrayFilter()];\n */\nvar GodrayFilter = /** @class */ (function (_super) {\n __extends(GodrayFilter, _super);\n /**\n * @param {object} [options] - Filter options\n * @param {number} [options.angle=30] - Angle/Light-source of the rays.\n * @param {number} [options.gain=0.5] - General intensity of the effect.\n * @param {number} [options.lacunarity=2.5] - The density of the fractal noise.\n * @param {boolean} [options.parallel=true] - `true` to use `angle`, `false` to use `center`\n * @param {number} [options.time=0] - The current time position.\n * @param {PIXI.Point|number[]} [options.center=[0,0]] - Focal point for non-parallel rays,\n * to use this `parallel` must be set to `false`.\n * @param {number} [options.alpha=1.0] - the alpha, defaults to 1, affects transparency of rays\n */\n function GodrayFilter(options) {\n var _this = _super.call(this, vertex, fragment.replace('${perlin}', perlin)) || this;\n /**\n * `true` if light rays are parallel (uses angle),\n * `false` to use the focal `center` point\n */\n _this.parallel = true;\n /** The current time. */\n _this.time = 0;\n _this._angle = 0;\n _this.uniforms.dimensions = new Float32Array(2);\n var opts = Object.assign(GodrayFilter.defaults, options);\n _this._angleLight = new Point();\n _this.angle = opts.angle;\n _this.gain = opts.gain;\n _this.lacunarity = opts.lacunarity;\n _this.alpha = opts.alpha;\n _this.parallel = opts.parallel;\n _this.center = opts.center;\n _this.time = opts.time;\n return _this;\n }\n /**\n * Applies the filter.\n * @private\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n GodrayFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.light = this.parallel ? this._angleLight : this.center;\n this.uniforms.parallel = this.parallel;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n this.uniforms.aspect = height / width;\n this.uniforms.time = this.time;\n this.uniforms.alpha = this.alpha;\n // draw the filter...\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(GodrayFilter.prototype, \"angle\", {\n /**\n * The angle/light-source of the rays in degrees. For instance, a value of 0 is vertical rays,\n * values of 90 or -90 produce horizontal rays.\n * @default 30\n */\n get: function () {\n return this._angle;\n },\n set: function (value) {\n this._angle = value;\n var radians = value * DEG_TO_RAD;\n this._angleLight.x = Math.cos(radians);\n this._angleLight.y = Math.sin(radians);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GodrayFilter.prototype, \"gain\", {\n /**\n * General intensity of the effect. A value closer to 1 will produce a more intense effect,\n * where a value closer to 0 will produce a subtler effect.\n * @default 0.5\n */\n get: function () {\n return this.uniforms.gain;\n },\n set: function (value) {\n this.uniforms.gain = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GodrayFilter.prototype, \"lacunarity\", {\n /**\n * The density of the fractal noise. A higher amount produces more rays and a smaller amound\n * produces fewer waves.\n * @default 2.5\n */\n get: function () {\n return this.uniforms.lacunarity;\n },\n set: function (value) {\n this.uniforms.lacunarity = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GodrayFilter.prototype, \"alpha\", {\n /**\n * The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.\n * @default 1\n */\n get: function () {\n return this.uniforms.alpha;\n },\n set: function (value) {\n this.uniforms.alpha = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default for constructior options. */\n GodrayFilter.defaults = {\n angle: 30,\n gain: 0.5,\n lacunarity: 2.5,\n time: 0,\n parallel: true,\n center: [0, 0],\n alpha: 1,\n };\n return GodrayFilter;\n}(Filter));\n\nexport { GodrayFilter };\n//# sourceMappingURL=filter-godray.esm.mjs.map\n","/*!\n * @pixi/filter-adjustment - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-adjustment is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform float gamma;\\nuniform float contrast;\\nuniform float saturation;\\nuniform float brightness;\\nuniform float red;\\nuniform float green;\\nuniform float blue;\\nuniform float alpha;\\n\\nvoid main(void)\\n{\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n if (c.a > 0.0) {\\n c.rgb /= c.a;\\n\\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\\n rgb.r *= red;\\n rgb.g *= green;\\n rgb.b *= blue;\\n c.rgb = rgb * brightness;\\n\\n c.rgb *= c.a;\\n }\\n\\n gl_FragColor = c * alpha;\\n}\\n\";\n\n/**\n * The ability to adjust gamma, contrast, saturation, brightness, alpha or color-channel shift.\n * This is a faster and much simpler to use than\n * {@link http://pixijs.download/release/docs/PIXI.filters.ColorMatrixFilter.html ColorMatrixFilter}\n * because it does not use a matrix.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/adjustment.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-adjustment|@pixi/filter-adjustment}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar AdjustmentFilter = /** @class */ (function (_super) {\n __extends(AdjustmentFilter, _super);\n /**\n * @param {object|number} [options] - The optional parameters of the filter.\n * @param {number} [options.gamma=1] - The amount of luminance\n * @param {number} [options.saturation=1] - The amount of color saturation\n * @param {number} [options.contrast=1] - The amount of contrast\n * @param {number} [options.brightness=1] - The overall brightness\n * @param {number} [options.red=1] - The multipled red channel\n * @param {number} [options.green=1] - The multipled green channel\n * @param {number} [options.blue=1] - The multipled blue channel\n * @param {number} [options.alpha=1] - The overall alpha amount\n */\n function AdjustmentFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** The amount of luminance */\n _this.gamma = 1;\n /** The amount of saturation */\n _this.saturation = 1;\n /** The amount of contrast */\n _this.contrast = 1;\n /** The amount of brightness */\n _this.brightness = 1;\n /** The amount of red channel */\n _this.red = 1;\n /** The amount of green channel */\n _this.green = 1;\n /** The amount of blue channel */\n _this.blue = 1;\n /** The amount of alpha channel */\n _this.alpha = 1;\n Object.assign(_this, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @ignore\n */\n AdjustmentFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms.gamma = Math.max(this.gamma, 0.0001);\n this.uniforms.saturation = this.saturation;\n this.uniforms.contrast = this.contrast;\n this.uniforms.brightness = this.brightness;\n this.uniforms.red = this.red;\n this.uniforms.green = this.green;\n this.uniforms.blue = this.blue;\n this.uniforms.alpha = this.alpha;\n filterManager.applyFilter(this, input, output, clear);\n };\n return AdjustmentFilter;\n}(Filter));\n\nexport { AdjustmentFilter };\n//# sourceMappingURL=filter-adjustment.esm.mjs.map\n","/*!\n * @pixi/filter-kawase-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-kawase-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 uOffset;\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n\\n // Sample top left pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\\n\\n // Sample top right pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\\n\\n // Sample bottom right pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\\n\\n // Sample bottom left pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\\n\\n // Average\\n color *= 0.25;\\n\\n gl_FragColor = color;\\n}\";\n\nvar fragmentClamp = \"\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 uOffset;\\nuniform vec4 filterClamp;\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n\\n // Sample top left pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample top right pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample bottom right pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample bottom left pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Average\\n color *= 0.25;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * A much faster blur than Gaussian blur, but more complicated to use.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/kawase-blur.png)\n *\n * @see https://software.intel.com/en-us/blogs/2014/07/15/an-investigation-of-fast-real-time-gpu-based-image-blur-algorithms\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-kawase-blur|@pixi/filter-kawase-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar KawaseBlurFilter = /** @class */ (function (_super) {\n __extends(KawaseBlurFilter, _super);\n /**\n * @param {number|number[]} [blur=4] - The blur of the filter. Should be greater than `0`. If\n * value is an Array, setting kernels.\n * @param {number} [quality=3] - The quality of the filter. Should be an integer greater than `1`.\n * @param {boolean} [clamp=false] - Clamp edges, useful for removing dark edges\n * from fullscreen filters or bleeding to the edge of filterArea.\n */\n function KawaseBlurFilter(blur, quality, clamp) {\n if (blur === void 0) { blur = 4; }\n if (quality === void 0) { quality = 3; }\n if (clamp === void 0) { clamp = false; }\n var _this = _super.call(this, vertex, clamp ? fragmentClamp : fragment) || this;\n _this._kernels = [];\n _this._blur = 4;\n _this._quality = 3;\n _this.uniforms.uOffset = new Float32Array(2);\n _this._pixelSize = new Point();\n _this.pixelSize = 1;\n _this._clamp = clamp;\n // if `blur` is array , as kernels\n if (Array.isArray(blur)) {\n _this.kernels = blur;\n }\n else {\n _this._blur = blur;\n _this.quality = quality;\n }\n return _this;\n }\n /**\n * Overrides apply\n * @private\n */\n KawaseBlurFilter.prototype.apply = function (filterManager, input, output, clear) {\n var uvX = this._pixelSize.x / input._frame.width;\n var uvY = this._pixelSize.y / input._frame.height;\n var offset;\n if (this._quality === 1 || this._blur === 0) {\n offset = this._kernels[0] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, input, output, clear);\n }\n else {\n var renderTarget = filterManager.getFilterTexture();\n var source = input;\n var target = renderTarget;\n var tmp = void 0;\n var last = this._quality - 1;\n for (var i = 0; i < last; i++) {\n offset = this._kernels[i] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, source, target, 1);\n tmp = source;\n source = target;\n target = tmp;\n }\n offset = this._kernels[last] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, source, output, clear);\n filterManager.returnFilterTexture(renderTarget);\n }\n };\n KawaseBlurFilter.prototype._updatePadding = function () {\n this.padding = Math.ceil(this._kernels.reduce(function (acc, v) { return acc + v + 0.5; }, 0));\n };\n /**\n * Auto generate kernels by blur & quality\n * @private\n */\n KawaseBlurFilter.prototype._generateKernels = function () {\n var blur = this._blur;\n var quality = this._quality;\n var kernels = [blur];\n if (blur > 0) {\n var k = blur;\n var step = blur / quality;\n for (var i = 1; i < quality; i++) {\n k -= step;\n kernels.push(k);\n }\n }\n this._kernels = kernels;\n this._updatePadding();\n };\n Object.defineProperty(KawaseBlurFilter.prototype, \"kernels\", {\n /**\n * The kernel size of the blur filter, for advanced usage.\n * @default [0]\n */\n get: function () {\n return this._kernels;\n },\n set: function (value) {\n if (Array.isArray(value) && value.length > 0) {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max.apply(Math, value);\n }\n else {\n // if value is invalid , set default value\n this._kernels = [0];\n this._quality = 1;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"clamp\", {\n /**\n * Get the if the filter is clampped.\n *\n * @readonly\n * @default false\n */\n get: function () {\n return this._clamp;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"pixelSize\", {\n get: function () {\n return this._pixelSize;\n },\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n *\n * @member {PIXI.Point|number[]}\n * @default [1, 1]\n */\n set: function (value) {\n if (typeof value === 'number') {\n this._pixelSize.x = value;\n this._pixelSize.y = value;\n }\n else if (Array.isArray(value)) {\n this._pixelSize.x = value[0];\n this._pixelSize.y = value[1];\n }\n else if (value instanceof Point) {\n this._pixelSize.x = value.x;\n this._pixelSize.y = value.y;\n }\n else {\n // if value is invalid , set default value\n this._pixelSize.x = 1;\n this._pixelSize.y = 1;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"quality\", {\n /**\n * The quality of the filter, integer greater than `1`.\n * @default 3\n */\n get: function () {\n return this._quality;\n },\n set: function (value) {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"blur\", {\n /**\n * The amount of blur, value greater than `0`.\n * @default 4\n */\n get: function () {\n return this._blur;\n },\n set: function (value) {\n this._blur = value;\n this._generateKernels();\n },\n enumerable: false,\n configurable: true\n });\n return KawaseBlurFilter;\n}(Filter));\n\nexport { KawaseBlurFilter };\n//# sourceMappingURL=filter-kawase-blur.esm.mjs.map\n","/*!\n * @pixi/filter-advanced-bloom - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-advanced-bloom is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { KawaseBlurFilter } from '@pixi/filter-kawase-blur';\nimport { settings } from '@pixi/settings';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"\\nuniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform float threshold;\\n\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n // A simple & fast algorithm for getting brightness.\\n // It's inaccuracy , but good enought for this feature.\\n float _max = max(max(color.r, color.g), color.b);\\n float _min = min(min(color.r, color.g), color.b);\\n float brightness = (_max + _min) * 0.5;\\n\\n if(brightness > threshold) {\\n gl_FragColor = color;\\n } else {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\\n }\\n}\\n\";\n\n/**\n * Internal filter for AdvancedBloomFilter to get brightness.\n * @class\n * @private\n */\nvar ExtractBrightnessFilter = /** @class */ (function (_super) {\n __extends(ExtractBrightnessFilter, _super);\n /**\n * @param {number} [threshold] - Defines how bright a color needs to be extracted.\n */\n function ExtractBrightnessFilter(threshold) {\n if (threshold === void 0) { threshold = 0.5; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.threshold = threshold;\n return _this;\n }\n Object.defineProperty(ExtractBrightnessFilter.prototype, \"threshold\", {\n /**\n * Defines how bright a color needs to be extracted.\n *\n * @default 0.5\n */\n get: function () {\n return this.uniforms.threshold;\n },\n set: function (value) {\n this.uniforms.threshold = value;\n },\n enumerable: false,\n configurable: true\n });\n return ExtractBrightnessFilter;\n}(Filter));\n\nvar fragment$1 = \"uniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D bloomTexture;\\nuniform float bloomScale;\\nuniform float brightness;\\n\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n color.rgb *= brightness;\\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\\n bloomColor.rgb *= bloomScale;\\n gl_FragColor = color + bloomColor;\\n}\\n\";\n\n/**\n * The AdvancedBloomFilter applies a Bloom Effect to an object. Unlike the normal BloomFilter\n * this had some advanced controls for adjusting the look of the bloom. Note: this filter\n * is slower than normal BloomFilter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/advanced-bloom.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-advanced-bloom|@pixi/filter-advanced-bloom}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar AdvancedBloomFilter = /** @class */ (function (_super) {\n __extends(AdvancedBloomFilter, _super);\n /**\n * @param {object|number} [options] - The optional parameters of advanced bloom filter.\n * When options is a number , it will be `options.threshold`.\n * @param {number} [options.threshold=0.5] - Defines how bright a color needs to be to affect bloom.\n * @param {number} [options.bloomScale=1.0] - To adjust the strength of the bloom. Higher values is\n * more intense brightness.\n * @param {number} [options.brightness=1.0] - The brightness, lower value is more subtle brightness,\n * higher value is blown-out.\n * @param {number} [options.blur=8] - Sets the strength of the Blur properties simultaneously\n * @param {number} [options.quality=4] - The quality of the Blur filter.\n * @param {number[]} [options.kernels=null] - The kernels of the Blur filter.\n * @param {number|number[]|PIXI.Point} [options.pixelSize=1] - the pixelSize of the Blur filter.\n * @param {number} [options.resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the Blur filter.\n */\n function AdvancedBloomFilter(options) {\n var _this = _super.call(this, vertex, fragment$1) || this;\n /** To adjust the strength of the bloom. Higher values is more intense brightness. */\n _this.bloomScale = 1;\n /** The brightness, lower value is more subtle brightness, higher value is blown-out. */\n _this.brightness = 1;\n _this._resolution = settings.FILTER_RESOLUTION;\n if (typeof options === 'number') {\n options = { threshold: options };\n }\n var opt = Object.assign(AdvancedBloomFilter.defaults, options);\n _this.bloomScale = opt.bloomScale;\n _this.brightness = opt.brightness;\n var kernels = opt.kernels, blur = opt.blur, quality = opt.quality, pixelSize = opt.pixelSize, resolution = opt.resolution;\n _this._extractFilter = new ExtractBrightnessFilter(opt.threshold);\n _this._extractFilter.resolution = resolution;\n _this._blurFilter = kernels\n ? new KawaseBlurFilter(kernels)\n : new KawaseBlurFilter(blur, quality);\n _this.pixelSize = pixelSize;\n _this.resolution = resolution;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n *\n * @private\n */\n AdvancedBloomFilter.prototype.apply = function (filterManager, input, output, clear, currentState) {\n var brightTarget = filterManager.getFilterTexture();\n this._extractFilter.apply(filterManager, input, brightTarget, 1, currentState);\n var bloomTarget = filterManager.getFilterTexture();\n this._blurFilter.apply(filterManager, brightTarget, bloomTarget, 1);\n this.uniforms.bloomScale = this.bloomScale;\n this.uniforms.brightness = this.brightness;\n this.uniforms.bloomTexture = bloomTarget;\n filterManager.applyFilter(this, input, output, clear);\n filterManager.returnFilterTexture(bloomTarget);\n filterManager.returnFilterTexture(brightTarget);\n };\n Object.defineProperty(AdvancedBloomFilter.prototype, \"resolution\", {\n /**\n * The resolution of the filter.\n * @ignore\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._resolution = value;\n if (this._extractFilter) {\n this._extractFilter.resolution = value;\n }\n if (this._blurFilter) {\n this._blurFilter.resolution = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"threshold\", {\n /**\n * Defines how bright a color needs to be to affect bloom.\n *\n * @default 0.5\n */\n get: function () {\n return this._extractFilter.threshold;\n },\n set: function (value) {\n this._extractFilter.threshold = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"kernels\", {\n /**\n * Sets the kernels of the Blur Filter\n */\n get: function () {\n return this._blurFilter.kernels;\n },\n set: function (value) {\n this._blurFilter.kernels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"blur\", {\n /**\n * Sets the strength of the Blur properties simultaneously\n *\n * @default 2\n */\n get: function () {\n return this._blurFilter.blur;\n },\n set: function (value) {\n this._blurFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"quality\", {\n /**\n * Sets the quality of the Blur Filter\n *\n * @default 4\n */\n get: function () {\n return this._blurFilter.quality;\n },\n set: function (value) {\n this._blurFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"pixelSize\", {\n /**\n * Sets the pixelSize of the Kawase Blur filter\n *\n * @member {number|number[]|PIXI.Point}\n * @default 1\n */\n get: function () {\n return this._blurFilter.pixelSize;\n },\n set: function (value) {\n this._blurFilter.pixelSize = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default construction options. */\n AdvancedBloomFilter.defaults = {\n threshold: 0.5,\n bloomScale: 1.0,\n brightness: 1.0,\n kernels: null,\n blur: 8,\n quality: 4,\n pixelSize: 1,\n resolution: settings.FILTER_RESOLUTION,\n };\n return AdvancedBloomFilter;\n}(Filter));\n\nexport { AdvancedBloomFilter };\n//# sourceMappingURL=filter-advanced-bloom.esm.mjs.map\n","/*!\n * @pixi/filter-ascii - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-ascii is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform vec4 filterArea;\\nuniform float pixelSize;\\nuniform sampler2D uSampler;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 pixelate(vec2 coord, vec2 size)\\n{\\n return floor( coord / size ) * size;\\n}\\n\\nvec2 getMod(vec2 coord, vec2 size)\\n{\\n return mod( coord , size) / size;\\n}\\n\\nfloat character(float n, vec2 p)\\n{\\n p = floor(p*vec2(4.0, -4.0) + 2.5);\\n\\n if (clamp(p.x, 0.0, 4.0) == p.x)\\n {\\n if (clamp(p.y, 0.0, 4.0) == p.y)\\n {\\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\\n }\\n }\\n return 0.0;\\n}\\n\\nvoid main()\\n{\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n // get the rounded color..\\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\\n pixCoord = unmapCoord(pixCoord);\\n\\n vec4 color = texture2D(uSampler, pixCoord);\\n\\n // determine the character to use\\n float gray = (color.r + color.g + color.b) / 3.0;\\n\\n float n = 65536.0; // .\\n if (gray > 0.2) n = 65600.0; // :\\n if (gray > 0.3) n = 332772.0; // *\\n if (gray > 0.4) n = 15255086.0; // o\\n if (gray > 0.5) n = 23385164.0; // &\\n if (gray > 0.6) n = 15252014.0; // 8\\n if (gray > 0.7) n = 13199452.0; // @\\n if (gray > 0.8) n = 11512810.0; // #\\n\\n // get the mod..\\n vec2 modd = getMod(coord, vec2(pixelSize));\\n\\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\\n\\n}\\n\";\n\n// TODO (cengler) - The Y is flipped in this shader for some reason.\n// @author Vico @vicocotea\n// original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h\n/**\n * An ASCII filter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/ascii.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-ascii|@pixi/filter-ascii}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar AsciiFilter = /** @class */ (function (_super) {\n __extends(AsciiFilter, _super);\n /**\n * @param {number} [size=8] - Size of the font\n */\n function AsciiFilter(size) {\n if (size === void 0) { size = 8; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.size = size;\n return _this;\n }\n Object.defineProperty(AsciiFilter.prototype, \"size\", {\n /**\n * The pixel size used by the filter.\n */\n get: function () {\n return this.uniforms.pixelSize;\n },\n set: function (value) {\n this.uniforms.pixelSize = value;\n },\n enumerable: false,\n configurable: true\n });\n return AsciiFilter;\n}(Filter));\n\nexport { AsciiFilter };\n//# sourceMappingURL=filter-ascii.esm.mjs.map\n","/*!\n * @pixi/filter-bevel - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-bevel is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { DEG_TO_RAD } from '@pixi/math';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform float transformX;\\nuniform float transformY;\\nuniform vec3 lightColor;\\nuniform float lightAlpha;\\nuniform vec3 shadowColor;\\nuniform float shadowAlpha;\\n\\nvoid main(void) {\\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float light = texture2D(uSampler, vTextureCoord - transform).a;\\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\\n\\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\\n gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\\n\";\n\n/**\n * Bevel Filter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bevel.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-bevel|@pixi/filter-bevel}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar BevelFilter = /** @class */ (function (_super) {\n __extends(BevelFilter, _super);\n /**\n * @param {object} [options] - The optional parameters of the filter.\n * @param {number} [options.rotation = 45] - The angle of the light in degrees.\n * @param {number} [options.thickness = 2] - The tickness of the bevel.\n * @param {number} [options.lightColor = 0xffffff] - Color of the light.\n * @param {number} [options.lightAlpha = 0.7] - Alpha of the light.\n * @param {number} [options.shadowColor = 0x000000] - Color of the shadow.\n * @param {number} [options.shadowAlpha = 0.7] - Alpha of the shadow.\n */\n function BevelFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n _this._thickness = 2;\n _this._angle = 0;\n _this.uniforms.lightColor = new Float32Array(3);\n _this.uniforms.shadowColor = new Float32Array(3);\n Object.assign(_this, {\n rotation: 45,\n thickness: 2,\n lightColor: 0xffffff,\n lightAlpha: 0.7,\n shadowColor: 0x000000,\n shadowAlpha: 0.7,\n }, options);\n // Workaround: https://github.com/pixijs/filters/issues/230\n // applies correctly only if there is at least a single-pixel padding with alpha=0 around an image\n // To solve this problem, a padding of 1 put on the filter should suffice\n _this.padding = 1;\n return _this;\n }\n /**\n * Update the transform matrix of offset angle.\n * @private\n */\n BevelFilter.prototype._updateTransform = function () {\n this.uniforms.transformX = this._thickness * Math.cos(this._angle);\n this.uniforms.transformY = this._thickness * Math.sin(this._angle);\n };\n Object.defineProperty(BevelFilter.prototype, \"rotation\", {\n /**\n * The angle of the light in degrees.\n * @default 45\n */\n get: function () {\n return this._angle / DEG_TO_RAD;\n },\n set: function (value) {\n this._angle = value * DEG_TO_RAD;\n this._updateTransform();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"thickness\", {\n /**\n * The tickness of the bevel.\n * @default 2\n */\n get: function () {\n return this._thickness;\n },\n set: function (value) {\n this._thickness = value;\n this._updateTransform();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"lightColor\", {\n /**\n * Color of the light.\n * @default 0xffffff\n */\n get: function () {\n return rgb2hex(this.uniforms.lightColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.lightColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"lightAlpha\", {\n /**\n * Alpha of the light.\n * @default 0.7\n */\n get: function () {\n return this.uniforms.lightAlpha;\n },\n set: function (value) {\n this.uniforms.lightAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"shadowColor\", {\n /**\n * Color of the shadow.\n * @default 0x000000\n */\n get: function () {\n return rgb2hex(this.uniforms.shadowColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.shadowColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"shadowAlpha\", {\n /**\n * Alpha of the shadow.\n * @default 0.7\n */\n get: function () {\n return this.uniforms.shadowAlpha;\n },\n set: function (value) {\n this.uniforms.shadowAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return BevelFilter;\n}(Filter));\n\nexport { BevelFilter };\n//# sourceMappingURL=filter-bevel.esm.mjs.map\n","/*!\n * @pixi/filter-bloom - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-bloom is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { BLEND_MODES } from '@pixi/constants';\nimport { AlphaFilter } from '@pixi/filter-alpha';\nimport { BlurFilterPass } from '@pixi/filter-blur';\nimport { settings } from '@pixi/settings';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * The BloomFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bloom.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-bloom|@pixi/filter-bloom}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar BloomFilter = /** @class */ (function (_super) {\n __extends(BloomFilter, _super);\n /**\n * @param {number|PIXI.Point|number[]} [blur=2] - Sets the strength of both the blurX and blurY properties simultaneously\n * @param {number} [quality=4] - The quality of the blurX & blurY filter.\n * @param {number} [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blurX & blurY filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blurX & blurY filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BloomFilter(blur, quality, resolution, kernelSize) {\n if (blur === void 0) { blur = 2; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = _super.call(this) || this;\n var blurX;\n var blurY;\n if (typeof blur === 'number') {\n blurX = blur;\n blurY = blur;\n }\n else if (blur instanceof Point) {\n blurX = blur.x;\n blurY = blur.y;\n }\n else if (Array.isArray(blur)) {\n blurX = blur[0];\n blurY = blur[1];\n }\n _this.blurXFilter = new BlurFilterPass(true, blurX, quality, resolution, kernelSize);\n _this.blurYFilter = new BlurFilterPass(false, blurY, quality, resolution, kernelSize);\n _this.blurYFilter.blendMode = BLEND_MODES.SCREEN;\n _this.defaultFilter = new AlphaFilter();\n return _this;\n }\n BloomFilter.prototype.apply = function (filterManager, input, output, clear) {\n var renderTarget = filterManager.getFilterTexture();\n // TODO - copyTexSubImage2D could be used here?\n this.defaultFilter.apply(filterManager, input, output, clear);\n this.blurXFilter.apply(filterManager, input, renderTarget, 1);\n this.blurYFilter.apply(filterManager, renderTarget, output, 0);\n filterManager.returnFilterTexture(renderTarget);\n };\n Object.defineProperty(BloomFilter.prototype, \"blur\", {\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BloomFilter.prototype, \"blurX\", {\n /**\n * Sets the strength of the blurX property\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BloomFilter.prototype, \"blurY\", {\n /**\n * Sets the strength of the blurY property\n * @default 2\n */\n get: function () {\n return this.blurYFilter.blur;\n },\n set: function (value) {\n this.blurYFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n return BloomFilter;\n}(Filter));\n\nexport { BloomFilter };\n//# sourceMappingURL=filter-bloom.esm.mjs.map\n","/*!\n * @pixi/filter-bulge-pinch - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-bulge-pinch is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"uniform float radius;\\nuniform float strength;\\nuniform vec2 center;\\nuniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\n\\nvoid main()\\n{\\n vec2 coord = vTextureCoord * filterArea.xy;\\n coord -= center * dimensions.xy;\\n float distance = length(coord);\\n if (distance < radius) {\\n float percent = distance / radius;\\n if (strength > 0.0) {\\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\\n } else {\\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\\n }\\n }\\n coord += center * dimensions.xy;\\n coord /= filterArea.xy;\\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n vec4 color = texture2D(uSampler, clampedCoord);\\n if (coord != clampedCoord) {\\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\\n }\\n\\n gl_FragColor = color;\\n}\\n\";\n\n// @author Julien CLEREL @JuloxRox\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/warp/bulgepinch.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * Bulges or pinches the image in a circle.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bulge-pinch.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-bulge-pinch|@pixi/filter-bulge-pinch}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar BulgePinchFilter = /** @class */ (function (_super) {\n __extends(BulgePinchFilter, _super);\n /**\n * @param {object} [options] - Options to use for filter.\n * @param {PIXI.Point|Array} [options.center=[0,0]] - The x and y coordinates of the center\n * of the circle of effect.\n * @param {number} [options.radius=100] - The radius of the circle of effect.\n * @param {number} [options.strength=1] - -1 to 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n */\n function BulgePinchFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n _this.uniforms.dimensions = new Float32Array(2);\n Object.assign(_this, BulgePinchFilter.defaults, options);\n return _this;\n }\n BulgePinchFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(BulgePinchFilter.prototype, \"radius\", {\n /**\n * The radius of the circle of effect.\n */\n get: function () {\n return this.uniforms.radius;\n },\n set: function (value) {\n this.uniforms.radius = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BulgePinchFilter.prototype, \"strength\", {\n /**\n * The strength of the effect. -1 to 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n */\n get: function () {\n return this.uniforms.strength;\n },\n set: function (value) {\n this.uniforms.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BulgePinchFilter.prototype, \"center\", {\n /**\n * The x and y coordinates of the center of the circle of effect.\n *\n * @member {PIXI.Point | Array}\n */\n get: function () {\n return this.uniforms.center;\n },\n set: function (value) {\n this.uniforms.center = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n BulgePinchFilter.defaults = {\n center: [0.5, 0.5],\n radius: 100,\n strength: 1,\n };\n return BulgePinchFilter;\n}(Filter));\n\nexport { BulgePinchFilter };\n//# sourceMappingURL=filter-bulge-pinch.esm.mjs.map\n","/*!\n * @pixi/filter-color-map - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-color-map is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, Filter } from '@pixi/core';\nimport { MIPMAP_MODES, SCALE_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform sampler2D colorMap;\\nuniform float _mix;\\nuniform float _size;\\nuniform float _sliceSize;\\nuniform float _slicePixelSize;\\nuniform float _sliceInnerSize;\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\\n\\n vec4 adjusted;\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n float innerWidth = _size - 1.0;\\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\\n float s0 = xOffset + (zSlice0 * _sliceSize);\\n float s1 = xOffset + (zSlice1 * _sliceSize);\\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\\n float zOffset = fract(color.b * innerWidth);\\n adjusted = mix(slice0Color, slice1Color, zOffset);\\n\\n color.rgb *= color.a;\\n }\\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\\n\\n}\";\n\n/**\n * The ColorMapFilter applies a color-map effect to an object.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/color-map.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-color-map|@pixi/filter-color-map}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ColorMapFilter = /** @class */ (function (_super) {\n __extends(ColorMapFilter, _super);\n /**\n * @param {HTMLImageElement|HTMLCanvasElement|PIXI.BaseTexture|PIXI.Texture} [colorMap] - The\n * colorMap texture of the filter.\n * @param {boolean} [nearest=false] - Whether use NEAREST for colorMap texture.\n * @param {number} [mix=1] - The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.\n */\n function ColorMapFilter(colorMap, nearest, mix) {\n if (nearest === void 0) { nearest = false; }\n if (mix === void 0) { mix = 1; }\n var _this = _super.call(this, vertex, fragment) || this;\n /** The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image. */\n _this.mix = 1;\n _this._size = 0;\n _this._sliceSize = 0;\n _this._slicePixelSize = 0;\n _this._sliceInnerSize = 0;\n _this._nearest = false;\n _this._scaleMode = null;\n _this._colorMap = null;\n _this._scaleMode = null;\n _this.nearest = nearest;\n _this.mix = mix;\n _this.colorMap = colorMap;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n ColorMapFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms._mix = this.mix;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(ColorMapFilter.prototype, \"colorSize\", {\n /**\n * The size of one color slice\n * @readonly\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMapFilter.prototype, \"colorMap\", {\n /**\n * the colorMap texture\n * @member {PIXI.Texture}\n */\n get: function () {\n return this._colorMap;\n },\n set: function (colorMap) {\n var _a;\n if (!colorMap) {\n return;\n }\n if (!(colorMap instanceof Texture)) {\n colorMap = Texture.from(colorMap);\n }\n if ((_a = colorMap) === null || _a === void 0 ? void 0 : _a.baseTexture) {\n colorMap.baseTexture.scaleMode = this._scaleMode;\n colorMap.baseTexture.mipmap = MIPMAP_MODES.OFF;\n this._size = colorMap.height;\n this._sliceSize = 1 / this._size;\n this._slicePixelSize = this._sliceSize / this._size;\n this._sliceInnerSize = this._slicePixelSize * (this._size - 1);\n this.uniforms._size = this._size;\n this.uniforms._sliceSize = this._sliceSize;\n this.uniforms._slicePixelSize = this._slicePixelSize;\n this.uniforms._sliceInnerSize = this._sliceInnerSize;\n this.uniforms.colorMap = colorMap;\n }\n this._colorMap = colorMap;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMapFilter.prototype, \"nearest\", {\n /**\n * Whether use NEAREST for colorMap texture.\n */\n get: function () {\n return this._nearest;\n },\n set: function (nearest) {\n this._nearest = nearest;\n this._scaleMode = nearest ? SCALE_MODES.NEAREST : SCALE_MODES.LINEAR;\n var texture = this._colorMap;\n if (texture && texture.baseTexture) {\n texture.baseTexture._glTextures = {};\n texture.baseTexture.scaleMode = this._scaleMode;\n texture.baseTexture.mipmap = MIPMAP_MODES.OFF;\n texture._updateID++;\n texture.baseTexture.emit('update', texture.baseTexture);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the colorMap is based on canvas , and the content of canvas has changed,\n * then call `updateColorMap` for update texture.\n */\n ColorMapFilter.prototype.updateColorMap = function () {\n var texture = this._colorMap;\n if (texture && texture.baseTexture) {\n texture._updateID++;\n texture.baseTexture.emit('update', texture.baseTexture);\n this.colorMap = texture;\n }\n };\n /**\n * Destroys this filter\n *\n * @param {boolean} [destroyBase=false] - Whether to destroy the base texture of colorMap as well\n */\n ColorMapFilter.prototype.destroy = function (destroyBase) {\n if (destroyBase === void 0) { destroyBase = false; }\n if (this._colorMap) {\n this._colorMap.destroy(destroyBase);\n }\n _super.prototype.destroy.call(this);\n };\n return ColorMapFilter;\n}(Filter));\n\nexport { ColorMapFilter };\n//# sourceMappingURL=filter-color-map.esm.mjs.map\n","/*!\n * @pixi/filter-color-overlay - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-color-overlay is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec3 color;\\nuniform float alpha;\\n\\nvoid main(void) {\\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\\n gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a);\\n}\\n\";\n\n/**\n * Replace all colors within a source graphic with a single color.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/color-overlay.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-color-replace|@pixi/filter-color-replace}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * // replaces red with blue\n * someSprite.filters = [new ColorOverlayFilter(\n * [1, 0, 0],\n * [0, 0, 1],\n * 0.001\n * )];\n *\n */\nvar ColorOverlayFilter = /** @class */ (function (_super) {\n __extends(ColorOverlayFilter, _super);\n /**\n * @param {number|Array} [color=0x000000] - The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @param {number} [alpha=1] - The alpha value of the color\n */\n function ColorOverlayFilter(color, alpha) {\n if (color === void 0) { color = 0x000000; }\n if (alpha === void 0) { alpha = 1; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._color = 0x0;\n _this._alpha = 1;\n _this.uniforms.color = new Float32Array(3);\n _this.color = color;\n _this.alpha = alpha;\n return _this;\n }\n Object.defineProperty(ColorOverlayFilter.prototype, \"color\", {\n get: function () {\n return this._color;\n },\n /**\n * The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @member {number|Array|Float32Array}\n * @default 0x000000\n */\n set: function (value) {\n var arr = this.uniforms.color;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._color = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n this._color = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorOverlayFilter.prototype, \"alpha\", {\n get: function () {\n return this._alpha;\n },\n /**\n * The alpha value of the color\n * @default 0\n */\n set: function (value) {\n this.uniforms.alpha = value;\n this._alpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorOverlayFilter;\n}(Filter));\n\nexport { ColorOverlayFilter };\n//# sourceMappingURL=filter-color-overlay.esm.mjs.map\n","/*!\n * @pixi/filter-color-replace - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-color-replace is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec3 originalColor;\\nuniform vec3 newColor;\\nuniform float epsilon;\\nvoid main(void) {\\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\\n float colorDistance = length(colorDiff);\\n float doReplace = step(colorDistance, epsilon);\\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\\n}\\n\";\n\n/**\n * ColorReplaceFilter, originally by mishaa, updated by timetocode\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/color-replace.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-color-replace|@pixi/filter-color-replace}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * // replaces true red with true blue\n * someSprite.filters = [new ColorReplaceFilter(\n * [1, 0, 0],\n * [0, 0, 1],\n * 0.001\n * )];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter(\n * [220/255.0, 220/255.0, 220/255.0],\n * [225/255.0, 200/255.0, 215/255.0],\n * 0.001\n * )];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter(0xdcdcdc, 0xe1c8d7, 0.001)];\n *\n */\nvar ColorReplaceFilter = /** @class */ (function (_super) {\n __extends(ColorReplaceFilter, _super);\n /**\n * @param {number|Array|Float32Array} [originalColor=0xFF0000] - The color that will be changed,\n * as a 3 component RGB e.g. `[1.0, 1.0, 1.0]`\n * @param {number|Array|Float32Array} [newColor=0x000000] - The resulting color, as a 3 component\n * RGB e.g. `[1.0, 0.5, 1.0]`\n * @param {number} [epsilon=0.4] - Tolerance/sensitivity of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n */\n function ColorReplaceFilter(originalColor, newColor, epsilon) {\n if (originalColor === void 0) { originalColor = 0xFF0000; }\n if (newColor === void 0) { newColor = 0x000000; }\n if (epsilon === void 0) { epsilon = 0.4; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._originalColor = 0xff0000;\n _this._newColor = 0x0;\n _this.uniforms.originalColor = new Float32Array(3);\n _this.uniforms.newColor = new Float32Array(3);\n _this.originalColor = originalColor;\n _this.newColor = newColor;\n _this.epsilon = epsilon;\n return _this;\n }\n Object.defineProperty(ColorReplaceFilter.prototype, \"originalColor\", {\n get: function () {\n return this._originalColor;\n },\n /**\n * The color that will be changed, as a 3 component RGB e.g. [1.0, 1.0, 1.0]\n * @member {number|Array|Float32Array}\n * @default 0xFF0000\n */\n set: function (value) {\n var arr = this.uniforms.originalColor;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._originalColor = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n this._originalColor = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorReplaceFilter.prototype, \"newColor\", {\n get: function () {\n return this._newColor;\n },\n /**\n * The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @member {number|Array|Float32Array}\n * @default 0x000000\n */\n set: function (value) {\n var arr = this.uniforms.newColor;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._newColor = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n this._newColor = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorReplaceFilter.prototype, \"epsilon\", {\n get: function () {\n return this.uniforms.epsilon;\n },\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n */\n set: function (value) {\n this.uniforms.epsilon = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorReplaceFilter;\n}(Filter));\n\nexport { ColorReplaceFilter };\n//# sourceMappingURL=filter-color-replace.esm.mjs.map\n","/*!\n * @pixi/filter-convolution - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-convolution is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying mediump vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec2 texelSize;\\nuniform float matrix[9];\\n\\nvoid main(void)\\n{\\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\\n\\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\\n\\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\\n\\n gl_FragColor =\\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\\n\\n gl_FragColor.a = c22.a;\\n}\\n\";\n\n/**\n * The ConvolutionFilter class applies a matrix convolution filter effect.\n * A convolution combines pixels in the input image with neighboring pixels to produce a new image.\n * A wide variety of image effects can be achieved through convolutions, including blurring, edge\n * detection, sharpening, embossing, and beveling. The matrix should be specified as a 9 point Array.\n * See https://docs.gimp.org/2.10/en/gimp-filter-convolution-matrix.html for more info.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/convolution.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-convolution|@pixi/filter-convolution}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ConvolutionFilter = /** @class */ (function (_super) {\n __extends(ConvolutionFilter, _super);\n /**\n * @param {number[]} [matrix=[0,0,0,0,0,0,0,0,0]] - An array of values used for matrix transformation.\n * Specified as a 9 point Array.\n * @param {number} [width=200] - Width of the object you are transforming\n * @param {number} [height=200] - Height of the object you are transforming\n */\n function ConvolutionFilter(matrix, width, height) {\n if (width === void 0) { width = 200; }\n if (height === void 0) { height = 200; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.uniforms.texelSize = new Float32Array(2);\n _this.uniforms.matrix = new Float32Array(9);\n if (matrix !== undefined) {\n _this.matrix = matrix;\n }\n _this.width = width;\n _this.height = height;\n return _this;\n }\n Object.defineProperty(ConvolutionFilter.prototype, \"matrix\", {\n /**\n * An array of values used for matrix transformation. Specified as a 9 point Array.\n */\n get: function () {\n return this.uniforms.matrix;\n },\n set: function (matrix) {\n var _this = this;\n matrix.forEach(function (v, i) {\n _this.uniforms.matrix[i] = v;\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ConvolutionFilter.prototype, \"width\", {\n /**\n * Width of the object you are transforming\n */\n get: function () {\n return 1 / this.uniforms.texelSize[0];\n },\n set: function (value) {\n this.uniforms.texelSize[0] = 1 / value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ConvolutionFilter.prototype, \"height\", {\n /**\n * Height of the object you are transforming\n */\n get: function () {\n return 1 / this.uniforms.texelSize[1];\n },\n set: function (value) {\n this.uniforms.texelSize[1] = 1 / value;\n },\n enumerable: false,\n configurable: true\n });\n return ConvolutionFilter;\n}(Filter));\n\nexport { ConvolutionFilter };\n//# sourceMappingURL=filter-convolution.esm.mjs.map\n","/*!\n * @pixi/filter-cross-hatch - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-cross-hatch is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\\n\\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\\n\\n if (lum < 1.00)\\n {\\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.75)\\n {\\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.50)\\n {\\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.3)\\n {\\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n}\\n\";\n\n/**\n * A Cross Hatch effect filter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/cross-hatch.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-cross-hatch|@pixi/filter-cross-hatch}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar CrossHatchFilter = /** @class */ (function (_super) {\n __extends(CrossHatchFilter, _super);\n function CrossHatchFilter() {\n return _super.call(this, vertex, fragment) || this;\n }\n return CrossHatchFilter;\n}(Filter));\n\nexport { CrossHatchFilter };\n//# sourceMappingURL=filter-cross-hatch.esm.mjs.map\n","/*!\n * @pixi/filter-crt - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-crt is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\n\\nconst float SQRT_2 = 1.414213;\\n\\nconst float light = 1.0;\\n\\nuniform float curvature;\\nuniform float lineWidth;\\nuniform float lineContrast;\\nuniform bool verticalLine;\\nuniform float noise;\\nuniform float noiseSize;\\n\\nuniform float vignetting;\\nuniform float vignettingAlpha;\\nuniform float vignettingBlur;\\n\\nuniform float seed;\\nuniform float time;\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main(void)\\n{\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n vec2 dir = vec2(vTextureCoord.xy * filterArea.xy / dimensions - vec2(0.5, 0.5));\\n \\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n vec3 rgb = gl_FragColor.rgb;\\n\\n if (noise > 0.0 && noiseSize > 0.0)\\n {\\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\\n rgb += _noise * noise;\\n }\\n\\n if (lineWidth > 0.0)\\n {\\n float _c = curvature > 0. ? curvature : 1.;\\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\\n vec2 uv = dir * k;\\n\\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\\n rgb *= j;\\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\\n rgb *= 0.99 + ceil(segment) * 0.015;\\n }\\n\\n if (vignetting > 0.0)\\n {\\n float outter = SQRT_2 - vignetting * SQRT_2;\\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\\n }\\n\\n gl_FragColor.rgb = rgb;\\n}\\n\";\n\n/**\n * The CRTFilter applies a CRT effect to an object.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/crt.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-crt|@pixi/filter-crt}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar CRTFilter = /** @class */ (function (_super) {\n __extends(CRTFilter, _super);\n /**\n * @param {object} [options] - The optional parameters of CRT effect\n * @param {number} [options.curvature=1.0] - Bent of interlaced lines, higher value means more bend\n * @param {number} [options.lineWidth=1.0] - Width of the interlaced lines\n * @param {number} [options.lineContrast=0.25] - Contrast of interlaced lines\n * @param {number} [options.verticalLine=false] - `true` is vertical lines, `false` is horizontal\n * @param {number} [options.noise=0.3] - Opacity/intensity of the noise effect between `0` and `1`\n * @param {number} [options.noiseSize=1.0] - The size of the noise particles\n * @param {number} [options.seed=0] - A seed value to apply to the random noise generation\n * @param {number} [options.vignetting=0.3] - The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @param {number} [options.vignettingAlpha=1.0] - Amount of opacity of vignette\n * @param {number} [options.vignettingBlur=0.3] - Blur intensity of the vignette\n * @param {number} [options.time=0] - For animating interlaced lines\n */\n function CRTFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** For animating interlaced lines */\n _this.time = 0;\n /** A seed value to apply to the random noise generation */\n _this.seed = 0;\n _this.uniforms.dimensions = new Float32Array(2);\n Object.assign(_this, CRTFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n CRTFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n this.uniforms.seed = this.seed;\n this.uniforms.time = this.time;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(CRTFilter.prototype, \"curvature\", {\n get: function () {\n return this.uniforms.curvature;\n },\n /**\n * Bent of interlaced lines, higher value means more bend\n * @default 1\n */\n set: function (value) {\n this.uniforms.curvature = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"lineWidth\", {\n get: function () {\n return this.uniforms.lineWidth;\n },\n /**\n * Width of interlaced lines\n * @default 1\n */\n set: function (value) {\n this.uniforms.lineWidth = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"lineContrast\", {\n get: function () {\n return this.uniforms.lineContrast;\n },\n /**\n * Contrast of interlaced lines\n * @default 0.25\n */\n set: function (value) {\n this.uniforms.lineContrast = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"verticalLine\", {\n get: function () {\n return this.uniforms.verticalLine;\n },\n /**\n * `true` for vertical lines, `false` for horizontal lines\n * @default false\n */\n set: function (value) {\n this.uniforms.verticalLine = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"noise\", {\n get: function () {\n return this.uniforms.noise;\n },\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0\n */\n set: function (value) {\n this.uniforms.noise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"noiseSize\", {\n get: function () {\n return this.uniforms.noiseSize;\n },\n /**\n * The size of the noise particles\n * @default 0\n */\n set: function (value) {\n this.uniforms.noiseSize = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"vignetting\", {\n get: function () {\n return this.uniforms.vignetting;\n },\n /**\n * The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignetting = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"vignettingAlpha\", {\n get: function () {\n return this.uniforms.vignettingAlpha;\n },\n /**\n * Amount of opacity of vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"vignettingBlur\", {\n get: function () {\n return this.uniforms.vignettingBlur;\n },\n /**\n * Blur intensity of the vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options */\n CRTFilter.defaults = {\n curvature: 1.0,\n lineWidth: 1.0,\n lineContrast: 0.25,\n verticalLine: false,\n noise: 0.0,\n noiseSize: 1.0,\n seed: 0.0,\n vignetting: 0.3,\n vignettingAlpha: 1.0,\n vignettingBlur: 0.3,\n time: 0.0,\n };\n return CRTFilter;\n}(Filter));\n\nexport { CRTFilter };\n//# sourceMappingURL=filter-crt.esm.mjs.map\n","/*!\n * @pixi/filter-drop-shadow - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-drop-shadow is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { KawaseBlurFilter } from '@pixi/filter-kawase-blur';\nimport { Filter } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { DEG_TO_RAD, Point } from '@pixi/math';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\n var arguments$1 = arguments;\n\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments$1[i];\r\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) { t[p] = s[p]; } }\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float alpha;\\nuniform vec3 color;\\n\\nuniform vec2 shift;\\nuniform vec4 inputSize;\\n\\nvoid main(void){\\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\\n\\n // Premultiply alpha\\n sample.rgb = color.rgb * sample.a;\\n\\n // alpha user alpha\\n sample *= alpha;\\n\\n gl_FragColor = sample;\\n}\";\n\n/**\n * Drop shadow filter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/drop-shadow.png)\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-drop-shadow|@pixi/filter-drop-shadow}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar DropShadowFilter = /** @class */ (function (_super) {\n __extends(DropShadowFilter, _super);\n /**\n * @param {object} [options] - Filter options\n * @param {number} [options.rotation=45] - The angle of the shadow in degrees.\n * @param {number} [options.distance=5] - Distance of shadow\n * @param {number} [options.color=0x000000] - Color of the shadow\n * @param {number} [options.alpha=0.5] - Alpha of the shadow\n * @param {boolean} [options.shadowOnly=false] - Whether render shadow only\n * @param {number} [options.blur=2] - Sets the strength of the Blur properties simultaneously\n * @param {number} [options.quality=3] - The quality of the Blur filter.\n * @param {number[]} [options.kernels=null] - The kernels of the Blur filter.\n * @param {number|number[]|PIXI.Point} [options.pixelSize=1] - the pixelSize of the Blur filter.\n * @param {number} [options.resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the Blur filter.\n */\n function DropShadowFilter(options) {\n var _this = _super.call(this) || this;\n /** Angle of the shadow in degrees. */\n _this.angle = 45;\n _this._distance = 5;\n _this._resolution = settings.FILTER_RESOLUTION;\n var opt = options\n ? __assign(__assign({}, DropShadowFilter.defaults), options) : DropShadowFilter.defaults;\n var kernels = opt.kernels, blur = opt.blur, quality = opt.quality, pixelSize = opt.pixelSize, resolution = opt.resolution;\n _this._tintFilter = new Filter(vertex, fragment);\n _this._tintFilter.uniforms.color = new Float32Array(4);\n _this._tintFilter.uniforms.shift = new Point();\n _this._tintFilter.resolution = resolution;\n _this._blurFilter = kernels\n ? new KawaseBlurFilter(kernels)\n : new KawaseBlurFilter(blur, quality);\n _this.pixelSize = pixelSize;\n _this.resolution = resolution;\n var shadowOnly = opt.shadowOnly, rotation = opt.rotation, distance = opt.distance, alpha = opt.alpha, color = opt.color;\n _this.shadowOnly = shadowOnly;\n _this.rotation = rotation;\n _this.distance = distance;\n _this.alpha = alpha;\n _this.color = color;\n _this._updatePadding();\n return _this;\n }\n DropShadowFilter.prototype.apply = function (filterManager, input, output, clear) {\n var target = filterManager.getFilterTexture();\n this._tintFilter.apply(filterManager, input, target, 1);\n this._blurFilter.apply(filterManager, target, output, clear);\n if (this.shadowOnly !== true) {\n filterManager.applyFilter(this, input, output, 0);\n }\n filterManager.returnFilterTexture(target);\n };\n /**\n * Recalculate the proper padding amount.\n * @private\n */\n DropShadowFilter.prototype._updatePadding = function () {\n this.padding = this.distance + (this.blur * 2);\n };\n /**\n * Update the transform matrix of offset angle.\n * @private\n */\n DropShadowFilter.prototype._updateShift = function () {\n this._tintFilter.uniforms.shift.set(this.distance * Math.cos(this.angle), this.distance * Math.sin(this.angle));\n };\n Object.defineProperty(DropShadowFilter.prototype, \"resolution\", {\n /**\n * The resolution of the filter.\n * @default PIXI.settings.FILTER_RESOLUTION\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._resolution = value;\n if (this._tintFilter) {\n this._tintFilter.resolution = value;\n }\n if (this._blurFilter) {\n this._blurFilter.resolution = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"distance\", {\n /**\n * Distance offset of the shadow\n * @default 5\n */\n get: function () {\n return this._distance;\n },\n set: function (value) {\n this._distance = value;\n this._updatePadding();\n this._updateShift();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"rotation\", {\n /**\n * The angle of the shadow in degrees\n * @default 2\n */\n get: function () {\n return this.angle / DEG_TO_RAD;\n },\n set: function (value) {\n this.angle = value * DEG_TO_RAD;\n this._updateShift();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"alpha\", {\n /**\n * The alpha of the shadow\n * @default 1\n */\n get: function () {\n return this._tintFilter.uniforms.alpha;\n },\n set: function (value) {\n this._tintFilter.uniforms.alpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"color\", {\n /**\n * The color of the shadow.\n * @default 0x000000\n */\n get: function () {\n return rgb2hex(this._tintFilter.uniforms.color);\n },\n set: function (value) {\n hex2rgb(value, this._tintFilter.uniforms.color);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"kernels\", {\n /**\n * Sets the kernels of the Blur Filter\n */\n get: function () {\n return this._blurFilter.kernels;\n },\n set: function (value) {\n this._blurFilter.kernels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"blur\", {\n /**\n * The blur of the shadow\n * @default 2\n */\n get: function () {\n return this._blurFilter.blur;\n },\n set: function (value) {\n this._blurFilter.blur = value;\n this._updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"quality\", {\n /**\n * Sets the quality of the Blur Filter\n * @default 4\n */\n get: function () {\n return this._blurFilter.quality;\n },\n set: function (value) {\n this._blurFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"pixelSize\", {\n /**\n * Sets the pixelSize of the Kawase Blur filter\n *\n * @member {number|number[]|PIXI.Point}\n * @default 1\n */\n get: function () {\n return this._blurFilter.pixelSize;\n },\n set: function (value) {\n this._blurFilter.pixelSize = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n DropShadowFilter.defaults = {\n rotation: 45,\n distance: 5,\n color: 0x000000,\n alpha: 0.5,\n shadowOnly: false,\n kernels: null,\n blur: 2,\n quality: 3,\n pixelSize: 1,\n resolution: settings.FILTER_RESOLUTION,\n };\n return DropShadowFilter;\n}(Filter));\n\nexport { DropShadowFilter };\n//# sourceMappingURL=filter-drop-shadow.esm.mjs.map\n","/*!\n * @pixi/filter-emboss - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-emboss is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float strength;\\nuniform vec4 filterArea;\\n\\n\\nvoid main(void)\\n{\\n\\tvec2 onePixel = vec2(1.0 / filterArea);\\n\\n\\tvec4 color;\\n\\n\\tcolor.rgb = vec3(0.5);\\n\\n\\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\\n\\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\\n\\n\\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\\n\\n\\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\\n\\n\\tgl_FragColor = vec4(color.rgb * alpha, alpha);\\n}\\n\";\n\n/**\n * An RGB Split Filter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/emboss.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-emboss|@pixi/filter-emboss}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar EmbossFilter = /** @class */ (function (_super) {\n __extends(EmbossFilter, _super);\n /**\n * @param {number} [strength=5] - Strength of the emboss.\n */\n function EmbossFilter(strength) {\n if (strength === void 0) { strength = 5; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.strength = strength;\n return _this;\n }\n Object.defineProperty(EmbossFilter.prototype, \"strength\", {\n /**\n * Strength of emboss.\n */\n get: function () {\n return this.uniforms.strength;\n },\n set: function (value) {\n this.uniforms.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n return EmbossFilter;\n}(Filter));\n\nexport { EmbossFilter };\n//# sourceMappingURL=filter-emboss.esm.mjs.map\n","/*!\n * @pixi/filter-glow - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-glow is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform sampler2D uSampler;\\n\\nuniform float outerStrength;\\nuniform float innerStrength;\\n\\nuniform vec4 glowColor;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform bool knockout;\\n\\nconst float PI = 3.14159265358979323846264;\\n\\nconst float DIST = __DIST__;\\nconst float ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.0);\\nconst float ANGLE_STEP_NUM = ceil(PI * 2.0 / ANGLE_STEP_SIZE);\\n\\nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM * DIST * (DIST + 1.0) / 2.0;\\n\\nvoid main(void) {\\n vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y);\\n\\n float totalAlpha = 0.0;\\n\\n vec2 direction;\\n vec2 displaced;\\n vec4 curColor;\\n\\n for (float angle = 0.0; angle < PI * 2.0; angle += ANGLE_STEP_SIZE) {\\n direction = vec2(cos(angle), sin(angle)) * px;\\n\\n for (float curDistance = 0.0; curDistance < DIST; curDistance++) {\\n displaced = clamp(vTextureCoord + direction * \\n (curDistance + 1.0), filterClamp.xy, filterClamp.zw);\\n\\n curColor = texture2D(uSampler, displaced);\\n\\n totalAlpha += (DIST - curDistance) * curColor.a;\\n }\\n }\\n \\n curColor = texture2D(uSampler, vTextureCoord);\\n\\n float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA);\\n\\n float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * curColor.a;\\n float innerGlowStrength = min(1.0, innerGlowAlpha);\\n \\n vec4 innerColor = mix(curColor, glowColor, innerGlowStrength);\\n\\n float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a);\\n float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);\\n\\n vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;\\n \\n if (knockout) {\\n float resultAlpha = outerGlowAlpha + innerGlowAlpha;\\n gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);\\n }\\n else {\\n gl_FragColor = innerColor + outerGlowColor;\\n }\\n}\\n\";\n\n/**\n * GlowFilter, originally by mishaa\n * [codepen]{@link http://codepen.io/mishaa/pen/raKzrm}.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/glow.png)\n * @class\n *\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-glow|@pixi/filter-glow}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * someSprite.filters = [\n * new GlowFilter({ distance: 15, outerStrength: 2 })\n * ];\n */\nvar GlowFilter = /** @class */ (function (_super) {\n __extends(GlowFilter, _super);\n /**\n * @param {number} [options] - Options for glow.\n * @param {number} [options.distance=10] - The distance of the glow. Make it 2 times more for resolution=2.\n * It can't be changed after filter creation.\n * @param {number} [options.outerStrength=4] - The strength of the glow outward from the edge of the sprite.\n * @param {number} [options.innerStrength=0] - The strength of the glow inward from the edge of the sprite.\n * @param {number} [options.color=0xffffff] - The color of the glow.\n * @param {number} [options.quality=0.1] - A number between 0 and 1 that describes the quality of the glow.\n * The higher the number the less performant.\n * @param {boolean} [options.knockout=false] - Toggle to hide the contents and only show glow.\n */\n function GlowFilter(options) {\n var _this = this;\n var opts = Object.assign({}, GlowFilter.defaults, options);\n var outerStrength = opts.outerStrength, innerStrength = opts.innerStrength, color = opts.color, knockout = opts.knockout, quality = opts.quality;\n var distance = Math.round(opts.distance);\n _this = _super.call(this, vertex, fragment\n .replace(/__ANGLE_STEP_SIZE__/gi, \"\" + (1 / quality / distance).toFixed(7))\n .replace(/__DIST__/gi, distance.toFixed(0) + \".0\")) || this;\n _this.uniforms.glowColor = new Float32Array([0, 0, 0, 1]);\n Object.assign(_this, {\n color: color,\n outerStrength: outerStrength,\n innerStrength: innerStrength,\n padding: distance,\n knockout: knockout,\n });\n return _this;\n }\n Object.defineProperty(GlowFilter.prototype, \"color\", {\n /**\n * The color of the glow.\n * @default 0xFFFFFF\n */\n get: function () {\n return rgb2hex(this.uniforms.glowColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.glowColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlowFilter.prototype, \"outerStrength\", {\n /**\n * The strength of the glow outward from the edge of the sprite.\n * @default 4\n */\n get: function () {\n return this.uniforms.outerStrength;\n },\n set: function (value) {\n this.uniforms.outerStrength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlowFilter.prototype, \"innerStrength\", {\n /**\n * The strength of the glow inward from the edge of the sprite.\n * @default 0\n */\n get: function () {\n return this.uniforms.innerStrength;\n },\n set: function (value) {\n this.uniforms.innerStrength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlowFilter.prototype, \"knockout\", {\n /**\n * Only draw the glow, not the texture itself\n * @default false\n */\n get: function () {\n return this.uniforms.knockout;\n },\n set: function (value) {\n this.uniforms.knockout = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default values for options. */\n GlowFilter.defaults = {\n distance: 10,\n outerStrength: 4,\n innerStrength: 0,\n color: 0xffffff,\n quality: 0.1,\n knockout: false,\n };\n return GlowFilter;\n}(Filter));\n\nexport { GlowFilter };\n//# sourceMappingURL=filter-glow.esm.mjs.map\n","/*!\n * @pixi/filter-motion-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-motion-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { ObservablePoint } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform vec2 uVelocity;\\nuniform int uKernelSize;\\nuniform float uOffset;\\n\\nconst int MAX_KERNEL_SIZE = 2048;\\n\\n// Notice:\\n// the perfect way:\\n// int kernelSize = min(uKernelSize, MAX_KERNELSIZE);\\n// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always.\\n// So use uKernelSize directly.\\n\\nvoid main(void)\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n if (uKernelSize == 0)\\n {\\n gl_FragColor = color;\\n return;\\n }\\n\\n vec2 velocity = uVelocity / filterArea.xy;\\n float offset = -uOffset / length(uVelocity) - 0.5;\\n int k = uKernelSize - 1;\\n\\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\\n if (i == k) {\\n break;\\n }\\n vec2 bias = velocity * (float(i) / float(k) + offset);\\n color += texture2D(uSampler, vTextureCoord + bias);\\n }\\n gl_FragColor = color / float(uKernelSize);\\n}\\n\";\n\n/**\n * The MotionBlurFilter applies a Motion blur to an object.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/motion-blur.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-motion-blur|@pixi/filter-motion-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar MotionBlurFilter = /** @class */ (function (_super) {\n __extends(MotionBlurFilter, _super);\n /**\n * @param {PIXI.ObservablePoint|PIXI.Point|number[]} [velocity=[0, 0]] - Sets the velocity of the motion for blur effect.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 5\n * @param {number} [offset=0] - The offset of the blur filter.\n */\n function MotionBlurFilter(velocity, kernelSize, offset) {\n if (velocity === void 0) { velocity = [0, 0]; }\n if (kernelSize === void 0) { kernelSize = 5; }\n if (offset === void 0) { offset = 0; }\n var _this = _super.call(this, vertex, fragment) || this;\n /**\n * The kernelSize of the blur, higher values are slower but look better.\n * Use odd value greater than 5.\n */\n _this.kernelSize = 5;\n _this.uniforms.uVelocity = new Float32Array(2);\n _this._velocity = new ObservablePoint(_this.velocityChanged, _this);\n _this.setVelocity(velocity);\n _this.kernelSize = kernelSize;\n _this.offset = offset;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n MotionBlurFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = this.velocity, x = _a.x, y = _a.y;\n this.uniforms.uKernelSize = (x !== 0 || y !== 0) ? this.kernelSize : 0;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(MotionBlurFilter.prototype, \"velocity\", {\n get: function () {\n return this._velocity;\n },\n /**\n * Sets the velocity of the motion for blur effect.\n *\n * @member {PIXI.ObservablePoint|PIXI.Point|number[]}\n */\n set: function (value) {\n this.setVelocity(value);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Set velocity with more broad types\n */\n MotionBlurFilter.prototype.setVelocity = function (value) {\n if (Array.isArray(value)) {\n var x = value[0], y = value[1];\n this._velocity.set(x, y);\n }\n else {\n this._velocity.copyFrom(value);\n }\n };\n /**\n * Handle velocity changed\n * @private\n */\n MotionBlurFilter.prototype.velocityChanged = function () {\n this.uniforms.uVelocity[0] = this._velocity.x;\n this.uniforms.uVelocity[1] = this._velocity.y;\n // The padding will be increased as the velocity and intern the blur size is changed\n this.padding = (Math.max(Math.abs(this._velocity.x), Math.abs(this._velocity.y)) >> 0) + 1;\n };\n Object.defineProperty(MotionBlurFilter.prototype, \"offset\", {\n get: function () {\n return this.uniforms.uOffset;\n },\n /**\n * The offset of the blur filter.\n * @default 0\n */\n set: function (value) {\n this.uniforms.uOffset = value;\n },\n enumerable: false,\n configurable: true\n });\n return MotionBlurFilter;\n}(Filter));\n\nexport { MotionBlurFilter };\n//# sourceMappingURL=filter-motion-blur.esm.mjs.map\n","/*!\n * @pixi/filter-multi-color-replace - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-multi-color-replace is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform float epsilon;\\n\\nconst int MAX_COLORS = %maxColors%;\\n\\nuniform vec3 originalColors[MAX_COLORS];\\nuniform vec3 targetColors[MAX_COLORS];\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n\\n float alpha = gl_FragColor.a;\\n if (alpha < 0.0001)\\n {\\n return;\\n }\\n\\n vec3 color = gl_FragColor.rgb / alpha;\\n\\n for(int i = 0; i < MAX_COLORS; i++)\\n {\\n vec3 origColor = originalColors[i];\\n if (origColor.r < 0.0)\\n {\\n break;\\n }\\n vec3 colorDiff = origColor - color;\\n if (length(colorDiff) < epsilon)\\n {\\n vec3 targetColor = targetColors[i];\\n gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha);\\n return;\\n }\\n }\\n}\\n\";\n\n/**\n * Filter for replacing a color with another color. Similar to ColorReplaceFilter, but support multiple\n * colors.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/multi-color-replace.png)\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-multi-color-replace|@pixi/filter-multi-color-replace}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * // replaces pure red with pure blue, and replaces pure green with pure white\n * someSprite.filters = [new MultiColorReplaceFilter(\n * [\n * [0xFF0000, 0x0000FF],\n * [0x00FF00, 0xFFFFFF]\n * ],\n * 0.001\n * )];\n *\n * You also could use [R, G, B] as the color\n * someOtherSprite.filters = [new MultiColorReplaceFilter(\n * [\n * [ [1,0,0], [0,0,1] ],\n * [ [0,1,0], [1,1,1] ]\n * ],\n * 0.001\n * )];\n *\n */\nvar MultiColorReplaceFilter = /** @class */ (function (_super) {\n __extends(MultiColorReplaceFilter, _super);\n /**\n * @param {Array} replacements - The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value\n * is target color.\n * @param {number} [epsilon=0.05] - Tolerance of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n * @param {number} [maxColors] - The maximum number of replacements filter is able to use. Because the\n * fragment is only compiled once, this cannot be changed after construction.\n * If omitted, the default value is the length of `replacements`.\n */\n function MultiColorReplaceFilter(replacements, epsilon, maxColors) {\n if (epsilon === void 0) { epsilon = 0.05; }\n if (maxColors === void 0) { maxColors = replacements.length; }\n var _this = _super.call(this, vertex, fragment.replace(/%maxColors%/g, (maxColors).toFixed(0))) || this;\n _this._replacements = [];\n _this._maxColors = 0;\n _this.epsilon = epsilon;\n _this._maxColors = maxColors;\n _this.uniforms.originalColors = new Float32Array(maxColors * 3);\n _this.uniforms.targetColors = new Float32Array(maxColors * 3);\n _this.replacements = replacements;\n return _this;\n }\n Object.defineProperty(MultiColorReplaceFilter.prototype, \"replacements\", {\n get: function () {\n return this._replacements;\n },\n /**\n * The source and target colors for replacement. See constructor for information on the format.\n *\n * @member {Array}\n */\n set: function (replacements) {\n var originals = this.uniforms.originalColors;\n var targets = this.uniforms.targetColors;\n var colorCount = replacements.length;\n if (colorCount > this._maxColors) {\n throw new Error(\"Length of replacements (\" + colorCount + \") exceeds the maximum colors length (\" + this._maxColors + \")\");\n }\n // Fill with negative values\n originals[colorCount * 3] = -1;\n for (var i = 0; i < colorCount; i++) {\n var pair = replacements[i];\n // for original colors\n var color = pair[0];\n if (typeof color === 'number') {\n color = hex2rgb(color);\n }\n else {\n pair[0] = rgb2hex(color);\n }\n originals[i * 3] = color[0];\n originals[(i * 3) + 1] = color[1];\n originals[(i * 3) + 2] = color[2];\n // for target colors\n var targetColor = pair[1];\n if (typeof targetColor === 'number') {\n targetColor = hex2rgb(targetColor);\n }\n else {\n pair[1] = rgb2hex(targetColor);\n }\n targets[i * 3] = targetColor[0];\n targets[(i * 3) + 1] = targetColor[1];\n targets[(i * 3) + 2] = targetColor[2];\n }\n this._replacements = replacements;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Should be called after changing any of the contents of the replacements.\n * This is a convenience method for resetting the `replacements`.\n */\n MultiColorReplaceFilter.prototype.refresh = function () {\n this.replacements = this._replacements;\n };\n Object.defineProperty(MultiColorReplaceFilter.prototype, \"maxColors\", {\n /**\n * The maximum number of color replacements supported by this filter. Can be changed\n * _only_ during construction.\n * @readonly\n */\n get: function () {\n return this._maxColors;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiColorReplaceFilter.prototype, \"epsilon\", {\n get: function () {\n return this.uniforms.epsilon;\n },\n /**\n * Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n set: function (value) {\n this.uniforms.epsilon = value;\n },\n enumerable: false,\n configurable: true\n });\n return MultiColorReplaceFilter;\n}(Filter));\n\nexport { MultiColorReplaceFilter };\n//# sourceMappingURL=filter-multi-color-replace.esm.mjs.map\n","/*!\n * @pixi/filter-outline - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-outline is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 thickness;\\nuniform vec4 outlineColor;\\nuniform vec4 filterClamp;\\n\\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\\n\\nvoid main(void) {\\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\\n vec4 curColor;\\n float maxAlpha = 0.;\\n vec2 displaced;\\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\\n maxAlpha = max(maxAlpha, curColor.a);\\n }\\n float resultAlpha = max(maxAlpha, ownColor.a);\\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\\n}\\n\";\n\n/**\n * OutlineFilter, originally by mishaa\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966\n * http://codepen.io/mishaa/pen/emGNRB
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/outline.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-outline|@pixi/filter-outline}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters} *\n * @example\n * someSprite.filters = [new OutlineFilter(2, 0x99ff99)];\n */\nvar OutlineFilter = /** @class */ (function (_super) {\n __extends(OutlineFilter, _super);\n /**\n * @param {number} [thickness=1] - The tickness of the outline. Make it 2 times more for resolution 2\n * @param {number} [color=0x000000] - The color of the outline.\n * @param {number} [quality=0.1] - The quality of the outline from `0` to `1`, using a higher quality\n * setting will result in slower performance and more accuracy.\n */\n function OutlineFilter(thickness, color, quality) {\n if (thickness === void 0) { thickness = 1; }\n if (color === void 0) { color = 0x000000; }\n if (quality === void 0) { quality = 0.1; }\n var _this = _super.call(this, vertex, fragment.replace(/\\$\\{angleStep\\}/, OutlineFilter.getAngleStep(quality))) || this;\n _this._thickness = 1;\n _this.uniforms.thickness = new Float32Array([0, 0]);\n _this.uniforms.outlineColor = new Float32Array([0, 0, 0, 1]);\n Object.assign(_this, { thickness: thickness, color: color, quality: quality });\n return _this;\n }\n /**\n * Get the angleStep by quality\n * @private\n */\n OutlineFilter.getAngleStep = function (quality) {\n var samples = Math.max(quality * OutlineFilter.MAX_SAMPLES, OutlineFilter.MIN_SAMPLES);\n return (Math.PI * 2 / samples).toFixed(7);\n };\n OutlineFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms.thickness[0] = this._thickness / input._frame.width;\n this.uniforms.thickness[1] = this._thickness / input._frame.height;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(OutlineFilter.prototype, \"color\", {\n /**\n * The color of the glow.\n * @default 0x000000\n */\n get: function () {\n return rgb2hex(this.uniforms.outlineColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.outlineColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OutlineFilter.prototype, \"thickness\", {\n /**\n * The thickness of the outline.\n * @default 1\n */\n get: function () {\n return this._thickness;\n },\n set: function (value) {\n this._thickness = value;\n this.padding = value;\n },\n enumerable: false,\n configurable: true\n });\n /** The minimum number of samples for rendering outline. */\n OutlineFilter.MIN_SAMPLES = 1;\n /** The maximum number of samples for rendering outline. */\n OutlineFilter.MAX_SAMPLES = 100;\n return OutlineFilter;\n}(Filter));\n\nexport { OutlineFilter };\n//# sourceMappingURL=filter-outline.esm.mjs.map\n","/*!\n * @pixi/filter-pixelate - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-pixelate is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 size;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 pixelate(vec2 coord, vec2 size)\\n{\\n\\treturn floor( coord / size ) * size;\\n}\\n\\nvoid main(void)\\n{\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n coord = pixelate(coord, size);\\n\\n coord = unmapCoord(coord);\\n\\n gl_FragColor = texture2D(uSampler, coord);\\n}\\n\";\n\n/**\n * This filter applies a pixelate effect making display objects appear 'blocky'.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/pixelate.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-pixelate|@pixi/filter-pixelate}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar PixelateFilter = /** @class */ (function (_super) {\n __extends(PixelateFilter, _super);\n /**\n * @param {PIXI.Point|Array|number} [size=10] - Either the width/height of the size of the pixels, or square size\n */\n function PixelateFilter(size) {\n if (size === void 0) { size = 10; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.size = size;\n return _this;\n }\n Object.defineProperty(PixelateFilter.prototype, \"size\", {\n /**\n * This a point that describes the size of the blocks.\n * x is the width of the block and y is the height.\n *\n * @member {PIXI.Point|Array|number}\n * @default 10\n */\n get: function () {\n return this.uniforms.size;\n },\n set: function (value) {\n if (typeof value === 'number') {\n value = [value, value];\n }\n this.uniforms.size = value;\n },\n enumerable: false,\n configurable: true\n });\n return PixelateFilter;\n}(Filter));\n\nexport { PixelateFilter };\n//# sourceMappingURL=filter-pixelate.esm.mjs.map\n","/*!\n * @pixi/filter-radial-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-radial-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform float uRadian;\\nuniform vec2 uCenter;\\nuniform float uRadius;\\nuniform int uKernelSize;\\n\\nconst int MAX_KERNEL_SIZE = 2048;\\n\\nvoid main(void)\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n if (uKernelSize == 0)\\n {\\n gl_FragColor = color;\\n return;\\n }\\n\\n float aspect = filterArea.y / filterArea.x;\\n vec2 center = uCenter.xy / filterArea.xy;\\n float gradient = uRadius / filterArea.x * 0.3;\\n float radius = uRadius / filterArea.x - gradient * 0.5;\\n int k = uKernelSize - 1;\\n\\n vec2 coord = vTextureCoord;\\n vec2 dir = vec2(center - coord);\\n float dist = length(vec2(dir.x, dir.y * aspect));\\n\\n float radianStep = uRadian;\\n if (radius >= 0.0 && dist > radius) {\\n float delta = dist - radius;\\n float gap = gradient;\\n float scale = 1.0 - abs(delta / gap);\\n if (scale <= 0.0) {\\n gl_FragColor = color;\\n return;\\n }\\n radianStep *= scale;\\n }\\n radianStep /= float(k);\\n\\n float s = sin(radianStep);\\n float c = cos(radianStep);\\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\\n\\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\\n if (i == k) {\\n break;\\n }\\n\\n coord -= center;\\n coord.y *= aspect;\\n coord = rotationMatrix * coord;\\n coord.y /= aspect;\\n coord += center;\\n\\n vec4 sample = texture2D(uSampler, coord);\\n\\n // switch to pre-multiplied alpha to correctly blur transparent images\\n // sample.rgb *= sample.a;\\n\\n color += sample;\\n }\\n\\n gl_FragColor = color / float(uKernelSize);\\n}\\n\";\n\n/**\n * The RadialBlurFilter applies a Motion blur to an object.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/radial-blur.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-radial-blur|@pixi/filter-radial-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar RadialBlurFilter = /** @class */ (function (_super) {\n __extends(RadialBlurFilter, _super);\n /**\n * @param {number} [angle=0] - Sets the angle of the motion for blur effect.\n * @param {PIXI.Point|number[]} [center=[0,0]] - The center of the radial.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 3\n * @param {number} [radius=-1] - The maximum size of the blur radius, `-1` is infinite\n */\n function RadialBlurFilter(angle, center, kernelSize, radius) {\n if (angle === void 0) { angle = 0; }\n if (center === void 0) { center = [0, 0]; }\n if (kernelSize === void 0) { kernelSize = 5; }\n if (radius === void 0) { radius = -1; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._angle = 0;\n _this.angle = angle;\n _this.center = center;\n _this.kernelSize = kernelSize;\n _this.radius = radius;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n RadialBlurFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms.uKernelSize = this._angle !== 0 ? this.kernelSize : 0;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(RadialBlurFilter.prototype, \"angle\", {\n get: function () {\n return this._angle;\n },\n /**\n * Sets the angle in degrees of the motion for blur effect.\n * @default 0\n */\n set: function (value) {\n this._angle = value;\n this.uniforms.uRadian = value * Math.PI / 180;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RadialBlurFilter.prototype, \"center\", {\n /**\n * Center of the effect.\n *\n * @member {PIXI.Point|number[]}\n * @default [0, 0]\n */\n get: function () {\n return this.uniforms.uCenter;\n },\n set: function (value) {\n this.uniforms.uCenter = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RadialBlurFilter.prototype, \"radius\", {\n /**\n * Outer radius of the effect. The default value of `-1` is infinite.\n * @default -1\n */\n get: function () {\n return this.uniforms.uRadius;\n },\n set: function (value) {\n if (value < 0 || value === Infinity) {\n value = -1;\n }\n this.uniforms.uRadius = value;\n },\n enumerable: false,\n configurable: true\n });\n return RadialBlurFilter;\n}(Filter));\n\nexport { RadialBlurFilter };\n//# sourceMappingURL=filter-radial-blur.esm.mjs.map\n","/*!\n * @pixi/filter-shockwave - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-shockwave is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\n\\nuniform vec2 center;\\n\\nuniform float amplitude;\\nuniform float wavelength;\\n// uniform float power;\\nuniform float brightness;\\nuniform float speed;\\nuniform float radius;\\n\\nuniform float time;\\n\\nconst float PI = 3.14159;\\n\\nvoid main()\\n{\\n float halfWavelength = wavelength * 0.5 / filterArea.x;\\n float maxRadius = radius / filterArea.x;\\n float currentRadius = time * speed / filterArea.x;\\n\\n float fade = 1.0;\\n\\n if (maxRadius > 0.0) {\\n if (currentRadius > maxRadius) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\\n }\\n\\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\\n dir.y *= filterArea.y / filterArea.x;\\n float dist = length(dir);\\n\\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n\\n vec2 diffUV = normalize(dir);\\n\\n float diff = (dist - currentRadius) / halfWavelength;\\n\\n float p = 1.0 - pow(abs(diff), 2.0);\\n\\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\\n\\n vec2 offset = diffUV * powDiff / filterArea.xy;\\n\\n // Do clamp :\\n vec2 coord = vTextureCoord + offset;\\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n vec4 color = texture2D(uSampler, clampedCoord);\\n if (coord != clampedCoord) {\\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\\n }\\n\\n // No clamp :\\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\\n\\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * The ShockwaveFilter class lets you apply a shockwave effect.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/shockwave.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-shockwave|@pixi/filter-shockwave}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ShockwaveFilter = /** @class */ (function (_super) {\n __extends(ShockwaveFilter, _super);\n /**\n * @param {PIXI.Point|number[]} [center=[0.5, 0.5]] - See `center` property.\n * @param {object} [options] - The optional parameters of shockwave filter.\n * @param {number} [options.amplitude=0.5] - See `amplitude`` property.\n * @param {number} [options.wavelength=1.0] - See `wavelength` property.\n * @param {number} [options.speed=500.0] - See `speed` property.\n * @param {number} [options.brightness=8] - See `brightness` property.\n * @param {number} [options.radius=4] - See `radius` property.\n * @param {number} [time=0] - See `time` property.\n */\n function ShockwaveFilter(center, options, time) {\n if (center === void 0) { center = [0, 0]; }\n if (time === void 0) { time = 0; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.center = center;\n Object.assign(_this, ShockwaveFilter.defaults, options);\n _this.time = time;\n return _this;\n }\n ShockwaveFilter.prototype.apply = function (filterManager, input, output, clear) {\n // There is no set/get of `time`, for performance.\n // Because in the most real cases, `time` will be changed in ever game tick.\n // Use set/get will take more function-call.\n this.uniforms.time = this.time;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(ShockwaveFilter.prototype, \"center\", {\n /**\n * Sets the center of the shockwave in normalized screen coords. That is\n * (0,0) is the top-left and (1,1) is the bottom right.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.center;\n },\n set: function (value) {\n this.uniforms.center = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"amplitude\", {\n /**\n * The amplitude of the shockwave.\n */\n get: function () {\n return this.uniforms.amplitude;\n },\n set: function (value) {\n this.uniforms.amplitude = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"wavelength\", {\n /**\n * The wavelength of the shockwave.\n */\n get: function () {\n return this.uniforms.wavelength;\n },\n set: function (value) {\n this.uniforms.wavelength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"brightness\", {\n /**\n * The brightness of the shockwave.\n */\n get: function () {\n return this.uniforms.brightness;\n },\n set: function (value) {\n this.uniforms.brightness = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"speed\", {\n /**\n * The speed about the shockwave ripples out.\n * The unit is `pixel/second`\n */\n get: function () {\n return this.uniforms.speed;\n },\n set: function (value) {\n this.uniforms.speed = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"radius\", {\n /**\n * The maximum radius of shockwave.\n * `< 0.0` means it's infinity.\n */\n get: function () {\n return this.uniforms.radius;\n },\n set: function (value) {\n this.uniforms.radius = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n ShockwaveFilter.defaults = {\n amplitude: 30.0,\n wavelength: 160.0,\n brightness: 1.0,\n speed: 500.0,\n radius: -1.0,\n };\n return ShockwaveFilter;\n}(Filter));\n\nexport { ShockwaveFilter };\n//# sourceMappingURL=filter-shockwave.esm.mjs.map\n","/*!\n * @pixi/filter-simple-lightmap - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-simple-lightmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform sampler2D uLightmap;\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\nuniform vec4 ambientColor;\\nvoid main() {\\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\\n vec4 light = texture2D(uLightmap, lightCoord);\\n vec3 ambient = ambientColor.rgb * ambientColor.a;\\n vec3 intensity = ambient + light.rgb;\\n vec3 finalColor = diffuseColor.rgb * intensity;\\n gl_FragColor = vec4(finalColor, diffuseColor.a);\\n}\\n\";\n\n/**\n* SimpleLightmap, originally by Oza94\n* http://www.html5gamedevs.com/topic/20027-pixijs-simple-lightmapping/\n* http://codepen.io/Oza94/pen/EPoRxj\n*\n* You have to specify filterArea, or suffer consequences.\n* You may have to use it with `filter.dontFit = true`,\n* until we rewrite this using same approach as for DisplacementFilter.\n*\n* ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/simple-lightmap.png)\n* @class\n* @extends PIXI.Filter\n* @memberof PIXI.filters\n* @see {@link https://www.npmjs.com/package/@pixi/filter-simple-lightmap|@pixi/filter-simple-lightmap}\n* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n*\n* @example\n* displayObject.filters = [new SimpleLightmapFilter(texture, 0x666666)];\n*/\nvar SimpleLightmapFilter = /** @class */ (function (_super) {\n __extends(SimpleLightmapFilter, _super);\n /**\n * @param {PIXI.Texture} texture - a texture where your lightmap is rendered\n * @param {Array|number} [color=0x000000] - An RGBA array of the ambient color\n * @param {number} [alpha=1] - Default alpha set independent of color (if it's a number, not array).\n */\n function SimpleLightmapFilter(texture, color, alpha) {\n if (color === void 0) { color = 0x000000; }\n if (alpha === void 0) { alpha = 1; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._color = 0x0;\n _this.uniforms.dimensions = new Float32Array(2);\n _this.uniforms.ambientColor = new Float32Array([0, 0, 0, alpha]);\n _this.texture = texture;\n _this.color = color;\n return _this;\n }\n /**\n * Applies the filter.\n * @private\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n SimpleLightmapFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a, _b;\n this.uniforms.dimensions[0] = (_a = input.filterFrame) === null || _a === void 0 ? void 0 : _a.width;\n this.uniforms.dimensions[1] = (_b = input.filterFrame) === null || _b === void 0 ? void 0 : _b.height;\n // draw the filter...\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(SimpleLightmapFilter.prototype, \"texture\", {\n /**\n * a texture where your lightmap is rendered\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.uniforms.uLightmap;\n },\n set: function (value) {\n this.uniforms.uLightmap = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SimpleLightmapFilter.prototype, \"color\", {\n get: function () {\n return this._color;\n },\n /**\n * An RGBA array of the ambient color or a hex color without alpha\n * @member {Array|number}\n */\n set: function (value) {\n var arr = this.uniforms.ambientColor;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._color = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n arr[3] = value[3];\n this._color = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SimpleLightmapFilter.prototype, \"alpha\", {\n /**\n * When setting `color` as hex, this can be used to set alpha independently.\n */\n get: function () {\n return this.uniforms.ambientColor[3];\n },\n set: function (value) {\n this.uniforms.ambientColor[3] = value;\n },\n enumerable: false,\n configurable: true\n });\n return SimpleLightmapFilter;\n}(Filter));\n\nexport { SimpleLightmapFilter };\n//# sourceMappingURL=filter-simple-lightmap.esm.mjs.map\n","/*!\n * @pixi/filter-tilt-shift - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-tilt-shift is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float blur;\\nuniform float gradientBlur;\\nuniform vec2 start;\\nuniform vec2 end;\\nuniform vec2 delta;\\nuniform vec2 texSize;\\n\\nfloat random(vec3 scale, float seed)\\n{\\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\\n}\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n float total = 0.0;\\n\\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\\n\\n for (float t = -30.0; t <= 30.0; t++)\\n {\\n float percent = (t + offset - 0.5) / 30.0;\\n float weight = 1.0 - abs(percent);\\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\\n sample.rgb *= sample.a;\\n color += sample * weight;\\n total += weight;\\n }\\n\\n color /= total;\\n color.rgb /= color.a + 0.00001;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShiftAxisFilter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @private\n */\nvar TiltShiftAxisFilter = /** @class */ (function (_super) {\n __extends(TiltShiftAxisFilter, _super);\n function TiltShiftAxisFilter(blur, gradientBlur, start, end) {\n if (blur === void 0) { blur = 100; }\n if (gradientBlur === void 0) { gradientBlur = 600; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.uniforms.blur = blur;\n _this.uniforms.gradientBlur = gradientBlur;\n _this.uniforms.start = start || new Point(0, window.innerHeight / 2);\n _this.uniforms.end = end || new Point(600, window.innerHeight / 2);\n _this.uniforms.delta = new Point(30, 30);\n _this.uniforms.texSize = new Point(window.innerWidth, window.innerHeight);\n _this.updateDelta();\n return _this;\n }\n /**\n * Updates the filter delta values.\n * This is overridden in the X and Y filters, does nothing for this class.\n *\n */\n TiltShiftAxisFilter.prototype.updateDelta = function () {\n this.uniforms.delta.x = 0;\n this.uniforms.delta.y = 0;\n };\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"blur\", {\n /**\n * The strength of the blur.\n *\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.blur;\n },\n set: function (value) {\n this.uniforms.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"gradientBlur\", {\n /**\n * The strength of the gradient blur.\n *\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.gradientBlur;\n },\n set: function (value) {\n this.uniforms.gradientBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"start\", {\n /**\n * The X value to start the effect at.\n *\n * @member {PIXI.Point}\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.start;\n },\n set: function (value) {\n this.uniforms.start = value;\n this.updateDelta();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"end\", {\n /**\n * The X value to end the effect at.\n *\n * @member {PIXI.Point}\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.end;\n },\n set: function (value) {\n this.uniforms.end = value;\n this.updateDelta();\n },\n enumerable: false,\n configurable: true\n });\n return TiltShiftAxisFilter;\n}(Filter));\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShiftXFilter.\n *\n * @class\n * @extends PIXI.TiltShiftAxisFilter\n * @memberof PIXI.filters\n * @private\n */\nvar TiltShiftXFilter = /** @class */ (function (_super) {\n __extends(TiltShiftXFilter, _super);\n function TiltShiftXFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates the filter delta values.\n */\n TiltShiftXFilter.prototype.updateDelta = function () {\n var dx = this.uniforms.end.x - this.uniforms.start.x;\n var dy = this.uniforms.end.y - this.uniforms.start.y;\n var d = Math.sqrt((dx * dx) + (dy * dy));\n this.uniforms.delta.x = dx / d;\n this.uniforms.delta.y = dy / d;\n };\n return TiltShiftXFilter;\n}(TiltShiftAxisFilter));\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShiftYFilter.\n *\n * @class\n * @extends PIXI.TiltShiftAxisFilter\n * @memberof PIXI.filters\n * @private\n */\nvar TiltShiftYFilter = /** @class */ (function (_super) {\n __extends(TiltShiftYFilter, _super);\n function TiltShiftYFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates the filter delta values.\n */\n TiltShiftYFilter.prototype.updateDelta = function () {\n var dx = this.uniforms.end.x - this.uniforms.start.x;\n var dy = this.uniforms.end.y - this.uniforms.start.y;\n var d = Math.sqrt((dx * dx) + (dy * dy));\n this.uniforms.delta.x = -dy / d;\n this.uniforms.delta.y = dx / d;\n };\n return TiltShiftYFilter;\n}(TiltShiftAxisFilter));\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/tilt-shift.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-tilt-shift|@pixi/filter-tilt-shift}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar TiltShiftFilter = /** @class */ (function (_super) {\n __extends(TiltShiftFilter, _super);\n /**\n * @param {number} [blur=100] - The strength of the blur.\n * @param {number} [gradientBlur=600] - The strength of the gradient blur.\n * @param {PIXI.Point} [start=null] - The Y value to start the effect at.\n * @param {PIXI.Point} [end=null] - The Y value to end the effect at.\n */\n function TiltShiftFilter(blur, gradientBlur, start, end) {\n if (blur === void 0) { blur = 100; }\n if (gradientBlur === void 0) { gradientBlur = 600; }\n var _this = _super.call(this) || this;\n _this.tiltShiftXFilter = new TiltShiftXFilter(blur, gradientBlur, start, end);\n _this.tiltShiftYFilter = new TiltShiftYFilter(blur, gradientBlur, start, end);\n return _this;\n }\n TiltShiftFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var renderTarget = filterManager.getFilterTexture();\n this.tiltShiftXFilter.apply(filterManager, input, renderTarget, 1);\n this.tiltShiftYFilter.apply(filterManager, renderTarget, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n };\n Object.defineProperty(TiltShiftFilter.prototype, \"blur\", {\n /**\n * The strength of the blur.\n */\n get: function () {\n return this.tiltShiftXFilter.blur;\n },\n set: function (value) {\n this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftFilter.prototype, \"gradientBlur\", {\n /**\n * The strength of the gradient blur.\n */\n get: function () {\n return this.tiltShiftXFilter.gradientBlur;\n },\n set: function (value) {\n this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftFilter.prototype, \"start\", {\n /**\n * The Y value to start the effect at.\n *\n * @member {PIXI.Point}\n */\n get: function () {\n return this.tiltShiftXFilter.start;\n },\n set: function (value) {\n this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftFilter.prototype, \"end\", {\n /**\n * The Y value to end the effect at.\n *\n * @member {PIXI.Point}\n */\n get: function () {\n return this.tiltShiftXFilter.end;\n },\n set: function (value) {\n this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value;\n },\n enumerable: false,\n configurable: true\n });\n return TiltShiftFilter;\n}(Filter));\n\nexport { TiltShiftAxisFilter, TiltShiftFilter, TiltShiftXFilter, TiltShiftYFilter };\n//# sourceMappingURL=filter-tilt-shift.esm.mjs.map\n","/*!\n * @pixi/filter-twist - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-twist is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float radius;\\nuniform float angle;\\nuniform vec2 offset;\\nuniform vec4 filterArea;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 twist(vec2 coord)\\n{\\n coord -= offset;\\n\\n float dist = length(coord);\\n\\n if (dist < radius)\\n {\\n float ratioDist = (radius - dist) / radius;\\n float angleMod = ratioDist * ratioDist * angle;\\n float s = sin(angleMod);\\n float c = cos(angleMod);\\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\\n }\\n\\n coord += offset;\\n\\n return coord;\\n}\\n\\nvoid main(void)\\n{\\n\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n coord = twist(coord);\\n\\n coord = unmapCoord(coord);\\n\\n gl_FragColor = texture2D(uSampler, coord );\\n\\n}\\n\";\n\n/**\n * This filter applies a twist effect making display objects appear twisted in the given direction.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/twist.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-twist|@pixi/filter-twist}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar TwistFilter = /** @class */ (function (_super) {\n __extends(TwistFilter, _super);\n /**\n * @param {object} [options] - Object object to use.\n * @param {number} [options.radius=200] - The radius of the twist.\n * @param {number} [options.angle=4] - The angle of the twist.\n * @param {number} [options.padding=20] - Padding for filter area.\n * @param {PIXI.Point} [options.offset] - Center of twist, in local, pixel coordinates.\n */\n function TwistFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n Object.assign(_this, TwistFilter.defaults, options);\n return _this;\n }\n Object.defineProperty(TwistFilter.prototype, \"offset\", {\n /**\n * This point describes the the offset of the twist.\n *\n * @member {PIXI.Point}\n */\n get: function () {\n return this.uniforms.offset;\n },\n set: function (value) {\n this.uniforms.offset = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TwistFilter.prototype, \"radius\", {\n /**\n * The radius of the twist.\n */\n get: function () {\n return this.uniforms.radius;\n },\n set: function (value) {\n this.uniforms.radius = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TwistFilter.prototype, \"angle\", {\n /**\n * The angle of the twist.\n */\n get: function () {\n return this.uniforms.angle;\n },\n set: function (value) {\n this.uniforms.angle = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n TwistFilter.defaults = {\n radius: 200,\n angle: 4,\n padding: 20,\n offset: new Point(),\n };\n return TwistFilter;\n}(Filter));\n\nexport { TwistFilter };\n//# sourceMappingURL=filter-twist.esm.mjs.map\n","/*!\n * @pixi/filter-zoom-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-zoom-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n { t[p] = s[p]; } }\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n { t[p[i]] = s[p[i]]; }\r\n } }\r\n return t;\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform vec2 uCenter;\\nuniform float uStrength;\\nuniform float uInnerRadius;\\nuniform float uRadius;\\n\\nconst float MAX_KERNEL_SIZE = ${maxKernelSize};\\n\\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\\nhighp float rand(vec2 co, float seed) {\\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\\n return fract(sin(sn) * c + seed);\\n}\\n\\nvoid main() {\\n\\n float minGradient = uInnerRadius * 0.3;\\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\\n\\n float gradient = uRadius * 0.3;\\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\\n\\n float countLimit = MAX_KERNEL_SIZE;\\n\\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\\n\\n float strength = uStrength;\\n\\n float delta = 0.0;\\n float gap;\\n if (dist < innerRadius) {\\n delta = innerRadius - dist;\\n gap = minGradient;\\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\\n delta = dist - radius;\\n gap = gradient;\\n }\\n\\n if (delta > 0.0) {\\n float normalCount = gap / filterArea.x;\\n delta = (normalCount - delta) / normalCount;\\n countLimit *= delta;\\n strength *= delta;\\n if (countLimit < 1.0)\\n {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n }\\n\\n // randomize the lookup values to hide the fixed number of samples\\n float offset = rand(vTextureCoord, 0.0);\\n\\n float total = 0.0;\\n vec4 color = vec4(0.0);\\n\\n dir *= strength;\\n\\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\\n float percent = (t + offset) / MAX_KERNEL_SIZE;\\n float weight = 4.0 * (percent - percent * percent);\\n vec2 p = vTextureCoord + dir * percent;\\n vec4 sample = texture2D(uSampler, p);\\n\\n // switch to pre-multiplied alpha to correctly blur transparent images\\n // sample.rgb *= sample.a;\\n\\n color += sample * weight;\\n total += weight;\\n\\n if (t > countLimit){\\n break;\\n }\\n }\\n\\n color /= total;\\n // switch back from pre-multiplied alpha\\n // color.rgb /= color.a + 0.00001;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * The ZoomFilter applies a Zoom blur to an object.
\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/zoom-blur.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-zoom-blur|@pixi/filter-zoom-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ZoomBlurFilter = /** @class */ (function (_super) {\n __extends(ZoomBlurFilter, _super);\n /**\n * @param {object} [options] - Filter options to use.\n * @param {number} [options.strength=0.1] - Sets the strength of the zoom blur effect\n * @param {PIXI.Point|number[]} [options.center=[0,0]] - The center of the zoom.\n * @param {number} [options.innerRadius=0] - The inner radius of zoom. The part in inner circle won't apply\n * zoom blur effect.\n * @param {number} [options.radius=-1] - See `radius` property.\n * @param {number} [options.maxKernelSize=32] - On older iOS devices, it's better to not go above `13.0`.\n * Decreasing this value will produce a lower-quality blur effect with more dithering.\n */\n function ZoomBlurFilter(options) {\n var _this = this;\n var _a = Object.assign(ZoomBlurFilter.defaults, options), maxKernelSize = _a.maxKernelSize, rest = __rest(_a, [\"maxKernelSize\"]);\n _this = _super.call(this, vertex, fragment.replace('${maxKernelSize}', maxKernelSize.toFixed(1))) || this;\n Object.assign(_this, rest);\n return _this;\n }\n Object.defineProperty(ZoomBlurFilter.prototype, \"center\", {\n /**\n * Center of the effect.\n *\n * @member {PIXI.Point|number[]}\n * @default [0, 0]\n */\n get: function () {\n return this.uniforms.uCenter;\n },\n set: function (value) {\n this.uniforms.uCenter = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ZoomBlurFilter.prototype, \"strength\", {\n /**\n * Intensity of the zoom effect.\n * @default 0.1\n */\n get: function () {\n return this.uniforms.uStrength;\n },\n set: function (value) {\n this.uniforms.uStrength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ZoomBlurFilter.prototype, \"innerRadius\", {\n /**\n * Radius of the inner region not effected by blur.\n * @default 0\n */\n get: function () {\n return this.uniforms.uInnerRadius;\n },\n set: function (value) {\n this.uniforms.uInnerRadius = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ZoomBlurFilter.prototype, \"radius\", {\n /**\n * Outer radius of the effect. The default value is `-1`.\n * `< 0.0` means it's infinity.\n * @default -1\n */\n get: function () {\n return this.uniforms.uRadius;\n },\n set: function (value) {\n if (value < 0 || value === Infinity) {\n value = -1;\n }\n this.uniforms.uRadius = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n ZoomBlurFilter.defaults = {\n strength: 0.1,\n center: [0, 0],\n innerRadius: 0,\n radius: -1,\n maxKernelSize: 32,\n };\n return ZoomBlurFilter;\n}(Filter));\n\nexport { ZoomBlurFilter };\n//# sourceMappingURL=filter-zoom-blur.esm.mjs.map\n","import { WebGALPixiContainer } from '@/Core/controller/stage/pixi/WebGALPixiContainer';\nimport { ShockwaveFilter } from 'pixi-filters';\n\nconst FILTER_NAME = 'shockwaveFilter';\n\nexport function getOrCreateShockwaveFilterImpl(container: WebGALPixiContainer, createMode: boolean) {\n const shockwaveFilterFromMap = container.containerFilters.get(FILTER_NAME);\n if (shockwaveFilterFromMap) {\n return shockwaveFilterFromMap;\n } else {\n if (createMode) {\n const shockwaveFilter = new ShockwaveFilter([1280, 720]);\n shockwaveFilter.time = 0;\n container.addFilter(shockwaveFilter);\n container.containerFilters.set(FILTER_NAME, shockwaveFilter);\n return shockwaveFilter;\n }\n }\n}\n\nexport function getShockwaveFilter(container: WebGALPixiContainer) {\n if (container.getOrCreateShockwaveFilter(false)) {\n const shockwaveFilter = container.getOrCreateShockwaveFilter() as ShockwaveFilter;\n return shockwaveFilter.time;\n }\n return 0;\n}\n\nexport function setShockwaveFilter(container: WebGALPixiContainer, value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n container.removeFilter(FILTER_NAME);\n } else {\n const shockwaveFilter = container.getOrCreateShockwaveFilter() as ShockwaveFilter;\n if (shockwaveFilter) shockwaveFilter.time = value;\n }\n}\n","import * as PIXI from 'pixi.js';\nimport { WebGALPixiContainer } from '@/Core/controller/stage/pixi/WebGALPixiContainer';\n\nconst INIT_RAD = 0;\nconst FILTER_NAME = 'radiusAlphaFilter';\n\nclass RadiusAlphaFilter extends PIXI.Filter {\n public constructor(center: PIXI.Point, radius: number) {\n const fragmentShader = `\n// 半径透明度的fragment shader\nprecision mediump float;\n\nuniform sampler2D uSampler; // 输入纹理\nvarying vec2 vTextureCoord; // 当前片元的纹理坐标\nuniform vec2 center; // 圆心坐标\nuniform float radius; // 圆的半径\n\nvoid main(void) {\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n // 计算屏幕宽高比\n float aspect = 16.0 / 9.0;\n\n // 根据宽高比校正纹理坐标\n vec2 aspectCorrectCoord = vTextureCoord;\n aspectCorrectCoord.x *= aspect;\n\n // 计算片元到圆心的距离\n float dist = distance(aspectCorrectCoord, center * vec2(aspect, 1.0));\n\n // 使用smoothstep函数计算alpha值,实现边缘羽化效果\n float alpha = smoothstep(radius, radius + 0.05, dist);\n\n // 输出最终颜色\n gl_FragColor = color * (1.0 - alpha);\n}\n `; // 填入上面的fragment shader代码\n super(null as any, fragmentShader);\n this.uniforms.center = [center.x, center.y];\n this.uniforms.radius = radius;\n }\n\n public set center(value: PIXI.Point) {\n this.uniforms.center = [value.x, value.y];\n }\n\n public get center(): PIXI.Point {\n return new PIXI.Point(this.uniforms.center[0], this.uniforms.center[1]);\n }\n\n public set radius(value: number) {\n this.uniforms.radius = value;\n }\n\n public get radius(): number {\n return this.uniforms.radius;\n }\n}\n\nexport function getOrCreateRadiusAlphaFilterImpl(container: WebGALPixiContainer, createMode: boolean) {\n const shockwaveFilterFromMap = container.containerFilters.get(FILTER_NAME);\n if (shockwaveFilterFromMap) {\n return shockwaveFilterFromMap;\n } else {\n if (createMode) {\n const shockwaveFilter = new RadiusAlphaFilter(new PIXI.Point(0.5, 0.5), INIT_RAD);\n shockwaveFilter.radius = INIT_RAD;\n container.addFilter(shockwaveFilter);\n container.containerFilters.set(FILTER_NAME, shockwaveFilter);\n return shockwaveFilter;\n }\n }\n}\n\nexport function getRadiusAlphaFilter(container: WebGALPixiContainer) {\n if (container.getOrCreateShockwaveFilter(false)) {\n const shockwaveFilter = container.getOrCreateRadiusAlphaFilter() as RadiusAlphaFilter;\n return shockwaveFilter.radius;\n }\n return INIT_RAD;\n}\n\nexport function setRadiusAlphaFilter(container: WebGALPixiContainer, value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n container.removeFilter(FILTER_NAME);\n } else {\n const shockwaveFilter = container.getOrCreateRadiusAlphaFilter() as RadiusAlphaFilter;\n if (shockwaveFilter) shockwaveFilter.radius = value;\n }\n}\n","import { OldFilmFilter } from '@pixi/filter-old-film';\nimport { DotFilter } from '@pixi/filter-dot';\nimport { ReflectionFilter } from '@pixi/filter-reflection';\nimport { GlitchFilter } from '@pixi/filter-glitch';\nimport { RGBSplitFilter } from '@pixi/filter-rgb-split';\nimport { GodrayFilter } from '@pixi/filter-godray';\nimport * as PIXI from 'pixi.js';\nimport {\n getOrCreateShockwaveFilterImpl,\n getShockwaveFilter,\n setShockwaveFilter,\n} from '@/Core/controller/stage/pixi/filters/ShockwaveFilter';\nimport {\n getOrCreateRadiusAlphaFilterImpl,\n getRadiusAlphaFilter,\n setRadiusAlphaFilter,\n} from '@/Core/controller/stage/pixi/shaders/RadiusAlphaFilter';\n\nexport class WebGALPixiContainer extends PIXI.Container {\n public containerFilters = new Map();\n private baseX = 0;\n private baseY = 0;\n\n private alphaFilter = new PIXI.filters.AlphaFilter(1);\n\n public constructor() {\n super();\n this.addFilter(this.alphaFilter);\n }\n\n public get alphaFilterVal() {\n return this.alphaFilter.alpha;\n }\n\n public set alphaFilterVal(value: number) {\n this.alphaFilter.alpha = value;\n }\n\n public addFilter(filter: PIXI.Filter) {\n if (this.filters) {\n this.filters.push(filter);\n } else {\n this.filters = [filter];\n }\n }\n\n public removeFilter(name: string) {\n const filter = this.containerFilters.get(name);\n if (filter) {\n const index = (this?.filters ?? []).findIndex((e) => e === filter);\n if (this.filters) {\n this.filters.splice(index, 1);\n this.containerFilters.delete(name);\n }\n }\n }\n\n public get blur(): number {\n // @ts-ignore\n return this.getOrCreateBlurFilter().blur as number;\n }\n\n public set blur(value: number) {\n // @ts-ignore\n this.getOrCreateBlurFilter().blur = value;\n }\n\n public get x() {\n const rX = super.position?.x ?? 0;\n return rX - this.baseX;\n }\n\n public set x(value) {\n if (!super.position) {\n return;\n }\n super.position.x = value + this.baseX;\n }\n\n public get y() {\n const rY = super.position?.y ?? 0;\n return rY - this.baseY;\n }\n\n public set y(value) {\n if (!super.position) {\n return;\n }\n super.position.y = value + this.baseY;\n }\n\n public setBaseX(x: number) {\n const originalX = this.x;\n this.baseX = x;\n this.x = originalX;\n }\n\n public setBaseY(y: number) {\n const originalY = this.y;\n this.baseY = y;\n this.y = originalY;\n }\n\n public getOrCreateBlurFilter() {\n const blurFilterFromMap = this.containerFilters.get('blur');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n const blurFilter = new PIXI.filters.BlurFilter();\n // 默认的 blur 是8,覆盖掉\n blurFilter.blur = 0;\n this.addFilter(blurFilter);\n this.containerFilters.set('blur', blurFilter);\n return blurFilter;\n }\n }\n\n /**\n * old film filter\n * @public\n */\n public getOrCreateOldFilmFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('oldFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const oldFilm = new OldFilmFilter();\n this.addFilter(oldFilm);\n this.containerFilters.set('oldFilm', oldFilm);\n return oldFilm;\n } else return null;\n }\n }\n public get oldFilm(): number {\n if (this.getOrCreateOldFilmFilter(false)) return 1;\n return 0;\n }\n\n public set oldFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('oldFilm');\n } else this.getOrCreateOldFilmFilter();\n }\n\n /**\n * dot film filter\n * @public\n */\n public getOrCreateDotFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('dotFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const dotFilm = new DotFilter();\n this.addFilter(dotFilm);\n this.containerFilters.set('dotFilm', dotFilm);\n return dotFilm;\n } else return null;\n }\n }\n public get dotFilm(): number {\n if (this.getOrCreateDotFilter(false)) return 1;\n return 0;\n }\n\n public set dotFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('dotFilm');\n } else this.getOrCreateDotFilter();\n }\n\n /**\n * reflection film filter\n * @public\n */\n public getOrCreateReflectionFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('reflectionFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const reflectionFilm = new ReflectionFilter();\n this.addFilter(reflectionFilm);\n this.containerFilters.set('reflectionFilm', reflectionFilm);\n return reflectionFilm;\n } else return null;\n }\n }\n public get reflectionFilm(): number {\n if (this.getOrCreateReflectionFilter(false)) return 1;\n return 0;\n }\n\n public set reflectionFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('reflectionFilm');\n } else this.getOrCreateReflectionFilter();\n }\n\n /**\n * glitchFilter film filter\n * @public\n */\n public getOrCreateGlitchFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('glitchFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const glitchFilm = new GlitchFilter();\n this.addFilter(glitchFilm);\n this.containerFilters.set('glitchFilm', glitchFilm);\n return glitchFilm;\n } else return null;\n }\n }\n public get glitchFilm(): number {\n if (this.getOrCreateGlitchFilter(false)) return 1;\n return 0;\n }\n\n public set glitchFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('glitchFilm');\n } else this.getOrCreateGlitchFilter();\n }\n\n /**\n * rgbSplitFilter film filter\n * @public\n */\n public getOrCreateRGBSplitFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('rgbFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const rgbFilm = new RGBSplitFilter();\n this.addFilter(rgbFilm);\n this.containerFilters.set('rgbFilm', rgbFilm);\n return rgbFilm;\n }\n }\n }\n public get rgbFilm(): number {\n if (this.getOrCreateRGBSplitFilter(false)) return 1;\n return 0;\n }\n\n public set rgbFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('rgbFilm');\n } else this.getOrCreateRGBSplitFilter();\n }\n\n /**\n * godrayFilter film filter\n * @public\n */\n public getOrCreateGodrayFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('godrayFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const godrayFilm = new GodrayFilter();\n this.addFilter(godrayFilm);\n this.containerFilters.set('godrayFilm', godrayFilm);\n return godrayFilm;\n }\n }\n }\n public get godrayFilm(): number {\n if (this.getOrCreateGodrayFilter(false)) return 1;\n return 0;\n }\n\n public set godrayFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('godrayFilm');\n } else this.getOrCreateGodrayFilter();\n }\n\n /**\n * ShockwaveFilter\n */\n\n public getOrCreateShockwaveFilter(createMode = true) {\n return getOrCreateShockwaveFilterImpl(this, createMode);\n }\n public get shockwaveFilter(): number {\n return getShockwaveFilter(this);\n }\n public set shockwaveFilter(value: number) {\n setShockwaveFilter(this, value);\n }\n\n /**\n * RadiusAlphaFilter\n */\n\n public getOrCreateRadiusAlphaFilter(createMode = true) {\n return getOrCreateRadiusAlphaFilterImpl(this, createMode);\n }\n public get radiusAlphaFilter(): number {\n return getRadiusAlphaFilter(this);\n }\n public set radiusAlphaFilter(value: number) {\n setRadiusAlphaFilter(this, value);\n }\n}\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/base - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:29 UTC\n *\n * @pixi-spine/base is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev , All Rights Reserved\n */\nimport { SCALE_MODES, MIPMAP_MODES, ALPHA_MODES, DRAW_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\nimport { Rectangle, Transform, Polygon } from '@pixi/math';\nimport { Container } from '@pixi/display';\nimport { Sprite } from '@pixi/sprite';\nimport { SimpleMesh } from '@pixi/mesh-extras';\nimport { Graphics } from '@pixi/graphics';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/**\r\n * @public\r\n */\r\nvar AttachmentType;\r\n(function (AttachmentType) {\r\n AttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\r\n AttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\r\n AttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\r\n AttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\r\n AttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\r\n AttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\r\n AttachmentType[AttachmentType[\"Clipping\"] = 6] = \"Clipping\";\r\n})(AttachmentType || (AttachmentType = {}));\n\n/**\r\n * @public\r\n */\r\nvar BinaryInput = /** @class */ (function () {\r\n function BinaryInput(data, strings, index, buffer) {\r\n if (strings === void 0) { strings = new Array(); }\r\n if (index === void 0) { index = 0; }\r\n if (buffer === void 0) { buffer = new DataView(data.buffer); }\r\n this.strings = strings;\r\n this.index = index;\r\n this.buffer = buffer;\r\n }\r\n BinaryInput.prototype.readByte = function () {\r\n return this.buffer.getInt8(this.index++);\r\n };\r\n BinaryInput.prototype.readUnsignedByte = function () {\r\n return this.buffer.getUint8(this.index++);\r\n };\r\n BinaryInput.prototype.readShort = function () {\r\n var value = this.buffer.getInt16(this.index);\r\n this.index += 2;\r\n return value;\r\n };\r\n BinaryInput.prototype.readInt32 = function () {\r\n var value = this.buffer.getInt32(this.index);\r\n this.index += 4;\r\n return value;\r\n };\r\n BinaryInput.prototype.readInt = function (optimizePositive) {\r\n var b = this.readByte();\r\n var result = b & 0x7F;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 7;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 14;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 21;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 28;\r\n }\r\n }\r\n }\r\n }\r\n return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\r\n };\r\n BinaryInput.prototype.readStringRef = function () {\r\n var index = this.readInt(true);\r\n return index == 0 ? null : this.strings[index - 1];\r\n };\r\n BinaryInput.prototype.readString = function () {\r\n var byteCount = this.readInt(true);\r\n switch (byteCount) {\r\n case 0:\r\n return null;\r\n case 1:\r\n return \"\";\r\n }\r\n byteCount--;\r\n var chars = \"\";\r\n for (var i = 0; i < byteCount;) {\r\n var b = this.readUnsignedByte();\r\n switch (b >> 4) {\r\n case 12:\r\n case 13:\r\n chars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\r\n i += 2;\r\n break;\r\n case 14:\r\n chars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\r\n i += 3;\r\n break;\r\n default:\r\n chars += String.fromCharCode(b);\r\n i++;\r\n }\r\n }\r\n return chars;\r\n };\r\n BinaryInput.prototype.readFloat = function () {\r\n var value = this.buffer.getFloat32(this.index);\r\n this.index += 4;\r\n return value;\r\n };\r\n BinaryInput.prototype.readBoolean = function () {\r\n return this.readByte() != 0;\r\n };\r\n return BinaryInput;\r\n}());\n\n// Those enums were moved from Animation.ts of spine 3.8 and 4.0\r\n/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`\r\n * < 1.\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @public\r\n * */\r\nvar MixBlend;\r\n(function (MixBlend) {\r\n /** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup\r\n * value is set. */\r\n MixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\r\n /** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to\r\n * the setup value. Timelines which perform instant transitions, such as DrawOrderTimeline or\r\n * AttachmentTimeline, use the setup value before the first key.\r\n *\r\n * `first` is intended for the first animations applied, not for animations layered on top of those. */\r\n MixBlend[MixBlend[\"first\"] = 1] = \"first\";\r\n /** Transitions from the current value to the timeline value. No change is made before the first key (the current value is\r\n * kept until the first key).\r\n *\r\n * `replace` is intended for animations layered on top of others, not for the first animations applied. */\r\n MixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\r\n /** Transitions from the current value to the current value plus the timeline value. No change is made before the first key\r\n * (the current value is kept until the first key).\r\n *\r\n * `add` is intended for animations layered on top of others, not for the first animations applied. Properties\r\n * keyed by additive animations must be set manually or by another animation before applying the additive animations, else\r\n * the property values will increase continually. */\r\n MixBlend[MixBlend[\"add\"] = 3] = \"add\";\r\n})(MixBlend || (MixBlend = {}));\r\n/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or\r\n * mixing in toward 1 (the timeline's value).\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @public\r\n * */\r\nvar MixDirection;\r\n(function (MixDirection) {\r\n MixDirection[MixDirection[\"mixIn\"] = 0] = \"mixIn\";\r\n MixDirection[MixDirection[\"mixOut\"] = 1] = \"mixOut\";\r\n})(MixDirection || (MixDirection = {}));\n\n// These enums were moved from PathConstraintData.ts of spine 3.7, 3.8 and 4.0\r\n/** Controls how the first bone is positioned along the path.\r\n *\r\n * See [Position mode](http://esotericsoftware.com/spine-path-constraints#Position-mode) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar PositionMode;\r\n(function (PositionMode) {\r\n PositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\r\n PositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\r\n})(PositionMode || (PositionMode = {}));\r\n/** Controls how bones are rotated, translated, and scaled to match the path.\r\n *\r\n * [Rotate mode](http://esotericsoftware.com/spine-path-constraints#Rotate-mod) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar RotateMode;\r\n(function (RotateMode) {\r\n RotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\r\n RotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\r\n RotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\r\n})(RotateMode || (RotateMode = {}));\n\n// This enum was moved from BoneData.ts of spine 3.7, 3.8 and 4.0\r\n/** Determines how a bone inherits world transforms from parent bones.\r\n * @public\r\n * */\r\nvar TransformMode;\r\n(function (TransformMode) {\r\n TransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\r\n TransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\r\n TransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\r\n TransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\r\n TransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\r\n})(TransformMode || (TransformMode = {}));\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nfunction filterFromString(text) {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(\"Unknown texture filter \" + text);\r\n }\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction wrapFromString(text) {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(\"Unknown texture wrap \" + text);\r\n }\r\n}\r\n/**\r\n * @public\r\n */\r\nvar TextureFilter;\r\n(function (TextureFilter) {\r\n TextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\r\n TextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\r\n TextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\r\n TextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\r\n TextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\r\n TextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\r\n TextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\"; // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n})(TextureFilter || (TextureFilter = {}));\r\n/**\r\n * @public\r\n */\r\nvar TextureWrap;\r\n(function (TextureWrap) {\r\n TextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\r\n TextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\r\n TextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\"; // WebGLRenderingContext.REPEAT\r\n})(TextureWrap || (TextureWrap = {}));\r\n/**\r\n * @public\r\n */\r\nvar TextureRegion = /** @class */ (function () {\r\n function TextureRegion() {\r\n //thats for overrides\r\n this.size = null;\r\n this.names = null;\r\n this.values = null;\r\n this.renderObject = null;\r\n }\r\n Object.defineProperty(TextureRegion.prototype, \"width\", {\r\n get: function () {\r\n var tex = this.texture;\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.orig.width;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"height\", {\r\n get: function () {\r\n var tex = this.texture;\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.orig.height;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"u\", {\r\n get: function () {\r\n return this.texture._uvs.x0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"v\", {\r\n get: function () {\r\n return this.texture._uvs.y0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"u2\", {\r\n get: function () {\r\n return this.texture._uvs.x2;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"v2\", {\r\n get: function () {\r\n return this.texture._uvs.y2;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"offsetX\", {\r\n get: function () {\r\n var tex = this.texture;\r\n return tex.trim ? tex.trim.x : 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"offsetY\", {\r\n get: function () {\r\n // console.warn(\"Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on.\");\r\n return this.spineOffsetY;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"pixiOffsetY\", {\r\n get: function () {\r\n var tex = this.texture;\r\n return tex.trim ? tex.trim.y : 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"spineOffsetY\", {\r\n get: function () {\r\n var tex = this.texture;\r\n return this.originalHeight - this.height - (tex.trim ? tex.trim.y : 0);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"originalWidth\", {\r\n get: function () {\r\n return this.texture.orig.width;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"originalHeight\", {\r\n get: function () {\r\n return this.texture.orig.height;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"x\", {\r\n get: function () {\r\n return this.texture.frame.x;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"y\", {\r\n get: function () {\r\n return this.texture.frame.y;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"rotate\", {\r\n get: function () {\r\n return this.texture.rotate !== 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"degrees\", {\r\n get: function () {\r\n return (360 - this.texture.rotate * 45) % 360;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return TextureRegion;\r\n}());\n\nvar RegionFields = /** @class */ (function () {\r\n function RegionFields() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n this.offsetX = 0;\r\n this.offsetY = 0;\r\n this.originalWidth = 0;\r\n this.originalHeight = 0;\r\n this.rotate = 0;\r\n this.index = 0;\r\n }\r\n return RegionFields;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlas = /** @class */ (function () {\r\n function TextureAtlas(atlasText, textureLoader, callback) {\r\n this.pages = new Array();\r\n this.regions = new Array();\r\n if (atlasText) {\r\n this.addSpineAtlas(atlasText, textureLoader, callback);\r\n }\r\n }\r\n TextureAtlas.prototype.addTexture = function (name, texture) {\r\n var pages = this.pages;\r\n var page = null;\r\n for (var i = 0; i < pages.length; i++) {\r\n if (pages[i].baseTexture === texture.baseTexture) {\r\n page = pages[i];\r\n break;\r\n }\r\n }\r\n if (page === null) {\r\n page = new TextureAtlasPage();\r\n page.name = 'texturePage';\r\n var baseTexture = texture.baseTexture;\r\n page.width = baseTexture.realWidth;\r\n page.height = baseTexture.realHeight;\r\n page.baseTexture = baseTexture;\r\n //those fields are not relevant in Pixi\r\n page.minFilter = page.magFilter = TextureFilter.Nearest;\r\n page.uWrap = TextureWrap.ClampToEdge;\r\n page.vWrap = TextureWrap.ClampToEdge;\r\n pages.push(page);\r\n }\r\n var region = new TextureAtlasRegion();\r\n region.name = name;\r\n region.page = page;\r\n region.texture = texture;\r\n region.index = -1;\r\n this.regions.push(region);\r\n return region;\r\n };\r\n TextureAtlas.prototype.addTextureHash = function (textures, stripExtension) {\r\n for (var key in textures) {\r\n if (textures.hasOwnProperty(key)) {\r\n this.addTexture(stripExtension && key.indexOf('.') !== -1 ? key.substr(0, key.lastIndexOf('.')) : key, textures[key]);\r\n }\r\n }\r\n };\r\n TextureAtlas.prototype.addSpineAtlas = function (atlasText, textureLoader, callback) {\r\n return this.load(atlasText, textureLoader, callback);\r\n };\r\n TextureAtlas.prototype.load = function (atlasText, textureLoader, callback) {\r\n var _this = this;\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n var reader = new TextureAtlasReader(atlasText);\r\n var entry = new Array(4);\r\n var page = null;\r\n var pageFields = {};\r\n var region = null;\r\n pageFields[\"size\"] = function () {\r\n page.width = parseInt(entry[1]);\r\n page.height = parseInt(entry[2]);\r\n };\r\n pageFields[\"format\"] = function () {\r\n // page.format = Format[tuple[0]]; we don't need format in WebGL\r\n };\r\n pageFields[\"filter\"] = function () {\r\n page.minFilter = filterFromString(entry[1]);\r\n page.magFilter = filterFromString(entry[2]);\r\n };\r\n pageFields[\"repeat\"] = function () {\r\n if (entry[1].indexOf('x') != -1)\r\n page.uWrap = TextureWrap.Repeat;\r\n if (entry[1].indexOf('y') != -1)\r\n page.vWrap = TextureWrap.Repeat;\r\n };\r\n pageFields[\"pma\"] = function () {\r\n page.pma = entry[1] == \"true\";\r\n };\r\n var regionFields = {};\r\n regionFields[\"xy\"] = function () {\r\n region.x = parseInt(entry[1]);\r\n region.y = parseInt(entry[2]);\r\n };\r\n regionFields[\"size\"] = function () {\r\n region.width = parseInt(entry[1]);\r\n region.height = parseInt(entry[2]);\r\n };\r\n regionFields[\"bounds\"] = function () {\r\n region.x = parseInt(entry[1]);\r\n region.y = parseInt(entry[2]);\r\n region.width = parseInt(entry[3]);\r\n region.height = parseInt(entry[4]);\r\n };\r\n regionFields[\"offset\"] = function () {\r\n region.offsetX = parseInt(entry[1]);\r\n region.offsetY = parseInt(entry[2]);\r\n };\r\n regionFields[\"orig\"] = function () {\r\n region.originalWidth = parseInt(entry[1]);\r\n region.originalHeight = parseInt(entry[2]);\r\n };\r\n regionFields[\"offsets\"] = function () {\r\n region.offsetX = parseInt(entry[1]);\r\n region.offsetY = parseInt(entry[2]);\r\n region.originalWidth = parseInt(entry[3]);\r\n region.originalHeight = parseInt(entry[4]);\r\n };\r\n regionFields[\"rotate\"] = function () {\r\n var rotateValue = entry[1];\r\n var rotate = 0;\r\n if (rotateValue.toLocaleLowerCase() == \"true\") {\r\n rotate = 6;\r\n }\r\n else if (rotateValue.toLocaleLowerCase() == \"false\") {\r\n rotate = 0;\r\n }\r\n else {\r\n rotate = ((720 - parseFloat(rotateValue)) % 360) / 45;\r\n }\r\n region.rotate = rotate;\r\n };\r\n regionFields[\"index\"] = function () {\r\n region.index = parseInt(entry[1]);\r\n };\r\n var line = reader.readLine();\r\n // Ignore empty lines before first entry.\r\n while (line != null && line.trim().length == 0)\r\n line = reader.readLine();\r\n // Header entries.\r\n while (true) {\r\n if (line == null || line.trim().length == 0)\r\n break;\r\n if (reader.readEntry(entry, line) == 0)\r\n break; // Silently ignore all header fields.\r\n line = reader.readLine();\r\n }\r\n var iterateParser = function () {\r\n while (true) {\r\n if (line == null) {\r\n return callback && callback(_this);\r\n }\r\n if (line.trim().length == 0) {\r\n page = null;\r\n line = reader.readLine();\r\n }\r\n else if (page === null) {\r\n page = new TextureAtlasPage();\r\n page.name = line.trim();\r\n while (true) {\r\n if (reader.readEntry(entry, line = reader.readLine()) == 0)\r\n break;\r\n var field = pageFields[entry[0]];\r\n if (field)\r\n field();\r\n }\r\n _this.pages.push(page);\r\n textureLoader(page.name, function (texture) {\r\n if (texture === null) {\r\n _this.pages.splice(_this.pages.indexOf(page), 1);\r\n return callback && callback(null);\r\n }\r\n page.baseTexture = texture;\r\n //TODO: set scaleMode and mipmapMode from spine\r\n if (page.pma) {\r\n texture.alphaMode = ALPHA_MODES.PMA;\r\n }\r\n if (!texture.valid) {\r\n texture.setSize(page.width, page.height);\r\n }\r\n page.setFilters();\r\n if (!page.width || !page.height) {\r\n page.width = texture.realWidth;\r\n page.height = texture.realHeight;\r\n if (!page.width || !page.height) {\r\n console.log(\"ERROR spine atlas page \" + page.name + \": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)\");\r\n }\r\n }\r\n iterateParser();\r\n });\r\n break;\r\n }\r\n else {\r\n region = new RegionFields();\r\n var atlasRegion = new TextureAtlasRegion();\r\n atlasRegion.name = line;\r\n atlasRegion.page = page;\r\n var names = null;\r\n var values = null;\r\n while (true) {\r\n var count = reader.readEntry(entry, line = reader.readLine());\r\n if (count == 0)\r\n break;\r\n var field = regionFields[entry[0]];\r\n if (field)\r\n field();\r\n else {\r\n if (names == null) {\r\n names = [];\r\n values = [];\r\n }\r\n names.push(entry[0]);\r\n var entryValues = [];\r\n for (var i = 0; i < count; i++)\r\n entryValues.push(parseInt(entry[i + 1]));\r\n values.push(entryValues);\r\n }\r\n }\r\n if (region.originalWidth == 0 && region.originalHeight == 0) {\r\n region.originalWidth = region.width;\r\n region.originalHeight = region.height;\r\n }\r\n var resolution = page.baseTexture.resolution;\r\n region.x /= resolution;\r\n region.y /= resolution;\r\n region.width /= resolution;\r\n region.height /= resolution;\r\n region.originalWidth /= resolution;\r\n region.originalHeight /= resolution;\r\n region.offsetX /= resolution;\r\n region.offsetY /= resolution;\r\n var swapWH = region.rotate % 4 !== 0;\r\n var frame = new Rectangle(region.x, region.y, swapWH ? region.height : region.width, swapWH ? region.width : region.height);\r\n var orig = new Rectangle(0, 0, region.originalWidth, region.originalHeight);\r\n var trim = new Rectangle(region.offsetX, region.originalHeight - region.height - region.offsetY, region.width, region.height);\r\n atlasRegion.texture = new Texture(atlasRegion.page.baseTexture, frame, orig, trim, region.rotate);\r\n atlasRegion.index = region.index;\r\n atlasRegion.texture.updateUvs();\r\n _this.regions.push(atlasRegion);\r\n }\r\n }\r\n };\r\n iterateParser();\r\n };\r\n TextureAtlas.prototype.findRegion = function (name) {\r\n for (var i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n };\r\n TextureAtlas.prototype.dispose = function () {\r\n for (var i = 0; i < this.pages.length; i++) {\r\n this.pages[i].baseTexture.dispose();\r\n }\r\n };\r\n return TextureAtlas;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlasReader = /** @class */ (function () {\r\n function TextureAtlasReader(text) {\r\n this.index = 0;\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n TextureAtlasReader.prototype.readLine = function () {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n };\r\n TextureAtlasReader.prototype.readEntry = function (entry, line) {\r\n if (line == null)\r\n return 0;\r\n line = line.trim();\r\n if (line.length == 0)\r\n return 0;\r\n var colon = line.indexOf(':');\r\n if (colon == -1)\r\n return 0;\r\n entry[0] = line.substr(0, colon).trim();\r\n for (var i = 1, lastMatch = colon + 1;; i++) {\r\n var comma = line.indexOf(',', lastMatch);\r\n if (comma == -1) {\r\n entry[i] = line.substr(lastMatch).trim();\r\n return i;\r\n }\r\n entry[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n if (i == 4)\r\n return 4;\r\n }\r\n };\r\n return TextureAtlasReader;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlasPage = /** @class */ (function () {\r\n function TextureAtlasPage() {\r\n this.minFilter = TextureFilter.Nearest;\r\n this.magFilter = TextureFilter.Nearest;\r\n this.uWrap = TextureWrap.ClampToEdge;\r\n this.vWrap = TextureWrap.ClampToEdge;\r\n }\r\n TextureAtlasPage.prototype.setFilters = function () {\r\n var tex = this.baseTexture;\r\n var filter = this.minFilter;\r\n if (filter == TextureFilter.Linear) {\r\n tex.scaleMode = SCALE_MODES.LINEAR;\r\n }\r\n else if (this.minFilter == TextureFilter.Nearest) {\r\n tex.scaleMode = SCALE_MODES.NEAREST;\r\n }\r\n else {\r\n tex.mipmap = MIPMAP_MODES.POW2;\r\n if (filter == TextureFilter.MipMapNearestNearest) {\r\n tex.scaleMode = SCALE_MODES.NEAREST;\r\n }\r\n else {\r\n tex.scaleMode = SCALE_MODES.LINEAR;\r\n }\r\n }\r\n };\r\n return TextureAtlasPage;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlasRegion = /** @class */ (function (_super) {\r\n __extends(TextureAtlasRegion, _super);\r\n function TextureAtlasRegion() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return TextureAtlasRegion;\r\n}(TextureRegion));\n\nvar fround_polyfill = (function (array) {\r\n return function (x) {\r\n return array[0] = x, array[0];\r\n };\r\n})(new Float32Array(1));\r\nvar fround = Math.fround || fround_polyfill;\r\n/**\r\n * @public\r\n */\r\nvar IntSet = /** @class */ (function () {\r\n function IntSet() {\r\n this.array = new Array();\r\n }\r\n IntSet.prototype.add = function (value) {\r\n var contains = this.contains(value);\r\n this.array[value | 0] = value | 0;\r\n return !contains;\r\n };\r\n IntSet.prototype.contains = function (value) {\r\n return this.array[value | 0] != undefined;\r\n };\r\n IntSet.prototype.remove = function (value) {\r\n this.array[value | 0] = undefined;\r\n };\r\n IntSet.prototype.clear = function () {\r\n this.array.length = 0;\r\n };\r\n return IntSet;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar StringSet = /** @class */ (function () {\r\n function StringSet() {\r\n this.entries = {};\r\n this.size = 0;\r\n }\r\n StringSet.prototype.add = function (value) {\r\n var contains = this.entries[value];\r\n this.entries[value] = true;\r\n if (!contains) {\r\n this.size++;\r\n return true;\r\n }\r\n return false;\r\n };\r\n StringSet.prototype.addAll = function (values) {\r\n var oldSize = this.size;\r\n for (var i = 0, n = values.length; i < n; i++)\r\n this.add(values[i]);\r\n return oldSize != this.size;\r\n };\r\n StringSet.prototype.contains = function (value) {\r\n return this.entries[value];\r\n };\r\n StringSet.prototype.clear = function () {\r\n this.entries = {};\r\n this.size = 0;\r\n };\r\n return StringSet;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Color = /** @class */ (function () {\r\n function Color(r, g, b, a) {\r\n if (r === void 0) { r = 0; }\r\n if (g === void 0) { g = 0; }\r\n if (b === void 0) { b = 0; }\r\n if (a === void 0) { a = 0; }\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n }\r\n Color.prototype.set = function (r, g, b, a) {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n return this.clamp();\r\n };\r\n Color.prototype.setFromColor = function (c) {\r\n this.r = c.r;\r\n this.g = c.g;\r\n this.b = c.b;\r\n this.a = c.a;\r\n return this;\r\n };\r\n Color.prototype.setFromString = function (hex) {\r\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n this.r = parseInt(hex.substr(0, 2), 16) / 255;\r\n this.g = parseInt(hex.substr(2, 2), 16) / 255;\r\n this.b = parseInt(hex.substr(4, 2), 16) / 255;\r\n this.a = hex.length != 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255;\r\n return this;\r\n };\r\n Color.prototype.add = function (r, g, b, a) {\r\n this.r += r;\r\n this.g += g;\r\n this.b += b;\r\n this.a += a;\r\n return this.clamp();\r\n };\r\n Color.prototype.clamp = function () {\r\n if (this.r < 0)\r\n this.r = 0;\r\n else if (this.r > 1)\r\n this.r = 1;\r\n if (this.g < 0)\r\n this.g = 0;\r\n else if (this.g > 1)\r\n this.g = 1;\r\n if (this.b < 0)\r\n this.b = 0;\r\n else if (this.b > 1)\r\n this.b = 1;\r\n if (this.a < 0)\r\n this.a = 0;\r\n else if (this.a > 1)\r\n this.a = 1;\r\n return this;\r\n };\r\n Color.rgba8888ToColor = function (color, value) {\r\n color.r = ((value & 0xff000000) >>> 24) / 255;\r\n color.g = ((value & 0x00ff0000) >>> 16) / 255;\r\n color.b = ((value & 0x0000ff00) >>> 8) / 255;\r\n color.a = ((value & 0x000000ff)) / 255;\r\n };\r\n Color.rgb888ToColor = function (color, value) {\r\n color.r = ((value & 0x00ff0000) >>> 16) / 255;\r\n color.g = ((value & 0x0000ff00) >>> 8) / 255;\r\n color.b = ((value & 0x000000ff)) / 255;\r\n };\r\n Color.fromString = function (hex) {\r\n return new Color().setFromString(hex);\r\n };\r\n Color.WHITE = new Color(1, 1, 1, 1);\r\n Color.RED = new Color(1, 0, 0, 1);\r\n Color.GREEN = new Color(0, 1, 0, 1);\r\n Color.BLUE = new Color(0, 0, 1, 1);\r\n Color.MAGENTA = new Color(1, 0, 1, 1);\r\n return Color;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar MathUtils = /** @class */ (function () {\r\n function MathUtils() {\r\n }\r\n MathUtils.clamp = function (value, min, max) {\r\n if (value < min)\r\n return min;\r\n if (value > max)\r\n return max;\r\n return value;\r\n };\r\n MathUtils.cosDeg = function (degrees) {\r\n return Math.cos(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.sinDeg = function (degrees) {\r\n return Math.sin(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.signum = function (value) {\r\n return value > 0 ? 1 : value < 0 ? -1 : 0;\r\n };\r\n MathUtils.toInt = function (x) {\r\n return x > 0 ? Math.floor(x) : Math.ceil(x);\r\n };\r\n MathUtils.cbrt = function (x) {\r\n var y = Math.pow(Math.abs(x), 1 / 3);\r\n return x < 0 ? -y : y;\r\n };\r\n MathUtils.randomTriangular = function (min, max) {\r\n return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\r\n };\r\n MathUtils.randomTriangularWith = function (min, max, mode) {\r\n var u = Math.random();\r\n var d = max - min;\r\n if (u <= (mode - min) / d)\r\n return min + Math.sqrt(u * d * (mode - min));\r\n return max - Math.sqrt((1 - u) * d * (max - mode));\r\n };\r\n MathUtils.isPowerOfTwo = function (value) {\r\n return value && (value & (value - 1)) === 0;\r\n };\r\n MathUtils.PI = 3.1415927;\r\n MathUtils.PI2 = MathUtils.PI * 2;\r\n MathUtils.radiansToDegrees = 180 / MathUtils.PI;\r\n MathUtils.radDeg = MathUtils.radiansToDegrees;\r\n MathUtils.degreesToRadians = MathUtils.PI / 180;\r\n MathUtils.degRad = MathUtils.degreesToRadians;\r\n return MathUtils;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Interpolation = /** @class */ (function () {\r\n function Interpolation() {\r\n }\r\n Interpolation.prototype.apply = function (start, end, a) {\r\n return start + (end - start) * this.applyInternal(a);\r\n };\r\n return Interpolation;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Pow = /** @class */ (function (_super) {\r\n __extends(Pow, _super);\r\n function Pow(power) {\r\n var _this = _super.call(this) || this;\r\n _this.power = 2;\r\n _this.power = power;\r\n return _this;\r\n }\r\n Pow.prototype.applyInternal = function (a) {\r\n if (a <= 0.5)\r\n return Math.pow(a * 2, this.power) / 2;\r\n return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\r\n };\r\n return Pow;\r\n}(Interpolation));\r\n/**\r\n * @public\r\n */\r\nvar PowOut = /** @class */ (function (_super) {\r\n __extends(PowOut, _super);\r\n function PowOut(power) {\r\n return _super.call(this, power) || this;\r\n }\r\n PowOut.prototype.applyInternal = function (a) {\r\n return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\r\n };\r\n return PowOut;\r\n}(Pow));\r\n/**\r\n * @public\r\n */\r\nvar Utils = /** @class */ (function () {\r\n function Utils() {\r\n }\r\n Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\r\n for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n dest[j] = source[i];\r\n }\r\n };\r\n Utils.arrayFill = function (array, fromIndex, toIndex, value) {\r\n for (var i = fromIndex; i < toIndex; i++)\r\n array[i] = value;\r\n };\r\n Utils.setArraySize = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n var oldSize = array.length;\r\n if (oldSize == size)\r\n return array;\r\n array.length = size;\r\n if (oldSize < size) {\r\n for (var i = oldSize; i < size; i++)\r\n array[i] = value;\r\n }\r\n return array;\r\n };\r\n Utils.ensureArrayCapacity = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n if (array.length >= size)\r\n return array;\r\n return Utils.setArraySize(array, size, value);\r\n };\r\n Utils.newArray = function (size, defaultValue) {\r\n var array = new Array(size);\r\n for (var i = 0; i < size; i++)\r\n array[i] = defaultValue;\r\n return array;\r\n };\r\n Utils.newFloatArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS)\r\n return new Float32Array(size);\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.newShortArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS)\r\n return new Int16Array(size);\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.toFloatArray = function (array) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n };\r\n Utils.toSinglePrecision = function (value) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? fround(value) : value;\r\n };\r\n // This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper = function (alpha, blend) {\r\n };\r\n Utils.contains = function (array, element, identity) {\r\n for (var i = 0; i < array.length; i++)\r\n if (array[i] == element)\r\n return true;\r\n return false;\r\n };\r\n Utils.enumValue = function (type, name) {\r\n return type[name[0].toUpperCase() + name.slice(1)];\r\n };\r\n Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\r\n return Utils;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar DebugUtils = /** @class */ (function () {\r\n function DebugUtils() {\r\n }\r\n DebugUtils.logBones = function (skeleton) {\r\n for (var i = 0; i < skeleton.bones.length; i++) {\r\n var bone = skeleton.bones[i];\r\n var mat = bone.matrix;\r\n console.log(bone.data.name + \", \" + mat.a + \", \" + mat.b + \", \" + mat.c + \", \" + mat.d + \", \" + mat.tx + \", \" + mat.ty);\r\n }\r\n };\r\n return DebugUtils;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Pool = /** @class */ (function () {\r\n function Pool(instantiator) {\r\n this.items = new Array();\r\n this.instantiator = instantiator;\r\n }\r\n Pool.prototype.obtain = function () {\r\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n };\r\n Pool.prototype.free = function (item) {\r\n if (item.reset)\r\n item.reset();\r\n this.items.push(item);\r\n };\r\n Pool.prototype.freeAll = function (items) {\r\n for (var i = 0; i < items.length; i++)\r\n this.free(items[i]);\r\n };\r\n Pool.prototype.clear = function () {\r\n this.items.length = 0;\r\n };\r\n return Pool;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Vector2 = /** @class */ (function () {\r\n function Vector2(x, y) {\r\n if (x === void 0) { x = 0; }\r\n if (y === void 0) { y = 0; }\r\n this.x = x;\r\n this.y = y;\r\n }\r\n Vector2.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Vector2.prototype.length = function () {\r\n var x = this.x;\r\n var y = this.y;\r\n return Math.sqrt(x * x + y * y);\r\n };\r\n Vector2.prototype.normalize = function () {\r\n var len = this.length();\r\n if (len != 0) {\r\n this.x /= len;\r\n this.y /= len;\r\n }\r\n return this;\r\n };\r\n return Vector2;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TimeKeeper = /** @class */ (function () {\r\n function TimeKeeper() {\r\n this.maxDelta = 0.064;\r\n this.framesPerSecond = 0;\r\n this.delta = 0;\r\n this.totalTime = 0;\r\n this.lastTime = Date.now() / 1000;\r\n this.frameCount = 0;\r\n this.frameTime = 0;\r\n }\r\n TimeKeeper.prototype.update = function () {\r\n var now = Date.now() / 1000;\r\n this.delta = now - this.lastTime;\r\n this.frameTime += this.delta;\r\n this.totalTime += this.delta;\r\n if (this.delta > this.maxDelta)\r\n this.delta = this.maxDelta;\r\n this.lastTime = now;\r\n this.frameCount++;\r\n if (this.frameTime > 1) {\r\n this.framesPerSecond = this.frameCount / this.frameTime;\r\n this.frameTime = 0;\r\n this.frameCount = 0;\r\n }\r\n };\r\n return TimeKeeper;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar WindowedMean = /** @class */ (function () {\r\n function WindowedMean(windowSize) {\r\n if (windowSize === void 0) { windowSize = 32; }\r\n this.addedValues = 0;\r\n this.lastValue = 0;\r\n this.mean = 0;\r\n this.dirty = true;\r\n this.values = new Array(windowSize);\r\n }\r\n WindowedMean.prototype.hasEnoughData = function () {\r\n return this.addedValues >= this.values.length;\r\n };\r\n WindowedMean.prototype.addValue = function (value) {\r\n if (this.addedValues < this.values.length)\r\n this.addedValues++;\r\n this.values[this.lastValue++] = value;\r\n if (this.lastValue > this.values.length - 1)\r\n this.lastValue = 0;\r\n this.dirty = true;\r\n };\r\n WindowedMean.prototype.getMean = function () {\r\n if (this.hasEnoughData()) {\r\n if (this.dirty) {\r\n var mean = 0;\r\n for (var i = 0; i < this.values.length; i++)\r\n mean += this.values[i];\r\n this.mean = mean / this.values.length;\r\n this.dirty = false;\r\n }\r\n return this.mean;\r\n }\r\n return 0;\r\n };\r\n return WindowedMean;\r\n}());\n\n/** Collects each visible BoundingBoxAttachment and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBoundsBase = /** @class */ (function () {\r\n function SkeletonBoundsBase() {\r\n /** The left edge of the axis aligned bounding box. */\r\n this.minX = 0;\r\n /** The bottom edge of the axis aligned bounding box. */\r\n this.minY = 0;\r\n /** The right edge of the axis aligned bounding box. */\r\n this.maxX = 0;\r\n /** The top edge of the axis aligned bounding box. */\r\n this.maxY = 0;\r\n /** The visible bounding boxes. */\r\n this.boundingBoxes = new Array();\r\n /** The world vertices for the bounding box polygons. */\r\n this.polygons = new Array();\r\n this.polygonPool = new Pool(function () {\r\n return Utils.newFloatArray(16);\r\n });\r\n }\r\n /** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding\r\n * box's polygon.\r\n * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the\r\n * SkeletonBounds AABB methods will always return true. */\r\n SkeletonBoundsBase.prototype.update = function (skeleton, updateAabb) {\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n var boundingBoxes = this.boundingBoxes;\r\n var polygons = this.polygons;\r\n var polygonPool = this.polygonPool;\r\n var slots = skeleton.slots;\r\n var slotCount = slots.length;\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n for (var i = 0; i < slotCount; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var attachment = slot.getAttachment();\r\n if (attachment != null && attachment.type === AttachmentType.BoundingBox) {\r\n var boundingBox = attachment;\r\n boundingBoxes.push(boundingBox);\r\n var polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\r\n }\r\n }\r\n if (updateAabb) {\r\n this.aabbCompute();\r\n }\r\n else {\r\n this.minX = Number.POSITIVE_INFINITY;\r\n this.minY = Number.POSITIVE_INFINITY;\r\n this.maxX = Number.NEGATIVE_INFINITY;\r\n this.maxY = Number.NEGATIVE_INFINITY;\r\n }\r\n };\r\n SkeletonBoundsBase.prototype.aabbCompute = function () {\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++) {\r\n var polygon = polygons[i];\r\n var vertices = polygon;\r\n for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n var x = vertices[ii];\r\n var y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n };\r\n /** Returns true if the axis aligned bounding box contains the point. */\r\n SkeletonBoundsBase.prototype.aabbContainsPoint = function (x, y) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n };\r\n /** Returns true if the axis aligned bounding box intersects the line segment. */\r\n SkeletonBoundsBase.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\r\n var minX = this.minX;\r\n var minY = this.minY;\r\n var maxX = this.maxX;\r\n var maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n var m = (y2 - y1) / (x2 - x1);\r\n var y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n var x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n return false;\r\n };\r\n /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\r\n SkeletonBoundsBase.prototype.aabbIntersectsSkeleton = function (bounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n };\r\n /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\r\n * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true.\r\n * Cannot be done here because BoundingBoxAttachment is not a thing yet*/\r\n SkeletonBoundsBase.prototype.containsPoint = function (x, y) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n /** Returns true if the polygon contains the point. */\r\n SkeletonBoundsBase.prototype.containsPointPolygon = function (polygon, x, y) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var prevIndex = nn - 2;\r\n var inside = false;\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var vertexY = vertices[ii + 1];\r\n var prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n var vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\r\n inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n };\r\n /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\r\n * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns\r\n * true. */\r\n SkeletonBoundsBase.prototype.intersectsSegment = function (x1, y1, x2, y2) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n /** Returns true if the polygon contains any part of the line segment. */\r\n SkeletonBoundsBase.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var width12 = x1 - x2, height12 = y1 - y2;\r\n var det1 = x1 * y2 - y1 * x2;\r\n var x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var x4 = vertices[ii], y4 = vertices[ii + 1];\r\n var det2 = x3 * y4 - y3 * x4;\r\n var width34 = x3 - x4, height34 = y3 - y4;\r\n var det3 = width12 * height34 - height12 * width34;\r\n var x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n var y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\r\n return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n };\r\n /** Returns the polygon for the specified bounding box, or null. */\r\n SkeletonBoundsBase.prototype.getPolygon = function (boundingBox) {\r\n if (!boundingBox)\r\n throw new Error(\"boundingBox cannot be null.\");\r\n var index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n };\r\n /** The width of the axis aligned bounding box. */\r\n SkeletonBoundsBase.prototype.getWidth = function () {\r\n return this.maxX - this.minX;\r\n };\r\n /** The height of the axis aligned bounding box. */\r\n SkeletonBoundsBase.prototype.getHeight = function () {\r\n return this.maxY - this.minY;\r\n };\r\n return SkeletonBoundsBase;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar settings = {\r\n yDown: true,\r\n /**\r\n * pixi-spine gives option to not fail at certain parsing errors\r\n * spine-ts fails here\r\n */\r\n FAIL_ON_NON_EXISTING_SKIN: false,\r\n /**\r\n * past Spine.globalAutoUpdate\r\n */\r\n GLOBAL_AUTO_UPDATE: true,\r\n /**\r\n * past Spine.globalDelayLimit\r\n */\r\n GLOBAL_DELAY_LIMIT: 0,\r\n};\n\nvar tempRgb = [0, 0, 0];\r\n/**\r\n * @public\r\n */\r\nvar SpineSprite = /** @class */ (function (_super) {\r\n __extends(SpineSprite, _super);\r\n function SpineSprite() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.region = null;\r\n _this.attachment = null;\r\n return _this;\r\n }\r\n return SpineSprite;\r\n}(Sprite));\r\n/**\r\n * @public\r\n */\r\nvar SpineMesh = /** @class */ (function (_super) {\r\n __extends(SpineMesh, _super);\r\n function SpineMesh(texture, vertices, uvs, indices, drawMode) {\r\n var _this = _super.call(this, texture, vertices, uvs, indices, drawMode) || this;\r\n _this.region = null;\r\n _this.attachment = null;\r\n return _this;\r\n }\r\n return SpineMesh;\r\n}(SimpleMesh));\r\n/**\r\n * A class that enables the you to import and run your spine animations in pixi.\r\n * The Spine animation data needs to be loaded using either the Loader or a SpineLoader before it can be used by this class\r\n * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\r\n *\r\n * ```js\r\n * let spineAnimation = new spine(spineData);\r\n * ```\r\n *\r\n * @public\r\n * @class\r\n * @extends Container\r\n * @memberof spine\r\n * @param spineData {object} The spine data loaded from a spine atlas.\r\n */\r\nvar SpineBase = /** @class */ (function (_super) {\r\n __extends(SpineBase, _super);\r\n function SpineBase(spineData) {\r\n var _this = _super.call(this) || this;\r\n if (!spineData) {\r\n throw new Error('The spineData param is required.');\r\n }\r\n if ((typeof spineData) === \"string\") {\r\n throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas(\"YOUR_RESOURCE_NAME\") from now on.');\r\n }\r\n /**\r\n * The spineData object\r\n *\r\n * @member {object}\r\n */\r\n _this.spineData = spineData;\r\n /**\r\n * A spine Skeleton object\r\n *\r\n * @member {object}\r\n */\r\n _this.createSkeleton(spineData);\r\n /**\r\n * An array of containers\r\n *\r\n * @member {Container[]}\r\n */\r\n _this.slotContainers = [];\r\n _this.tempClipContainers = [];\r\n for (var i = 0, n = _this.skeleton.slots.length; i < n; i++) {\r\n var slot = _this.skeleton.slots[i];\r\n var attachment = slot.getAttachment();\r\n var slotContainer = _this.newContainer();\r\n _this.slotContainers.push(slotContainer);\r\n _this.addChild(slotContainer);\r\n _this.tempClipContainers.push(null);\r\n if (!attachment) {\r\n continue;\r\n }\r\n if (attachment.type === AttachmentType.Region) {\r\n var spriteName = attachment.name;\r\n var sprite = _this.createSprite(slot, attachment, spriteName);\r\n slot.currentSprite = sprite;\r\n slot.currentSpriteName = spriteName;\r\n slotContainer.addChild(sprite);\r\n }\r\n else if (attachment.type === AttachmentType.Mesh) {\r\n var mesh = _this.createMesh(slot, attachment);\r\n slot.currentMesh = mesh;\r\n slot.currentMeshId = attachment.id;\r\n slot.currentMeshName = attachment.name;\r\n slotContainer.addChild(mesh);\r\n }\r\n else if (attachment.type === AttachmentType.Clipping) {\r\n _this.createGraphics(slot, attachment);\r\n slotContainer.addChild(slot.clippingContainer);\r\n slotContainer.addChild(slot.currentGraphics);\r\n }\r\n }\r\n /**\r\n * The tint applied to all spine slots. This is a [r,g,b] value. A value of [1,1,1] will remove any tint effect.\r\n *\r\n * @member {number}\r\n * @memberof spine.Spine#\r\n */\r\n _this.tintRgb = new Float32Array([1, 1, 1]);\r\n _this.autoUpdate = true;\r\n _this.visible = true;\r\n return _this;\r\n }\r\n Object.defineProperty(SpineBase.prototype, \"debug\", {\r\n get: function () {\r\n return this._debug;\r\n },\r\n set: function (value) {\r\n var _a;\r\n if (value == this._debug) { // soft equality allows null == undefined\r\n return;\r\n }\r\n (_a = this._debug) === null || _a === void 0 ? void 0 : _a.unregisterSpine(this);\r\n value === null || value === void 0 ? void 0 : value.registerSpine(this);\r\n this._debug = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(SpineBase.prototype, \"autoUpdate\", {\r\n /**\r\n * If this flag is set to true, the spine animation will be automatically updated every\r\n * time the object id drawn. The down side of this approach is that the delta time is\r\n * automatically calculated and you could miss out on cool effects like slow motion,\r\n * pause, skip ahead and the sorts. Most of these effects can be achieved even with\r\n * autoUpdate enabled but are harder to achieve.\r\n *\r\n * @member {boolean}\r\n * @memberof spine.Spine#\r\n * @default true\r\n */\r\n get: function () {\r\n return this._autoUpdate;\r\n },\r\n set: function (value) {\r\n if (value !== this._autoUpdate) {\r\n this._autoUpdate = value;\r\n this.updateTransform = value ? SpineBase.prototype.autoUpdateTransform : Container.prototype.updateTransform;\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(SpineBase.prototype, \"tint\", {\r\n /**\r\n * The tint applied to the spine object. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\r\n *\r\n * @member {number}\r\n * @memberof spine.Spine#\r\n * @default 0xFFFFFF\r\n */\r\n get: function () {\r\n return rgb2hex(this.tintRgb);\r\n },\r\n set: function (value) {\r\n this.tintRgb = hex2rgb(value, this.tintRgb);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(SpineBase.prototype, \"delayLimit\", {\r\n /**\r\n * Limit value for the update dt with Spine.globalDelayLimit\r\n * that can be overridden with localDelayLimit\r\n * @return {number} - Maximum processed dt value for the update\r\n */\r\n get: function () {\r\n var limit = typeof this.localDelayLimit !== \"undefined\" ?\r\n this.localDelayLimit : settings.GLOBAL_DELAY_LIMIT;\r\n // If limit is 0, this means there is no limit for the delay\r\n return limit || Number.MAX_VALUE;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Update the spine skeleton and its animations by delta time (dt)\r\n *\r\n * @param dt {number} Delta time. Time by which the animation should be updated\r\n */\r\n SpineBase.prototype.update = function (dt) {\r\n var _a;\r\n // Limit delta value to avoid animation jumps\r\n var delayLimit = this.delayLimit;\r\n if (dt > delayLimit)\r\n dt = delayLimit;\r\n this.state.update(dt);\r\n this.state.apply(this.skeleton);\r\n //check we haven't been destroyed via a spine event callback in state update\r\n if (!this.skeleton)\r\n return;\r\n this.skeleton.updateWorldTransform();\r\n var slots = this.skeleton.slots;\r\n // in case pixi has double tint\r\n var globalClr = this.color;\r\n var light = null, dark = null;\r\n if (globalClr) {\r\n light = globalClr.light;\r\n dark = globalClr.dark;\r\n }\r\n else {\r\n light = this.tintRgb;\r\n }\r\n // let thack = false;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n var slotContainer = this.slotContainers[i];\r\n if (!attachment) {\r\n slotContainer.visible = false;\r\n continue;\r\n }\r\n var spriteColor = null;\r\n if (attachment.sequence) {\r\n attachment.sequence.apply(slot, attachment);\r\n }\r\n var region = attachment.region;\r\n var attColor = attachment.color;\r\n switch (attachment != null && attachment.type) {\r\n case AttachmentType.Region:\r\n var transform = slotContainer.transform;\r\n transform.setFromMatrix(slot.bone.matrix);\r\n region = attachment.region;\r\n if (slot.currentMesh) {\r\n slot.currentMesh.visible = false;\r\n slot.currentMesh = null;\r\n slot.currentMeshId = undefined;\r\n slot.currentMeshName = undefined;\r\n }\r\n if (!region) {\r\n if (slot.currentSprite) {\r\n slot.currentSprite.renderable = false;\r\n }\r\n break;\r\n }\r\n if (!slot.currentSpriteName || slot.currentSpriteName !== attachment.name) {\r\n var spriteName = attachment.name;\r\n if (slot.currentSprite) {\r\n slot.currentSprite.visible = false;\r\n }\r\n slot.sprites = slot.sprites || {};\r\n if (slot.sprites[spriteName] !== undefined) {\r\n slot.sprites[spriteName].visible = true;\r\n }\r\n else {\r\n var sprite = this.createSprite(slot, attachment, spriteName);\r\n slotContainer.addChild(sprite);\r\n }\r\n slot.currentSprite = slot.sprites[spriteName];\r\n slot.currentSpriteName = spriteName;\r\n // force sprite update when attachment name is same.\r\n // issues https://github.com/pixijs/pixi-spine/issues/318\r\n }\r\n slot.currentSprite.renderable = true;\r\n if (!slot.hackRegion) {\r\n this.setSpriteRegion(attachment, slot.currentSprite, region);\r\n }\r\n if (slot.currentSprite.color) {\r\n //YAY! double - tint!\r\n spriteColor = slot.currentSprite.color;\r\n }\r\n else {\r\n tempRgb[0] = light[0] * slot.color.r * attColor.r;\r\n tempRgb[1] = light[1] * slot.color.g * attColor.g;\r\n tempRgb[2] = light[2] * slot.color.b * attColor.b;\r\n slot.currentSprite.tint = rgb2hex(tempRgb);\r\n }\r\n slot.currentSprite.blendMode = slot.blendMode;\r\n break;\r\n case AttachmentType.Mesh:\r\n if (slot.currentSprite) {\r\n //TODO: refactor this thing, switch it on and off for container\r\n slot.currentSprite.visible = false;\r\n slot.currentSprite = null;\r\n slot.currentSpriteName = undefined;\r\n //TODO: refactor this shit\r\n var transform_1 = new Transform();\r\n transform_1._parentID = -1;\r\n transform_1._worldID = slotContainer.transform._worldID;\r\n slotContainer.transform = transform_1;\r\n }\r\n if (!region) {\r\n if (slot.currentMesh) {\r\n slot.currentMesh.renderable = false;\r\n }\r\n break;\r\n }\r\n var id = attachment.id;\r\n if (slot.currentMeshId === undefined || slot.currentMeshId !== id) {\r\n var meshId = id;\r\n if (slot.currentMesh) {\r\n slot.currentMesh.visible = false;\r\n }\r\n slot.meshes = slot.meshes || {};\r\n if (slot.meshes[meshId] !== undefined) {\r\n slot.meshes[meshId].visible = true;\r\n }\r\n else {\r\n var mesh = this.createMesh(slot, attachment);\r\n slotContainer.addChild(mesh);\r\n }\r\n slot.currentMesh = slot.meshes[meshId];\r\n slot.currentMeshName = attachment.name;\r\n slot.currentMeshId = meshId;\r\n }\r\n slot.currentMesh.renderable = true;\r\n attachment.computeWorldVerticesOld(slot, slot.currentMesh.vertices);\r\n if (slot.currentMesh.color) {\r\n // pixi-heaven\r\n spriteColor = slot.currentMesh.color;\r\n }\r\n else {\r\n tempRgb[0] = light[0] * slot.color.r * attColor.r;\r\n tempRgb[1] = light[1] * slot.color.g * attColor.g;\r\n tempRgb[2] = light[2] * slot.color.b * attColor.b;\r\n slot.currentMesh.tint = rgb2hex(tempRgb);\r\n }\r\n slot.currentMesh.blendMode = slot.blendMode;\r\n if (!slot.hackRegion) {\r\n this.setMeshRegion(attachment, slot.currentMesh, region);\r\n }\r\n break;\r\n case AttachmentType.Clipping:\r\n if (!slot.currentGraphics) {\r\n this.createGraphics(slot, attachment);\r\n slotContainer.addChild(slot.clippingContainer);\r\n slotContainer.addChild(slot.currentGraphics);\r\n }\r\n this.updateGraphics(slot, attachment);\r\n slotContainer.alpha = 1.0;\r\n slotContainer.visible = true;\r\n continue;\r\n default:\r\n slotContainer.visible = false;\r\n continue;\r\n }\r\n slotContainer.visible = true;\r\n // pixi has double tint\r\n if (spriteColor) {\r\n var r0 = slot.color.r * attColor.r;\r\n var g0 = slot.color.g * attColor.g;\r\n var b0 = slot.color.b * attColor.b;\r\n //YAY! double-tint!\r\n spriteColor.setLight(light[0] * r0 + dark[0] * (1.0 - r0), light[1] * g0 + dark[1] * (1.0 - g0), light[2] * b0 + dark[2] * (1.0 - b0));\r\n if (slot.darkColor) {\r\n r0 = slot.darkColor.r;\r\n g0 = slot.darkColor.g;\r\n b0 = slot.darkColor.b;\r\n }\r\n else {\r\n r0 = 0.0;\r\n g0 = 0.0;\r\n b0 = 0.0;\r\n }\r\n spriteColor.setDark(light[0] * r0 + dark[0] * (1 - r0), light[1] * g0 + dark[1] * (1 - g0), light[2] * b0 + dark[2] * (1 - b0));\r\n }\r\n slotContainer.alpha = slot.color.a;\r\n }\r\n //== this is clipping implementation ===\r\n //TODO: remove parent hacks when pixi masks allow it\r\n var drawOrder = this.skeleton.drawOrder;\r\n var clippingAttachment = null;\r\n var clippingContainer = null;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = slots[drawOrder[i].data.index];\r\n var slotContainer = this.slotContainers[drawOrder[i].data.index];\r\n if (!clippingContainer) {\r\n //Adding null check as it is possible for slotContainer.parent to be null in the event of a spine being disposed off in its loop callback\r\n if (slotContainer.parent !== null && slotContainer.parent !== this) {\r\n slotContainer.parent.removeChild(slotContainer);\r\n //silend add hack\r\n slotContainer.parent = this;\r\n }\r\n }\r\n if (slot.currentGraphics && slot.getAttachment()) {\r\n clippingContainer = slot.clippingContainer;\r\n clippingAttachment = slot.getAttachment();\r\n clippingContainer.children.length = 0;\r\n this.children[i] = slotContainer;\r\n if (clippingAttachment.endSlot === slot.data) {\r\n clippingAttachment.endSlot = null;\r\n }\r\n }\r\n else {\r\n if (clippingContainer) {\r\n var c = this.tempClipContainers[i];\r\n if (!c) {\r\n c = this.tempClipContainers[i] = this.newContainer();\r\n c.visible = false;\r\n }\r\n this.children[i] = c;\r\n //silent remove hack\r\n slotContainer.parent = null;\r\n clippingContainer.addChild(slotContainer);\r\n if (clippingAttachment.endSlot == slot.data) {\r\n clippingContainer.renderable = true;\r\n clippingContainer = null;\r\n clippingAttachment = null;\r\n }\r\n }\r\n else {\r\n this.children[i] = slotContainer;\r\n }\r\n }\r\n }\r\n // if you can debug, then debug!\r\n (_a = this._debug) === null || _a === void 0 ? void 0 : _a.renderDebug(this);\r\n };\r\n SpineBase.prototype.setSpriteRegion = function (attachment, sprite, region) {\r\n // prevent setters calling when attachment and region is same\r\n if (sprite.attachment === attachment && sprite.region === region) {\r\n return;\r\n }\r\n sprite.region = region;\r\n sprite.attachment = attachment;\r\n sprite.texture = region.texture;\r\n sprite.rotation = attachment.rotation * MathUtils.degRad;\r\n sprite.position.x = attachment.x;\r\n sprite.position.y = attachment.y;\r\n sprite.alpha = attachment.color.a;\r\n if (!region.size) {\r\n sprite.scale.x = attachment.scaleX * attachment.width / region.originalWidth;\r\n sprite.scale.y = -attachment.scaleY * attachment.height / region.originalHeight;\r\n }\r\n else {\r\n //hacked!\r\n sprite.scale.x = region.size.width / region.originalWidth;\r\n sprite.scale.y = -region.size.height / region.originalHeight;\r\n }\r\n };\r\n SpineBase.prototype.setMeshRegion = function (attachment, mesh, region) {\r\n if (mesh.attachment === attachment && mesh.region === region) {\r\n return;\r\n }\r\n mesh.region = region;\r\n mesh.attachment = attachment;\r\n mesh.texture = region.texture;\r\n region.texture.updateUvs();\r\n mesh.uvBuffer.update(attachment.regionUVs);\r\n };\r\n /**\r\n * When autoupdate is set to yes this function is used as pixi's updateTransform function\r\n *\r\n * @private\r\n */\r\n SpineBase.prototype.autoUpdateTransform = function () {\r\n if (settings.GLOBAL_AUTO_UPDATE) {\r\n this.lastTime = this.lastTime || Date.now();\r\n var timeDelta = (Date.now() - this.lastTime) * 0.001;\r\n this.lastTime = Date.now();\r\n this.update(timeDelta);\r\n }\r\n else {\r\n this.lastTime = 0;\r\n }\r\n Container.prototype.updateTransform.call(this);\r\n };\r\n /**\r\n * Create a new sprite to be used with core.RegionAttachment\r\n *\r\n * @param slot {spine.Slot} The slot to which the attachment is parented\r\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\r\n * @private\r\n */\r\n SpineBase.prototype.createSprite = function (slot, attachment, defName) {\r\n var region = attachment.region;\r\n if (slot.hackAttachment === attachment) {\r\n region = slot.hackRegion;\r\n }\r\n var texture = region ? region.texture : null;\r\n var sprite = this.newSprite(texture);\r\n sprite.anchor.set(0.5);\r\n if (region) {\r\n this.setSpriteRegion(attachment, sprite, attachment.region);\r\n }\r\n slot.sprites = slot.sprites || {};\r\n slot.sprites[defName] = sprite;\r\n return sprite;\r\n };\r\n /**\r\n * Creates a Strip from the spine data\r\n * @param slot {spine.Slot} The slot to which the attachment is parented\r\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\r\n * @private\r\n */\r\n SpineBase.prototype.createMesh = function (slot, attachment) {\r\n var region = attachment.region;\r\n if (slot.hackAttachment === attachment) {\r\n region = slot.hackRegion;\r\n slot.hackAttachment = null;\r\n slot.hackRegion = null;\r\n }\r\n var strip = this.newMesh(region ? region.texture : null, new Float32Array(attachment.regionUVs.length), attachment.regionUVs, new Uint16Array(attachment.triangles), DRAW_MODES.TRIANGLES);\r\n if (typeof strip._canvasPadding !== \"undefined\") {\r\n strip._canvasPadding = 1.5;\r\n }\r\n strip.alpha = attachment.color.a;\r\n strip.region = attachment.region;\r\n if (region) {\r\n this.setMeshRegion(attachment, strip, region);\r\n }\r\n slot.meshes = slot.meshes || {};\r\n slot.meshes[attachment.id] = strip;\r\n return strip;\r\n };\r\n //@ts-ignore\r\n SpineBase.prototype.createGraphics = function (slot, clip) {\r\n var graphics = this.newGraphics();\r\n var poly = new Polygon([]);\r\n graphics.clear();\r\n graphics.beginFill(0xffffff, 1);\r\n graphics.drawPolygon(poly);\r\n graphics.renderable = false;\r\n slot.currentGraphics = graphics;\r\n slot.clippingContainer = this.newContainer();\r\n slot.clippingContainer.mask = slot.currentGraphics;\r\n return graphics;\r\n };\r\n SpineBase.prototype.updateGraphics = function (slot, clip) {\r\n var geom = slot.currentGraphics.geometry;\r\n var vertices = geom.graphicsData[0].shape.points;\r\n var n = clip.worldVerticesLength;\r\n vertices.length = n;\r\n clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\r\n geom.invalidate();\r\n };\r\n /**\r\n * Changes texture in attachment in specific slot.\r\n *\r\n * PIXI runtime feature, it was made to satisfy our users.\r\n *\r\n * @param slotIndex {number}\r\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\r\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\r\n * @returns {boolean} Success flag\r\n */\r\n SpineBase.prototype.hackTextureBySlotIndex = function (slotIndex, texture, size) {\r\n if (texture === void 0) { texture = null; }\r\n if (size === void 0) { size = null; }\r\n var slot = this.skeleton.slots[slotIndex];\r\n if (!slot) {\r\n return false;\r\n }\r\n var attachment = slot.getAttachment();\r\n var region = attachment.region;\r\n if (texture) {\r\n region = new TextureRegion();\r\n region.texture = texture;\r\n region.size = size;\r\n slot.hackRegion = region;\r\n slot.hackAttachment = attachment;\r\n }\r\n else {\r\n slot.hackRegion = null;\r\n slot.hackAttachment = null;\r\n }\r\n if (slot.currentSprite) {\r\n this.setSpriteRegion(attachment, slot.currentSprite, region);\r\n }\r\n else if (slot.currentMesh) {\r\n this.setMeshRegion(attachment, slot.currentMesh, region);\r\n }\r\n return true;\r\n };\r\n /**\r\n * Changes texture in attachment in specific slot.\r\n *\r\n * PIXI runtime feature, it was made to satisfy our users.\r\n *\r\n * @param slotName {string}\r\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\r\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\r\n * @returns {boolean} Success flag\r\n */\r\n SpineBase.prototype.hackTextureBySlotName = function (slotName, texture, size) {\r\n if (texture === void 0) { texture = null; }\r\n if (size === void 0) { size = null; }\r\n var index = this.skeleton.findSlotIndex(slotName);\r\n if (index == -1) {\r\n return false;\r\n }\r\n return this.hackTextureBySlotIndex(index, texture, size);\r\n };\r\n /**\r\n * Changes texture of an attachment\r\n *\r\n * PIXI runtime feature, it was made to satisfy our users.\r\n *\r\n * @param slotName {string}\r\n * @param attachmentName {string}\r\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\r\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\r\n * @returns {boolean} Success flag\r\n */\r\n SpineBase.prototype.hackTextureAttachment = function (slotName, attachmentName, texture, size) {\r\n if (size === void 0) { size = null; }\r\n // changes the texture of an attachment at the skeleton level\r\n var slotIndex = this.skeleton.findSlotIndex(slotName);\r\n var attachment = this.skeleton.getAttachmentByName(slotName, attachmentName);\r\n attachment.region.texture = texture;\r\n var slot = this.skeleton.slots[slotIndex];\r\n if (!slot) {\r\n return false;\r\n }\r\n // gets the currently active attachment in this slot\r\n var currentAttachment = slot.getAttachment();\r\n if (attachmentName === currentAttachment.name) {\r\n // if the attachment we are changing is currently active, change the the live texture\r\n var region = attachment.region;\r\n if (texture) {\r\n region = new TextureRegion();\r\n region.texture = texture;\r\n region.size = size;\r\n slot.hackRegion = region;\r\n slot.hackAttachment = currentAttachment;\r\n }\r\n else {\r\n slot.hackRegion = null;\r\n slot.hackAttachment = null;\r\n }\r\n if (slot.currentSprite && slot.currentSprite.region != region) {\r\n this.setSpriteRegion(currentAttachment, slot.currentSprite, region);\r\n slot.currentSprite.region = region;\r\n }\r\n else if (slot.currentMesh && slot.currentMesh.region != region) {\r\n this.setMeshRegion(currentAttachment, slot.currentMesh, region);\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n //those methods can be overriden to spawn different classes\r\n SpineBase.prototype.newContainer = function () {\r\n return new Container();\r\n };\r\n SpineBase.prototype.newSprite = function (tex) {\r\n return new SpineSprite(tex);\r\n };\r\n SpineBase.prototype.newGraphics = function () {\r\n return new Graphics();\r\n };\r\n SpineBase.prototype.newMesh = function (texture, vertices, uvs, indices, drawMode) {\r\n return new SpineMesh(texture, vertices, uvs, indices, drawMode);\r\n };\r\n SpineBase.prototype.transformHack = function () {\r\n return 1;\r\n };\r\n /**\r\n * Hack for pixi-display and pixi-lights. Every attachment name ending with a suffix will be added to different layer\r\n * @param nameSuffix\r\n * @param group\r\n * @param outGroup\r\n */\r\n SpineBase.prototype.hackAttachmentGroups = function (nameSuffix, group, outGroup) {\r\n if (!nameSuffix) {\r\n return undefined;\r\n }\r\n var list_d = [], list_n = [];\r\n for (var i = 0, len = this.skeleton.slots.length; i < len; i++) {\r\n var slot = this.skeleton.slots[i];\r\n var name_1 = slot.currentSpriteName || slot.currentMeshName || \"\";\r\n var target = slot.currentSprite || slot.currentMesh;\r\n if (name_1.endsWith(nameSuffix)) {\r\n target.parentGroup = group;\r\n list_n.push(target);\r\n }\r\n else if (outGroup && target) {\r\n target.parentGroup = outGroup;\r\n list_d.push(target);\r\n }\r\n }\r\n return [list_d, list_n];\r\n };\r\n SpineBase.prototype.destroy = function (options) {\r\n this.debug = null; // setter will do the cleanup\r\n for (var i = 0, n = this.skeleton.slots.length; i < n; i++) {\r\n var slot = this.skeleton.slots[i];\r\n for (var name_2 in slot.meshes) {\r\n slot.meshes[name_2].destroy(options);\r\n }\r\n slot.meshes = null;\r\n for (var name_3 in slot.sprites) {\r\n slot.sprites[name_3].destroy(options);\r\n }\r\n slot.sprites = null;\r\n }\r\n for (var i = 0, n = this.slotContainers.length; i < n; i++) {\r\n this.slotContainers[i].destroy(options);\r\n }\r\n this.spineData = null;\r\n this.skeleton = null;\r\n this.slotContainers = null;\r\n this.stateData = null;\r\n this.state = null;\r\n this.tempClipContainers = null;\r\n _super.prototype.destroy.call(this, options);\r\n };\r\n SpineBase.clippingPolygon = [];\r\n return SpineBase;\r\n}(Container));\r\n/**\r\n * The visibility of the spine object. If false the object will not be drawn,\r\n * the updateTransform function will not be called, and the spine will not be automatically updated.\r\n *\r\n * @member {boolean}\r\n * @memberof spine.Spine#\r\n * @default true\r\n */\r\nObject.defineProperty(SpineBase.prototype, 'visible', {\r\n get: function () {\r\n return this._visible;\r\n },\r\n set: function (value) {\r\n if (value !== this._visible) {\r\n this._visible = value;\r\n if (value) {\r\n this.lastTime = 0;\r\n }\r\n }\r\n }\r\n});\n\n/**\r\n * This is a debug renderer that uses PixiJS Graphics under the hood.\r\n * @public\r\n */\r\nvar SpineDebugRenderer = /** @class */ (function () {\r\n function SpineDebugRenderer() {\r\n this.registeredSpines = new Map();\r\n this.drawDebug = true;\r\n this.drawMeshHull = true;\r\n this.drawMeshTriangles = true;\r\n this.drawBones = true;\r\n this.drawPaths = true;\r\n this.drawBoundingBoxes = true;\r\n this.drawClipping = true;\r\n this.drawRegionAttachments = true;\r\n this.lineWidth = 1;\r\n this.regionAttachmentsColor = 0x0078ff;\r\n this.meshHullColor = 0x0078ff;\r\n this.meshTrianglesColor = 0xffcc00;\r\n this.clippingPolygonColor = 0xff00ff;\r\n this.boundingBoxesRectColor = 0x00ff00;\r\n this.boundingBoxesPolygonColor = 0x00ff00;\r\n this.boundingBoxesCircleColor = 0x00ff00;\r\n this.pathsCurveColor = 0xff0000;\r\n this.pathsLineColor = 0xff00ff;\r\n this.skeletonXYColor = 0xff0000;\r\n this.bonesColor = 0x00eecc;\r\n }\r\n /**\r\n * The debug is attached by force to each spine object. So we need to create it inside the spine when we get the first update\r\n */\r\n SpineDebugRenderer.prototype.registerSpine = function (spine) {\r\n if (this.registeredSpines.has(spine)) {\r\n console.warn(\"SpineDebugRenderer.registerSpine() - this spine is already registered!\", spine);\r\n }\r\n var debugDisplayObjects = {\r\n parentDebugContainer: new Container(),\r\n bones: new Container(),\r\n skeletonXY: new Graphics(),\r\n regionAttachmentsShape: new Graphics(),\r\n meshTrianglesLine: new Graphics(),\r\n meshHullLine: new Graphics(),\r\n clippingPolygon: new Graphics(),\r\n boundingBoxesRect: new Graphics(),\r\n boundingBoxesCircle: new Graphics(),\r\n boundingBoxesPolygon: new Graphics(),\r\n pathsCurve: new Graphics(),\r\n pathsLine: new Graphics(),\r\n };\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.bones);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.skeletonXY);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.regionAttachmentsShape);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.meshTrianglesLine);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.meshHullLine);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.clippingPolygon);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesRect);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesCircle);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesPolygon);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.pathsCurve);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.pathsLine);\r\n spine.addChild(debugDisplayObjects.parentDebugContainer);\r\n this.registeredSpines.set(spine, debugDisplayObjects);\r\n };\r\n SpineDebugRenderer.prototype.renderDebug = function (spine) {\r\n if (!this.registeredSpines.has(spine)) {\r\n // This should never happen. Spines are registered when you assign spine.debug\r\n this.registerSpine(spine);\r\n }\r\n var debugDisplayObjects = this.registeredSpines.get(spine);\r\n debugDisplayObjects.skeletonXY.clear();\r\n debugDisplayObjects.regionAttachmentsShape.clear();\r\n debugDisplayObjects.meshTrianglesLine.clear();\r\n debugDisplayObjects.meshHullLine.clear();\r\n debugDisplayObjects.clippingPolygon.clear();\r\n debugDisplayObjects.boundingBoxesRect.clear();\r\n debugDisplayObjects.boundingBoxesCircle.clear();\r\n debugDisplayObjects.boundingBoxesPolygon.clear();\r\n debugDisplayObjects.pathsCurve.clear();\r\n debugDisplayObjects.pathsLine.clear();\r\n for (var len = debugDisplayObjects.bones.children.length; len > 0; len--) {\r\n debugDisplayObjects.bones.children[len - 1].destroy({ children: true, texture: true, baseTexture: true });\r\n }\r\n var scale = spine.scale.x || spine.scale.y || 1;\r\n var lineWidth = this.lineWidth / scale;\r\n if (this.drawBones) {\r\n this.drawBonesFunc(spine, debugDisplayObjects, lineWidth, scale);\r\n }\r\n if (this.drawPaths) {\r\n this.drawPathsFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawBoundingBoxes) {\r\n this.drawBoundingBoxesFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawClipping) {\r\n this.drawClippingFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawMeshHull || this.drawMeshTriangles) {\r\n this.drawMeshHullAndMeshTriangles(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawRegionAttachments) {\r\n this.drawRegionAttachmentsFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawBonesFunc = function (spine, debugDisplayObjects, lineWidth, scale) {\r\n var skeleton = spine.skeleton;\r\n var skeletonX = skeleton.x;\r\n var skeletonY = skeleton.y;\r\n var bones = skeleton.bones;\r\n debugDisplayObjects.skeletonXY.lineStyle(lineWidth, this.skeletonXYColor, 1);\r\n for (var i = 0, len = bones.length; i < len; i++) {\r\n var bone = bones[i], boneLen = bone.data.length, starX = skeletonX + bone.matrix.tx, starY = skeletonY + bone.matrix.ty, endX = skeletonX + boneLen * bone.matrix.a + bone.matrix.tx, endY = skeletonY + boneLen * bone.matrix.b + bone.matrix.ty;\r\n if (bone.data.name === \"root\" || bone.data.parent === null) {\r\n continue;\r\n }\r\n // Triangle calculation formula\r\n // area: A=sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c))/4\r\n // alpha: alpha=acos((pow(b, 2)+pow(c, 2)-pow(a, 2))/(2*b*c))\r\n // beta: beta=acos((pow(a, 2)+pow(c, 2)-pow(b, 2))/(2*a*c))\r\n // gamma: gamma=acos((pow(a, 2)+pow(b, 2)-pow(c, 2))/(2*a*b))\r\n var w = Math.abs(starX - endX), h = Math.abs(starY - endY), \r\n // a = w, // side length a\r\n a2 = Math.pow(w, 2), // square root of side length a\r\n b = h, // side length b\r\n b2 = Math.pow(h, 2), // square root of side length b\r\n c = Math.sqrt(a2 + b2), // side length c\r\n c2 = Math.pow(c, 2), // square root of side length c\r\n rad = Math.PI / 180, \r\n // A = Math.acos([a2 + c2 - b2] / [2 * a * c]) || 0, // Angle A\r\n // C = Math.acos([a2 + b2 - c2] / [2 * a * b]) || 0, // C angle\r\n B = Math.acos((c2 + b2 - a2) / (2 * b * c)) || 0; // angle of corner B\r\n if (c === 0) {\r\n continue;\r\n }\r\n var gp = new Graphics();\r\n debugDisplayObjects.bones.addChild(gp);\r\n // draw bone\r\n var refRation = c / 50 / scale;\r\n gp.beginFill(this.bonesColor, 1);\r\n gp.drawPolygon(0, 0, 0 - refRation, c - refRation * 3, 0, c - refRation, 0 + refRation, c - refRation * 3);\r\n gp.endFill();\r\n gp.x = starX;\r\n gp.y = starY;\r\n gp.pivot.y = c;\r\n // Calculate bone rotation angle\r\n var rotation = 0;\r\n if (starX < endX && starY < endY) {\r\n // bottom right\r\n rotation = -B + 180 * rad;\r\n }\r\n else if (starX > endX && starY < endY) {\r\n // bottom left\r\n rotation = 180 * rad + B;\r\n }\r\n else if (starX > endX && starY > endY) {\r\n // top left\r\n rotation = -B;\r\n }\r\n else if (starX < endX && starY > endY) {\r\n // bottom left\r\n rotation = B;\r\n }\r\n else if (starY === endY && starX < endX) {\r\n // To the right\r\n rotation = 90 * rad;\r\n }\r\n else if (starY === endY && starX > endX) {\r\n // go left\r\n rotation = -90 * rad;\r\n }\r\n else if (starX === endX && starY < endY) {\r\n // down\r\n rotation = 180 * rad;\r\n }\r\n else if (starX === endX && starY > endY) {\r\n // up\r\n rotation = 0;\r\n }\r\n gp.rotation = rotation;\r\n // Draw the starting rotation point of the bone\r\n gp.lineStyle(lineWidth + refRation / 2.4, this.bonesColor, 1);\r\n gp.beginFill(0x000000, 0.6);\r\n gp.drawCircle(0, c, refRation * 1.2);\r\n gp.endFill();\r\n }\r\n // Draw the skeleton starting point \"X\" form\r\n var startDotSize = lineWidth * 3;\r\n debugDisplayObjects.skeletonXY.moveTo(skeletonX - startDotSize, skeletonY - startDotSize);\r\n debugDisplayObjects.skeletonXY.lineTo(skeletonX + startDotSize, skeletonY + startDotSize);\r\n debugDisplayObjects.skeletonXY.moveTo(skeletonX + startDotSize, skeletonY - startDotSize);\r\n debugDisplayObjects.skeletonXY.lineTo(skeletonX - startDotSize, skeletonY + startDotSize);\r\n };\r\n SpineDebugRenderer.prototype.drawRegionAttachmentsFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.regionAttachmentsShape.lineStyle(lineWidth, this.regionAttachmentsColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i], attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Region) {\r\n continue;\r\n }\r\n var regionAttachment = attachment;\r\n var vertices = new Float32Array(8);\r\n regionAttachment === null || regionAttachment === void 0 ? void 0 : regionAttachment.updateOffset(); // We don't need this on all versions\r\n regionAttachment.computeWorldVertices(slot, vertices, 0, 2);\r\n debugDisplayObjects.regionAttachmentsShape.drawPolygon(Array.from(vertices.slice(0, 8)));\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawMeshHullAndMeshTriangles = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.meshHullLine.lineStyle(lineWidth, this.meshHullColor, 1);\r\n debugDisplayObjects.meshTrianglesLine.lineStyle(lineWidth, this.meshTrianglesColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active) {\r\n continue;\r\n }\r\n var attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Mesh) {\r\n continue;\r\n }\r\n var meshAttachment = attachment;\r\n var vertices = new Float32Array(meshAttachment.worldVerticesLength), triangles = meshAttachment.triangles;\r\n var hullLength = meshAttachment.hullLength;\r\n meshAttachment.computeWorldVertices(slot, 0, meshAttachment.worldVerticesLength, vertices, 0, 2);\r\n // draw the skinned mesh (triangle)\r\n if (this.drawMeshTriangles) {\r\n for (var i_1 = 0, len_1 = triangles.length; i_1 < len_1; i_1 += 3) {\r\n var v1 = triangles[i_1] * 2, v2 = triangles[i_1 + 1] * 2, v3 = triangles[i_1 + 2] * 2;\r\n debugDisplayObjects.meshTrianglesLine.moveTo(vertices[v1], vertices[v1 + 1]);\r\n debugDisplayObjects.meshTrianglesLine.lineTo(vertices[v2], vertices[v2 + 1]);\r\n debugDisplayObjects.meshTrianglesLine.lineTo(vertices[v3], vertices[v3 + 1]);\r\n }\r\n }\r\n // draw skin border\r\n if (this.drawMeshHull && hullLength > 0) {\r\n hullLength = (hullLength >> 1) * 2;\r\n var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\r\n for (var i_2 = 0, len_2 = hullLength; i_2 < len_2; i_2 += 2) {\r\n var x = vertices[i_2], y = vertices[i_2 + 1];\r\n debugDisplayObjects.meshHullLine.moveTo(x, y);\r\n debugDisplayObjects.meshHullLine.lineTo(lastX, lastY);\r\n lastX = x;\r\n lastY = y;\r\n }\r\n }\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawClippingFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.clippingPolygon.lineStyle(lineWidth, this.clippingPolygonColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active) {\r\n continue;\r\n }\r\n var attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Clipping) {\r\n continue;\r\n }\r\n var clippingAttachment = attachment;\r\n var nn = clippingAttachment.worldVerticesLength, world = new Float32Array(nn);\r\n clippingAttachment.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n debugDisplayObjects.clippingPolygon.drawPolygon(Array.from(world));\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawBoundingBoxesFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var _this = this;\r\n // draw the total outline of the bounding box\r\n debugDisplayObjects.boundingBoxesRect.lineStyle(lineWidth, this.boundingBoxesRectColor, 5);\r\n var bounds = new SkeletonBoundsBase();\r\n bounds.update(spine.skeleton, true);\r\n debugDisplayObjects.boundingBoxesRect.drawRect(bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\r\n var polygons = bounds.polygons, drawPolygon = function (polygonVertices, _offset, count) {\r\n debugDisplayObjects.boundingBoxesPolygon.lineStyle(lineWidth, _this.boundingBoxesPolygonColor, 1);\r\n debugDisplayObjects.boundingBoxesPolygon.beginFill(_this.boundingBoxesPolygonColor, 0.1);\r\n if (count < 3) {\r\n throw new Error(\"Polygon must contain at least 3 vertices\");\r\n }\r\n var paths = [], dotSize = lineWidth * 2;\r\n for (var i = 0, len = polygonVertices.length; i < len; i += 2) {\r\n var x1 = polygonVertices[i], y1 = polygonVertices[i + 1];\r\n // draw the bounding box node\r\n debugDisplayObjects.boundingBoxesCircle.lineStyle(0);\r\n debugDisplayObjects.boundingBoxesCircle.beginFill(_this.boundingBoxesCircleColor);\r\n debugDisplayObjects.boundingBoxesCircle.drawCircle(x1, y1, dotSize);\r\n debugDisplayObjects.boundingBoxesCircle.endFill();\r\n paths.push(x1, y1);\r\n }\r\n // draw the bounding box area\r\n debugDisplayObjects.boundingBoxesPolygon.drawPolygon(paths);\r\n debugDisplayObjects.boundingBoxesPolygon.endFill();\r\n };\r\n for (var i = 0, len = polygons.length; i < len; i++) {\r\n var polygon = polygons[i];\r\n drawPolygon(polygon, 0, polygon.length);\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawPathsFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.pathsCurve.lineStyle(lineWidth, this.pathsCurveColor, 1);\r\n debugDisplayObjects.pathsLine.lineStyle(lineWidth, this.pathsLineColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active) {\r\n continue;\r\n }\r\n var attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Path) {\r\n continue;\r\n }\r\n var pathAttachment = attachment;\r\n var nn = pathAttachment.worldVerticesLength;\r\n var world = new Float32Array(nn);\r\n pathAttachment.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\r\n if (pathAttachment.closed) {\r\n var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\r\n x2 = world[nn - 4];\r\n y2 = world[nn - 3];\r\n // curve\r\n debugDisplayObjects.pathsCurve.moveTo(x1, y1);\r\n debugDisplayObjects.pathsCurve.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);\r\n // handle\r\n debugDisplayObjects.pathsLine.moveTo(x1, y1);\r\n debugDisplayObjects.pathsLine.lineTo(cx1, cy1);\r\n debugDisplayObjects.pathsLine.moveTo(x2, y2);\r\n debugDisplayObjects.pathsLine.lineTo(cx2, cy2);\r\n }\r\n nn -= 4;\r\n for (var ii = 4; ii < nn; ii += 6) {\r\n var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\r\n x2 = world[ii + 4];\r\n y2 = world[ii + 5];\r\n // curve\r\n debugDisplayObjects.pathsCurve.moveTo(x1, y1);\r\n debugDisplayObjects.pathsCurve.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);\r\n // handle\r\n debugDisplayObjects.pathsLine.moveTo(x1, y1);\r\n debugDisplayObjects.pathsLine.lineTo(cx1, cy1);\r\n debugDisplayObjects.pathsLine.moveTo(x2, y2);\r\n debugDisplayObjects.pathsLine.lineTo(cx2, cy2);\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n }\r\n };\r\n SpineDebugRenderer.prototype.unregisterSpine = function (spine) {\r\n if (!this.registeredSpines.has(spine)) {\r\n console.warn(\"SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!\", spine);\r\n }\r\n var debugDisplayObjects = this.registeredSpines.get(spine);\r\n debugDisplayObjects.parentDebugContainer.destroy({ baseTexture: true, children: true, texture: true });\r\n this.registeredSpines.delete(spine);\r\n };\r\n return SpineDebugRenderer;\r\n}());\n\nexport { AttachmentType, BinaryInput, Color, DebugUtils, IntSet, Interpolation, MathUtils, MixBlend, MixDirection, Pool, PositionMode, Pow, PowOut, RotateMode, SkeletonBoundsBase, SpineBase, SpineDebugRenderer, SpineMesh, SpineSprite, StringSet, TextureAtlas, TextureAtlasPage, TextureAtlasRegion, TextureFilter, TextureRegion, TextureWrap, TimeKeeper, TransformMode, Utils, Vector2, WindowedMean, filterFromString, settings, wrapFromString };\n//# sourceMappingURL=base.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/loader-base - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/loader-base is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev , All Rights Reserved\n */\nimport { LoaderResource } from '@pixi/loaders';\nimport { BaseTexture } from '@pixi/core';\nimport { TextureAtlas } from '@pixi-spine/base';\nimport { ALPHA_MODES } from '@pixi/constants';\n\nfunction isJson(resource) {\r\n return resource.type === LoaderResource.TYPE.JSON;\r\n}\r\nfunction isBuffer(resource) {\r\n return resource.xhrType === LoaderResource.XHR_RESPONSE_TYPE.BUFFER;\r\n}\r\nLoaderResource.setExtensionXhrType('skel', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);\r\n/**\r\n * @public\r\n */\r\nvar AbstractSpineParser = /** @class */ (function () {\r\n function AbstractSpineParser() {\r\n }\r\n AbstractSpineParser.prototype.genMiddleware = function () {\r\n var self = this;\r\n return {\r\n use: function (resource, next) {\r\n // skip if no data, its not json, or it isn't atlas data\r\n if (!resource.data) {\r\n return next();\r\n }\r\n var isJsonSpineModel = isJson(resource) && resource.data.bones;\r\n var isBinarySpineModel = isBuffer(resource) && (resource.extension === 'skel' || resource.metadata\r\n && resource.metadata.spineMetadata);\r\n if (!isJsonSpineModel && !isBinarySpineModel) {\r\n return next();\r\n }\r\n var parser = null;\r\n var dataToParse = resource.data;\r\n if (isJsonSpineModel) {\r\n parser = self.createJsonParser();\r\n }\r\n else {\r\n parser = self.createBinaryParser();\r\n if (resource.data instanceof ArrayBuffer) {\r\n dataToParse = new Uint8Array(resource.data);\r\n }\r\n }\r\n var metadata = (resource.metadata || {});\r\n var metadataSkeletonScale = metadata ? metadata.spineSkeletonScale : null;\r\n if (metadataSkeletonScale) {\r\n parser.scale = metadataSkeletonScale;\r\n }\r\n var metadataAtlas = metadata.spineAtlas;\r\n if (metadataAtlas === false) {\r\n return next();\r\n }\r\n if (metadataAtlas && metadataAtlas.pages) {\r\n self.parseData(resource, parser, metadataAtlas, dataToParse);\r\n return next();\r\n }\r\n var metadataAtlasSuffix = metadata.spineAtlasSuffix || '.atlas';\r\n /**\r\n * use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files\r\n * that correspond to the spine file are in the same base URL and that the .json and .atlas files\r\n * have the same name\r\n */\r\n var atlasPath = resource.url;\r\n var queryStringPos = atlasPath.indexOf('?');\r\n if (queryStringPos > 0) {\r\n //remove querystring\r\n atlasPath = atlasPath.substr(0, queryStringPos);\r\n }\r\n atlasPath = atlasPath.substr(0, atlasPath.lastIndexOf('.')) + metadataAtlasSuffix;\r\n // use atlas path as a params. (no need to use same atlas file name with json file name)\r\n if (metadata.spineAtlasFile) {\r\n atlasPath = metadata.spineAtlasFile;\r\n }\r\n //remove the baseUrl\r\n atlasPath = atlasPath.replace(this.baseUrl, '');\r\n var atlasOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n xhrType: LoaderResource.XHR_RESPONSE_TYPE.TEXT,\r\n metadata: metadata.spineMetadata || null,\r\n parentResource: resource\r\n };\r\n var imageOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n metadata: metadata.imageMetadata || null,\r\n parentResource: resource\r\n };\r\n var baseUrl = resource.url.substr(0, resource.url.lastIndexOf('/') + 1);\r\n //remove the baseUrl\r\n baseUrl = baseUrl.replace(this.baseUrl, '');\r\n var namePrefix = metadata.imageNamePrefix || (resource.name + '_atlas_page_');\r\n var adapter = metadata.images ? staticImageLoader(metadata.images)\r\n : metadata.image ? staticImageLoader({ 'default': metadata.image })\r\n : metadata.imageLoader ? metadata.imageLoader(this, namePrefix, baseUrl, imageOptions)\r\n : imageLoaderAdapter(this, namePrefix, baseUrl, imageOptions);\r\n function createSkeletonWithRawAtlas(rawData) {\r\n new TextureAtlas(rawData, adapter, function (spineAtlas) {\r\n if (spineAtlas) {\r\n self.parseData(resource, parser, spineAtlas, dataToParse);\r\n }\r\n next();\r\n });\r\n }\r\n if (metadata.atlasRawData) {\r\n createSkeletonWithRawAtlas(metadata.atlasRawData);\r\n }\r\n else {\r\n this.add(resource.name + '_atlas', atlasPath, atlasOptions, function (atlasResource) {\r\n if (!atlasResource.error) {\r\n createSkeletonWithRawAtlas(atlasResource.data);\r\n }\r\n else {\r\n next();\r\n }\r\n });\r\n }\r\n }\r\n };\r\n };\r\n return AbstractSpineParser;\r\n}());\r\n/**\r\n * @public\r\n */\r\nfunction imageLoaderAdapter(loader, namePrefix, baseUrl, imageOptions) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length - 1)) {\r\n baseUrl += '/';\r\n }\r\n return function (line, callback) {\r\n var name = namePrefix + line;\r\n var url = baseUrl + line;\r\n var cachedResource = loader.resources[name];\r\n if (cachedResource) {\r\n var done = function () {\r\n callback(cachedResource.texture.baseTexture);\r\n };\r\n if (cachedResource.texture) {\r\n done();\r\n }\r\n else {\r\n cachedResource.onAfterMiddleware.add(done);\r\n }\r\n }\r\n else {\r\n loader.add(name, url, imageOptions, function (resource) {\r\n if (!resource.error) {\r\n if (line.indexOf('-pma.') >= 0) {\r\n resource.texture.baseTexture.alphaMode = ALPHA_MODES.PMA;\r\n }\r\n callback(resource.texture.baseTexture);\r\n }\r\n else {\r\n callback(null);\r\n }\r\n });\r\n }\r\n };\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction syncImageLoaderAdapter(baseUrl, crossOrigin) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length - 1)) {\r\n baseUrl += '/';\r\n }\r\n return function (line, callback) {\r\n callback(BaseTexture.from(line, crossOrigin));\r\n };\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction staticImageLoader(pages) {\r\n return function (line, callback) {\r\n var page = pages[line] || pages['default'];\r\n if (page && page.baseTexture)\r\n callback(page.baseTexture);\r\n else\r\n callback(page);\r\n };\r\n}\n\nexport { AbstractSpineParser, imageLoaderAdapter, staticImageLoader, syncImageLoaderAdapter };\n//# sourceMappingURL=loader-base.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/runtime-3.8 - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/runtime-3.8 is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev , All Rights Reserved\n */\nimport { Utils, AttachmentType, Color, MathUtils, PowOut, MixBlend, MixDirection, IntSet, Pool, settings, TransformMode, RotateMode, PositionMode, Vector2, BinaryInput, SkeletonBoundsBase, SpineBase } from '@pixi-spine/base';\nimport { Matrix } from '@pixi/math';\nimport { BLEND_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nvar Attachment = /** @class */ (function () {\r\n function Attachment(name) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar VertexAttachment = /** @class */ (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n _this.worldVerticesLength = 0;\r\n _this.deformAttachment = _this;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVerticesOld = function (slot, worldVertices) {\r\n this.computeWorldVertices(slot, 0, this.worldVerticesLength, worldVertices, 0, 2);\r\n };\r\n /** Transforms local vertices to world coordinates.\r\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\r\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\r\n * @param offset The worldVertices index to begin writing values. */\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.deform;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var mat = slot.bone.matrix;\r\n var x = mat.tx;\r\n var y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n VertexAttachment.prototype.copyTo = function (attachment) {\r\n if (this.bones != null) {\r\n attachment.bones = new Array(this.bones.length);\r\n Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\r\n }\r\n else\r\n attachment.bones = null;\r\n if (this.vertices != null) {\r\n attachment.vertices = Utils.newFloatArray(this.vertices.length);\r\n Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\r\n }\r\n else\r\n attachment.vertices = null;\r\n attachment.worldVerticesLength = this.worldVerticesLength;\r\n attachment.deformAttachment = this.deformAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar BoundingBoxAttachment = /** @class */ (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.BoundingBox;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n BoundingBoxAttachment.prototype.copy = function () {\r\n var copy = new BoundingBoxAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return BoundingBoxAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar ClippingAttachment = /** @class */ (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Clipping;\r\n // Nonessential.\r\n _this.color = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\r\n return _this;\r\n }\r\n ClippingAttachment.prototype.copy = function () {\r\n var copy = new ClippingAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.endSlot = this.endSlot;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return ClippingAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar MeshAttachment = /** @class */ (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Mesh;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.tempColor = new Color(0, 0, 0, 0);\r\n return _this;\r\n }\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n /** @param parentMesh May be null. */\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n MeshAttachment.prototype.copy = function () {\r\n if (this.parentMesh != null)\r\n return this.newLinkedMesh();\r\n var copy = new MeshAttachment(this.name);\r\n copy.region = this.region;\r\n copy.path = this.path;\r\n copy.color.setFromColor(this.color);\r\n this.copyTo(copy);\r\n copy.regionUVs = new Float32Array(this.regionUVs.length);\r\n Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\r\n copy.triangles = new Array(this.triangles.length);\r\n Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\r\n copy.hullLength = this.hullLength;\r\n // Nonessential.\r\n if (this.edges != null) {\r\n copy.edges = new Array(this.edges.length);\r\n Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\r\n }\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n return copy;\r\n };\r\n MeshAttachment.prototype.newLinkedMesh = function () {\r\n var copy = new MeshAttachment(this.name);\r\n copy.region = this.region;\r\n copy.path = this.path;\r\n copy.color.setFromColor(this.color);\r\n copy.deformAttachment = this.deformAttachment;\r\n copy.setParentMesh(this.parentMesh != null ? this.parentMesh : this);\r\n // copy.updateUVs();\r\n return copy;\r\n };\r\n return MeshAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PathAttachment = /** @class */ (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Path;\r\n _this.closed = false;\r\n _this.constantSpeed = false;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n PathAttachment.prototype.copy = function () {\r\n var copy = new PathAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.lengths = new Array(this.lengths.length);\r\n Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\r\n copy.closed = closed;\r\n copy.constantSpeed = this.constantSpeed;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PathAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PointAttachment = /** @class */ (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Point;\r\n _this.color = new Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n var mat = bone.matrix;\r\n point.x = this.x * mat.a + this.y * mat.c + bone.worldX;\r\n point.y = this.x * mat.b + this.y * mat.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var mat = bone.matrix;\r\n var cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\r\n var x = cos * mat.a + sin * mat.c;\r\n var y = cos * mat.b + sin * mat.d;\r\n return Math.atan2(y, x) * MathUtils.radDeg;\r\n };\r\n PointAttachment.prototype.copy = function () {\r\n var copy = new PointAttachment(this.name);\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.rotation = this.rotation;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PointAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar Slot = /** @class */ (function () {\r\n function Slot(data, bone) {\r\n this.deform = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (bone == null)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.darkColor = data.darkColor == null ? null : new Color();\r\n this.setToSetupPose();\r\n this.blendMode = this.data.blendMode;\r\n }\r\n /** @return May be null. */\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.deform.length = 0;\r\n };\r\n Slot.prototype.setAttachmentTime = function (time) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n };\r\n /** Returns the time since the attachment was set. */\r\n Slot.prototype.getAttachmentTime = function () {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n };\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor != null)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar RegionAttachment = /** @class */ (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Region;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.scaleX = 1;\r\n _this.scaleY = 1;\r\n _this.rotation = 0;\r\n _this.width = 0;\r\n _this.height = 0;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.offset = Utils.newFloatArray(8);\r\n _this.uvs = Utils.newFloatArray(8);\r\n _this.tempColor = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n RegionAttachment.prototype.updateOffset = function () {\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var localXCos = localX * cos + this.x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + this.y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + this.x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + this.y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[RegionAttachment.OX1] = localXCos - localYSin;\r\n offset[RegionAttachment.OY1] = localYCos + localXSin;\r\n offset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n offset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n offset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n offset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n };\r\n RegionAttachment.prototype.setRegion = function (region) {\r\n this.region = region;\r\n var uvs = this.uvs;\r\n if (region.rotate) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n var vertexOffset = this.offset;\r\n var mat = bone instanceof Slot ? bone.bone.matrix : bone.matrix;\r\n var x = mat.tx, y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[RegionAttachment.OX1];\r\n offsetY = vertexOffset[RegionAttachment.OY1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // br\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX2];\r\n offsetY = vertexOffset[RegionAttachment.OY2];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // bl\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX3];\r\n offsetY = vertexOffset[RegionAttachment.OY3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ul\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX4];\r\n offsetY = vertexOffset[RegionAttachment.OY4];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ur\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.prototype.copy = function () {\r\n var copy = new RegionAttachment(this.name);\r\n copy.region = this.region;\r\n copy.rendererObject = this.rendererObject;\r\n copy.path = this.path;\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.scaleX = this.scaleX;\r\n copy.scaleY = this.scaleY;\r\n copy.rotation = this.rotation;\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\r\n Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n RegionAttachment.OX1 = 0;\r\n RegionAttachment.OY1 = 1;\r\n RegionAttachment.OX2 = 2;\r\n RegionAttachment.OY2 = 3;\r\n RegionAttachment.OX3 = 4;\r\n RegionAttachment.OY3 = 5;\r\n RegionAttachment.OX4 = 6;\r\n RegionAttachment.OY4 = 7;\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar JitterEffect = /** @class */ (function () {\r\n function JitterEffect(jitterX, jitterY) {\r\n this.jitterX = 0;\r\n this.jitterY = 0;\r\n this.jitterX = jitterX;\r\n this.jitterY = jitterY;\r\n }\r\n JitterEffect.prototype.begin = function (skeleton) {\r\n };\r\n JitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n position.x += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n position.y += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n };\r\n JitterEffect.prototype.end = function () {\r\n };\r\n return JitterEffect;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SwirlEffect = /** @class */ (function () {\r\n function SwirlEffect(radius) {\r\n this.centerX = 0;\r\n this.centerY = 0;\r\n this.radius = 0;\r\n this.angle = 0;\r\n this.worldX = 0;\r\n this.worldY = 0;\r\n this.radius = radius;\r\n }\r\n SwirlEffect.prototype.begin = function (skeleton) {\r\n this.worldX = skeleton.x + this.centerX;\r\n this.worldY = skeleton.y + this.centerY;\r\n };\r\n SwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n var radAngle = this.angle * MathUtils.degreesToRadians;\r\n var x = position.x - this.worldX;\r\n var y = position.y - this.worldY;\r\n var dist = Math.sqrt(x * x + y * y);\r\n if (dist < this.radius) {\r\n var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n var cos = Math.cos(theta);\r\n var sin = Math.sin(theta);\r\n position.x = cos * x - sin * y + this.worldX;\r\n position.y = sin * x + cos * y + this.worldY;\r\n }\r\n };\r\n SwirlEffect.prototype.end = function () {\r\n };\r\n SwirlEffect.interpolation = new PowOut(2);\r\n return SwirlEffect;\r\n}());\n\n/** A simple container for a list of timelines and a name. */\r\n/**\r\n * @public\r\n */\r\nvar Animation = /** @class */ (function () {\r\n function Animation(name, timelines, duration) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (timelines == null)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.timelineIds = [];\r\n for (var i = 0; i < timelines.length; i++)\r\n this.timelineIds[timelines[i].getPropertyId()] = true;\r\n this.duration = duration;\r\n }\r\n Animation.prototype.hasTimeline = function (id) {\r\n return this.timelineIds[id] == true;\r\n };\r\n /** Applies all the animation's timelines to the specified skeleton.\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @param loop If true, the animation repeats after {@link #getDuration()}.\r\n * @param events May be null to ignore fired events. */\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n /** @param target After the first and before the last value.\r\n * @returns index of first value greater than the target. */\r\n Animation.binarySearch = function (values, target, step) {\r\n if (step === void 0) { step = 1; }\r\n var low = 0;\r\n var high = values.length / step - 2;\r\n if (high == 0)\r\n return step;\r\n var current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high)\r\n return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n };\r\n Animation.linearSearch = function (values, target, step) {\r\n for (var i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target)\r\n return i;\r\n return -1;\r\n };\r\n return Animation;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TimelineType;\r\n(function (TimelineType) {\r\n TimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n TimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n TimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n TimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n TimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n TimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n TimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n TimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n TimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n TimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n TimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n TimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n TimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n TimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n TimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n})(TimelineType || (TimelineType = {}));\r\n/** The base class for timelines that use interpolation between key frame values. */\r\n/**\r\n * @public\r\n */\r\nvar CurveTimeline = /** @class */ (function () {\r\n function CurveTimeline(frameCount) {\r\n if (frameCount <= 0)\r\n throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n /** The number of key frames for this timeline. */\r\n CurveTimeline.prototype.getFrameCount = function () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n };\r\n /** Sets the specified key frame to linear interpolation. */\r\n CurveTimeline.prototype.setLinear = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n };\r\n /** Sets the specified key frame to stepped interpolation. */\r\n CurveTimeline.prototype.setStepped = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n };\r\n /** Returns the interpolation type for the specified key frame.\r\n * @returns Linear is 0, stepped is 1, Bezier is 2. */\r\n CurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n var index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length)\r\n return CurveTimeline.LINEAR;\r\n var type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR)\r\n return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED)\r\n return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n };\r\n /** Sets the specified key frame to Bezier interpolation. `cx1` and `cx2` are from 0 to 1,\r\n * representing the percent of time between the two key frames. `cy1` and `cy2` are the percent of the\r\n * difference between the key frame's values. */\r\n CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n var x = dfx, y = dfy;\r\n for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n };\r\n /** Returns the interpolated percentage for the specified key frame and linear percentage. */\r\n CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n percent = MathUtils.clamp(percent, 0, 1);\r\n var curves = this.curves;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var type = curves[i];\r\n if (type == CurveTimeline.LINEAR)\r\n return percent;\r\n if (type == CurveTimeline.STEPPED)\r\n return 0;\r\n i++;\r\n var x = 0;\r\n for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n var prevX = void 0, prevY = void 0;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n }\r\n else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n var y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\r\n };\r\n CurveTimeline.LINEAR = 0;\r\n CurveTimeline.STEPPED = 1;\r\n CurveTimeline.BEZIER = 2;\r\n CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n return CurveTimeline;\r\n}());\r\n/** Changes a bone's local {@link Bone#rotation}. */\r\n/**\r\n * @public\r\n */\r\nvar RotateTimeline = /** @class */ (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount << 1);\r\n return _this;\r\n }\r\n RotateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.rotate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time and angle of the specified keyframe. */\r\n RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n };\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n var r_1 = bone.data.rotation - bone.rotation;\r\n bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\r\n var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r_2 * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r_2 += bone.data.rotation - bone.rotation;\r\n r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; // Wrap within -180 and 180.\r\n case MixBlend.add:\r\n bone.rotation += r_2 * alpha;\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n var r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n }\r\n };\r\n RotateTimeline.ENTRIES = 2;\r\n RotateTimeline.PREV_TIME = -2;\r\n RotateTimeline.PREV_ROTATION = -1;\r\n RotateTimeline.ROTATION = 1;\r\n return RotateTimeline;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */\r\n/**\r\n * @public\r\n */\r\nvar TranslateTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.translate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time in seconds, x, and y values for the specified key frame. */\r\n TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n };\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + TranslateTimeline.PREV_X];\r\n y = frames[frames.length + TranslateTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n x = frames[frame + TranslateTimeline.PREV_X];\r\n y = frames[frame + TranslateTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n x += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n y += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n TranslateTimeline.ENTRIES = 3;\r\n TranslateTimeline.PREV_TIME = -3;\r\n TranslateTimeline.PREV_X = -2;\r\n TranslateTimeline.PREV_Y = -1;\r\n TranslateTimeline.X = 1;\r\n TranslateTimeline.Y = 2;\r\n return TranslateTimeline;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\r\n/**\r\n * @public\r\n */\r\nvar ScaleTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ScaleTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.scale << 24) + this.boneIndex;\r\n };\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n x = frames[frame + ScaleTimeline.PREV_X];\r\n y = frames[frame + ScaleTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n }\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = MathUtils.signum(x);\r\n by = MathUtils.signum(y);\r\n bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n}(TranslateTimeline));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\r\n/**\r\n * @public\r\n */\r\nvar ShearTimeline = /** @class */ (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ShearTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.shear << 24) + this.boneIndex;\r\n };\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ShearTimeline.PREV_X];\r\n y = frames[frames.length + ShearTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n x = frames[frame + ShearTimeline.PREV_X];\r\n y = frames[frame + ShearTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n x = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n y = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n}(TranslateTimeline));\r\n/** Changes a slot's {@link Slot#color}. */\r\n/**\r\n * @public\r\n */\r\nvar ColorTimeline = /** @class */ (function (_super) {\r\n __extends(ColorTimeline, _super);\r\n function ColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n ColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.color << 24) + this.slotIndex;\r\n };\r\n /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\r\n ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n };\r\n ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n return;\r\n case MixBlend.first:\r\n var color = slot.color, setup = slot.data.color;\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n if (alpha == 1)\r\n slot.color.set(r, g, b, a);\r\n else {\r\n var color = slot.color;\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n ColorTimeline.ENTRIES = 5;\r\n ColorTimeline.PREV_TIME = -5;\r\n ColorTimeline.PREV_R = -4;\r\n ColorTimeline.PREV_G = -3;\r\n ColorTimeline.PREV_B = -2;\r\n ColorTimeline.PREV_A = -1;\r\n ColorTimeline.R = 1;\r\n ColorTimeline.G = 2;\r\n ColorTimeline.B = 3;\r\n ColorTimeline.A = 4;\r\n return ColorTimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\r\n/**\r\n * @public\r\n */\r\nvar TwoColorTimeline = /** @class */ (function (_super) {\r\n __extends(TwoColorTimeline, _super);\r\n function TwoColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TwoColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.twoColor << 24) + this.slotIndex;\r\n };\r\n /** Sets the time in seconds, light, and dark colors for the specified key frame. */\r\n TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n frameIndex *= TwoColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TwoColorTimeline.R] = r;\r\n this.frames[frameIndex + TwoColorTimeline.G] = g;\r\n this.frames[frameIndex + TwoColorTimeline.B] = b;\r\n this.frames[frameIndex + TwoColorTimeline.A] = a;\r\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n };\r\n TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n slot.darkColor.setFromColor(slot.data.darkColor);\r\n return;\r\n case MixBlend.first:\r\n var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + TwoColorTimeline.PREV_R];\r\n g = frames[i + TwoColorTimeline.PREV_G];\r\n b = frames[i + TwoColorTimeline.PREV_B];\r\n a = frames[i + TwoColorTimeline.PREV_A];\r\n r2 = frames[i + TwoColorTimeline.PREV_R2];\r\n g2 = frames[i + TwoColorTimeline.PREV_G2];\r\n b2 = frames[i + TwoColorTimeline.PREV_B2];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n r = frames[frame + TwoColorTimeline.PREV_R];\r\n g = frames[frame + TwoColorTimeline.PREV_G];\r\n b = frames[frame + TwoColorTimeline.PREV_B];\r\n a = frames[frame + TwoColorTimeline.PREV_A];\r\n r2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n g2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n b2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n g += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n b += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n a += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n }\r\n if (alpha == 1) {\r\n slot.color.set(r, g, b, a);\r\n slot.darkColor.set(r2, g2, b2, 1);\r\n }\r\n else {\r\n var light = slot.color, dark = slot.darkColor;\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n dark.setFromColor(slot.data.darkColor);\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n }\r\n };\r\n TwoColorTimeline.ENTRIES = 8;\r\n TwoColorTimeline.PREV_TIME = -8;\r\n TwoColorTimeline.PREV_R = -7;\r\n TwoColorTimeline.PREV_G = -6;\r\n TwoColorTimeline.PREV_B = -5;\r\n TwoColorTimeline.PREV_A = -4;\r\n TwoColorTimeline.PREV_R2 = -3;\r\n TwoColorTimeline.PREV_G2 = -2;\r\n TwoColorTimeline.PREV_B2 = -1;\r\n TwoColorTimeline.R = 1;\r\n TwoColorTimeline.G = 2;\r\n TwoColorTimeline.B = 3;\r\n TwoColorTimeline.A = 4;\r\n TwoColorTimeline.R2 = 5;\r\n TwoColorTimeline.G2 = 6;\r\n TwoColorTimeline.B2 = 7;\r\n return TwoColorTimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#attachment}. */\r\n/**\r\n * @public\r\n */\r\nvar AttachmentTimeline = /** @class */ (function () {\r\n function AttachmentTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n AttachmentTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.attachment << 24) + this.slotIndex;\r\n };\r\n /** The number of key frames for this timeline. */\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the attachment name for the specified key frame. */\r\n AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n var frameIndex = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n var attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n AttachmentTimeline.prototype.setAttachment = function (skeleton, slot, attachmentName) {\r\n slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n return AttachmentTimeline;\r\n}());\r\nvar zeros = null;\r\n/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}. */\r\n/**\r\n * @public\r\n */\r\nvar DeformTimeline = /** @class */ (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount);\r\n _this.frameVertices = new Array(frameCount);\r\n if (zeros == null)\r\n zeros = Utils.newFloatArray(64);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n };\r\n /** Sets the time in seconds and the vertices for the specified key frame.\r\n * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\r\n DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var slotAttachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof VertexAttachment) || !(slotAttachment.deformAttachment == this.attachment))\r\n return;\r\n var deformArray = slot.deform;\r\n if (deformArray.length == 0)\r\n blend = MixBlend.setup;\r\n var frameVertices = this.frameVertices;\r\n var vertexCount = frameVertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var vertexAttachment = slotAttachment;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n deformArray.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n deformArray.length = 0;\r\n break;\r\n }\r\n var deform_1 = Utils.setArraySize(deformArray, vertexCount);\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform_1[i] += (setupVertices[i] - deform_1[i]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets.\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform_1[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n var deform = Utils.setArraySize(deformArray, vertexCount);\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n var lastVertices = frameVertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_1 = 0; i_1 < vertexCount; i_1++) {\r\n deform[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n deform[i_2] += lastVertices[i_2];\r\n }\r\n }\r\n else {\r\n Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (vertexAttachment_1.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n var setup = setupVertices[i_3];\r\n deform[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n deform[i_4] = lastVertices[i_4] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_6 = 0; i_6 < vertexCount; i_6++) {\r\n deform[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n deform[i_7] += lastVertices[i_7] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time);\r\n var prevVertices = frameVertices[frame - 1];\r\n var nextVertices = frameVertices[frame];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n var prev = prevVertices[i_8];\r\n deform[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n var prev = prevVertices[i_9];\r\n deform[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n var prev = prevVertices[i_10];\r\n deform[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (vertexAttachment_2.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n var prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n deform[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n var prev = prevVertices[i_12];\r\n deform[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n var prev = prevVertices[i_13];\r\n deform[i_13] += (prev + (nextVertices[i_13] - prev) * percent - deform[i_13]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n var prev = prevVertices[i_14];\r\n deform[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n var prev = prevVertices[i_15];\r\n deform[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n}(CurveTimeline));\r\n/** Fires an {@link Event} when specific animation times are reached. */\r\n/**\r\n * @public\r\n */\r\nvar EventTimeline = /** @class */ (function () {\r\n function EventTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n EventTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.event << 24;\r\n };\r\n /** The number of key frames for this timeline. */\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the event for the specified key frame. */\r\n EventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n };\r\n /** Fires events for frames > `lastTime` and <= `time`. */\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (firedEvents == null)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0])\r\n return; // Time is before first frame.\r\n var frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n var frameTime = frames[frame];\r\n while (frame > 0) { // Fire multiple events with the same frame.\r\n if (frames[frame - 1] != frameTime)\r\n break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n };\r\n return EventTimeline;\r\n}());\r\n/** Changes a skeleton's {@link Skeleton#drawOrder}. */\r\n/**\r\n * @public\r\n */\r\nvar DrawOrderTimeline = /** @class */ (function () {\r\n function DrawOrderTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array(frameCount);\r\n }\r\n DrawOrderTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.drawOrder << 24;\r\n };\r\n /** The number of key frames for this timeline. */\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the draw order for the specified key frame.\r\n * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\r\n * draw order. */\r\n DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n if (direction == MixDirection.mixOut && blend == MixBlend.setup) {\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frame = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n var drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n return DrawOrderTimeline;\r\n}());\r\n/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},\r\n * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */\r\n/**\r\n * @public\r\n */\r\nvar IkConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n };\r\n /** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */\r\n IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, softness, bendDirection, compress, stretch) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.SOFTNESS] = softness;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.softness += (constraint.data.softness - constraint.softness) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness\r\n + (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n constraint.softness += (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n var mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n var softness = frames[frame + IkConstraintTimeline.PREV_SOFTNESS];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness\r\n + (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n constraint.softness += (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n };\r\n IkConstraintTimeline.ENTRIES = 6;\r\n IkConstraintTimeline.PREV_TIME = -6;\r\n IkConstraintTimeline.PREV_MIX = -5;\r\n IkConstraintTimeline.PREV_SOFTNESS = -4;\r\n IkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n IkConstraintTimeline.PREV_COMPRESS = -2;\r\n IkConstraintTimeline.PREV_STRETCH = -1;\r\n IkConstraintTimeline.MIX = 1;\r\n IkConstraintTimeline.SOFTNESS = 2;\r\n IkConstraintTimeline.BEND_DIRECTION = 3;\r\n IkConstraintTimeline.COMPRESS = 4;\r\n IkConstraintTimeline.STRETCH = 5;\r\n return IkConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},\r\n * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */\r\n/**\r\n * @public\r\n */\r\nvar TransformConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n };\r\n /** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */\r\n TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0, scale = 0, shear = 0;\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n }\r\n };\r\n TransformConstraintTimeline.ENTRIES = 5;\r\n TransformConstraintTimeline.PREV_TIME = -5;\r\n TransformConstraintTimeline.PREV_ROTATE = -4;\r\n TransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n TransformConstraintTimeline.PREV_SCALE = -2;\r\n TransformConstraintTimeline.PREV_SHEAR = -1;\r\n TransformConstraintTimeline.ROTATE = 1;\r\n TransformConstraintTimeline.TRANSLATE = 2;\r\n TransformConstraintTimeline.SCALE = 3;\r\n TransformConstraintTimeline.SHEAR = 4;\r\n return TransformConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a path constraint's {@link PathConstraint#position}. */\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintPositionTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n };\r\n /** Sets the time in seconds and path constraint position for the specified key frame. */\r\n PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n };\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = 0;\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) // Time is after last frame.\r\n position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n PathConstraintPositionTimeline.ENTRIES = 2;\r\n PathConstraintPositionTimeline.PREV_TIME = -2;\r\n PathConstraintPositionTimeline.PREV_VALUE = -1;\r\n PathConstraintPositionTimeline.VALUE = 1;\r\n return PathConstraintPositionTimeline;\r\n}(CurveTimeline));\r\n/** Changes a path constraint's {@link PathConstraint#spacing}. */\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintSpacingTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = 0;\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) // Time is after last frame.\r\n spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n}(PathConstraintPositionTimeline));\r\n/** Changes a transform constraint's {@link PathConstraint#rotateMix} and\r\n * {@link TransformConstraint#translateMix}. */\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintMixTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n };\r\n /** The time in seconds, rotate mix, and translate mix for the specified key frame. */\r\n PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = constraint.data.rotateMix;\r\n constraint.translateMix = constraint.data.translateMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0;\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\r\n rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n }\r\n };\r\n PathConstraintMixTimeline.ENTRIES = 3;\r\n PathConstraintMixTimeline.PREV_TIME = -3;\r\n PathConstraintMixTimeline.PREV_ROTATE = -2;\r\n PathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n PathConstraintMixTimeline.ROTATE = 1;\r\n PathConstraintMixTimeline.TRANSLATE = 2;\r\n return PathConstraintMixTimeline;\r\n}(CurveTimeline));\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\r\n * multiple animations on top of each other (layering).\r\n *\r\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */\r\n/**\r\n * @public\r\n */\r\nvar AnimationState = /** @class */ (function () {\r\n function AnimationState(data) {\r\n /** The list of tracks that currently have animations, which may contain null entries. */\r\n this.tracks = new Array();\r\n /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\r\n * or faster. Defaults to 1.\r\n *\r\n * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\r\n this.timeScale = 1;\r\n this.unkeyedState = 0;\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new IntSet();\r\n this.animationsChanged = false;\r\n this.trackEntryPool = new Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next != null) {\r\n // When the next entry's delay is passed, change to the next entry, preserving leftover time.\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom != null) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n // End mixing from entries once all have completed.\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from != null)\r\n from.mixingTo = null;\r\n while (from != null) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n /** Returns true when all mixing from entries are complete. */\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (from == null)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n // Require mixTime > 0 to ensure the mixing from entry was applied at least once.\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom != null)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\r\n * animation state can be applied to multiple skeletons to pose them identically.\r\n * @returns True if any animations were applied. */\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i_1 = 0, n_1 = tracks.length; i_1 < n_1; i_1++) {\r\n var current = tracks[i_1];\r\n if (current == null || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i_1 == 0 ? MixBlend.first : current.mixBlend;\r\n // Apply mixing from entries first.\r\n var mix = current.alpha;\r\n if (current.mixingFrom != null)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && current.next == null)\r\n mix = 0;\r\n // Apply current entry.\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n var timelineCount = current.animation.timelines.length;\r\n var timelines = current.animation.timelines;\r\n if ((i_1 == 0 && mix == 1) || blend == MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n // Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\r\n // to sometimes stop rendering when using color correction, as their RGBA values become NaN.\r\n // (https://github.com/pixijs/pixi-spine/issues/302)\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n var timeline = timelines[ii];\r\n if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, blend, true);\r\n else\r\n timeline.apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.mixIn);\r\n }\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var firstFrame = current.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = current.timelinesRotation;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline_1 = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : MixBlend.setup;\r\n if (timeline_1 instanceof RotateTimeline) {\r\n this.applyRotateTimeline(timeline_1, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else if (timeline_1 instanceof AttachmentTimeline) {\r\n this.applyAttachmentTimeline(timeline_1, skeleton, animationTime, blend, true);\r\n }\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timeline_1.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection.mixIn);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n // Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\r\n // subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\r\n // the time is before the first key).\r\n var setupState = this.unkeyedState + AnimationState.SETUP;\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = skeleton.slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.attachmentState == setupState) {\r\n var attachmentName = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n }\r\n }\r\n this.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom != null)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\r\n mix = 1;\r\n if (blend == MixBlend.first)\r\n blend = MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var events = mix < from.eventThreshold ? this.events : null;\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n var timelineCount = from.animation.timelines.length;\r\n var timelines = from.animation.timelines;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n if (blend == MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.mixOut);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var firstFrame = from.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = from.timelinesRotation;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = MixDirection.mixOut;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case AnimationState.SUBSEQUENT:\r\n if (!drawOrder && timeline instanceof DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.HOLD_SUBSEQUENT:\r\n timelineBlend = blend;\r\n alpha = alphaHold;\r\n break;\r\n case AnimationState.HOLD_FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (timeline instanceof RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n else if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, timelineBlend, attachments);\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(alpha, blend);\r\n if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)\r\n direction = MixDirection.mixIn;\r\n timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyAttachmentTimeline = function (timeline, skeleton, time, blend, attachments) {\r\n var slot = skeleton.slots[timeline.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = timeline.frames;\r\n if (time < frames[0]) { // Time is before first frame.\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\r\n }\r\n else {\r\n var frameIndex;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time) - 1;\r\n this.setAttachment(skeleton, slot, timeline.attachmentNames[frameIndex], attachments);\r\n }\r\n // If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\r\n if (slot.attachmentState <= this.unkeyedState)\r\n slot.attachmentState = this.unkeyedState + AnimationState.SETUP;\r\n };\r\n AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {\r\n slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n if (attachments)\r\n slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\r\n return;\r\n }\r\n var rotateTimeline = timeline;\r\n var frames = rotateTimeline.frames;\r\n var bone = skeleton.bones[rotateTimeline.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) // Time is after last frame.\r\n r2 = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n r2 = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n r2 = prevRotation + r2 * percent + bone.data.rotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n }\r\n }\r\n // Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops.\r\n lastDiff = timelinesRotation[i + 1]; // Difference between bones.\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n // Detect cross at 0 (not 180).\r\n if (MathUtils.signum(lastDiff) != MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n // A cross after a 360 rotation is a loop.\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360; // Store loops as part of lastTotal.\r\n if (dir != current)\r\n total += 360 * MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n r1 += total * alpha;\r\n bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n // Queue events before complete.\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_1);\r\n }\r\n // Queue complete if completed a loop iteration or the animation.\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n // Queue events after complete.\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, events[i]);\r\n }\r\n };\r\n /** Removes all animations from all tracks, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n /** Removes all animations from the track, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (current == null)\r\n return;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (from == null)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n if (from != null) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n // Store the interrupted mix percentage.\r\n if (from.mixingFrom != null && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\r\n }\r\n this.queue.start(current);\r\n };\r\n /** Sets an animation by name.\r\n *\r\n * {@link #setAnimationWith(}. */\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never\r\n * applied to a skeleton, it is replaced (not mixed from).\r\n * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\r\n * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current != null) {\r\n if (current.nextTrackLast == -1) {\r\n // Don't mix from an entry that was never applied.\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.disposeNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n /** Queues an animation by name.\r\n *\r\n * See {@link #addAnimationWith()}. */\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is\r\n * equivalent to calling {@link #setAnimationWith()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix\r\n * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the\r\n * previous entry is looping, its next loop completion is used instead of its duration.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (last == null) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n if (delay <= 0) {\r\n var duration = last.animationEnd - last.animationStart;\r\n if (duration != 0) {\r\n if (last.loop)\r\n delay += duration * (1 + ((last.trackTime / duration) | 0));\r\n else\r\n delay += Math.max(duration, last.trackTime);\r\n delay -= this.data.getMix(last.animation, animation);\r\n }\r\n else\r\n delay = last.trackTime;\r\n }\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\r\n * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n *\r\n * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\r\n * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\r\n * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\r\n * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\r\n * 0 still mixes out over one frame.\r\n *\r\n * Mixing in is done by first setting an empty animation, then adding an animation using\r\n * {@link #addAnimation()} and on the returned track entry, set the\r\n * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\r\n * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\r\n * setup pose value if no lower tracks key the property to the value keyed in the new animation. */\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\r\n * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling\r\n * {@link #setEmptyAnimation()}.\r\n *\r\n * See {@link #setEmptyAnimation()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or\r\n * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next\r\n * loop completion is used instead of its duration.\r\n * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (delay <= 0)\r\n delay -= mixDuration;\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix\r\n * duration. */\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current != null)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n /** @param last May be null. */\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.interruptAlpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n entry.mixBlend = MixBlend.replace;\r\n return entry;\r\n };\r\n AnimationState.prototype.disposeNext = function (entry) {\r\n var next = entry.next;\r\n while (next != null) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var entry = this.tracks[i];\r\n if (entry == null)\r\n continue;\r\n while (entry.mixingFrom != null)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (entry.mixingFrom == null || entry.mixBlend != MixBlend.add)\r\n this.computeHold(entry);\r\n entry = entry.mixingTo;\r\n } while (entry != null);\r\n }\r\n };\r\n AnimationState.prototype.computeHold = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n entry.timelineHoldMix.length = 0;\r\n var timelineDipMix = Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n var propertyIDs = this.propertyIDs;\r\n if (to != null && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++) {\r\n timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;\r\n }\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var timeline = timelines[i];\r\n var id = timeline.getPropertyId();\r\n if (!propertyIDs.add(id))\r\n timelineMode[i] = AnimationState.SUBSEQUENT;\r\n else if (to == null || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\r\n || timeline instanceof EventTimeline || !to.animation.hasTimeline(id)) {\r\n timelineMode[i] = AnimationState.FIRST;\r\n }\r\n else {\r\n for (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n if (next.animation.hasTimeline(id))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = AnimationState.HOLD_MIX;\r\n timelineDipMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = AnimationState.HOLD_FIRST;\r\n }\r\n }\r\n };\r\n /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n /** Adds a listener to receive events for all track entries. */\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (listener == null)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n /** Removes the listener added with {@link #addListener()}. */\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n /** Removes all listeners added with {@link #addListener()}. */\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\r\n * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\r\n * are not wanted because new animations are being set. */\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.prototype.setAnimationByName = function (trackIndex, animationName, loop) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n };\r\n AnimationState.prototype.addAnimationByName = function (trackIndex, animationName, loop, delay) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n };\r\n AnimationState.prototype.hasAnimation = function (animationName) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n };\r\n AnimationState.prototype.hasAnimationByName = function (animationName) {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n return this.hasAnimation(animationName);\r\n };\r\n AnimationState.emptyAnimation = new Animation(\"\", [], 0);\r\n /** 1. A previously applied timeline has set this property.\r\n *\r\n * Result: Mix from the current pose to the timeline pose. */\r\n AnimationState.SUBSEQUENT = 0;\r\n /** 1. This is the first timeline to set this property.\r\n * 2. The next track entry applied after this one does not have a timeline to set this property.\r\n *\r\n * Result: Mix from the setup pose to the timeline pose. */\r\n AnimationState.FIRST = 1;\r\n /** 1) A previously applied timeline has set this property.
\r\n * 2) The next track entry to be applied does have a timeline to set this property.
\r\n * 3) The next track entry after that one does not have a timeline to set this property.
\r\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\r\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\r\n AnimationState.HOLD_SUBSEQUENT = 2;\r\n /** 1) This is the first timeline to set this property.
\r\n * 2) The next track entry to be applied does have a timeline to set this property.
\r\n * 3) The next track entry after that one does not have a timeline to set this property.
\r\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\r\n * that key the same property. A subsequent timeline will set this property using a mix. */\r\n AnimationState.HOLD_FIRST = 3;\r\n /** 1. This is the first timeline to set this property.\r\n * 2. The next track entry to be applied does have a timeline to set this property.\r\n * 3. The next track entry after that one does have a timeline to set this property.\r\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\r\n *\r\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\r\n * 2 track entries in a row have a timeline that sets the same property.\r\n *\r\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\r\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\r\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\r\n * place. */\r\n AnimationState.HOLD_MIX = 4;\r\n AnimationState.SETUP = 1;\r\n AnimationState.CURRENT = 2;\r\n AnimationState.deprecatedWarning1 = false;\r\n AnimationState.deprecatedWarning2 = false;\r\n AnimationState.deprecatedWarning3 = false;\r\n return AnimationState;\r\n}());\r\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\r\n *\r\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */\r\n/**\r\n * @public\r\n */\r\nvar TrackEntry = /** @class */ (function () {\r\n function TrackEntry() {\r\n /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\r\n * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\r\n * the values from the lower tracks.\r\n *\r\n * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first\r\n * called. */\r\n this.mixBlend = MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\r\n * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\r\n * `animationStart` time. */\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n /** Returns true if at least one loop has been completed.\r\n *\r\n * See {@link AnimationStateListener#complete()}. */\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\r\n * long way around when using {@link #alpha} and starting animations on other tracks.\r\n *\r\n * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\r\n * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\r\n * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\r\n * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n Object.defineProperty(TrackEntry.prototype, \"time\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TrackEntry.prototype, \"endTime\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n TrackEntry.prototype.loopsCount = function () {\r\n return Math.floor(this.trackTime / this.trackEnd);\r\n };\r\n TrackEntry.deprecatedWarning1 = false;\r\n TrackEntry.deprecatedWarning2 = false;\r\n return TrackEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.deprecateStuff = function () {\r\n if (!EventQueue.deprecatedWarning1) {\r\n EventQueue.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'\");\r\n }\r\n return true;\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener != null && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].start)\r\n listeners[ii].start(entry);\r\n //deprecation\r\n entry.onStart && this.deprecateStuff() && entry.onStart(entry.trackIndex);\r\n this.animState.onStart && this.deprecateStuff() && this.deprecateStuff && this.animState.onStart(entry.trackIndex);\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener != null && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].interrupt)\r\n listeners[ii].interrupt(entry);\r\n break;\r\n case EventType.end:\r\n if (entry.listener != null && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].end)\r\n listeners[ii].end(entry);\r\n //deprecation\r\n entry.onEnd && this.deprecateStuff() && entry.onEnd(entry.trackIndex);\r\n this.animState.onEnd && this.deprecateStuff() && this.animState.onEnd(entry.trackIndex);\r\n // Fall through.\r\n case EventType.dispose:\r\n if (entry.listener != null && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].dispose)\r\n listeners[ii].dispose(entry);\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener != null && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].complete)\r\n listeners[ii].complete(entry);\r\n //deprecation\r\n var count = MathUtils.toInt(entry.loopsCount());\r\n entry.onComplete && this.deprecateStuff() && entry.onComplete(entry.trackIndex, count);\r\n this.animState.onComplete && this.deprecateStuff() && this.animState.onComplete(entry.trackIndex, count);\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener != null && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].event)\r\n listeners[ii].event(entry, event_3);\r\n //deprecation\r\n entry.onEvent && this.deprecateStuff() && entry.onEvent(entry.trackIndex, event_3);\r\n this.animState.onEvent && this.deprecateStuff() && this.animState.onEvent(entry.trackIndex, event_3);\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n EventQueue.deprecatedWarning1 = false;\r\n return EventQueue;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventType;\r\n(function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n})(EventType || (EventType = {}));\r\n/**\r\n * @public\r\n */\r\nvar AnimationStateAdapter = /** @class */ (function () {\r\n function AnimationStateAdapter() {\r\n }\r\n AnimationStateAdapter.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AnimationStateData = /** @class */ (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n this.defaultMix = 0;\r\n if (skeletonData == null)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (from == null)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (to == null)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n AnimationStateData.prototype.setMixByName = function (fromName, toName, duration) {\r\n if (!AnimationStateData.deprecatedWarning1) {\r\n AnimationStateData.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\r\n }\r\n this.setMix(fromName, toName, duration);\r\n };\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (from == null)\r\n throw new Error(\"from cannot be null.\");\r\n if (to == null)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n AnimationStateData.deprecatedWarning1 = false;\r\n return AnimationStateData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AtlasAttachmentLoader = /** @class */ (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n var attachment = new RegionAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n var attachment = new MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new BoundingBoxAttachment(name);\r\n };\r\n /** @return May be null to not load an attachment */\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Bone = /** @class */ (function () {\r\n /** @param parent May be null. */\r\n function Bone(data, skeleton, parent) {\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n this.matrix = new Matrix();\r\n this.children = new Array();\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 0;\r\n this.scaleY = 0;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.ax = 0;\r\n this.ay = 0;\r\n this.arotation = 0;\r\n this.ascaleX = 0;\r\n this.ascaleY = 0;\r\n this.ashearX = 0;\r\n this.ashearY = 0;\r\n this.appliedValid = false;\r\n this.sorted = false;\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Object.defineProperty(Bone.prototype, \"worldX\", {\r\n get: function () {\r\n return this.matrix.tx;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bone.prototype, \"worldY\", {\r\n get: function () {\r\n return this.matrix.ty;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Bone.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local transform. */\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and the specified local transform. */\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n var sx = this.skeleton.scaleX;\r\n var sy = settings.yDown ? -this.skeleton.scaleY : this.skeleton.scaleY;\r\n if (parent == null) { // Root bone.\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n m.tx = x * sx + skeleton.x;\r\n m.ty = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n switch (this.data.transformMode) {\r\n case TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pa /= this.skeleton.scaleX;\r\n pc /= this.skeleton.scaleY;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = MathUtils.cosDeg(rx) * scaleX;\r\n var lb = MathUtils.cosDeg(ry) * scaleY;\r\n var lc = MathUtils.sinDeg(rx) * scaleX;\r\n var ld = MathUtils.sinDeg(ry) * scaleY;\r\n m.a = pa * la - pb * lc;\r\n m.c = pa * lb - pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection: {\r\n var cos = MathUtils.cosDeg(rotation);\r\n var sin = MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / sx;\r\n var zc = (pc * cos + pd * sin) / sy;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (settings.yDown ?\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY > 0) :\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(90 + shearY) * scaleY;\r\n m.a = za * la + zb * lc;\r\n m.c = za * lb + zb * ld;\r\n m.b = zc * la + zd * lc;\r\n m.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n m.a *= sx;\r\n m.c *= sx;\r\n m.b *= sy;\r\n m.d *= sy;\r\n };\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldScaleX = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.a * m.a + m.c * m.c);\r\n };\r\n Bone.prototype.getWorldScaleY = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.b * m.b + m.d * m.d);\r\n };\r\n /** Computes the individual applied transform values from the world transform. This can be useful to perform processing using\r\n * the applied transform after the world transform has been modified directly (eg, by a constraint).\r\n *

\r\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */\r\n Bone.prototype.updateAppliedTransform = function () {\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n if (parent == null) {\r\n this.ax = m.tx;\r\n this.ay = m.ty;\r\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\r\n return;\r\n }\r\n var pm = parent.matrix;\r\n var pid = 1 / (pm.a * pm.d - pm.b * pm.c);\r\n var dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\r\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\r\n var ia = pid * pm.d;\r\n var id = pid * pm.a;\r\n var ib = pid * pm.c;\r\n var ic = pid * pm.b;\r\n var ra = ia * m.a - ib * m.b;\r\n var rb = ia * m.c - ib * m.d;\r\n var rc = id * m.b - ic * m.a;\r\n var rd = id * m.d - ic * m.c;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n };\r\n Bone.prototype.worldToLocal = function (world) {\r\n var m = this.matrix;\r\n var a = m.a, b = m.c, c = m.b, d = m.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n Bone.prototype.localToWorld = function (local) {\r\n var m = this.matrix;\r\n var x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n };\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(mat.a * sin - mat.b * cos, mat.d * cos - mat.c * sin) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n var sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(cos * mat.b + sin * mat.d, cos * mat.a + sin * mat.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var mat = this.matrix;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n this.appliedValid = false;\r\n };\r\n return Bone;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar BoneData = /** @class */ (function () {\r\n function BoneData(index, name, parent) {\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.transformMode = TransformMode.Normal;\r\n this.skinRequired = false;\r\n this.color = new Color();\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar ConstraintData = /** @class */ (function () {\r\n function ConstraintData(name, order, skinRequired) {\r\n this.name = name;\r\n this.order = order;\r\n this.skinRequired = skinRequired;\r\n }\r\n return ConstraintData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Event = /** @class */ (function () {\r\n function Event(time, data) {\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar EventData = /** @class */ (function () {\r\n function EventData(name) {\r\n this.name = name;\r\n }\r\n return EventData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraint = /** @class */ (function () {\r\n function IkConstraint(data, skeleton) {\r\n this.bendDirection = 0;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.mix = 1;\r\n this.softness = 0;\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.softness = data.softness;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n IkConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n IkConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n IkConstraint.prototype.update = function () {\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.softness, this.mix);\r\n break;\r\n }\r\n };\r\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\r\n * coordinate system. */\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var p = bone.parent.matrix;\r\n var pa = p.a, pb = p.c, pc = p.b, pd = p.d;\r\n var rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\r\n switch (bone.data.transformMode) {\r\n case TransformMode.OnlyTranslation:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n break;\r\n case TransformMode.NoRotationOrReflection:\r\n var s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\r\n var sa = pa / bone.skeleton.scaleX;\r\n var sc = pc / bone.skeleton.scaleY;\r\n pb = -sc * s * bone.skeleton.scaleX;\r\n pd = sa * s * bone.skeleton.scaleY;\r\n rotationIK += Math.atan2(sc, sa) * MathUtils.radDeg;\r\n // Fall through\r\n default:\r\n var x = targetX - p.tx, y = targetY - p.ty;\r\n var d = pa * pd - pb * pc;\r\n tx = (x * pd - y * pb) / d - bone.ax;\r\n ty = (y * pa - x * pc) / d - bone.ay;\r\n }\r\n rotationIK += Math.atan2(ty, tx) * MathUtils.radDeg;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n switch (bone.data.transformMode) {\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n }\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\r\n * target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, softness, alpha) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n if (!parent.appliedValid)\r\n parent.updateAppliedTransform();\r\n if (!child.appliedValid)\r\n child.updateAppliedTransform();\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n var pmat = parent.matrix;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pmat.a, b = pmat.c, c = pmat.b, d = pmat.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + pmat.tx;\r\n cwy = c * cx + pmat.ty;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + pmat.tx;\r\n cwy = c * cx + d * cy + pmat.ty;\r\n }\r\n var pp = parent.parent.matrix;\r\n a = pp.a;\r\n b = pp.c;\r\n c = pp.b;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = cwx - pp.tx, y = cwy - pp.ty;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\r\n if (l1 < 0.0001) {\r\n this.apply1(parent, targetX, targetY, false, stretch, false, alpha);\r\n child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n return;\r\n }\r\n x = targetX - pp.tx;\r\n y = targetY - pp.ty;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\r\n var dd = tx * tx + ty * ty;\r\n if (softness != 0) {\r\n softness *= psx * (csx + 1) / 2;\r\n var td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\r\n if (sd > 0) {\r\n var p = Math.min(1, sd / (softness * 2)) - 1;\r\n p = (sd - softness * (1 - p * p)) / td;\r\n tx -= p * tx;\r\n ty -= p * ty;\r\n dd = tx * tx + ty * ty;\r\n }\r\n }\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) {\r\n cos = 1;\r\n if (stretch)\r\n sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n }\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) / 2;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180)\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180)\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraintData = /** @class */ (function (_super) {\r\n __extends(IkConstraintData, _super);\r\n function IkConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n _this.bendDirection = 1;\r\n _this.compress = false;\r\n _this.stretch = false;\r\n _this.uniform = false;\r\n _this.mix = 1;\r\n _this.softness = 0;\r\n return _this;\r\n }\r\n return IkConstraintData;\r\n}(ConstraintData));\n\n/**\r\n * @public\r\n */\r\nvar PathConstraintData = /** @class */ (function (_super) {\r\n __extends(PathConstraintData, _super);\r\n function PathConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n return _this;\r\n }\r\n return PathConstraintData;\r\n}(ConstraintData));\r\n/**\r\n * @public\r\n */\r\nvar SpacingMode;\r\n(function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n})(SpacingMode || (SpacingMode = {}));\n\n/**\r\n * @public\r\n */\r\nvar PathConstraint = /** @class */ (function () {\r\n function PathConstraint(data, skeleton) {\r\n this.position = 0;\r\n this.spacing = 0;\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n PathConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n PathConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n var translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate)\r\n return;\r\n var data = this.data;\r\n var spacingMode = data.spacingMode;\r\n var lengthSpacing = spacingMode == SpacingMode.Length;\r\n var rotateMode = data.rotateMode;\r\n var tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\r\n var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var bones = this.bones;\r\n var spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n var spacing = this.spacing;\r\n if (scale || lengthSpacing) {\r\n if (scale)\r\n lengths = Utils.setArraySize(this.lengths, boneCount);\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = 0;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_1;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_1 / setupLength;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = rotateMode == RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone.matrix;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n mat.tx += (boneX - mat.tx) * translateMix;\r\n mat.ty += (boneY - mat.ty) * translateMix;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_2 = lengths[i];\r\n if (length_2 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_2 - 1) * rotateMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_3 = bone.data.length;\r\n boneX += (length_3 * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length_3 * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n bone.appliedValid = false;\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (percentPosition)\r\n position *= pathLength_1;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength_1;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_4 = lengths[curve];\r\n if (p > length_4)\r\n continue;\r\n if (curve == 0)\r\n p /= length_4;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_4 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n // Curve lengths.\r\n var curves = Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition)\r\n position *= pathLength;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_5 = curves[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_6 = segments[segment];\r\n if (p > length_6)\r\n continue;\r\n if (segment == 0)\r\n p /= length_6;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p))\r\n p = 0.0001;\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents)\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraint = /** @class */ (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.temp = new Vector2();\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n TransformConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n TransformConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += (temp.x - mat.tx) * translateMix;\r\n mat.ty += (temp.y - mat.ty) * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = Math.sqrt(mat.a * mat.a + mat.b * mat.b);\r\n var ts = Math.sqrt(ta * ta + tc * tc);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = Math.sqrt(mat.c * mat.c + mat.d * mat.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var b = mat.c, d = mat.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(mat.b, mat.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r = by + (r + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += temp.x * translateMix;\r\n mat.ty += temp.y * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n var b = mat.c, d = mat.d;\r\n r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * rotateMix;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax - x + this.data.offsetX) * translateMix;\r\n y += (target.ay - y + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n if (scaleY > 0.00001)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n bone.shearY += r * shearMix;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0)\r\n rotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax + this.data.offsetX) * translateMix;\r\n y += (target.ay + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n if (scaleY > 0.00001)\r\n scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0)\r\n shearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n return TransformConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Skeleton = /** @class */ (function () {\r\n function Skeleton(data) {\r\n this._updateCache = new Array();\r\n this.updateCacheReset = new Array();\r\n this.time = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.x = 0;\r\n this.y = 0;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (boneData.parent == null)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n this.updateCacheReset.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n bone.sorted = bone.data.skinRequired;\r\n bone.active = !bone.sorted;\r\n }\r\n if (this.skin != null) {\r\n var skinBones = this.skin.bones;\r\n for (var i = 0, n = this.skin.bones.length; i < n; i++) {\r\n var bone = this.bones[skinBones[i].index];\r\n do {\r\n bone.sorted = false;\r\n bone.active = true;\r\n bone = bone.parent;\r\n } while (bone != null);\r\n }\r\n }\r\n // IK first, lowest hierarchy depth first.\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length > 1) {\r\n var child = constrained[constrained.length - 1];\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin != null)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n var i = 0;\r\n while (i < pathBones.length) {\r\n var boneCount = pathBones[i++];\r\n for (var n = i + boneCount; i < n; i++) {\r\n var boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent != null)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.active)\r\n continue;\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n /** Updates the world transform for each bone and applies constraints. */\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var updateCacheReset = this.updateCacheReset;\r\n for (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n var bone = updateCacheReset[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n bone.appliedValid = true;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n /** Sets the bones and constraints to their setup pose values. */\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n };\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n /** @return May return null. */\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Sets a skin by name.\r\n * @see #setSkin(Skin) */\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n * @param newSkin May be null. */\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin == this.skin)\r\n return;\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1 != null) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n this.updateCache();\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (attachmentName == null)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin != null)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n /** @param attachmentName May be null. */\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size The width and height of the AABB.\r\n * @param temp Working memory */\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (temp === void 0) { temp = new Array(2); }\r\n if (offset == null)\r\n throw new Error(\"offset cannot be null.\");\r\n if (size == null)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices != null) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Skeleton.prototype.update = function (delta) {\r\n this.time += delta;\r\n };\r\n Object.defineProperty(Skeleton.prototype, \"flipX\", {\r\n get: function () {\r\n return this.scaleX == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleX = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Skeleton.prototype, \"flipY\", {\r\n get: function () {\r\n return this.scaleY == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleY = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Skeleton.deprecatedWarning1 = false;\r\n return Skeleton;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SkeletonData = /** @class */ (function () {\r\n function SkeletonData() {\r\n this.bones = new Array(); // Ordered parents first.\r\n this.slots = new Array(); // Setup pose draw order.\r\n this.skins = new Array();\r\n this.events = new Array();\r\n this.animations = new Array();\r\n this.ikConstraints = new Array();\r\n this.transformConstraints = new Array();\r\n this.pathConstraints = new Array();\r\n // Nonessential\r\n this.fps = 0;\r\n }\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (skinName == null)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (eventDataName == null)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.name == eventDataName)\r\n return event_1;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (animationName == null)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SlotData = /** @class */ (function () {\r\n function SlotData(index, name, boneData) {\r\n this.color = new Color(1, 1, 1, 1);\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (boneData == null)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraintData = /** @class */ (function (_super) {\r\n __extends(TransformConstraintData, _super);\r\n function TransformConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n _this.rotateMix = 0;\r\n _this.translateMix = 0;\r\n _this.scaleMix = 0;\r\n _this.shearMix = 0;\r\n _this.offsetRotation = 0;\r\n _this.offsetX = 0;\r\n _this.offsetY = 0;\r\n _this.offsetScaleX = 0;\r\n _this.offsetScaleY = 0;\r\n _this.offsetShearY = 0;\r\n _this.relative = false;\r\n _this.local = false;\r\n return _this;\r\n }\r\n return TransformConstraintData;\r\n}(ConstraintData));\n\n/**\r\n * @public\r\n */\r\nvar SkinEntry = /** @class */ (function () {\r\n function SkinEntry(slotIndex, name, attachment) {\r\n this.slotIndex = slotIndex;\r\n this.name = name;\r\n this.attachment = attachment;\r\n }\r\n return SkinEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Skin = /** @class */ (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n this.bones = Array();\r\n this.constraints = new Array();\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n Skin.prototype.setAttachment = function (slotIndex, name, attachment) {\r\n if (attachment == null)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n Skin.prototype.addSkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var j = 0; j < this.bones.length; j++) {\r\n if (this.bones[j] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var j = 0; j < this.constraints.length; j++) {\r\n if (this.constraints[j] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n };\r\n Skin.prototype.copySkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var j = 0; j < this.bones.length; j++) {\r\n if (this.bones[j] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var j = 0; j < this.constraints.length; j++) {\r\n if (this.constraints[j] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n if (attachment.attachment == null)\r\n continue;\r\n if (attachment.attachment instanceof MeshAttachment) {\r\n attachment.attachment = attachment.attachment.newLinkedMesh();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n else {\r\n attachment.attachment = attachment.attachment.copy();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n }\r\n };\r\n /** @return May be null. */\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n Skin.prototype.removeAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n if (dictionary)\r\n dictionary[name] = null;\r\n };\r\n Skin.prototype.getAttachments = function () {\r\n var entries = new Array();\r\n for (var i = 0; i < this.attachments.length; i++) {\r\n var slotAttachments = this.attachments[i];\r\n if (slotAttachments) {\r\n for (var name_1 in slotAttachments) {\r\n var attachment = slotAttachments[name_1];\r\n if (attachment)\r\n entries.push(new SkinEntry(i, name_1, attachment));\r\n }\r\n }\r\n }\r\n return entries;\r\n };\r\n Skin.prototype.getAttachmentsForSlot = function (slotIndex, attachments) {\r\n var slotAttachments = this.attachments[slotIndex];\r\n if (slotAttachments) {\r\n for (var name_2 in slotAttachments) {\r\n var attachment = slotAttachments[name_2];\r\n if (attachment)\r\n attachments.push(new SkinEntry(slotIndex, name_2, attachment));\r\n }\r\n }\r\n };\r\n Skin.prototype.clear = function () {\r\n this.attachments.length = 0;\r\n this.bones.length = 0;\r\n this.constraints.length = 0;\r\n };\r\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SkeletonBinary = /** @class */ (function () {\r\n function SkeletonBinary(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonBinary.prototype.readSkeletonData = function (binary) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n skeletonData.name = \"\"; // BOZO\r\n var input = new BinaryInput(binary);\r\n skeletonData.hash = input.readString();\r\n skeletonData.version = input.readString();\r\n if (skeletonData.version === '3.8.75') {\r\n var error = \"Unsupported skeleton data, 3.8.75 is deprecated, please export with a newer version of Spine.\";\r\n console.error(error);\r\n }\r\n skeletonData.x = input.readFloat();\r\n skeletonData.y = input.readFloat();\r\n skeletonData.width = input.readFloat();\r\n skeletonData.height = input.readFloat();\r\n var nonessential = input.readBoolean();\r\n if (nonessential) {\r\n skeletonData.fps = input.readFloat();\r\n skeletonData.imagesPath = input.readString();\r\n skeletonData.audioPath = input.readString();\r\n }\r\n var n = 0;\r\n // Strings.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++)\r\n input.strings.push(input.readString());\r\n // Bones.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var name_1 = input.readString();\r\n var parent_1 = i == 0 ? null : skeletonData.bones[input.readInt(true)];\r\n var data = new BoneData(i, name_1, parent_1);\r\n data.rotation = input.readFloat();\r\n data.x = input.readFloat() * scale;\r\n data.y = input.readFloat() * scale;\r\n data.scaleX = input.readFloat();\r\n data.scaleY = input.readFloat();\r\n data.shearX = input.readFloat();\r\n data.shearY = input.readFloat();\r\n data.length = input.readFloat() * scale;\r\n data.transformMode = SkeletonBinary.TransformModeValues[input.readInt(true)];\r\n data.skinRequired = input.readBoolean();\r\n if (nonessential)\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n skeletonData.bones.push(data);\r\n }\r\n // Slots.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var slotName = input.readString();\r\n var boneData = skeletonData.bones[input.readInt(true)];\r\n var data = new SlotData(i, slotName, boneData);\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n var darkColor = input.readInt32();\r\n if (darkColor != -1)\r\n Color.rgb888ToColor(data.darkColor = new Color(), darkColor);\r\n data.attachmentName = input.readStringRef();\r\n data.blendMode = SkeletonBinary.BlendModeValues[input.readInt(true)];\r\n skeletonData.slots.push(data);\r\n }\r\n // IK constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new IkConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.mix = input.readFloat();\r\n data.softness = input.readFloat() * scale;\r\n data.bendDirection = input.readByte();\r\n data.compress = input.readBoolean();\r\n data.stretch = input.readBoolean();\r\n data.uniform = input.readBoolean();\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n // Transform constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new TransformConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.local = input.readBoolean();\r\n data.relative = input.readBoolean();\r\n data.offsetRotation = input.readFloat();\r\n data.offsetX = input.readFloat() * scale;\r\n data.offsetY = input.readFloat() * scale;\r\n data.offsetScaleX = input.readFloat();\r\n data.offsetScaleY = input.readFloat();\r\n data.offsetShearY = input.readFloat();\r\n data.rotateMix = input.readFloat();\r\n data.translateMix = input.readFloat();\r\n data.scaleMix = input.readFloat();\r\n data.shearMix = input.readFloat();\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n // Path constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new PathConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.slots[input.readInt(true)];\r\n data.positionMode = SkeletonBinary.PositionModeValues[input.readInt(true)];\r\n data.spacingMode = SkeletonBinary.SpacingModeValues[input.readInt(true)];\r\n data.rotateMode = SkeletonBinary.RotateModeValues[input.readInt(true)];\r\n data.offsetRotation = input.readFloat();\r\n data.position = input.readFloat();\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = input.readFloat();\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = input.readFloat();\r\n data.translateMix = input.readFloat();\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n // Default skin.\r\n var defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\r\n if (defaultSkin != null) {\r\n skeletonData.defaultSkin = defaultSkin;\r\n skeletonData.skins.push(defaultSkin);\r\n }\r\n // Skins.\r\n {\r\n var i = skeletonData.skins.length;\r\n Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\r\n for (; i < n; i++)\r\n skeletonData.skins[i] = this.readSkin(input, skeletonData, false, nonessential);\r\n }\r\n // Linked meshes.\r\n n = this.linkedMeshes.length;\r\n for (var i = 0; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_2 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var data = new EventData(input.readStringRef());\r\n data.intValue = input.readInt(false);\r\n data.floatValue = input.readFloat();\r\n data.stringValue = input.readString();\r\n data.audioPath = input.readString();\r\n if (data.audioPath != null) {\r\n data.volume = input.readFloat();\r\n data.balance = input.readFloat();\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n // Animations.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++)\r\n skeletonData.animations.push(this.readAnimation(input, input.readString(), skeletonData));\r\n return skeletonData;\r\n };\r\n SkeletonBinary.prototype.readSkin = function (input, skeletonData, defaultSkin, nonessential) {\r\n var skin = null;\r\n var slotCount = 0;\r\n if (defaultSkin) {\r\n slotCount = input.readInt(true);\r\n if (slotCount == 0)\r\n return null;\r\n skin = new Skin(\"default\");\r\n }\r\n else {\r\n skin = new Skin(input.readStringRef());\r\n skin.bones.length = input.readInt(true);\r\n for (var i = 0, n = skin.bones.length; i < n; i++)\r\n skin.bones[i] = skeletonData.bones[input.readInt(true)];\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\r\n slotCount = input.readInt(true);\r\n }\r\n for (var i = 0; i < slotCount; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var name_2 = input.readStringRef();\r\n var attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name_2, nonessential);\r\n if (attachment != null)\r\n skin.setAttachment(slotIndex, name_2, attachment);\r\n }\r\n }\r\n return skin;\r\n };\r\n SkeletonBinary.prototype.readAttachment = function (input, skeletonData, skin, slotIndex, attachmentName, nonessential) {\r\n var scale = this.scale;\r\n var name = input.readStringRef();\r\n if (name == null)\r\n name = attachmentName;\r\n var typeIndex = input.readByte();\r\n var type = SkeletonBinary.AttachmentTypeValues[typeIndex];\r\n switch (type) {\r\n case AttachmentType.Region: {\r\n var path = input.readStringRef();\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var scaleX = input.readFloat();\r\n var scaleY = input.readFloat();\r\n var width = input.readFloat();\r\n var height = input.readFloat();\r\n var color = input.readInt32();\r\n if (path == null)\r\n path = name;\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = x * scale;\r\n region.y = y * scale;\r\n region.scaleX = scaleX;\r\n region.scaleY = scaleY;\r\n region.rotation = rotation;\r\n region.width = width * scale;\r\n region.height = height * scale;\r\n Color.rgba8888ToColor(region.color, color);\r\n // region.updateOffset();\r\n return region;\r\n }\r\n case AttachmentType.BoundingBox: {\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n box.worldVerticesLength = vertexCount << 1;\r\n box.vertices = vertices.vertices;\r\n box.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(box.color, color);\r\n return box;\r\n }\r\n case AttachmentType.Mesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var vertexCount = input.readInt(true);\r\n var uvs = this.readFloatArray(input, vertexCount << 1, 1);\r\n var triangles = this.readShortArray(input);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var hullLength = input.readInt(true);\r\n var edges = null;\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n edges = this.readShortArray(input);\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (path == null)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n mesh.bones = vertices.bones;\r\n mesh.vertices = vertices.vertices;\r\n mesh.worldVerticesLength = vertexCount << 1;\r\n mesh.triangles = triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // mesh.updateUVs();\r\n mesh.hullLength = hullLength << 1;\r\n if (nonessential) {\r\n mesh.edges = edges;\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n return mesh;\r\n }\r\n case AttachmentType.LinkedMesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var skinName = input.readStringRef();\r\n var parent_3 = input.readStringRef();\r\n var inheritDeform = input.readBoolean();\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (path == null)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n if (nonessential) {\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n this.linkedMeshes.push(new LinkedMesh$1(mesh, skinName, slotIndex, parent_3, inheritDeform));\r\n return mesh;\r\n }\r\n case AttachmentType.Path: {\r\n var closed_1 = input.readBoolean();\r\n var constantSpeed = input.readBoolean();\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0, n = lengths.length; i < n; i++)\r\n lengths[i] = input.readFloat() * scale;\r\n var color = nonessential ? input.readInt32() : 0;\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = closed_1;\r\n path.constantSpeed = constantSpeed;\r\n path.worldVerticesLength = vertexCount << 1;\r\n path.vertices = vertices.vertices;\r\n path.bones = vertices.bones;\r\n path.lengths = lengths;\r\n if (nonessential)\r\n Color.rgba8888ToColor(path.color, color);\r\n return path;\r\n }\r\n case AttachmentType.Point: {\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var color = nonessential ? input.readInt32() : 0;\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = x * scale;\r\n point.y = y * scale;\r\n point.rotation = rotation;\r\n if (nonessential)\r\n Color.rgba8888ToColor(point.color, color);\r\n return point;\r\n }\r\n case AttachmentType.Clipping: {\r\n var endSlotIndex = input.readInt(true);\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n clip.endSlot = skeletonData.slots[endSlotIndex];\r\n clip.worldVerticesLength = vertexCount << 1;\r\n clip.vertices = vertices.vertices;\r\n clip.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(clip.color, color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonBinary.prototype.readVertices = function (input, vertexCount) {\r\n var verticesLength = vertexCount << 1;\r\n var vertices = new Vertices();\r\n var scale = this.scale;\r\n if (!input.readBoolean()) {\r\n vertices.vertices = this.readFloatArray(input, verticesLength, scale);\r\n return vertices;\r\n }\r\n var weights = new Array();\r\n var bonesArray = new Array();\r\n for (var i = 0; i < vertexCount; i++) {\r\n var boneCount = input.readInt(true);\r\n bonesArray.push(boneCount);\r\n for (var ii = 0; ii < boneCount; ii++) {\r\n bonesArray.push(input.readInt(true));\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat());\r\n }\r\n }\r\n vertices.vertices = Utils.toFloatArray(weights);\r\n vertices.bones = bonesArray;\r\n return vertices;\r\n };\r\n SkeletonBinary.prototype.readFloatArray = function (input, n, scale) {\r\n var array = new Array(n);\r\n if (scale == 1) {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat();\r\n }\r\n else {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat() * scale;\r\n }\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readShortArray = function (input) {\r\n var n = input.readInt(true);\r\n var array = new Array(n);\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readShort();\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readAnimation = function (input, name, skeletonData) {\r\n var timelines = new Array();\r\n var scale = this.scale;\r\n var duration = 0;\r\n var tempColor1 = new Color();\r\n var tempColor2 = new Color();\r\n // Slot timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.SLOT_ATTACHMENT: {\r\n var timeline = new AttachmentTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++)\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readStringRef());\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\r\n break;\r\n }\r\n case SkeletonBinary.SLOT_COLOR: {\r\n var timeline = new ColorTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n Color.rgba8888ToColor(tempColor1, input.readInt32());\r\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * ColorTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.SLOT_TWO_COLOR: {\r\n var timeline = new TwoColorTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n Color.rgba8888ToColor(tempColor1, input.readInt32());\r\n Color.rgb888ToColor(tempColor2, input.readInt32());\r\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a, tempColor2.r, tempColor2.g, tempColor2.b);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * TwoColorTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var boneIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.BONE_ROTATE: {\r\n var timeline = new RotateTimeline(frameCount);\r\n timeline.boneIndex = boneIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * RotateTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.BONE_TRANSLATE:\r\n case SkeletonBinary.BONE_SCALE:\r\n case SkeletonBinary.BONE_SHEAR: {\r\n var timeline = void 0;\r\n var timelineScale = 1;\r\n if (timelineType == SkeletonBinary.BONE_SCALE)\r\n timeline = new ScaleTimeline(frameCount);\r\n else if (timelineType == SkeletonBinary.BONE_SHEAR)\r\n timeline = new ShearTimeline(frameCount);\r\n else {\r\n timeline = new TranslateTimeline(frameCount);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale, input.readFloat() * timelineScale);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * TranslateTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var frameCount = input.readInt(true);\r\n var timeline = new IkConstraintTimeline(frameCount);\r\n timeline.ikConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat() * scale, input.readByte(), input.readBoolean(), input.readBoolean());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n // Transform constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var frameCount = input.readInt(true);\r\n var timeline = new TransformConstraintTimeline(frameCount);\r\n timeline.transformConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n // Path constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.PATH_POSITION:\r\n case SkeletonBinary.PATH_SPACING: {\r\n var timeline = void 0;\r\n var timelineScale = 1;\r\n if (timelineType == SkeletonBinary.PATH_SPACING) {\r\n timeline = new PathConstraintSpacingTimeline(frameCount);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new PathConstraintPositionTimeline(frameCount);\r\n if (data.positionMode == PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.PATH_MIX: {\r\n var timeline = new PathConstraintMixTimeline(frameCount);\r\n timeline.pathConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var skin = skeletonData.skins[input.readInt(true)];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var slotIndex = input.readInt(true);\r\n for (var iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\r\n var attachment = skin.getAttachment(slotIndex, input.readStringRef());\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var frameCount = input.readInt(true);\r\n var timeline = new DeformTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n var deform = void 0;\r\n var end = input.readInt(true);\r\n if (end == 0)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = input.readInt(true);\r\n end += start;\r\n if (scale == 1) {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat();\r\n }\r\n else {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat() * scale;\r\n }\r\n if (!weighted) {\r\n for (var v = 0, vn = deform.length; v < vn; v++)\r\n deform[v] += vertices[v];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, time, deform);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderCount = input.readInt(true);\r\n if (drawOrderCount > 0) {\r\n var timeline = new DrawOrderTimeline(drawOrderCount);\r\n var slotCount = skeletonData.slots.length;\r\n for (var i = 0; i < drawOrderCount; i++) {\r\n var time = input.readFloat();\r\n var offsetCount = input.readInt(true);\r\n var drawOrder = Utils.newArray(slotCount, 0);\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n drawOrder[ii] = -1;\r\n var unchanged = Utils.newArray(slotCount - offsetCount, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var ii = 0; ii < offsetCount; ii++) {\r\n var slotIndex = input.readInt(true);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + input.readInt(true)] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n if (drawOrder[ii] == -1)\r\n drawOrder[ii] = unchanged[--unchangedIndex];\r\n timeline.setFrame(i, time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[drawOrderCount - 1]);\r\n }\r\n // Event timeline.\r\n var eventCount = input.readInt(true);\r\n if (eventCount > 0) {\r\n var timeline = new EventTimeline(eventCount);\r\n for (var i = 0; i < eventCount; i++) {\r\n var time = input.readFloat();\r\n var eventData = skeletonData.events[input.readInt(true)];\r\n var event_1 = new Event(time, eventData);\r\n event_1.intValue = input.readInt(false);\r\n event_1.floatValue = input.readFloat();\r\n event_1.stringValue = input.readBoolean() ? input.readString() : eventData.stringValue;\r\n if (event_1.data.audioPath != null) {\r\n event_1.volume = input.readFloat();\r\n event_1.balance = input.readFloat();\r\n }\r\n timeline.setFrame(i, event_1);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[eventCount - 1]);\r\n }\r\n return new Animation(name, timelines, duration);\r\n };\r\n SkeletonBinary.prototype.readCurve = function (input, frameIndex, timeline) {\r\n switch (input.readByte()) {\r\n case SkeletonBinary.CURVE_STEPPED:\r\n timeline.setStepped(frameIndex);\r\n break;\r\n case SkeletonBinary.CURVE_BEZIER:\r\n this.setCurve(timeline, frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\r\n break;\r\n }\r\n };\r\n SkeletonBinary.prototype.setCurve = function (timeline, frameIndex, cx1, cy1, cx2, cy2) {\r\n timeline.setCurve(frameIndex, cx1, cy1, cx2, cy2);\r\n };\r\n SkeletonBinary.AttachmentTypeValues = [0 /*AttachmentType.Region*/, 1 /*AttachmentType.BoundingBox*/, 2 /*AttachmentType.Mesh*/, 3 /*AttachmentType.LinkedMesh*/, 4 /*AttachmentType.Path*/, 5 /*AttachmentType.Point*/, 6 /*AttachmentType.Clipping*/];\r\n SkeletonBinary.TransformModeValues = [TransformMode.Normal, TransformMode.OnlyTranslation, TransformMode.NoRotationOrReflection, TransformMode.NoScale, TransformMode.NoScaleOrReflection];\r\n SkeletonBinary.PositionModeValues = [PositionMode.Fixed, PositionMode.Percent];\r\n SkeletonBinary.SpacingModeValues = [SpacingMode.Length, SpacingMode.Fixed, SpacingMode.Percent];\r\n SkeletonBinary.RotateModeValues = [RotateMode.Tangent, RotateMode.Chain, RotateMode.ChainScale];\r\n SkeletonBinary.BlendModeValues = [BLEND_MODES.NORMAL, BLEND_MODES.ADD, BLEND_MODES.MULTIPLY, BLEND_MODES.SCREEN];\r\n SkeletonBinary.BONE_ROTATE = 0;\r\n SkeletonBinary.BONE_TRANSLATE = 1;\r\n SkeletonBinary.BONE_SCALE = 2;\r\n SkeletonBinary.BONE_SHEAR = 3;\r\n SkeletonBinary.SLOT_ATTACHMENT = 0;\r\n SkeletonBinary.SLOT_COLOR = 1;\r\n SkeletonBinary.SLOT_TWO_COLOR = 2;\r\n SkeletonBinary.PATH_POSITION = 0;\r\n SkeletonBinary.PATH_SPACING = 1;\r\n SkeletonBinary.PATH_MIX = 2;\r\n SkeletonBinary.CURVE_LINEAR = 0;\r\n SkeletonBinary.CURVE_STEPPED = 1;\r\n SkeletonBinary.CURVE_BEZIER = 2;\r\n return SkeletonBinary;\r\n}());\r\nvar LinkedMesh$1 = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritDeform = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\r\nvar Vertices = /** @class */ (function () {\r\n function Vertices(bones, vertices) {\r\n if (bones === void 0) { bones = null; }\r\n if (vertices === void 0) { vertices = null; }\r\n this.bones = bones;\r\n this.vertices = vertices;\r\n }\r\n return Vertices;\r\n}());\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBounds = /** @class */ (function (_super) {\r\n __extends(SkeletonBounds, _super);\r\n function SkeletonBounds() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return SkeletonBounds;\r\n}(SkeletonBoundsBase));\n\n/**\r\n * @public\r\n */\r\nvar SkeletonJson = /** @class */ (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n // Skeleton\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n if (skeletonData.version.substr(0, 3) !== '3.8') {\r\n var error = \"Spine 3.8 loader cant load version \" + skeletonMap.spine + \". Please configure your pixi-spine bundle\";\r\n console.error(error);\r\n }\r\n if (skeletonData.version === '3.8.75') {\r\n var error = \"Unsupported skeleton data, 3.8.75 is deprecated, please export with a newer version of Spine.\";\r\n console.error(error);\r\n }\r\n skeletonData.x = skeletonMap.x;\r\n skeletonData.y = skeletonMap.y;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n // Bones\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_1 = null;\r\n var parentName = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_1 = skeletonData.findBone(parentName);\r\n if (parent_1 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new BoneData(skeletonData.bones.length, boneMap.name, parent_1);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n data.skinRequired = this.getValue(boneMap, \"skin\", false);\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n // Slots.\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var slotName = slotMap.name;\r\n var boneName = slotMap.bone;\r\n var boneData = skeletonData.findBone(boneName);\r\n if (boneData == null)\r\n throw new Error(\"Slot bone not found: \" + boneName);\r\n var data = new SlotData(skeletonData.slots.length, slotName, boneData);\r\n var color = this.getValue(slotMap, \"color\", null);\r\n if (color != null)\r\n data.color.setFromString(color);\r\n var dark = this.getValue(slotMap, \"dark\", null);\r\n if (dark != null) {\r\n data.darkColor = new Color(1, 1, 1, 1);\r\n data.darkColor.setFromString(dark);\r\n }\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n // IK constraints\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new IkConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"IK target bone not found: \" + targetName);\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n data.softness = this.getValue(constraintMap, \"softness\", 0) * scale;\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.compress = this.getValue(constraintMap, \"compress\", false);\r\n data.stretch = this.getValue(constraintMap, \"stretch\", false);\r\n data.uniform = this.getValue(constraintMap, \"uniform\", false);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new TransformConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n data.local = this.getValue(constraintMap, \"local\", false);\r\n data.relative = this.getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n // Path constraints.\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new PathConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Path target slot not found: \" + targetName);\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n // Skins.\r\n if (root.skins) {\r\n for (var i = 0; i < root.skins.length; i++) {\r\n var skinMap = root.skins[i];\r\n var skin = new Skin(skinMap.name);\r\n if (skinMap.bones) {\r\n for (var ii = 0; ii < skinMap.bones.length; ii++) {\r\n var bone = skeletonData.findBone(skinMap.bones[ii]);\r\n if (bone == null)\r\n throw new Error(\"Skin bone not found: \" + skinMap.bones[i]);\r\n skin.bones.push(bone);\r\n }\r\n }\r\n if (skinMap.ik) {\r\n for (var ii = 0; ii < skinMap.ik.length; ii++) {\r\n var constraint = skeletonData.findIkConstraint(skinMap.ik[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin IK constraint not found: \" + skinMap.ik[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.transform) {\r\n for (var ii = 0; ii < skinMap.transform.length; ii++) {\r\n var constraint = skeletonData.findTransformConstraint(skinMap.transform[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin transform constraint not found: \" + skinMap.transform[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.path) {\r\n for (var ii = 0; ii < skinMap.path.length; ii++) {\r\n var constraint = skeletonData.findPathConstraint(skinMap.path[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin path constraint not found: \" + skinMap.path[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n for (var slotName in skinMap.attachments) {\r\n var slot = skeletonData.findSlot(slotName);\r\n if (slot == null)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotMap = skinMap.attachments[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\r\n if (attachment != null)\r\n skin.setAttachment(slot.index, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_2 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n data.audioPath = this.getValue(eventMap, \"audio\", null);\r\n if (data.audioPath != null) {\r\n data.volume = this.getValue(eventMap, \"volume\", 1);\r\n data.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n // Animations.\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n var type = this.getValue(map, \"type\", \"region\");\r\n switch (type) {\r\n case \"region\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n region.color.setFromString(color);\r\n // region.updateOffset();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n mesh.color.setFromString(color);\r\n mesh.width = this.getValue(map, \"width\", 0) * scale;\r\n mesh.height = this.getValue(map, \"height\", 0) * scale;\r\n var parent_3 = this.getValue(map, \"parent\", null);\r\n if (parent_3 != null) {\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_3, this.getValue(map, \"deform\", true)));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // mesh.updateUVs();\r\n mesh.edges = this.getValue(map, \"edges\", null);\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = this.getValue(map, \"x\", 0) * scale;\r\n point.y = this.getValue(map, \"y\", 0) * scale;\r\n point.rotation = this.getValue(map, \"rotation\", 0);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n var end = this.getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n var duration = 0;\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (timelineName == \"attachment\") {\r\n var timeline = new AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, this.getValue(valueMap, \"time\", 0), valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n else if (timelineName == \"color\") {\r\n var timeline = new ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var color = new Color();\r\n color.setFromString(valueMap.color || \"ffffffff\");\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\r\n }\r\n else if (timelineName == \"twoColor\") {\r\n var timeline = new TwoColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var light = new Color();\r\n var dark = new Color();\r\n light.setFromString(valueMap.light);\r\n dark.setFromString(valueMap.dark);\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TwoColorTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n var timeline = new RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"angle\", 0));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n var timeline = null;\r\n var timelineScale = 1, defaultValue = 0;\r\n if (timelineName === \"scale\") {\r\n timeline = new ScaleTimeline(timelineMap.length);\r\n defaultValue = 1;\r\n }\r\n else if (timelineName === \"shear\")\r\n timeline = new ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var x = this.getValue(valueMap, \"x\", defaultValue), y = this.getValue(valueMap, \"y\", defaultValue);\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n var timeline = new IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"softness\", 0) * scale, this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var constraintMap = map.transform[constraintName];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n var timeline = new TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Path constraint timelines.\r\n if (map.path) {\r\n for (var constraintName in map.path) {\r\n var constraintMap = map.path[constraintName];\r\n var index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n if (map.deform) {\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var skin = skeletonData.findSkin(deformName);\r\n if (skin == null) {\r\n if (settings.FAIL_ON_NON_EXISTING_SKIN) {\r\n throw new Error(\"Skin not found: \" + deformName);\r\n }\r\n else {\r\n continue;\r\n }\r\n }\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n var attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null)\r\n throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n var frameIndex = 0;\r\n for (var j = 0; j < timelineMap.length; j++) {\r\n var valueMap = timelineMap[j];\r\n var deform = void 0;\r\n var verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = this.getValue(valueMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null)\r\n drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n var timeline = new DrawOrderTimeline(drawOrderNode.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frameIndex = 0;\r\n for (var j = 0; j < drawOrderNode.length; j++) {\r\n var drawOrderMap = drawOrderNode[j];\r\n var drawOrder = null;\r\n var offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n var unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var i = 0; i < offsets.length; i++) {\r\n var offsetMap = offsets[i];\r\n var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1)\r\n drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, this.getValue(drawOrderMap, \"time\", 0), drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n // Event timeline.\r\n if (map.events) {\r\n var timeline = new EventTimeline(map.events.length);\r\n var frameIndex = 0;\r\n for (var i = 0; i < map.events.length; i++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_1 = new Event(Utils.toSinglePrecision(this.getValue(eventMap, \"time\", 0)), eventData);\r\n event_1.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event_1.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event_1.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_1.data.audioPath != null) {\r\n event_1.volume = this.getValue(eventMap, \"volume\", 1);\r\n event_1.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frameIndex++, event_1);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n if (!map.hasOwnProperty(\"curve\"))\r\n return;\r\n if (map.curve === \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else {\r\n var curve = map.curve;\r\n timeline.setCurve(frameIndex, curve, this.getValue(map, \"c2\", 0), this.getValue(map, \"c3\", 1), this.getValue(map, \"c4\", 1));\r\n }\r\n };\r\n SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return BLEND_MODES.NORMAL;\r\n if (str == \"additive\")\r\n return BLEND_MODES.ADD;\r\n if (str == \"multiply\")\r\n return BLEND_MODES.MULTIPLY;\r\n if (str == \"screen\")\r\n return BLEND_MODES.SCREEN;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n SkeletonJson.positionModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\")\r\n return PositionMode.Fixed;\r\n if (str == \"percent\")\r\n return PositionMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.spacingModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"length\")\r\n return SpacingMode.Length;\r\n if (str == \"fixed\")\r\n return SpacingMode.Fixed;\r\n if (str == \"percent\")\r\n return SpacingMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.rotateModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\")\r\n return RotateMode.Tangent;\r\n if (str == \"chain\")\r\n return RotateMode.Chain;\r\n if (str == \"chainscale\")\r\n return RotateMode.ChainScale;\r\n throw new Error(\"Unknown rotate mode: \" + str);\r\n };\r\n SkeletonJson.transformModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return TransformMode.Normal;\r\n if (str == \"onlytranslation\")\r\n return TransformMode.OnlyTranslation;\r\n if (str == \"norotationorreflection\")\r\n return TransformMode.NoRotationOrReflection;\r\n if (str == \"noscale\")\r\n return TransformMode.NoScale;\r\n if (str == \"noscaleorreflection\")\r\n return TransformMode.NoScaleOrReflection;\r\n throw new Error(\"Unknown transform mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n}());\r\nvar LinkedMesh = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritDeform = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n this.skeleton = new Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new AnimationStateData(spineData);\r\n this.state = new AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { Animation, AnimationState, AnimationStateAdapter, AnimationStateData, AtlasAttachmentLoader, Attachment, AttachmentTimeline, Bone, BoneData, BoundingBoxAttachment, ClippingAttachment, ColorTimeline, ConstraintData, CurveTimeline, DeformTimeline, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, IkConstraint, IkConstraintData, IkConstraintTimeline, JitterEffect, MeshAttachment, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PointAttachment, RegionAttachment, RotateTimeline, ScaleTimeline, ShearTimeline, Skeleton, SkeletonBinary, SkeletonBounds, SkeletonData, SkeletonJson, Skin, SkinEntry, Slot, SlotData, SpacingMode, Spine, SwirlEffect, TimelineType, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TranslateTimeline, TwoColorTimeline, VertexAttachment };\n//# sourceMappingURL=runtime-3.8.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/runtime-3.7 - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/runtime-3.7 is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev , All Rights Reserved\n */\nimport { AttachmentType, Color, MathUtils, Utils, PowOut, MixBlend, MixDirection, IntSet, Pool, settings, TransformMode, RotateMode, PositionMode, Vector2, SkeletonBoundsBase, SpineBase } from '@pixi-spine/base';\nimport { Matrix } from '@pixi/math';\nimport { BLEND_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nvar Attachment = /** @class */ (function () {\r\n function Attachment(name) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar VertexAttachment = /** @class */ (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n _this.worldVerticesLength = 0;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVerticesOld = function (slot, worldVertices) {\r\n this.computeWorldVertices(slot, 0, this.worldVerticesLength, worldVertices, 0, 2);\r\n };\r\n /** Transforms local vertices to world coordinates.\r\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\r\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\r\n * @param offset The worldVertices index to begin writing values. */\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.attachmentVertices;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var mat = slot.bone.matrix;\r\n var x = mat.tx;\r\n var y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n /** Returns true if a deform originally applied to the specified attachment should be applied to this attachment. */\r\n VertexAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n return this == sourceAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar BoundingBoxAttachment = /** @class */ (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.BoundingBox;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n return BoundingBoxAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar ClippingAttachment = /** @class */ (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Clipping;\r\n // Nonessential.\r\n _this.color = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\r\n return _this;\r\n }\r\n return ClippingAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar MeshAttachment = /** @class */ (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Mesh;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.inheritDeform = false;\r\n _this.tempColor = new Color(0, 0, 0, 0);\r\n return _this;\r\n }\r\n MeshAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n };\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n /** @param parentMesh May be null. */\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n return MeshAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PathAttachment = /** @class */ (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Path;\r\n _this.closed = false;\r\n _this.constantSpeed = false;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n return PathAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PointAttachment = /** @class */ (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Point;\r\n _this.color = new Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n var mat = bone.matrix;\r\n point.x = this.x * mat.a + this.y * mat.c + bone.worldX;\r\n point.y = this.x * mat.b + this.y * mat.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var mat = bone.matrix;\r\n var cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\r\n var x = cos * mat.a + sin * mat.c;\r\n var y = cos * mat.b + sin * mat.d;\r\n return Math.atan2(y, x) * MathUtils.radDeg;\r\n };\r\n return PointAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar Slot = /** @class */ (function () {\r\n function Slot(data, bone) {\r\n this.attachmentVertices = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (bone == null)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.darkColor = data.darkColor == null ? null : new Color();\r\n this.setToSetupPose();\r\n this.blendMode = this.data.blendMode;\r\n }\r\n /** @return May be null. */\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.attachmentVertices.length = 0;\r\n };\r\n Slot.prototype.setAttachmentTime = function (time) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n };\r\n /** Returns the time since the attachment was set. */\r\n Slot.prototype.getAttachmentTime = function () {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n };\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor != null)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar RegionAttachment = /** @class */ (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Region;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.scaleX = 1;\r\n _this.scaleY = 1;\r\n _this.rotation = 0;\r\n _this.width = 0;\r\n _this.height = 0;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.offset = Utils.newFloatArray(8);\r\n _this.uvs = Utils.newFloatArray(8);\r\n _this.tempColor = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n RegionAttachment.prototype.updateOffset = function () {\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var localXCos = localX * cos + this.x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + this.y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + this.x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + this.y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[RegionAttachment.OX1] = localXCos - localYSin;\r\n offset[RegionAttachment.OY1] = localYCos + localXSin;\r\n offset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n offset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n offset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n offset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n };\r\n RegionAttachment.prototype.setRegion = function (region) {\r\n this.region = region;\r\n var uvs = this.uvs;\r\n if (region.rotate) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n var vertexOffset = this.offset;\r\n var mat = bone instanceof Slot ? bone.bone.matrix : bone.matrix;\r\n var x = mat.tx, y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[RegionAttachment.OX1];\r\n offsetY = vertexOffset[RegionAttachment.OY1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // br\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX2];\r\n offsetY = vertexOffset[RegionAttachment.OY2];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // bl\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX3];\r\n offsetY = vertexOffset[RegionAttachment.OY3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ul\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX4];\r\n offsetY = vertexOffset[RegionAttachment.OY4];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ur\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.OX1 = 0;\r\n RegionAttachment.OY1 = 1;\r\n RegionAttachment.OX2 = 2;\r\n RegionAttachment.OY2 = 3;\r\n RegionAttachment.OX3 = 4;\r\n RegionAttachment.OY3 = 5;\r\n RegionAttachment.OX4 = 6;\r\n RegionAttachment.OY4 = 7;\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar JitterEffect = /** @class */ (function () {\r\n function JitterEffect(jitterX, jitterY) {\r\n this.jitterX = 0;\r\n this.jitterY = 0;\r\n this.jitterX = jitterX;\r\n this.jitterY = jitterY;\r\n }\r\n JitterEffect.prototype.begin = function (skeleton) {\r\n };\r\n JitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n position.x += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n position.y += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n };\r\n JitterEffect.prototype.end = function () {\r\n };\r\n return JitterEffect;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SwirlEffect = /** @class */ (function () {\r\n function SwirlEffect(radius) {\r\n this.centerX = 0;\r\n this.centerY = 0;\r\n this.radius = 0;\r\n this.angle = 0;\r\n this.worldX = 0;\r\n this.worldY = 0;\r\n this.radius = radius;\r\n }\r\n SwirlEffect.prototype.begin = function (skeleton) {\r\n this.worldX = skeleton.x + this.centerX;\r\n this.worldY = skeleton.y + this.centerY;\r\n };\r\n SwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n var radAngle = this.angle * MathUtils.degreesToRadians;\r\n var x = position.x - this.worldX;\r\n var y = position.y - this.worldY;\r\n var dist = Math.sqrt(x * x + y * y);\r\n if (dist < this.radius) {\r\n var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n var cos = Math.cos(theta);\r\n var sin = Math.sin(theta);\r\n position.x = cos * x - sin * y + this.worldX;\r\n position.y = sin * x + cos * y + this.worldY;\r\n }\r\n };\r\n SwirlEffect.prototype.end = function () {\r\n };\r\n SwirlEffect.interpolation = new PowOut(2);\r\n return SwirlEffect;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Animation = /** @class */ (function () {\r\n function Animation(name, timelines, duration) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (timelines == null)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.duration = duration;\r\n }\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n Animation.binarySearch = function (values, target, step) {\r\n if (step === void 0) { step = 1; }\r\n var low = 0;\r\n var high = values.length / step - 2;\r\n if (high == 0)\r\n return step;\r\n var current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high)\r\n return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n };\r\n Animation.linearSearch = function (values, target, step) {\r\n for (var i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target)\r\n return i;\r\n return -1;\r\n };\r\n return Animation;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TimelineType;\r\n(function (TimelineType) {\r\n TimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n TimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n TimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n TimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n TimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n TimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n TimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n TimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n TimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n TimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n TimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n TimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n TimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n TimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n TimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n})(TimelineType || (TimelineType = {}));\r\n/**\r\n * @public\r\n */\r\nvar CurveTimeline = /** @class */ (function () {\r\n function CurveTimeline(frameCount) {\r\n if (frameCount <= 0)\r\n throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n CurveTimeline.prototype.getFrameCount = function () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n };\r\n CurveTimeline.prototype.setLinear = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n };\r\n CurveTimeline.prototype.setStepped = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n };\r\n CurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n var index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length)\r\n return CurveTimeline.LINEAR;\r\n var type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR)\r\n return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED)\r\n return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n };\r\n /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.\r\n * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of\r\n * the difference between the keyframe's values. */\r\n CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n var x = dfx, y = dfy;\r\n for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n };\r\n CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n percent = MathUtils.clamp(percent, 0, 1);\r\n var curves = this.curves;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var type = curves[i];\r\n if (type == CurveTimeline.LINEAR)\r\n return percent;\r\n if (type == CurveTimeline.STEPPED)\r\n return 0;\r\n i++;\r\n var x = 0;\r\n for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n var prevX = void 0, prevY = void 0;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n }\r\n else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n var y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\r\n };\r\n CurveTimeline.LINEAR = 0;\r\n CurveTimeline.STEPPED = 1;\r\n CurveTimeline.BEZIER = 2;\r\n CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n return CurveTimeline;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar RotateTimeline = /** @class */ (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount << 1);\r\n return _this;\r\n }\r\n RotateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.rotate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time and angle of the specified keyframe. */\r\n RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n };\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n var r_1 = bone.data.rotation - bone.rotation;\r\n bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\r\n var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r_2 * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r_2 += bone.data.rotation - bone.rotation;\r\n r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; // Wrap within -180 and 180.\r\n case MixBlend.add:\r\n bone.rotation += r_2 * alpha;\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n var r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n }\r\n };\r\n RotateTimeline.ENTRIES = 2;\r\n RotateTimeline.PREV_TIME = -2;\r\n RotateTimeline.PREV_ROTATION = -1;\r\n RotateTimeline.ROTATION = 1;\r\n return RotateTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar TranslateTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.translate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n };\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + TranslateTimeline.PREV_X];\r\n y = frames[frames.length + TranslateTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n x = frames[frame + TranslateTimeline.PREV_X];\r\n y = frames[frame + TranslateTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n x += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n y += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n TranslateTimeline.ENTRIES = 3;\r\n TranslateTimeline.PREV_TIME = -3;\r\n TranslateTimeline.PREV_X = -2;\r\n TranslateTimeline.PREV_Y = -1;\r\n TranslateTimeline.X = 1;\r\n TranslateTimeline.Y = 2;\r\n return TranslateTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar ScaleTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ScaleTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.scale << 24) + this.boneIndex;\r\n };\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n x = frames[frame + ScaleTimeline.PREV_X];\r\n y = frames[frame + ScaleTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n }\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = MathUtils.signum(x);\r\n by = MathUtils.signum(y);\r\n bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n}(TranslateTimeline));\r\n/**\r\n * @public\r\n */\r\nvar ShearTimeline = /** @class */ (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ShearTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.shear << 24) + this.boneIndex;\r\n };\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ShearTimeline.PREV_X];\r\n y = frames[frames.length + ShearTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n x = frames[frame + ShearTimeline.PREV_X];\r\n y = frames[frame + ShearTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n x = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n y = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n}(TranslateTimeline));\r\n/**\r\n * @public\r\n */\r\nvar ColorTimeline = /** @class */ (function (_super) {\r\n __extends(ColorTimeline, _super);\r\n function ColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n ColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.color << 24) + this.slotIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n };\r\n ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n return;\r\n case MixBlend.first:\r\n var color = slot.color, setup = slot.data.color;\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n if (alpha == 1)\r\n slot.color.set(r, g, b, a);\r\n else {\r\n var color = slot.color;\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n ColorTimeline.ENTRIES = 5;\r\n ColorTimeline.PREV_TIME = -5;\r\n ColorTimeline.PREV_R = -4;\r\n ColorTimeline.PREV_G = -3;\r\n ColorTimeline.PREV_B = -2;\r\n ColorTimeline.PREV_A = -1;\r\n ColorTimeline.R = 1;\r\n ColorTimeline.G = 2;\r\n ColorTimeline.B = 3;\r\n ColorTimeline.A = 4;\r\n return ColorTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar TwoColorTimeline = /** @class */ (function (_super) {\r\n __extends(TwoColorTimeline, _super);\r\n function TwoColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TwoColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.twoColor << 24) + this.slotIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n frameIndex *= TwoColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TwoColorTimeline.R] = r;\r\n this.frames[frameIndex + TwoColorTimeline.G] = g;\r\n this.frames[frameIndex + TwoColorTimeline.B] = b;\r\n this.frames[frameIndex + TwoColorTimeline.A] = a;\r\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n };\r\n TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n slot.darkColor.setFromColor(slot.data.darkColor);\r\n return;\r\n case MixBlend.first:\r\n var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + TwoColorTimeline.PREV_R];\r\n g = frames[i + TwoColorTimeline.PREV_G];\r\n b = frames[i + TwoColorTimeline.PREV_B];\r\n a = frames[i + TwoColorTimeline.PREV_A];\r\n r2 = frames[i + TwoColorTimeline.PREV_R2];\r\n g2 = frames[i + TwoColorTimeline.PREV_G2];\r\n b2 = frames[i + TwoColorTimeline.PREV_B2];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n r = frames[frame + TwoColorTimeline.PREV_R];\r\n g = frames[frame + TwoColorTimeline.PREV_G];\r\n b = frames[frame + TwoColorTimeline.PREV_B];\r\n a = frames[frame + TwoColorTimeline.PREV_A];\r\n r2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n g2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n b2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n g += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n b += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n a += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n }\r\n if (alpha == 1) {\r\n slot.color.set(r, g, b, a);\r\n slot.darkColor.set(r2, g2, b2, 1);\r\n }\r\n else {\r\n var light = slot.color, dark = slot.darkColor;\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n dark.setFromColor(slot.data.darkColor);\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n }\r\n };\r\n TwoColorTimeline.ENTRIES = 8;\r\n TwoColorTimeline.PREV_TIME = -8;\r\n TwoColorTimeline.PREV_R = -7;\r\n TwoColorTimeline.PREV_G = -6;\r\n TwoColorTimeline.PREV_B = -5;\r\n TwoColorTimeline.PREV_A = -4;\r\n TwoColorTimeline.PREV_R2 = -3;\r\n TwoColorTimeline.PREV_G2 = -2;\r\n TwoColorTimeline.PREV_B2 = -1;\r\n TwoColorTimeline.R = 1;\r\n TwoColorTimeline.G = 2;\r\n TwoColorTimeline.B = 3;\r\n TwoColorTimeline.A = 4;\r\n TwoColorTimeline.R2 = 5;\r\n TwoColorTimeline.G2 = 6;\r\n TwoColorTimeline.B2 = 7;\r\n return TwoColorTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar AttachmentTimeline = /** @class */ (function () {\r\n function AttachmentTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n AttachmentTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.attachment << 24) + this.slotIndex;\r\n };\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (direction == MixDirection.mixOut && blend == MixBlend.setup) {\r\n var attachmentName_1 = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first) {\r\n var attachmentName_2 = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2));\r\n }\r\n return;\r\n }\r\n var frameIndex = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n var attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n return AttachmentTimeline;\r\n}());\r\nvar zeros = null;\r\n/**\r\n * @public\r\n */\r\nvar DeformTimeline = /** @class */ (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount);\r\n _this.frameVertices = new Array(frameCount);\r\n if (zeros == null)\r\n zeros = Utils.newFloatArray(64);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n };\r\n /** Sets the time of the specified keyframe. */\r\n DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var slotAttachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof VertexAttachment) || !slotAttachment.applyDeform(this.attachment))\r\n return;\r\n var verticesArray = slot.attachmentVertices;\r\n if (verticesArray.length == 0)\r\n blend = MixBlend.setup;\r\n var frameVertices = this.frameVertices;\r\n var vertexCount = frameVertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var vertexAttachment = slotAttachment;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n verticesArray.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n verticesArray.length = 0;\r\n break;\r\n }\r\n var vertices_1 = Utils.setArraySize(verticesArray, vertexCount);\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets.\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices_1[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n var vertices = Utils.setArraySize(verticesArray, vertexCount);\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n var lastVertices = frameVertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n vertices[i] += lastVertices[i] - setupVertices[i];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] += lastVertices[i];\r\n }\r\n }\r\n else {\r\n Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (vertexAttachment_1.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var setup = setupVertices[i];\r\n vertices[i] = setup + (lastVertices[i] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] = lastVertices[i] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] += (lastVertices[i] - vertices[i]) * alpha;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n vertices[i] += (lastVertices[i] - setupVertices[i]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] += lastVertices[i] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time);\r\n var prevVertices = frameVertices[frame - 1];\r\n var nextVertices = frameVertices[frame];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += prev + (nextVertices[i] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] = prev + (nextVertices[i] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (vertexAttachment_2.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i], setup = setupVertices[i];\r\n vertices[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar EventTimeline = /** @class */ (function () {\r\n function EventTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n EventTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.event << 24;\r\n };\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time of the specified keyframe. */\r\n EventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n };\r\n /** Fires events for frames > lastTime and <= time. */\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (firedEvents == null)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0])\r\n return; // Time is before first frame.\r\n var frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n var frameTime = frames[frame];\r\n while (frame > 0) { // Fire multiple events with the same frame.\r\n if (frames[frame - 1] != frameTime)\r\n break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n };\r\n return EventTimeline;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar DrawOrderTimeline = /** @class */ (function () {\r\n function DrawOrderTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array(frameCount);\r\n }\r\n DrawOrderTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.drawOrder << 24;\r\n };\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time of the specified keyframe.\r\n * @param drawOrder May be null to use bind pose draw order. */\r\n DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n if (direction == MixDirection.mixOut && blend == MixBlend.setup) {\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frame = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n var drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n return DrawOrderTimeline;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar IkConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n };\r\n /** Sets the time, mix and bend direction of the specified keyframe. */\r\n IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n var mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n };\r\n IkConstraintTimeline.ENTRIES = 5;\r\n IkConstraintTimeline.PREV_TIME = -5;\r\n IkConstraintTimeline.PREV_MIX = -4;\r\n IkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n IkConstraintTimeline.PREV_COMPRESS = -2;\r\n IkConstraintTimeline.PREV_STRETCH = -1;\r\n IkConstraintTimeline.MIX = 1;\r\n IkConstraintTimeline.BEND_DIRECTION = 2;\r\n IkConstraintTimeline.COMPRESS = 3;\r\n IkConstraintTimeline.STRETCH = 4;\r\n return IkConstraintTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar TransformConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n };\r\n /** Sets the time and mixes of the specified keyframe. */\r\n TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0, scale = 0, shear = 0;\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n }\r\n };\r\n TransformConstraintTimeline.ENTRIES = 5;\r\n TransformConstraintTimeline.PREV_TIME = -5;\r\n TransformConstraintTimeline.PREV_ROTATE = -4;\r\n TransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n TransformConstraintTimeline.PREV_SCALE = -2;\r\n TransformConstraintTimeline.PREV_SHEAR = -1;\r\n TransformConstraintTimeline.ROTATE = 1;\r\n TransformConstraintTimeline.TRANSLATE = 2;\r\n TransformConstraintTimeline.SCALE = 3;\r\n TransformConstraintTimeline.SHEAR = 4;\r\n return TransformConstraintTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintPositionTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n };\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = 0;\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) // Time is after last frame.\r\n position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n PathConstraintPositionTimeline.ENTRIES = 2;\r\n PathConstraintPositionTimeline.PREV_TIME = -2;\r\n PathConstraintPositionTimeline.PREV_VALUE = -1;\r\n PathConstraintPositionTimeline.VALUE = 1;\r\n return PathConstraintPositionTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintSpacingTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = 0;\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) // Time is after last frame.\r\n spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n}(PathConstraintPositionTimeline));\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintMixTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n };\r\n /** Sets the time and mixes of the specified keyframe. */\r\n PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = constraint.data.rotateMix;\r\n constraint.translateMix = constraint.data.translateMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0;\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\r\n rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n }\r\n };\r\n PathConstraintMixTimeline.ENTRIES = 3;\r\n PathConstraintMixTimeline.PREV_TIME = -3;\r\n PathConstraintMixTimeline.PREV_ROTATE = -2;\r\n PathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n PathConstraintMixTimeline.ROTATE = 1;\r\n PathConstraintMixTimeline.TRANSLATE = 2;\r\n return PathConstraintMixTimeline;\r\n}(CurveTimeline));\n\n/**\r\n * @public\r\n */\r\nvar AnimationState = /** @class */ (function () {\r\n function AnimationState(data) {\r\n this.tracks = new Array();\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new IntSet();\r\n this.animationsChanged = false;\r\n this.timeScale = 1;\r\n this.trackEntryPool = new Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next != null) {\r\n // When the next entry's delay is passed, change to the next entry, preserving leftover time.\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom != null) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n // End mixing from entries once all have completed.\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from != null)\r\n from.mixingTo = null;\r\n while (from != null) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (from == null)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n // Require mixTime > 0 to ensure the mixing from entry was applied at least once.\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom != null)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i == 0 ? MixBlend.first : current.mixBlend;\r\n // Apply mixing from entries first.\r\n var mix = current.alpha;\r\n if (current.mixingFrom != null)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && current.next == null)\r\n mix = 0;\r\n // Apply current entry.\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n var timelineCount = current.animation.timelines.length;\r\n var timelines = current.animation.timelines;\r\n if ((i == 0 && mix == 1) || blend == MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n // Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\r\n // to sometimes stop rendering when using color correction, as their RGBA values become NaN.\r\n // (https://github.com/pixijs/pixi-spine/issues/302)\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.mixIn);\r\n }\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var firstFrame = current.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = current.timelinesRotation;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : MixBlend.setup;\r\n if (timeline instanceof RotateTimeline) {\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection.mixIn);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom != null)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\r\n mix = 1;\r\n if (blend == MixBlend.first)\r\n blend = MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var events = mix < from.eventThreshold ? this.events : null;\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n var timelineCount = from.animation.timelines.length;\r\n var timelines = from.animation.timelines;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n if (blend == MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.mixOut);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var firstFrame = from.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = from.timelinesRotation;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = MixDirection.mixOut;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case AnimationState.SUBSEQUENT:\r\n if (!attachments && timeline instanceof AttachmentTimeline)\r\n continue;\r\n if (!drawOrder && timeline instanceof DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.HOLD:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (timeline instanceof RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(alpha, blend);\r\n if (timelineBlend == MixBlend.setup) {\r\n if (timeline instanceof AttachmentTimeline) {\r\n if (attachments)\r\n direction = MixDirection.mixOut;\r\n }\r\n else if (timeline instanceof DrawOrderTimeline) {\r\n if (drawOrder)\r\n direction = MixDirection.mixOut;\r\n }\r\n }\r\n timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\r\n return;\r\n }\r\n var rotateTimeline = timeline;\r\n var frames = rotateTimeline.frames;\r\n var bone = skeleton.bones[rotateTimeline.boneIndex];\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) // Time is after last frame.\r\n r2 = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n r2 = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n r2 = prevRotation + r2 * percent + bone.data.rotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n }\r\n }\r\n // Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops.\r\n lastDiff = timelinesRotation[i + 1]; // Difference between bones.\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n // Detect cross at 0 (not 180).\r\n if (MathUtils.signum(lastDiff) != MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n // A cross after a 360 rotation is a loop.\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360; // Store loops as part of lastTotal.\r\n if (dir != current)\r\n total += 360 * MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n r1 += total * alpha;\r\n bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n // Queue events before complete.\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_1);\r\n }\r\n // Queue complete if completed a loop iteration or the animation.\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n // Queue events after complete.\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, events[i]);\r\n }\r\n };\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (current == null)\r\n return;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (from == null)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n if (from != null) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n // Store the interrupted mix percentage.\r\n if (from.mixingFrom != null && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\r\n }\r\n this.queue.start(current);\r\n };\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current != null) {\r\n if (current.nextTrackLast == -1) {\r\n // Don't mix from an entry that was never applied.\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.disposeNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (last == null) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n if (delay <= 0) {\r\n var duration = last.animationEnd - last.animationStart;\r\n if (duration != 0) {\r\n if (last.loop)\r\n delay += duration * (1 + ((last.trackTime / duration) | 0));\r\n else\r\n delay += Math.max(duration, last.trackTime);\r\n delay -= this.data.getMix(last.animation, animation);\r\n }\r\n else\r\n delay = last.trackTime;\r\n }\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (delay <= 0)\r\n delay -= mixDuration;\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current != null)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n Utils.ensureArrayCapacity(this.tracks, index - this.tracks.length + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.interruptAlpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n return entry;\r\n };\r\n AnimationState.prototype.disposeNext = function (entry) {\r\n var next = entry.next;\r\n while (next != null) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var entry = this.tracks[i];\r\n if (entry == null)\r\n continue;\r\n while (entry.mixingFrom != null)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (entry.mixingFrom == null || entry.mixBlend != MixBlend.add)\r\n this.setTimelineModes(entry);\r\n entry = entry.mixingTo;\r\n } while (entry != null);\r\n }\r\n };\r\n AnimationState.prototype.setTimelineModes = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n entry.timelineHoldMix.length = 0;\r\n var timelineDipMix = Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n var propertyIDs = this.propertyIDs;\r\n if (to != null && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++) {\r\n propertyIDs.add(timelines[i].getPropertyId());\r\n timelineMode[i] = AnimationState.HOLD;\r\n }\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var id = timelines[i].getPropertyId();\r\n if (!propertyIDs.add(id))\r\n timelineMode[i] = AnimationState.SUBSEQUENT;\r\n else if (to == null || !this.hasTimeline(to, id))\r\n timelineMode[i] = AnimationState.FIRST;\r\n else {\r\n for (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n if (this.hasTimeline(next, id))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = AnimationState.HOLD_MIX;\r\n timelineDipMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = AnimationState.HOLD;\r\n }\r\n }\r\n };\r\n AnimationState.prototype.hasTimeline = function (entry, id) {\r\n var timelines = entry.animation.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n if (timelines[i].getPropertyId() == id)\r\n return true;\r\n return false;\r\n };\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (listener == null)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n /** Removes the listener added with {@link #addListener(AnimationStateListener)}. */\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.prototype.setAnimationByName = function (trackIndex, animationName, loop) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n };\r\n AnimationState.prototype.addAnimationByName = function (trackIndex, animationName, loop, delay) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n };\r\n AnimationState.prototype.hasAnimation = function (animationName) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n };\r\n AnimationState.prototype.hasAnimationByName = function (animationName) {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n return this.hasAnimation(animationName);\r\n };\r\n AnimationState.emptyAnimation = new Animation(\"\", [], 0);\r\n AnimationState.SUBSEQUENT = 0;\r\n AnimationState.FIRST = 1;\r\n AnimationState.HOLD = 2;\r\n AnimationState.HOLD_MIX = 3;\r\n AnimationState.deprecatedWarning1 = false;\r\n AnimationState.deprecatedWarning2 = false;\r\n AnimationState.deprecatedWarning3 = false;\r\n return AnimationState;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TrackEntry = /** @class */ (function () {\r\n function TrackEntry() {\r\n this.mixBlend = MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n Object.defineProperty(TrackEntry.prototype, \"time\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TrackEntry.prototype, \"endTime\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n TrackEntry.prototype.loopsCount = function () {\r\n return Math.floor(this.trackTime / this.trackEnd);\r\n };\r\n TrackEntry.deprecatedWarning1 = false;\r\n TrackEntry.deprecatedWarning2 = false;\r\n return TrackEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.deprecateStuff = function () {\r\n if (!EventQueue.deprecatedWarning1) {\r\n EventQueue.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'\");\r\n }\r\n return true;\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener != null && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].start)\r\n listeners[ii].start(entry);\r\n //deprecation\r\n entry.onStart && this.deprecateStuff() && entry.onStart(entry.trackIndex);\r\n this.animState.onStart && this.deprecateStuff() && this.deprecateStuff && this.animState.onStart(entry.trackIndex);\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener != null && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].interrupt)\r\n listeners[ii].interrupt(entry);\r\n break;\r\n case EventType.end:\r\n if (entry.listener != null && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].end)\r\n listeners[ii].end(entry);\r\n //deprecation\r\n entry.onEnd && this.deprecateStuff() && entry.onEnd(entry.trackIndex);\r\n this.animState.onEnd && this.deprecateStuff() && this.animState.onEnd(entry.trackIndex);\r\n // Fall through.\r\n case EventType.dispose:\r\n if (entry.listener != null && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].dispose)\r\n listeners[ii].dispose(entry);\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener != null && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].complete)\r\n listeners[ii].complete(entry);\r\n //deprecation\r\n var count = MathUtils.toInt(entry.loopsCount());\r\n entry.onComplete && this.deprecateStuff() && entry.onComplete(entry.trackIndex, count);\r\n this.animState.onComplete && this.deprecateStuff() && this.animState.onComplete(entry.trackIndex, count);\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener != null && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].event)\r\n listeners[ii].event(entry, event_3);\r\n //deprecation\r\n entry.onEvent && this.deprecateStuff() && entry.onEvent(entry.trackIndex, event_3);\r\n this.animState.onEvent && this.deprecateStuff() && this.animState.onEvent(entry.trackIndex, event_3);\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n EventQueue.deprecatedWarning1 = false;\r\n return EventQueue;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventType;\r\n(function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n})(EventType || (EventType = {}));\r\n/**\r\n * @public\r\n */\r\nvar AnimationStateAdapter2 = /** @class */ (function () {\r\n function AnimationStateAdapter2() {\r\n }\r\n AnimationStateAdapter2.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter2;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AnimationStateData = /** @class */ (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n this.defaultMix = 0;\r\n if (skeletonData == null)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (from == null)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (to == null)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n AnimationStateData.prototype.setMixByName = function (fromName, toName, duration) {\r\n if (!AnimationStateData.deprecatedWarning1) {\r\n AnimationStateData.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\r\n }\r\n this.setMix(fromName, toName, duration);\r\n };\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (from == null)\r\n throw new Error(\"from cannot be null.\");\r\n if (to == null)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n AnimationStateData.deprecatedWarning1 = false;\r\n return AnimationStateData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AtlasAttachmentLoader = /** @class */ (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n var attachment = new RegionAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n var attachment = new MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new BoundingBoxAttachment(name);\r\n };\r\n /** @return May be null to not load an attachment */\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Bone = /** @class */ (function () {\r\n /** @param parent May be null. */\r\n function Bone(data, skeleton, parent) {\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n this.matrix = new Matrix();\r\n this.children = new Array();\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 0;\r\n this.scaleY = 0;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.ax = 0;\r\n this.ay = 0;\r\n this.arotation = 0;\r\n this.ascaleX = 0;\r\n this.ascaleY = 0;\r\n this.ashearX = 0;\r\n this.ashearY = 0;\r\n this.appliedValid = false;\r\n this.sorted = false;\r\n /** NOT USED IN 3.7. Needed for the debug graph code */\r\n this.active = true;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Object.defineProperty(Bone.prototype, \"worldX\", {\r\n get: function () {\r\n return this.matrix.tx;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bone.prototype, \"worldY\", {\r\n get: function () {\r\n return this.matrix.ty;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local transform. */\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and the specified local transform. */\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n var sx = this.skeleton.scaleX;\r\n var sy = settings.yDown ? -this.skeleton.scaleY : this.skeleton.scaleY;\r\n if (parent == null) { // Root bone.\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n m.tx = x * sx + skeleton.x;\r\n m.ty = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n switch (this.data.transformMode) {\r\n case TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = MathUtils.cosDeg(rx) * scaleX;\r\n var lb = MathUtils.cosDeg(ry) * scaleY;\r\n var lc = MathUtils.sinDeg(rx) * scaleX;\r\n var ld = MathUtils.sinDeg(ry) * scaleY;\r\n m.a = pa * la - pb * lc;\r\n m.c = pa * lb - pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection: {\r\n var cos = MathUtils.cosDeg(rotation);\r\n var sin = MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / sx;\r\n var zc = (pc * cos + pd * sin) / sy;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (settings.yDown ?\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY > 0) :\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(90 + shearY) * scaleY;\r\n m.a = za * la + zb * lc;\r\n m.c = za * lb + zb * ld;\r\n m.b = zc * la + zd * lc;\r\n m.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n m.a *= sx;\r\n m.c *= sx;\r\n m.b *= sy;\r\n m.d *= sy;\r\n };\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldScaleX = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.a * m.a + m.c * m.c);\r\n };\r\n Bone.prototype.getWorldScaleY = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.b * m.b + m.d * m.d);\r\n };\r\n /** Computes the individual applied transform values from the world transform. This can be useful to perform processing using\r\n * the applied transform after the world transform has been modified directly (eg, by a constraint).\r\n *

\r\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */\r\n Bone.prototype.updateAppliedTransform = function () {\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n if (parent == null) {\r\n this.ax = m.tx;\r\n this.ay = m.ty;\r\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\r\n return;\r\n }\r\n var pm = parent.matrix;\r\n var pid = 1 / (pm.a * pm.d - pm.b * pm.c);\r\n var dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\r\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\r\n var ia = pid * pm.d;\r\n var id = pid * pm.a;\r\n var ib = pid * pm.c;\r\n var ic = pid * pm.b;\r\n var ra = ia * m.a - ib * m.b;\r\n var rb = ia * m.c - ib * m.d;\r\n var rc = id * m.b - ic * m.a;\r\n var rd = id * m.d - ic * m.c;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n };\r\n Bone.prototype.worldToLocal = function (world) {\r\n var m = this.matrix;\r\n var a = m.a, b = m.c, c = m.b, d = m.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n Bone.prototype.localToWorld = function (local) {\r\n var m = this.matrix;\r\n var x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n };\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(mat.a * sin - mat.b * cos, mat.d * cos - mat.c * sin) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n var sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(cos * mat.b + sin * mat.d, cos * mat.a + sin * mat.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var mat = this.matrix;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n this.appliedValid = false;\r\n };\r\n return Bone;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar BoneData = /** @class */ (function () {\r\n function BoneData(index, name, parent) {\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.transformMode = TransformMode.Normal;\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Event = /** @class */ (function () {\r\n function Event(time, data) {\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar EventData = /** @class */ (function () {\r\n function EventData(name) {\r\n this.name = name;\r\n }\r\n return EventData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraint = /** @class */ (function () {\r\n function IkConstraint(data, skeleton) {\r\n this.bendDirection = 0;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.mix = 1;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n IkConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n IkConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n IkConstraint.prototype.update = function () {\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix);\r\n break;\r\n }\r\n };\r\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\r\n * coordinate system. */\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var p = bone.parent.matrix;\r\n var id = 1 / (p.a * p.d - p.b * p.c);\r\n var x = targetX - p.tx, y = targetY - p.ty;\r\n var tx = (x * p.d - y * p.c) * id - bone.ax, ty = (y * p.a - x * p.b) * id - bone.ay;\r\n var rotationIK = Math.atan2(ty, tx) * MathUtils.radDeg - bone.ashearX - bone.arotation;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\r\n * target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n if (!parent.appliedValid)\r\n parent.updateAppliedTransform();\r\n if (!child.appliedValid)\r\n child.updateAppliedTransform();\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n var pmat = parent.matrix;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pmat.a, b = pmat.c, c = pmat.b, d = pmat.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + pmat.tx;\r\n cwy = c * cx + pmat.ty;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + pmat.tx;\r\n cwy = c * cx + d * cy + pmat.ty;\r\n }\r\n var pp = parent.parent.matrix;\r\n a = pp.a;\r\n b = pp.c;\r\n c = pp.b;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = targetX - pp.tx, y = targetY - pp.ty;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty;\r\n x = cwx - pp.tx;\r\n y = cwy - pp.ty;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) {\r\n cos = 1;\r\n if (stretch && l1 + l2 > 0.0001)\r\n sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n }\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) / 2;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180)\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180)\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraintData = /** @class */ (function () {\r\n function IkConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.bendDirection = 1;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.uniform = false;\r\n this.mix = 1;\r\n this.name = name;\r\n }\r\n return IkConstraintData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar PathConstraintData = /** @class */ (function () {\r\n function PathConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.name = name;\r\n }\r\n return PathConstraintData;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar SpacingMode;\r\n(function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n})(SpacingMode || (SpacingMode = {}));\n\n/**\r\n * @public\r\n */\r\nvar PathConstraint = /** @class */ (function () {\r\n function PathConstraint(data, skeleton) {\r\n this.position = 0;\r\n this.spacing = 0;\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n PathConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n var translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate)\r\n return;\r\n var data = this.data;\r\n var spacingMode = data.spacingMode;\r\n var lengthSpacing = spacingMode == SpacingMode.Length;\r\n var rotateMode = data.rotateMode;\r\n var tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\r\n var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var bones = this.bones;\r\n var spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n var spacing = this.spacing;\r\n if (scale || lengthSpacing) {\r\n if (scale)\r\n lengths = Utils.setArraySize(this.lengths, boneCount);\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = 0;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_1;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_1 / setupLength;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = rotateMode == RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone.matrix;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n mat.tx += (boneX - mat.tx) * translateMix;\r\n mat.ty += (boneY - mat.ty) * translateMix;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_2 = lengths[i];\r\n if (length_2 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_2 - 1) * rotateMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_3 = bone.data.length;\r\n boneX += (length_3 * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length_3 * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n bone.appliedValid = false;\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (percentPosition)\r\n position *= pathLength_1;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength_1;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_4 = lengths[curve];\r\n if (p > length_4)\r\n continue;\r\n if (curve == 0)\r\n p /= length_4;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_4 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n // Curve lengths.\r\n var curves = Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition)\r\n position *= pathLength;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_5 = curves[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_6 = segments[segment];\r\n if (p > length_6)\r\n continue;\r\n if (segment == 0)\r\n p /= length_6;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p))\r\n p = 0.0001;\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents)\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n };\r\n PathConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraint = /** @class */ (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.temp = new Vector2();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n TransformConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += (temp.x - mat.tx) * translateMix;\r\n mat.ty += (temp.y - mat.ty) * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = Math.sqrt(mat.a * mat.a + mat.b * mat.b);\r\n var ts = Math.sqrt(ta * ta + tc * tc);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = Math.sqrt(mat.c * mat.c + mat.d * mat.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var b = mat.c, d = mat.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(mat.b, mat.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r = by + (r + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += temp.x * translateMix;\r\n mat.ty += temp.y * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n var b = mat.c, d = mat.d;\r\n r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * rotateMix;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax - x + this.data.offsetX) * translateMix;\r\n y += (target.ay - y + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n if (scaleY > 0.00001)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n bone.shearY += r * shearMix;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0)\r\n rotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax + this.data.offsetX) * translateMix;\r\n y += (target.ay + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n if (scaleY > 0.00001)\r\n scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0)\r\n shearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n return TransformConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Skeleton = /** @class */ (function () {\r\n function Skeleton(data) {\r\n this._updateCache = new Array();\r\n this.updateCacheReset = new Array();\r\n this.time = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.x = 0;\r\n this.y = 0;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (boneData.parent == null)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n this.updateCacheReset.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].sorted = false;\r\n // IK first, lowest hierarchy depth first.\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length > 1) {\r\n var child = constrained[constrained.length - 1];\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin != null)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n var i = 0;\r\n while (i < pathBones.length) {\r\n var boneCount = pathBones[i++];\r\n for (var n = i + boneCount; i < n; i++) {\r\n var boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent != null)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n /** Updates the world transform for each bone and applies constraints. */\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var updateCacheReset = this.updateCacheReset;\r\n for (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n var bone = updateCacheReset[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n bone.appliedValid = true;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n /** Sets the bones and constraints to their setup pose values. */\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.mix = constraint.data.mix;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n };\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n /** @return May return null. */\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Sets a skin by name.\r\n * @see #setSkin(Skin) */\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n * @param newSkin May be null. */\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1 != null) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (attachmentName == null)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin != null)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n /** @param attachmentName May be null. */\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size The width and height of the AABB.\r\n * @param temp Working memory */\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (offset == null)\r\n throw new Error(\"offset cannot be null.\");\r\n if (size == null)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices != null) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Skeleton.prototype.update = function (delta) {\r\n this.time += delta;\r\n };\r\n Object.defineProperty(Skeleton.prototype, \"flipX\", {\r\n get: function () {\r\n return this.scaleX == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleX = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Skeleton.prototype, \"flipY\", {\r\n get: function () {\r\n return this.scaleY == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleY = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Skeleton.deprecatedWarning1 = false;\r\n return Skeleton;\r\n}());\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBounds = /** @class */ (function (_super) {\r\n __extends(SkeletonBounds, _super);\r\n function SkeletonBounds() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return SkeletonBounds;\r\n}(SkeletonBoundsBase));\n\n/**\r\n * @public\r\n */\r\nvar SkeletonData = /** @class */ (function () {\r\n function SkeletonData() {\r\n this.bones = new Array(); // Ordered parents first.\r\n this.slots = new Array(); // Setup pose draw order.\r\n this.skins = new Array();\r\n this.events = new Array();\r\n this.animations = new Array();\r\n this.ikConstraints = new Array();\r\n this.transformConstraints = new Array();\r\n this.pathConstraints = new Array();\r\n // Nonessential\r\n this.fps = 0;\r\n }\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (skinName == null)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (eventDataName == null)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.name == eventDataName)\r\n return event_1;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (animationName == null)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SlotData = /** @class */ (function () {\r\n function SlotData(index, name, boneData) {\r\n this.color = new Color(1, 1, 1, 1);\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (boneData == null)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraintData = /** @class */ (function () {\r\n function TransformConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.offsetRotation = 0;\r\n this.offsetX = 0;\r\n this.offsetY = 0;\r\n this.offsetScaleX = 0;\r\n this.offsetScaleY = 0;\r\n this.offsetShearY = 0;\r\n this.relative = false;\r\n this.local = false;\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return TransformConstraintData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Skin = /** @class */ (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n Skin.prototype.addAttachment = function (slotIndex, name, attachment) {\r\n if (attachment == null)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n /** @return May be null. */\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SkeletonJson = /** @class */ (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n // Skeleton\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n // Bones\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_1 = null;\r\n var parentName = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_1 = skeletonData.findBone(parentName);\r\n if (parent_1 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new BoneData(skeletonData.bones.length, boneMap.name, parent_1);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n // Slots.\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var slotName = slotMap.name;\r\n var boneName = slotMap.bone;\r\n var boneData = skeletonData.findBone(boneName);\r\n if (boneData == null)\r\n throw new Error(\"Slot bone not found: \" + boneName);\r\n var data = new SlotData(skeletonData.slots.length, slotName, boneData);\r\n var color = this.getValue(slotMap, \"color\", null);\r\n if (color != null)\r\n data.color.setFromString(color);\r\n var dark = this.getValue(slotMap, \"dark\", null);\r\n if (dark != null) {\r\n data.darkColor = new Color(1, 1, 1, 1);\r\n data.darkColor.setFromString(dark);\r\n }\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n // IK constraints\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new IkConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"IK target bone not found: \" + targetName);\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new TransformConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n data.local = this.getValue(constraintMap, \"local\", false);\r\n data.relative = this.getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n // Path constraints.\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new PathConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Path target slot not found: \" + targetName);\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n // Skins.\r\n if (root.skins) {\r\n for (var skinName in root.skins) {\r\n var skinMap = root.skins[skinName];\r\n var skin = new Skin(skinName);\r\n for (var slotName in skinMap) {\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotMap = skinMap[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);\r\n if (attachment != null)\r\n skin.addAttachment(slotIndex, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_2 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n //linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n data.audioPath = this.getValue(eventMap, \"audio\", null);\r\n if (data.audioPath != null) {\r\n data.volume = this.getValue(eventMap, \"volume\", 1);\r\n data.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n // Animations.\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n var type = this.getValue(map, \"type\", \"region\");\r\n switch (type) {\r\n case \"region\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n region.color.setFromString(color);\r\n //region.updateOffset();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n mesh.color.setFromString(color);\r\n var parent_3 = this.getValue(map, \"parent\", null);\r\n if (parent_3 != null) {\r\n mesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_3));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n //mesh.updateUVs();\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = this.getValue(map, \"x\", 0) * scale;\r\n point.y = this.getValue(map, \"y\", 0) * scale;\r\n point.rotation = this.getValue(map, \"rotation\", 0);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n var end = this.getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n var duration = 0;\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (timelineName == \"attachment\") {\r\n var timeline = new AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n else if (timelineName == \"color\") {\r\n var timeline = new ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var color = new Color();\r\n color.setFromString(valueMap.color || \"ffffffff\");\r\n timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\r\n }\r\n else if (timelineName == \"twoColor\") {\r\n var timeline = new TwoColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var light = new Color();\r\n var dark = new Color();\r\n light.setFromString(valueMap.light);\r\n dark.setFromString(valueMap.dark);\r\n timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TwoColorTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n var timeline = new RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"scale\")\r\n timeline = new ScaleTimeline(timelineMap.length);\r\n else if (timelineName === \"shear\")\r\n timeline = new ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n var timeline = new IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var constraintMap = map.transform[constraintName];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n var timeline = new TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Path constraint timelines.\r\n if (map.paths) {\r\n for (var constraintName in map.paths) {\r\n var constraintMap = map.paths[constraintName];\r\n var index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n if (map.deform) {\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var skin = skeletonData.findSkin(deformName);\r\n if (skin == null) {\r\n if (settings.FAIL_ON_NON_EXISTING_SKIN) {\r\n throw new Error(\"Skin not found: \" + deformName);\r\n }\r\n else {\r\n continue;\r\n }\r\n }\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n var attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null)\r\n throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n var frameIndex = 0;\r\n for (var j = 0; j < timelineMap.length; j++) {\r\n var valueMap = timelineMap[j];\r\n var deform = void 0;\r\n var verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = this.getValue(valueMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, valueMap.time, deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null)\r\n drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n var timeline = new DrawOrderTimeline(drawOrderNode.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frameIndex = 0;\r\n for (var j = 0; j < drawOrderNode.length; j++) {\r\n var drawOrderMap = drawOrderNode[j];\r\n var drawOrder = null;\r\n var offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n var unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var i = 0; i < offsets.length; i++) {\r\n var offsetMap = offsets[i];\r\n var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1)\r\n drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n // Event timeline.\r\n if (map.events) {\r\n var timeline = new EventTimeline(map.events.length);\r\n var frameIndex = 0;\r\n for (var i = 0; i < map.events.length; i++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_1 = new Event(Utils.toSinglePrecision(eventMap.time), eventData);\r\n event_1.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event_1.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event_1.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_1.data.audioPath != null) {\r\n event_1.volume = this.getValue(eventMap, \"volume\", 1);\r\n event_1.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frameIndex++, event_1);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n if (!map.curve)\r\n return;\r\n if (map.curve === \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n var curve = map.curve;\r\n timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n }\r\n };\r\n SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return BLEND_MODES.NORMAL;\r\n if (str == \"additive\")\r\n return BLEND_MODES.ADD;\r\n if (str == \"multiply\")\r\n return BLEND_MODES.MULTIPLY;\r\n if (str == \"screen\")\r\n return BLEND_MODES.SCREEN;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n SkeletonJson.positionModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\")\r\n return PositionMode.Fixed;\r\n if (str == \"percent\")\r\n return PositionMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.spacingModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"length\")\r\n return SpacingMode.Length;\r\n if (str == \"fixed\")\r\n return SpacingMode.Fixed;\r\n if (str == \"percent\")\r\n return SpacingMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.rotateModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\")\r\n return RotateMode.Tangent;\r\n if (str == \"chain\")\r\n return RotateMode.Chain;\r\n if (str == \"chainscale\")\r\n return RotateMode.ChainScale;\r\n throw new Error(\"Unknown rotate mode: \" + str);\r\n };\r\n SkeletonJson.transformModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return TransformMode.Normal;\r\n if (str == \"onlytranslation\")\r\n return TransformMode.OnlyTranslation;\r\n if (str == \"norotationorreflection\")\r\n return TransformMode.NoRotationOrReflection;\r\n if (str == \"noscale\")\r\n return TransformMode.NoScale;\r\n if (str == \"noscaleorreflection\")\r\n return TransformMode.NoScaleOrReflection;\r\n throw new Error(\"Unknown transform mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n}());\r\nvar LinkedMesh = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n }\r\n return LinkedMesh;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n this.skeleton = new Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new AnimationStateData(spineData);\r\n this.state = new AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { Animation, AnimationState, AnimationStateAdapter2, AnimationStateData, AtlasAttachmentLoader, Attachment, AttachmentTimeline, Bone, BoneData, BoundingBoxAttachment, ClippingAttachment, ColorTimeline, CurveTimeline, DeformTimeline, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, IkConstraint, IkConstraintData, IkConstraintTimeline, JitterEffect, MeshAttachment, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PointAttachment, RegionAttachment, RotateTimeline, ScaleTimeline, ShearTimeline, Skeleton, SkeletonBounds, SkeletonData, SkeletonJson, Skin, Slot, SlotData, SpacingMode, Spine, SwirlEffect, TimelineType, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TranslateTimeline, TwoColorTimeline, VertexAttachment };\n//# sourceMappingURL=runtime-3.7.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/runtime-4.1 - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/runtime-4.1 is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev , All Rights Reserved\n */\nimport { Utils, AttachmentType, Color, MathUtils, MixBlend, MixDirection, StringSet, Pool, settings, TransformMode, PositionMode, RotateMode, Vector2, BinaryInput, SkeletonBoundsBase, SpineBase } from '@pixi-spine/base';\nimport { Matrix } from '@pixi/math';\nimport { BLEND_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * The base class for all attachments.\r\n * @public\r\n */\r\nvar Attachment = /** @class */ (function () {\r\n function Attachment(name) {\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n}());\r\n/**\r\n * Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's\r\n * {@link Slot#deform}.\r\n * @public\r\n */\r\nvar VertexAttachment = /** @class */ (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n /** The unique ID for this attachment. */\r\n _this.id = VertexAttachment.nextID++;\r\n /** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting\r\n * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null\r\n * if this attachment has no weights. */\r\n _this.bones = null;\r\n /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`\r\n * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting\r\n * each vertex. */\r\n _this.vertices = [];\r\n /** The maximum number of world vertex values that can be output by\r\n * {@link #computeWorldVertices()} using the `count` parameter. */\r\n _this.worldVerticesLength = 0;\r\n /** Timelines for the timeline attachment are also applied to this attachment.\r\n * May be null if no attachment-specific timelines should be applied. */\r\n _this.timelineAttachment = _this;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVerticesOld = function (slot, worldVertices) {\r\n this.computeWorldVertices(slot, 0, this.worldVerticesLength, worldVertices, 0, 2);\r\n };\r\n /** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is\r\n * not empty, it is used to deform the vertices.\r\n *\r\n * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\r\n * Runtimes Guide.\r\n * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.\r\n * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *\r\n * `stride` / 2.\r\n * @param offset The `worldVertices` index to begin writing values.\r\n * @param stride The number of `worldVertices` entries between the value pairs written. */\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.deform;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (!bones) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var mat = slot.bone.matrix;\r\n var x = mat.tx;\r\n var y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n /** Does not copy id (generated) or name (set on construction). **/\r\n VertexAttachment.prototype.copyTo = function (attachment) {\r\n if (this.bones) {\r\n attachment.bones = new Array(this.bones.length);\r\n Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\r\n }\r\n else\r\n attachment.bones = null;\r\n if (this.vertices) {\r\n attachment.vertices = Utils.newFloatArray(this.vertices.length);\r\n Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\r\n }\r\n attachment.worldVerticesLength = this.worldVerticesLength;\r\n attachment.timelineAttachment = this.timelineAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar BoundingBoxAttachment = /** @class */ (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.BoundingBox;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n BoundingBoxAttachment.prototype.copy = function () {\r\n var copy = new BoundingBoxAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return BoundingBoxAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar ClippingAttachment = /** @class */ (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Clipping;\r\n /** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of\r\n * the skeleton's rendering. */\r\n _this.endSlot = null;\r\n // Nonessential.\r\n /** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons\r\n * are not usually rendered at runtime. */\r\n _this.color = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\r\n return _this;\r\n }\r\n ClippingAttachment.prototype.copy = function () {\r\n var copy = new ClippingAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.endSlot = this.endSlot;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return ClippingAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar MeshAttachment = /** @class */ (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name, path) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Mesh;\r\n _this.region = null;\r\n /** Triplets of vertex indices which describe the mesh's triangulation. */\r\n _this.triangles = [];\r\n /** The color to tint the mesh. */\r\n _this.color = new Color(1, 1, 1, 1);\r\n /** The width of the mesh's image. Available only when nonessential data was exported. */\r\n _this.width = 0;\r\n /** The height of the mesh's image. Available only when nonessential data was exported. */\r\n _this.height = 0;\r\n /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */\r\n _this.hullLength = 0;\r\n /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if\r\n * nonessential data was exported. Triangulation is not performed at runtime. */\r\n _this.edges = [];\r\n _this.parentMesh = null;\r\n _this.sequence = null;\r\n _this.tempColor = new Color(0, 0, 0, 0);\r\n _this.path = path;\r\n return _this;\r\n }\r\n /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},\r\n * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the\r\n * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n /** @param parentMesh May be null. */\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n MeshAttachment.prototype.copy = function () {\r\n if (this.parentMesh)\r\n return this.newLinkedMesh();\r\n var copy = new MeshAttachment(this.name, this.path);\r\n copy.region = this.region;\r\n copy.color.setFromColor(this.color);\r\n this.copyTo(copy);\r\n copy.regionUVs = new Float32Array(this.regionUVs.length);\r\n Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\r\n copy.triangles = new Array(this.triangles.length);\r\n Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\r\n copy.hullLength = this.hullLength;\r\n copy.sequence = this.sequence != null ? this.sequence.copy() : null;\r\n // Nonessential.\r\n if (this.edges) {\r\n copy.edges = new Array(this.edges.length);\r\n Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\r\n }\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n return copy;\r\n };\r\n MeshAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n if (this.sequence != null)\r\n this.sequence.apply(slot, this);\r\n _super.prototype.computeWorldVertices.call(this, slot, start, count, worldVertices, offset, stride);\r\n };\r\n /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/\r\n MeshAttachment.prototype.newLinkedMesh = function () {\r\n var copy = new MeshAttachment(this.name, this.path);\r\n copy.region = this.region;\r\n copy.color.setFromColor(this.color);\r\n copy.timelineAttachment = this.timelineAttachment;\r\n copy.setParentMesh(this.parentMesh ? this.parentMesh : this);\r\n // if (copy.region != null) copy.updateRegion();\r\n return copy;\r\n };\r\n return MeshAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PathAttachment = /** @class */ (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Path;\r\n /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */\r\n _this.lengths = [];\r\n /** If true, the start and end knots are connected. */\r\n _this.closed = false;\r\n /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer\r\n * calculations are performed but calculating positions along the path is less accurate. */\r\n _this.constantSpeed = false;\r\n /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually\r\n * rendered at runtime. */\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n PathAttachment.prototype.copy = function () {\r\n var copy = new PathAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.lengths = new Array(this.lengths.length);\r\n Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\r\n copy.closed = closed;\r\n copy.constantSpeed = this.constantSpeed;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PathAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PointAttachment = /** @class */ (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Point;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.rotation = 0;\r\n /** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments\r\n * are not usually rendered at runtime. */\r\n _this.color = new Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n var mat = bone.matrix;\r\n point.x = this.x * mat.a + this.y * mat.c + bone.worldX;\r\n point.y = this.x * mat.b + this.y * mat.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var mat = bone.matrix;\r\n var cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\r\n var x = cos * mat.a + sin * mat.c;\r\n var y = cos * mat.b + sin * mat.d;\r\n return Math.atan2(y, x) * MathUtils.radDeg;\r\n };\r\n PointAttachment.prototype.copy = function () {\r\n var copy = new PointAttachment(this.name);\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.rotation = this.rotation;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PointAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar RegionAttachment = /** @class */ (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name, path) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Region;\r\n /** The local x translation. */\r\n _this.x = 0;\r\n /** The local y translation. */\r\n _this.y = 0;\r\n /** The local scaleX. */\r\n _this.scaleX = 1;\r\n /** The local scaleY. */\r\n _this.scaleY = 1;\r\n /** The local rotation. */\r\n _this.rotation = 0;\r\n /** The width of the region attachment in Spine. */\r\n _this.width = 0;\r\n /** The height of the region attachment in Spine. */\r\n _this.height = 0;\r\n /** The color to tint the region attachment. */\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.rendererObject = null;\r\n _this.region = null;\r\n _this.sequence = null;\r\n /** For each of the 4 vertices, a pair of x,y values that is the local position of the vertex.\r\n *\r\n * See {@link #updateOffset()}. */\r\n _this.offset = Utils.newFloatArray(8);\r\n _this.uvs = Utils.newFloatArray(8);\r\n _this.tempColor = new Color(1, 1, 1, 1);\r\n _this.path = path;\r\n return _this;\r\n }\r\n /** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */\r\n RegionAttachment.prototype.updateRegion = function () {\r\n if (!this.region)\r\n throw new Error(\"Region not set.\");\r\n var region = this.region;\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var x = this.x, y = this.y;\r\n var localXCos = localX * cos + x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[0] = localXCos - localYSin;\r\n offset[1] = localYCos + localXSin;\r\n offset[2] = localXCos - localY2Sin;\r\n offset[3] = localY2Cos + localXSin;\r\n offset[4] = localX2Cos - localY2Sin;\r\n offset[5] = localY2Cos + localX2Sin;\r\n offset[6] = localX2Cos - localYSin;\r\n offset[7] = localYCos + localX2Sin;\r\n var uvs = this.uvs;\r\n if (region.degrees == 90) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n /** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may\r\n * be changed.\r\n *

\r\n * See World transforms in the Spine\r\n * Runtimes Guide.\r\n * @param worldVertices The output world vertices. Must have a length >= offset + 8.\r\n * @param offset The worldVertices index to begin writing values.\r\n * @param stride The number of worldVertices entries between the value pairs written. */\r\n RegionAttachment.prototype.computeWorldVertices = function (slot, worldVertices, offset, stride) {\r\n if (this.sequence != null)\r\n this.sequence.apply(slot, this);\r\n var bone = slot.bone;\r\n var vertexOffset = this.offset;\r\n var mat = bone.matrix;\r\n var x = mat.tx, y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[0];\r\n offsetY = vertexOffset[1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // br\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[2];\r\n offsetY = vertexOffset[3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // bl\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[4];\r\n offsetY = vertexOffset[5];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ul\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[6];\r\n offsetY = vertexOffset[7];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ur\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.prototype.copy = function () {\r\n var copy = new RegionAttachment(this.name, this.path);\r\n copy.region = this.region;\r\n copy.rendererObject = this.rendererObject;\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.scaleX = this.scaleX;\r\n copy.scaleY = this.scaleY;\r\n copy.rotation = this.rotation;\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\r\n Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\r\n copy.color.setFromColor(this.color);\r\n copy.sequence = this.sequence != null ? this.sequence.copy() : null;\r\n return copy;\r\n };\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar Sequence = /** @class */ (function () {\r\n function Sequence(count) {\r\n this.id = Sequence.nextID();\r\n this.start = 0;\r\n this.digits = 0;\r\n /** The index of the region to show for the setup pose. */\r\n this.setupIndex = 0;\r\n this.regions = new Array(count);\r\n }\r\n Sequence.prototype.copy = function () {\r\n var copy = new Sequence(this.regions.length);\r\n Utils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length);\r\n copy.start = this.start;\r\n copy.digits = this.digits;\r\n copy.setupIndex = this.setupIndex;\r\n return copy;\r\n };\r\n Sequence.prototype.apply = function (slot, attachment) {\r\n var index = slot.sequenceIndex;\r\n if (index == -1)\r\n index = this.setupIndex;\r\n if (index >= this.regions.length)\r\n index = this.regions.length - 1;\r\n var region = this.regions[index];\r\n if (attachment.region != region) {\r\n attachment.region = region;\r\n // attachment.updateRegion();\r\n }\r\n };\r\n Sequence.prototype.getPath = function (basePath, index) {\r\n var result = basePath;\r\n var frame = (this.start + index).toString();\r\n for (var i = this.digits - frame.length; i > 0; i--)\r\n result += \"0\";\r\n result += frame;\r\n return result;\r\n };\r\n Sequence.nextID = function () {\r\n return Sequence._nextID++;\r\n };\r\n Sequence._nextID = 0;\r\n return Sequence;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar SequenceMode;\r\n(function (SequenceMode) {\r\n SequenceMode[SequenceMode[\"hold\"] = 0] = \"hold\";\r\n SequenceMode[SequenceMode[\"once\"] = 1] = \"once\";\r\n SequenceMode[SequenceMode[\"loop\"] = 2] = \"loop\";\r\n SequenceMode[SequenceMode[\"pingpong\"] = 3] = \"pingpong\";\r\n SequenceMode[SequenceMode[\"onceReverse\"] = 4] = \"onceReverse\";\r\n SequenceMode[SequenceMode[\"loopReverse\"] = 5] = \"loopReverse\";\r\n SequenceMode[SequenceMode[\"pingpongReverse\"] = 6] = \"pingpongReverse\";\r\n})(SequenceMode || (SequenceMode = {}));\r\n/**\r\n * @public\r\n */\r\nvar SequenceModeValues = [\r\n SequenceMode.hold,\r\n SequenceMode.once,\r\n SequenceMode.loop,\r\n SequenceMode.pingpong,\r\n SequenceMode.onceReverse,\r\n SequenceMode.loopReverse,\r\n SequenceMode.pingpongReverse\r\n];\n\n/**\r\n * A simple container for a list of timelines and a name.\r\n * @public\r\n * */\r\nvar Animation = /** @class */ (function () {\r\n function Animation(name, timelines, duration) {\r\n this.timelines = [];\r\n this.timelineIds = new StringSet();\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n this.setTimelines(timelines);\r\n this.duration = duration;\r\n }\r\n Animation.prototype.setTimelines = function (timelines) {\r\n if (!timelines)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.timelines = timelines;\r\n this.timelineIds.clear();\r\n for (var i = 0; i < timelines.length; i++)\r\n this.timelineIds.addAll(timelines[i].getPropertyIds());\r\n };\r\n Animation.prototype.hasTimeline = function (ids) {\r\n for (var i = 0; i < ids.length; i++)\r\n if (this.timelineIds.contains(ids[i]))\r\n return true;\r\n return false;\r\n };\r\n /** Applies all the animation's timelines to the specified skeleton.\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @param loop If true, the animation repeats after {@link #getDuration()}.\r\n * @param events May be null to ignore fired events. */\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n return Animation;\r\n}());\r\nvar Property = {\r\n rotate: 0,\r\n x: 1,\r\n y: 2,\r\n scaleX: 3,\r\n scaleY: 4,\r\n shearX: 5,\r\n shearY: 6,\r\n rgb: 7,\r\n alpha: 8,\r\n rgb2: 9,\r\n attachment: 10,\r\n deform: 11,\r\n event: 12,\r\n drawOrder: 13,\r\n ikConstraint: 14,\r\n transformConstraint: 15,\r\n pathConstraintPosition: 16,\r\n pathConstraintSpacing: 17,\r\n pathConstraintMix: 18,\r\n sequence: 19\r\n};\r\n/** The interface for all timelines.\r\n * @public\r\n * */\r\nvar Timeline = /** @class */ (function () {\r\n function Timeline(frameCount, propertyIds) {\r\n this.propertyIds = propertyIds;\r\n this.frames = Utils.newFloatArray(frameCount * this.getFrameEntries());\r\n }\r\n Timeline.prototype.getPropertyIds = function () {\r\n return this.propertyIds;\r\n };\r\n Timeline.prototype.getFrameEntries = function () {\r\n return 1;\r\n };\r\n Timeline.prototype.getFrameCount = function () {\r\n return this.frames.length / this.getFrameEntries();\r\n };\r\n Timeline.prototype.getDuration = function () {\r\n return this.frames[this.frames.length - this.getFrameEntries()];\r\n };\r\n Timeline.search1 = function (frames, time) {\r\n var n = frames.length;\r\n for (var i = 1; i < n; i++)\r\n if (frames[i] > time)\r\n return i - 1;\r\n return n - 1;\r\n };\r\n Timeline.search = function (frames, time, step) {\r\n var n = frames.length;\r\n for (var i = step; i < n; i += step)\r\n if (frames[i] > time)\r\n return i - step;\r\n return n - step;\r\n };\r\n return Timeline;\r\n}());\r\n/** The base class for timelines that use interpolation between key frame values.\r\n * @public\r\n * */\r\nvar CurveTimeline = /** @class */ (function (_super) {\r\n __extends(CurveTimeline, _super);\r\n function CurveTimeline(frameCount, bezierCount, propertyIds) {\r\n var _this = _super.call(this, frameCount, propertyIds) || this;\r\n _this.curves = Utils.newFloatArray(frameCount + bezierCount * 18 /*BEZIER_SIZE*/);\r\n _this.curves[frameCount - 1] = 1 /*STEPPED*/;\r\n return _this;\r\n }\r\n /** Sets the specified key frame to linear interpolation. */\r\n CurveTimeline.prototype.setLinear = function (frame) {\r\n this.curves[frame] = 0 /*LINEAR*/;\r\n };\r\n /** Sets the specified key frame to stepped interpolation. */\r\n CurveTimeline.prototype.setStepped = function (frame) {\r\n this.curves[frame] = 1 /*STEPPED*/;\r\n };\r\n /** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger\r\n * than the actual number of Bezier curves. */\r\n CurveTimeline.prototype.shrink = function (bezierCount) {\r\n var size = this.getFrameCount() + bezierCount * 18 /*BEZIER_SIZE*/;\r\n if (this.curves.length > size) {\r\n var newCurves = Utils.newFloatArray(size);\r\n Utils.arrayCopy(this.curves, 0, newCurves, 0, size);\r\n this.curves = newCurves;\r\n }\r\n };\r\n /** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than\r\n * one curve per frame.\r\n * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified\r\n * in the constructor), inclusive.\r\n * @param frame Between 0 and frameCount - 1, inclusive.\r\n * @param value The index of the value for this frame that this curve is used for.\r\n * @param time1 The time for the first key.\r\n * @param value1 The value for the first key.\r\n * @param cx1 The time for the first Bezier handle.\r\n * @param cy1 The value for the first Bezier handle.\r\n * @param cx2 The time of the second Bezier handle.\r\n * @param cy2 The value for the second Bezier handle.\r\n * @param time2 The time for the second key.\r\n * @param value2 The value for the second key. */\r\n CurveTimeline.prototype.setBezier = function (bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) {\r\n var curves = this.curves;\r\n var i = this.getFrameCount() + bezier * 18 /*BEZIER_SIZE*/;\r\n if (value == 0)\r\n curves[frame] = 2 /*BEZIER*/ + i;\r\n var tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03;\r\n var dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 0.006;\r\n var ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\r\n var dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667;\r\n var x = time1 + dx, y = value1 + dy;\r\n for (var n = i + 18 /*BEZIER_SIZE*/; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dx += ddx;\r\n dy += ddy;\r\n ddx += dddx;\r\n ddy += dddy;\r\n x += dx;\r\n y += dy;\r\n }\r\n };\r\n /** Returns the Bezier interpolated value for the specified time.\r\n * @param frameIndex The index into {@link #getFrames()} for the values of the frame before time.\r\n * @param valueOffset The offset from frameIndex to the value this curve is used for.\r\n * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */\r\n CurveTimeline.prototype.getBezierValue = function (time, frameIndex, valueOffset, i) {\r\n var curves = this.curves;\r\n if (curves[i] > time) {\r\n var x_1 = this.frames[frameIndex], y_1 = this.frames[frameIndex + valueOffset];\r\n return y_1 + (time - x_1) / (curves[i] - x_1) * (curves[i + 1] - y_1);\r\n }\r\n var n = i + 18 /*BEZIER_SIZE*/;\r\n for (i += 2; i < n; i += 2) {\r\n if (curves[i] >= time) {\r\n var x_2 = curves[i - 2], y_2 = curves[i - 1];\r\n return y_2 + (time - x_2) / (curves[i] - x_2) * (curves[i + 1] - y_2);\r\n }\r\n }\r\n frameIndex += this.getFrameEntries();\r\n var x = curves[n - 2], y = curves[n - 1];\r\n return y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y);\r\n };\r\n return CurveTimeline;\r\n}(Timeline));\r\n/**\r\n * @public\r\n */\r\nvar CurveTimeline1 = /** @class */ (function (_super) {\r\n __extends(CurveTimeline1, _super);\r\n function CurveTimeline1(frameCount, bezierCount, propertyId) {\r\n return _super.call(this, frameCount, bezierCount, [propertyId]) || this;\r\n }\r\n CurveTimeline1.prototype.getFrameEntries = function () {\r\n return 2 /*ENTRIES*/;\r\n };\r\n /** Sets the time and value for the specified frame.\r\n * @param frame Between 0 and frameCount, inclusive.\r\n * @param time The frame time in seconds. */\r\n CurveTimeline1.prototype.setFrame = function (frame, time, value) {\r\n frame <<= 1;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*VALUE*/] = value;\r\n };\r\n /** Returns the interpolated value for the specified time. */\r\n CurveTimeline1.prototype.getCurveValue = function (time) {\r\n var frames = this.frames;\r\n var i = frames.length - 2;\r\n for (var ii = 2; ii <= i; ii += 2) {\r\n if (frames[ii] > time) {\r\n i = ii - 2;\r\n break;\r\n }\r\n }\r\n var curveType = this.curves[i >> 1];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i], value = frames[i + 1 /*VALUE*/];\r\n return value + (time - before) / (frames[i + 2 /*ENTRIES*/] - before) * (frames[i + 2 /*ENTRIES*/ + 1 /*VALUE*/] - value);\r\n case 1 /*STEPPED*/:\r\n return frames[i + 1 /*VALUE*/];\r\n }\r\n return this.getBezierValue(time, i, 1 /*VALUE*/, curveType - 2 /*BEZIER*/);\r\n };\r\n return CurveTimeline1;\r\n}(CurveTimeline));\r\n/** The base class for a {@link CurveTimeline} which sets two properties.\r\n * @public\r\n * */\r\nvar CurveTimeline2 = /** @class */ (function (_super) {\r\n __extends(CurveTimeline2, _super);\r\n /** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}.\r\n * @param propertyIds Unique identifiers for the properties the timeline modifies. */\r\n function CurveTimeline2(frameCount, bezierCount, propertyId1, propertyId2) {\r\n return _super.call(this, frameCount, bezierCount, [propertyId1, propertyId2]) || this;\r\n }\r\n CurveTimeline2.prototype.getFrameEntries = function () {\r\n return 3 /*ENTRIES*/;\r\n };\r\n /** Sets the time and values for the specified frame.\r\n * @param frame Between 0 and frameCount, inclusive.\r\n * @param time The frame time in seconds. */\r\n CurveTimeline2.prototype.setFrame = function (frame, time, value1, value2) {\r\n frame *= 3 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*VALUE1*/] = value1;\r\n this.frames[frame + 2 /*VALUE2*/] = value2;\r\n };\r\n return CurveTimeline2;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#rotation}.\r\n * @public\r\n * */\r\nvar RotateTimeline = /** @class */ (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.rotate + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n bone.rotation += (bone.data.rotation - bone.rotation) * alpha;\r\n }\r\n return;\r\n }\r\n var r = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += r * alpha;\r\n }\r\n };\r\n return RotateTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#x} and {@link Bone#y}.\r\n * @public\r\n * */\r\nvar TranslateTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.x + \"|\" + boneIndex, Property.y + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n var i = Timeline.search(frames, time, 3 /*ENTRIES*/);\r\n var curveType = this.curves[i / 3 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n var t = (time - before) / (frames[i + 3 /*ENTRIES*/] - before);\r\n x += (frames[i + 3 /*ENTRIES*/ + 1 /*VALUE1*/] - x) * t;\r\n y += (frames[i + 3 /*ENTRIES*/ + 2 /*VALUE2*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n break;\r\n default:\r\n x = this.getBezierValue(time, i, 1 /*VALUE1*/, curveType - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 2 /*VALUE2*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n return TranslateTimeline;\r\n}(CurveTimeline2));\r\n/** Changes a bone's local {@link Bone#x}.\r\n * @public\r\n * */\r\nvar TranslateXTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateXTimeline, _super);\r\n function TranslateXTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.x + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n TranslateXTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n }\r\n return;\r\n }\r\n var x = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n }\r\n };\r\n return TranslateXTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#x}.\r\n * @public\r\n * */\r\nvar TranslateYTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateYTimeline, _super);\r\n function TranslateYTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.y + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n TranslateYTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var y = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.y += y * alpha;\r\n }\r\n };\r\n return TranslateYTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}.\r\n * @public\r\n * */\r\nvar ScaleTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.scaleX + \"|\" + boneIndex, Property.scaleY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x, y;\r\n var i = Timeline.search(frames, time, 3 /*ENTRIES*/);\r\n var curveType = this.curves[i / 3 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n var t = (time - before) / (frames[i + 3 /*ENTRIES*/] - before);\r\n x += (frames[i + 3 /*ENTRIES*/ + 1 /*VALUE1*/] - x) * t;\r\n y += (frames[i + 3 /*ENTRIES*/ + 2 /*VALUE2*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n break;\r\n default:\r\n x = this.getBezierValue(time, i, 1 /*VALUE1*/, curveType - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 2 /*VALUE2*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n x *= bone.data.scaleX;\r\n y *= bone.data.scaleY;\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n}(CurveTimeline2));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}.\r\n * @public\r\n * */\r\nvar ScaleXTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleXTimeline, _super);\r\n function ScaleXTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.scaleX + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ScaleXTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n }\r\n return;\r\n }\r\n var x = this.getCurveValue(time) * bone.data.scaleX;\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add)\r\n bone.scaleX += x - bone.data.scaleX;\r\n else\r\n bone.scaleX = x;\r\n }\r\n else {\r\n // Mixing out uses sign of setup or current pose, else use sign of key.\r\n var bx = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleXTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}.\r\n * @public\r\n * */\r\nvar ScaleYTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleYTimeline, _super);\r\n function ScaleYTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.scaleY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ScaleYTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var y = this.getCurveValue(time) * bone.data.scaleY;\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add)\r\n bone.scaleY += y - bone.data.scaleY;\r\n else\r\n bone.scaleY = y;\r\n }\r\n else {\r\n // Mixing out uses sign of setup or current pose, else use sign of key.\r\n var by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n by = bone.data.scaleY;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n by = bone.scaleY;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleYTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar ShearTimeline = /** @class */ (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.shearX + \"|\" + boneIndex, Property.shearY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n var i = Timeline.search(frames, time, 3 /*ENTRIES*/);\r\n var curveType = this.curves[i / 3 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n var t = (time - before) / (frames[i + 3 /*ENTRIES*/] - before);\r\n x += (frames[i + 3 /*ENTRIES*/ + 1 /*VALUE1*/] - x) * t;\r\n y += (frames[i + 3 /*ENTRIES*/ + 2 /*VALUE2*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n break;\r\n default:\r\n x = this.getBezierValue(time, i, 1 /*VALUE1*/, curveType - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 2 /*VALUE2*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n}(CurveTimeline2));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar ShearXTimeline = /** @class */ (function (_super) {\r\n __extends(ShearXTimeline, _super);\r\n function ShearXTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.shearX + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ShearXTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n }\r\n return;\r\n }\r\n var x = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n }\r\n };\r\n return ShearXTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar ShearYTimeline = /** @class */ (function (_super) {\r\n __extends(ShearYTimeline, _super);\r\n function ShearYTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.shearY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ShearYTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var y = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearYTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a slot's {@link Slot#color}.\r\n * @public\r\n * */\r\nvar RGBATimeline = /** @class */ (function (_super) {\r\n __extends(RGBATimeline, _super);\r\n function RGBATimeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex,\r\n Property.alpha + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGBATimeline.prototype.getFrameEntries = function () {\r\n return 5 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\r\n RGBATimeline.prototype.setFrame = function (frame, time, r, g, b, a) {\r\n frame *= 5 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n this.frames[frame + 4 /*A*/] = a;\r\n };\r\n RGBATimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var color = slot.color;\r\n if (time < frames[0]) {\r\n var setup = slot.data.color;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n color.setFromColor(setup);\r\n return;\r\n case MixBlend.first:\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n var i = Timeline.search(frames, time, 5 /*ENTRIES*/);\r\n var curveType = this.curves[i / 5 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n var t = (time - before) / (frames[i + 5 /*ENTRIES*/] - before);\r\n r += (frames[i + 5 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 5 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 5 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n a += (frames[i + 5 /*ENTRIES*/ + 4 /*A*/] - a) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n a = this.getBezierValue(time, i, 4 /*A*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1)\r\n color.set(r, g, b, a);\r\n else {\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n return RGBATimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#color}.\r\n * @public\r\n * */\r\nvar RGBTimeline = /** @class */ (function (_super) {\r\n __extends(RGBTimeline, _super);\r\n function RGBTimeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGBTimeline.prototype.getFrameEntries = function () {\r\n return 4 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\r\n RGBTimeline.prototype.setFrame = function (frame, time, r, g, b) {\r\n frame <<= 2;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n };\r\n RGBTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var color = slot.color;\r\n if (time < frames[0]) {\r\n var setup = slot.data.color;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n color.r = setup.r;\r\n color.g = setup.g;\r\n color.b = setup.b;\r\n return;\r\n case MixBlend.first:\r\n color.r += (setup.r - color.r) * alpha;\r\n color.g += (setup.g - color.g) * alpha;\r\n color.b += (setup.b - color.b) * alpha;\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0;\r\n var i = Timeline.search(frames, time, 4 /*ENTRIES*/);\r\n var curveType = this.curves[i >> 2];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n var t = (time - before) / (frames[i + 4 /*ENTRIES*/] - before);\r\n r += (frames[i + 4 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 4 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 4 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1) {\r\n color.r = r;\r\n color.g = g;\r\n color.b = b;\r\n }\r\n else {\r\n if (blend == MixBlend.setup) {\r\n var setup = slot.data.color;\r\n color.r = setup.r;\r\n color.g = setup.g;\r\n color.b = setup.b;\r\n }\r\n color.r += (r - color.r) * alpha;\r\n color.g += (g - color.g) * alpha;\r\n color.b += (b - color.b) * alpha;\r\n }\r\n };\r\n return RGBTimeline;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar AlphaTimeline = /** @class */ (function (_super) {\r\n __extends(AlphaTimeline, _super);\r\n function AlphaTimeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.alpha + \"|\" + slotIndex) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n AlphaTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var color = slot.color;\r\n if (time < this.frames[0]) { // Time is before first frame.\r\n var setup = slot.data.color;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n color.a = setup.a;\r\n return;\r\n case MixBlend.first:\r\n color.a += (setup.a - color.a) * alpha;\r\n }\r\n return;\r\n }\r\n var a = this.getCurveValue(time);\r\n if (alpha == 1)\r\n color.a = a;\r\n else {\r\n if (blend == MixBlend.setup)\r\n color.a = slot.data.color.a;\r\n color.a += (a - color.a) * alpha;\r\n }\r\n };\r\n return AlphaTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting.\r\n * @public\r\n * */\r\nvar RGBA2Timeline = /** @class */ (function (_super) {\r\n __extends(RGBA2Timeline, _super);\r\n function RGBA2Timeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex,\r\n Property.alpha + \"|\" + slotIndex,\r\n Property.rgb2 + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGBA2Timeline.prototype.getFrameEntries = function () {\r\n return 8 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, light, and dark colors for the specified key frame. */\r\n RGBA2Timeline.prototype.setFrame = function (frame, time, r, g, b, a, r2, g2, b2) {\r\n frame <<= 3;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n this.frames[frame + 4 /*A*/] = a;\r\n this.frames[frame + 5 /*R2*/] = r2;\r\n this.frames[frame + 6 /*G2*/] = g2;\r\n this.frames[frame + 7 /*B2*/] = b2;\r\n };\r\n RGBA2Timeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var light = slot.color, dark = slot.darkColor;\r\n if (time < frames[0]) {\r\n var setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n light.setFromColor(setupLight);\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n return;\r\n case MixBlend.first:\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.r += (setupDark.r - dark.r) * alpha;\r\n dark.g += (setupDark.g - dark.g) * alpha;\r\n dark.b += (setupDark.b - dark.b) * alpha;\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n var i = Timeline.search(frames, time, 8 /*ENTRIES*/);\r\n var curveType = this.curves[i >> 3];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n r2 = frames[i + 5 /*R2*/];\r\n g2 = frames[i + 6 /*G2*/];\r\n b2 = frames[i + 7 /*B2*/];\r\n var t = (time - before) / (frames[i + 8 /*ENTRIES*/] - before);\r\n r += (frames[i + 8 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 8 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 8 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n a += (frames[i + 8 /*ENTRIES*/ + 4 /*A*/] - a) * t;\r\n r2 += (frames[i + 8 /*ENTRIES*/ + 5 /*R2*/] - r2) * t;\r\n g2 += (frames[i + 8 /*ENTRIES*/ + 6 /*G2*/] - g2) * t;\r\n b2 += (frames[i + 8 /*ENTRIES*/ + 7 /*B2*/] - b2) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n r2 = frames[i + 5 /*R2*/];\r\n g2 = frames[i + 6 /*G2*/];\r\n b2 = frames[i + 7 /*B2*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n a = this.getBezierValue(time, i, 4 /*A*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n r2 = this.getBezierValue(time, i, 5 /*R2*/, curveType + 18 /*BEZIER_SIZE*/ * 4 - 2 /*BEZIER*/);\r\n g2 = this.getBezierValue(time, i, 6 /*G2*/, curveType + 18 /*BEZIER_SIZE*/ * 5 - 2 /*BEZIER*/);\r\n b2 = this.getBezierValue(time, i, 7 /*B2*/, curveType + 18 /*BEZIER_SIZE*/ * 6 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1) {\r\n light.set(r, g, b, a);\r\n dark.r = r2;\r\n dark.g = g2;\r\n dark.b = b2;\r\n }\r\n else {\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n var setupDark = slot.data.darkColor;\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.r += (r2 - dark.r) * alpha;\r\n dark.g += (g2 - dark.g) * alpha;\r\n dark.b += (b2 - dark.b) * alpha;\r\n }\r\n };\r\n return RGBA2Timeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting.\r\n * @public\r\n * */\r\nvar RGB2Timeline = /** @class */ (function (_super) {\r\n __extends(RGB2Timeline, _super);\r\n function RGB2Timeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex,\r\n Property.rgb2 + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGB2Timeline.prototype.getFrameEntries = function () {\r\n return 7 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, light, and dark colors for the specified key frame. */\r\n RGB2Timeline.prototype.setFrame = function (frame, time, r, g, b, r2, g2, b2) {\r\n frame *= 7 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n this.frames[frame + 4 /*R2*/] = r2;\r\n this.frames[frame + 5 /*G2*/] = g2;\r\n this.frames[frame + 6 /*B2*/] = b2;\r\n };\r\n RGB2Timeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var light = slot.color, dark = slot.darkColor;\r\n if (time < frames[0]) {\r\n var setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n light.r = setupLight.r;\r\n light.g = setupLight.g;\r\n light.b = setupLight.b;\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n return;\r\n case MixBlend.first:\r\n light.r += (setupLight.r - light.r) * alpha;\r\n light.g += (setupLight.g - light.g) * alpha;\r\n light.b += (setupLight.b - light.b) * alpha;\r\n dark.r += (setupDark.r - dark.r) * alpha;\r\n dark.g += (setupDark.g - dark.g) * alpha;\r\n dark.b += (setupDark.b - dark.b) * alpha;\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, r2 = 0, g2 = 0, b2 = 0;\r\n var i = Timeline.search(frames, time, 7 /*ENTRIES*/);\r\n var curveType = this.curves[i / 7 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n r2 = frames[i + 4 /*R2*/];\r\n g2 = frames[i + 5 /*G2*/];\r\n b2 = frames[i + 6 /*B2*/];\r\n var t = (time - before) / (frames[i + 7 /*ENTRIES*/] - before);\r\n r += (frames[i + 7 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 7 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 7 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n r2 += (frames[i + 7 /*ENTRIES*/ + 4 /*R2*/] - r2) * t;\r\n g2 += (frames[i + 7 /*ENTRIES*/ + 5 /*G2*/] - g2) * t;\r\n b2 += (frames[i + 7 /*ENTRIES*/ + 6 /*B2*/] - b2) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n r2 = frames[i + 4 /*R2*/];\r\n g2 = frames[i + 5 /*G2*/];\r\n b2 = frames[i + 6 /*B2*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n r2 = this.getBezierValue(time, i, 4 /*R2*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n g2 = this.getBezierValue(time, i, 5 /*G2*/, curveType + 18 /*BEZIER_SIZE*/ * 4 - 2 /*BEZIER*/);\r\n b2 = this.getBezierValue(time, i, 6 /*B2*/, curveType + 18 /*BEZIER_SIZE*/ * 5 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1) {\r\n light.r = r;\r\n light.g = g;\r\n light.b = b;\r\n dark.r = r2;\r\n dark.g = g2;\r\n dark.b = b2;\r\n }\r\n else {\r\n if (blend == MixBlend.setup) {\r\n var setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.r = setupLight.r;\r\n light.g = setupLight.g;\r\n light.b = setupLight.b;\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n }\r\n light.r += (r - light.r) * alpha;\r\n light.g += (g - light.g) * alpha;\r\n light.b += (b - light.b) * alpha;\r\n dark.r += (r2 - dark.r) * alpha;\r\n dark.g += (g2 - dark.g) * alpha;\r\n dark.b += (b2 - dark.b) * alpha;\r\n }\r\n };\r\n return RGB2Timeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#attachment}.\r\n * @public\r\n * */\r\nvar AttachmentTimeline = /** @class */ (function (_super) {\r\n __extends(AttachmentTimeline, _super);\r\n function AttachmentTimeline(frameCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, [\r\n Property.attachment + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n _this.attachmentNames = new Array(frameCount);\r\n return _this;\r\n }\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the attachment name for the specified key frame. */\r\n AttachmentTimeline.prototype.setFrame = function (frame, time, attachmentName) {\r\n this.frames[frame] = time;\r\n this.attachmentNames[frame] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n if (time < this.frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n this.setAttachment(skeleton, slot, this.attachmentNames[Timeline.search1(this.frames, time)]);\r\n };\r\n AttachmentTimeline.prototype.setAttachment = function (skeleton, slot, attachmentName) {\r\n slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n return AttachmentTimeline;\r\n}(Timeline));\r\n/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}.\r\n * @public\r\n * */\r\nvar DeformTimeline = /** @class */ (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount, bezierCount, slotIndex, attachment) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.deform + \"|\" + slotIndex + \"|\" + attachment.id\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n _this.attachment = attachment;\r\n _this.vertices = new Array(frameCount);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the vertices for the specified key frame.\r\n * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\r\n DeformTimeline.prototype.setFrame = function (frame, time, vertices) {\r\n this.frames[frame] = time;\r\n this.vertices[frame] = vertices;\r\n };\r\n /** @param value1 Ignored (0 is used for a deform timeline).\r\n * @param value2 Ignored (1 is used for a deform timeline). */\r\n DeformTimeline.prototype.setBezier = function (bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) {\r\n var curves = this.curves;\r\n var i = this.getFrameCount() + bezier * 18 /*BEZIER_SIZE*/;\r\n if (value == 0)\r\n curves[frame] = 2 /*BEZIER*/ + i;\r\n var tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06;\r\n var dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = (cy1 - cy2 + 0.33333333) * 0.018;\r\n var ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\r\n var dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667;\r\n var x = time1 + dx, y = dy;\r\n for (var n = i + 18 /*BEZIER_SIZE*/; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dx += ddx;\r\n dy += ddy;\r\n ddx += dddx;\r\n ddy += dddy;\r\n x += dx;\r\n y += dy;\r\n }\r\n };\r\n DeformTimeline.prototype.getCurvePercent = function (time, frame) {\r\n var curves = this.curves;\r\n var i = curves[frame];\r\n switch (i) {\r\n case 0 /*LINEAR*/:\r\n var x_3 = this.frames[frame];\r\n return (time - x_3) / (this.frames[frame + this.getFrameEntries()] - x_3);\r\n case 1 /*STEPPED*/:\r\n return 0;\r\n }\r\n i -= 2 /*BEZIER*/;\r\n if (curves[i] > time) {\r\n var x_4 = this.frames[frame];\r\n return curves[i + 1] * (time - x_4) / (curves[i] - x_4);\r\n }\r\n var n = i + 18 /*BEZIER_SIZE*/;\r\n for (i += 2; i < n; i += 2) {\r\n if (curves[i] >= time) {\r\n var x_5 = curves[i - 2], y_3 = curves[i - 1];\r\n return y_3 + (time - x_5) / (curves[i] - x_5) * (curves[i + 1] - y_3);\r\n }\r\n }\r\n var x = curves[n - 2], y = curves[n - 1];\r\n return y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var slotAttachment = slot.getAttachment();\r\n if (!slotAttachment)\r\n return;\r\n if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != this.attachment)\r\n return;\r\n var deform = slot.deform;\r\n if (deform.length == 0)\r\n blend = MixBlend.setup;\r\n var vertices = this.vertices;\r\n var vertexCount = vertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n deform.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n deform.length = 0;\r\n return;\r\n }\r\n deform.length = vertexCount;\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform[i] += (setupVertices[i] - deform[i]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets.\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n deform.length = vertexCount;\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n var lastVertices = vertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_1 = 0; i_1 < vertexCount; i_1++)\r\n deform[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n deform[i_2] += lastVertices[i_2];\r\n }\r\n }\r\n else\r\n Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (!vertexAttachment_1.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n var setup = setupVertices[i_3];\r\n deform[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n deform[i_4] = lastVertices[i_4] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_6 = 0; i_6 < vertexCount; i_6++)\r\n deform[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n deform[i_7] += lastVertices[i_7] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Timeline.search1(frames, time);\r\n var percent = this.getCurvePercent(time, frame);\r\n var prevVertices = vertices[frame];\r\n var nextVertices = vertices[frame + 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n var prev = prevVertices[i_8];\r\n deform[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n var prev = prevVertices[i_9];\r\n deform[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n var prev = prevVertices[i_10];\r\n deform[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (!vertexAttachment_2.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n var prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n deform[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n var prev = prevVertices[i_12];\r\n deform[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n var prev = prevVertices[i_13];\r\n deform[i_13] += (prev + (nextVertices[i_13] - prev) * percent - deform[i_13]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n var prev = prevVertices[i_14];\r\n deform[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n var prev = prevVertices[i_15];\r\n deform[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n}(CurveTimeline));\r\n/** Fires an {@link Event} when specific animation times are reached.\r\n * @public\r\n * */\r\nvar EventTimeline = /** @class */ (function (_super) {\r\n __extends(EventTimeline, _super);\r\n function EventTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount, EventTimeline.propertyIds) || this;\r\n _this.events = new Array(frameCount);\r\n return _this;\r\n }\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the event for the specified key frame. */\r\n EventTimeline.prototype.setFrame = function (frame, event) {\r\n this.frames[frame] = event.time;\r\n this.events[frame] = event;\r\n };\r\n /** Fires events for frames > `lastTime` and <= `time`. */\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (!firedEvents)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0])\r\n return; // Time is before first frame.\r\n var i = 0;\r\n if (lastTime < frames[0])\r\n i = 0;\r\n else {\r\n i = Timeline.search1(frames, lastTime) + 1;\r\n var frameTime = frames[i];\r\n while (i > 0) { // Fire multiple events with the same frame.\r\n if (frames[i - 1] != frameTime)\r\n break;\r\n i--;\r\n }\r\n }\r\n for (; i < frameCount && time >= frames[i]; i++)\r\n firedEvents.push(this.events[i]);\r\n };\r\n EventTimeline.propertyIds = [\"\" + Property.event];\r\n return EventTimeline;\r\n}(Timeline));\r\n/** Changes a skeleton's {@link Skeleton#drawOrder}.\r\n * @public\r\n * */\r\nvar DrawOrderTimeline = /** @class */ (function (_super) {\r\n __extends(DrawOrderTimeline, _super);\r\n function DrawOrderTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount, DrawOrderTimeline.propertyIds) || this;\r\n _this.drawOrders = new Array(frameCount);\r\n return _this;\r\n }\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the draw order for the specified key frame.\r\n * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\r\n * draw order. */\r\n DrawOrderTimeline.prototype.setFrame = function (frame, time, drawOrder) {\r\n this.frames[frame] = time;\r\n this.drawOrders[frame] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n if (time < this.frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var idx = Timeline.search1(this.frames, time);\r\n var drawOrderToSetupIndex = this.drawOrders[idx];\r\n if (!drawOrderToSetupIndex)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n else {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n DrawOrderTimeline.propertyIds = [\"\" + Property.drawOrder];\r\n return DrawOrderTimeline;\r\n}(Timeline));\r\n/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},\r\n * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}.\r\n * @public\r\n * */\r\nvar IkConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount, bezierCount, ikConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.ikConstraint + \"|\" + ikConstraintIndex\r\n ]) || this;\r\n /** The index of the IK constraint slot in {@link Skeleton#ikConstraints} that will be changed. */\r\n _this.ikConstraintIndex = 0;\r\n _this.ikConstraintIndex = ikConstraintIndex;\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getFrameEntries = function () {\r\n return 6 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */\r\n IkConstraintTimeline.prototype.setFrame = function (frame, time, mix, softness, bendDirection, compress, stretch) {\r\n frame *= 6 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*MIX*/] = mix;\r\n this.frames[frame + 2 /*SOFTNESS*/] = softness;\r\n this.frames[frame + 3 /*BEND_DIRECTION*/] = bendDirection;\r\n this.frames[frame + 4 /*COMPRESS*/] = compress ? 1 : 0;\r\n this.frames[frame + 5 /*STRETCH*/] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.softness += (constraint.data.softness - constraint.softness) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n var mix = 0, softness = 0;\r\n var i = Timeline.search(frames, time, 6 /*ENTRIES*/);\r\n var curveType = this.curves[i / 6 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n mix = frames[i + 1 /*MIX*/];\r\n softness = frames[i + 2 /*SOFTNESS*/];\r\n var t = (time - before) / (frames[i + 6 /*ENTRIES*/] - before);\r\n mix += (frames[i + 6 /*ENTRIES*/ + 1 /*MIX*/] - mix) * t;\r\n softness += (frames[i + 6 /*ENTRIES*/ + 2 /*SOFTNESS*/] - softness) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n mix = frames[i + 1 /*MIX*/];\r\n softness = frames[i + 2 /*SOFTNESS*/];\r\n break;\r\n default:\r\n mix = this.getBezierValue(time, i, 1 /*MIX*/, curveType - 2 /*BEZIER*/);\r\n softness = this.getBezierValue(time, i, 2 /*SOFTNESS*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness + (softness - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[i + 3 /*BEND_DIRECTION*/];\r\n constraint.compress = frames[i + 4 /*COMPRESS*/] != 0;\r\n constraint.stretch = frames[i + 5 /*STRETCH*/] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix - constraint.mix) * alpha;\r\n constraint.softness += (softness - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[i + 3 /*BEND_DIRECTION*/];\r\n constraint.compress = frames[i + 4 /*COMPRESS*/] != 0;\r\n constraint.stretch = frames[i + 5 /*STRETCH*/] != 0;\r\n }\r\n }\r\n };\r\n return IkConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},\r\n * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}.\r\n * @public\r\n * */\r\nvar TransformConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount, bezierCount, transformConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.transformConstraint + \"|\" + transformConstraintIndex\r\n ]) || this;\r\n /** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */\r\n _this.transformConstraintIndex = 0;\r\n _this.transformConstraintIndex = transformConstraintIndex;\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getFrameEntries = function () {\r\n return 7 /*ENTRIES*/;\r\n };\r\n /** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */\r\n TransformConstraintTimeline.prototype.setFrame = function (frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY) {\r\n var frames = this.frames;\r\n frame *= 7 /*ENTRIES*/;\r\n frames[frame] = time;\r\n frames[frame + 1 /*ROTATE*/] = mixRotate;\r\n frames[frame + 2 /*X*/] = mixX;\r\n frames[frame + 3 /*Y*/] = mixY;\r\n frames[frame + 4 /*SCALEX*/] = mixScaleX;\r\n frames[frame + 5 /*SCALEY*/] = mixScaleY;\r\n frames[frame + 6 /*SHEARY*/] = mixShearY;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mixRotate = data.mixRotate;\r\n constraint.mixX = data.mixX;\r\n constraint.mixY = data.mixY;\r\n constraint.mixScaleX = data.mixScaleX;\r\n constraint.mixScaleY = data.mixScaleY;\r\n constraint.mixShearY = data.mixShearY;\r\n return;\r\n case MixBlend.first:\r\n constraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (data.mixX - constraint.mixX) * alpha;\r\n constraint.mixY += (data.mixY - constraint.mixY) * alpha;\r\n constraint.mixScaleX += (data.mixScaleX - constraint.mixScaleX) * alpha;\r\n constraint.mixScaleY += (data.mixScaleY - constraint.mixScaleY) * alpha;\r\n constraint.mixShearY += (data.mixShearY - constraint.mixShearY) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate, x, y, scaleX, scaleY, shearY;\r\n var i = Timeline.search(frames, time, 7 /*ENTRIES*/);\r\n var curveType = this.curves[i / 7 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n scaleX = frames[i + 4 /*SCALEX*/];\r\n scaleY = frames[i + 5 /*SCALEY*/];\r\n shearY = frames[i + 6 /*SHEARY*/];\r\n var t = (time - before) / (frames[i + 7 /*ENTRIES*/] - before);\r\n rotate += (frames[i + 7 /*ENTRIES*/ + 1 /*ROTATE*/] - rotate) * t;\r\n x += (frames[i + 7 /*ENTRIES*/ + 2 /*X*/] - x) * t;\r\n y += (frames[i + 7 /*ENTRIES*/ + 3 /*Y*/] - y) * t;\r\n scaleX += (frames[i + 7 /*ENTRIES*/ + 4 /*SCALEX*/] - scaleX) * t;\r\n scaleY += (frames[i + 7 /*ENTRIES*/ + 5 /*SCALEY*/] - scaleY) * t;\r\n shearY += (frames[i + 7 /*ENTRIES*/ + 6 /*SHEARY*/] - shearY) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n scaleX = frames[i + 4 /*SCALEX*/];\r\n scaleY = frames[i + 5 /*SCALEY*/];\r\n shearY = frames[i + 6 /*SHEARY*/];\r\n break;\r\n default:\r\n rotate = this.getBezierValue(time, i, 1 /*ROTATE*/, curveType - 2 /*BEZIER*/);\r\n x = this.getBezierValue(time, i, 2 /*X*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 3 /*Y*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n scaleX = this.getBezierValue(time, i, 4 /*SCALEX*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n scaleY = this.getBezierValue(time, i, 5 /*SCALEY*/, curveType + 18 /*BEZIER_SIZE*/ * 4 - 2 /*BEZIER*/);\r\n shearY = this.getBezierValue(time, i, 6 /*SHEARY*/, curveType + 18 /*BEZIER_SIZE*/ * 5 - 2 /*BEZIER*/);\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\r\n constraint.mixX = data.mixX + (x - data.mixX) * alpha;\r\n constraint.mixY = data.mixY + (y - data.mixY) * alpha;\r\n constraint.mixScaleX = data.mixScaleX + (scaleX - data.mixScaleX) * alpha;\r\n constraint.mixScaleY = data.mixScaleY + (scaleY - data.mixScaleY) * alpha;\r\n constraint.mixShearY = data.mixShearY + (shearY - data.mixShearY) * alpha;\r\n }\r\n else {\r\n constraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (x - constraint.mixX) * alpha;\r\n constraint.mixY += (y - constraint.mixY) * alpha;\r\n constraint.mixScaleX += (scaleX - constraint.mixScaleX) * alpha;\r\n constraint.mixScaleY += (scaleY - constraint.mixScaleY) * alpha;\r\n constraint.mixShearY += (shearY - constraint.mixShearY) * alpha;\r\n }\r\n };\r\n return TransformConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a path constraint's {@link PathConstraint#position}.\r\n * @public\r\n * */\r\nvar PathConstraintPositionTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount, bezierCount, pathConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.pathConstraintPosition + \"|\" + pathConstraintIndex) || this;\r\n /** The index of the path constraint slot in {@link Skeleton#pathConstraints} that will be changed. */\r\n _this.pathConstraintIndex = 0;\r\n _this.pathConstraintIndex = pathConstraintIndex;\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = this.getCurveValue(time);\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n return PathConstraintPositionTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a path constraint's {@link PathConstraint#spacing}.\r\n * @public\r\n * */\r\nvar PathConstraintSpacingTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount, bezierCount, pathConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.pathConstraintSpacing + \"|\" + pathConstraintIndex) || this;\r\n /** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */\r\n _this.pathConstraintIndex = 0;\r\n _this.pathConstraintIndex = pathConstraintIndex;\r\n return _this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = this.getCurveValue(time);\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a transform constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and\r\n * {@link PathConstraint#getMixY()}.\r\n * @public\r\n * */\r\nvar PathConstraintMixTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount, bezierCount, pathConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.pathConstraintMix + \"|\" + pathConstraintIndex\r\n ]) || this;\r\n /** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */\r\n _this.pathConstraintIndex = 0;\r\n _this.pathConstraintIndex = pathConstraintIndex;\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getFrameEntries = function () {\r\n return 4 /*ENTRIES*/;\r\n };\r\n PathConstraintMixTimeline.prototype.setFrame = function (frame, time, mixRotate, mixX, mixY) {\r\n var frames = this.frames;\r\n frame <<= 2;\r\n frames[frame] = time;\r\n frames[frame + 1 /*ROTATE*/] = mixRotate;\r\n frames[frame + 2 /*X*/] = mixX;\r\n frames[frame + 3 /*Y*/] = mixY;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mixRotate = constraint.data.mixRotate;\r\n constraint.mixX = constraint.data.mixX;\r\n constraint.mixY = constraint.data.mixY;\r\n return;\r\n case MixBlend.first:\r\n constraint.mixRotate += (constraint.data.mixRotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (constraint.data.mixX - constraint.mixX) * alpha;\r\n constraint.mixY += (constraint.data.mixY - constraint.mixY) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate, x, y;\r\n var i = Timeline.search(frames, time, 4 /*ENTRIES*/);\r\n var curveType = this.curves[i >> 2];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n var t = (time - before) / (frames[i + 4 /*ENTRIES*/] - before);\r\n rotate += (frames[i + 4 /*ENTRIES*/ + 1 /*ROTATE*/] - rotate) * t;\r\n x += (frames[i + 4 /*ENTRIES*/ + 2 /*X*/] - x) * t;\r\n y += (frames[i + 4 /*ENTRIES*/ + 3 /*Y*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n break;\r\n default:\r\n rotate = this.getBezierValue(time, i, 1 /*ROTATE*/, curveType - 2 /*BEZIER*/);\r\n x = this.getBezierValue(time, i, 2 /*X*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 3 /*Y*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\r\n constraint.mixX = data.mixX + (x - data.mixX) * alpha;\r\n constraint.mixY = data.mixY + (y - data.mixY) * alpha;\r\n }\r\n else {\r\n constraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (x - constraint.mixX) * alpha;\r\n constraint.mixY += (y - constraint.mixY) * alpha;\r\n }\r\n };\r\n return PathConstraintMixTimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}.\r\n * @public\r\n * */\r\nvar SequenceTimeline = /** @class */ (function (_super) {\r\n __extends(SequenceTimeline, _super);\r\n function SequenceTimeline(frameCount, slotIndex, attachment) {\r\n var _this = _super.call(this, frameCount, [\r\n Property.sequence + \"|\" + slotIndex + \"|\" + attachment.sequence.id\r\n ]) || this;\r\n _this.slotIndex = slotIndex;\r\n _this.attachment = attachment;\r\n return _this;\r\n }\r\n SequenceTimeline.prototype.getFrameEntries = function () {\r\n return SequenceTimeline.ENTRIES;\r\n };\r\n SequenceTimeline.prototype.getSlotIndex = function () {\r\n return this.slotIndex;\r\n };\r\n SequenceTimeline.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the time, mode, index, and frame time for the specified frame.\r\n * @param frame Between 0 and frameCount, inclusive.\r\n * @param time Seconds between frames. */\r\n SequenceTimeline.prototype.setFrame = function (frame, time, mode, index, delay) {\r\n var frames = this.frames;\r\n frame *= SequenceTimeline.ENTRIES;\r\n frames[frame] = time;\r\n frames[frame + SequenceTimeline.MODE] = mode | (index << 4);\r\n frames[frame + SequenceTimeline.DELAY] = delay;\r\n };\r\n SequenceTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var slotAttachment = slot.attachment;\r\n var attachment = this.attachment;\r\n if (slotAttachment != attachment) {\r\n if (!(slotAttachment instanceof VertexAttachment)\r\n || slotAttachment.timelineAttachment != attachment)\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) { // Time is before first frame.\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n slot.sequenceIndex = -1;\r\n return;\r\n }\r\n var i = Timeline.search(frames, time, SequenceTimeline.ENTRIES);\r\n var before = frames[i];\r\n var modeAndIndex = frames[i + SequenceTimeline.MODE];\r\n var delay = frames[i + SequenceTimeline.DELAY];\r\n if (!this.attachment.sequence)\r\n return;\r\n var index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length;\r\n var mode = SequenceModeValues[modeAndIndex & 0xf];\r\n if (mode != SequenceMode.hold) {\r\n index += (((time - before) / delay + 0.00001) | 0);\r\n switch (mode) {\r\n case SequenceMode.once:\r\n index = Math.min(count - 1, index);\r\n break;\r\n case SequenceMode.loop:\r\n index %= count;\r\n break;\r\n case SequenceMode.pingpong: {\r\n var n = (count << 1) - 2;\r\n index = n == 0 ? 0 : index % n;\r\n if (index >= count)\r\n index = n - index;\r\n break;\r\n }\r\n case SequenceMode.onceReverse:\r\n index = Math.max(count - 1 - index, 0);\r\n break;\r\n case SequenceMode.loopReverse:\r\n index = count - 1 - (index % count);\r\n break;\r\n case SequenceMode.pingpongReverse: {\r\n var n = (count << 1) - 2;\r\n index = n == 0 ? 0 : (index + count - 1) % n;\r\n if (index >= count)\r\n index = n - index;\r\n }\r\n }\r\n }\r\n slot.sequenceIndex = index;\r\n };\r\n SequenceTimeline.ENTRIES = 3;\r\n SequenceTimeline.MODE = 1;\r\n SequenceTimeline.DELAY = 2;\r\n return SequenceTimeline;\r\n}(Timeline));\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\r\n * multiple animations on top of each other (layering).\r\n *\r\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide.\r\n * @public\r\n * */\r\nvar AnimationState = /** @class */ (function () {\r\n function AnimationState(data) {\r\n /** The list of tracks that currently have animations, which may contain null entries. */\r\n this.tracks = new Array();\r\n /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\r\n * or faster. Defaults to 1.\r\n *\r\n * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\r\n this.timeScale = 1;\r\n this.unkeyedState = 0;\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new StringSet();\r\n this.animationsChanged = false;\r\n this.trackEntryPool = new Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n AnimationState.emptyAnimation = function () {\r\n return AnimationState._emptyAnimation;\r\n };\r\n /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (!current)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next) {\r\n // When the next entry's delay is passed, change to the next entry, preserving leftover time.\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.clearNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom && this.updateMixingFrom(current, delta)) {\r\n // End mixing from entries once all have completed.\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from)\r\n from.mixingTo = null;\r\n while (from) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n /** Returns true when all mixing from entries are complete. */\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (!from)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n // Require mixTime > 0 to ensure the mixing from entry was applied at least once.\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\r\n * animation state can be applied to multiple skeletons to pose them identically.\r\n * @returns True if any animations were applied. */\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i_1 = 0, n_1 = tracks.length; i_1 < n_1; i_1++) {\r\n var current = tracks[i_1];\r\n if (!current || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i_1 == 0 ? MixBlend.first : current.mixBlend;\r\n // Apply mixing from entries first.\r\n var mix = current.alpha;\r\n if (current.mixingFrom)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && !current.next)\r\n mix = 0;\r\n // Apply current entry.\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime;\r\n var applyEvents = events;\r\n if (current.reverse) {\r\n applyTime = current.animation.duration - applyTime;\r\n applyEvents = null;\r\n }\r\n var timelines = current.animation.timelines;\r\n var timelineCount = timelines.length;\r\n if ((i_1 == 0 && mix == 1) || blend == MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n // Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\r\n // to sometimes stop rendering when using color correction, as their RGBA values become NaN.\r\n // (https://github.com/pixijs/pixi-spine/issues/302)\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n var timeline = timelines[ii];\r\n if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, true);\r\n else\r\n timeline.apply(skeleton, animationLast, applyTime, applyEvents, mix, blend, MixDirection.mixIn);\r\n }\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var shortestRotation = current.shortestRotation;\r\n var firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1;\r\n if (firstFrame)\r\n current.timelinesRotation.length = timelineCount << 1;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline_1 = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;\r\n if (!shortestRotation && timeline_1 instanceof RotateTimeline) {\r\n this.applyRotateTimeline(timeline_1, skeleton, applyTime, mix, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else if (timeline_1 instanceof AttachmentTimeline) {\r\n this.applyAttachmentTimeline(timeline_1, skeleton, applyTime, blend, true);\r\n }\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timeline_1.apply(skeleton, animationLast, applyTime, applyEvents, mix, timelineBlend, MixDirection.mixIn);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n // Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\r\n // subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\r\n // the time is before the first key).\r\n var setupState = this.unkeyedState + SETUP;\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = skeleton.slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.attachmentState == setupState) {\r\n var attachmentName = slot.data.attachmentName;\r\n slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n }\r\n }\r\n this.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\r\n mix = 1;\r\n if (blend == MixBlend.first)\r\n blend = MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var timelines = from.animation.timelines;\r\n var timelineCount = timelines.length;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime;\r\n var events = null;\r\n if (from.reverse)\r\n applyTime = from.animation.duration - applyTime;\r\n else if (mix < from.eventThreshold)\r\n events = this.events;\r\n if (blend == MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, MixDirection.mixOut);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var shortestRotation = from.shortestRotation;\r\n var firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1;\r\n if (firstFrame)\r\n from.timelinesRotation.length = timelineCount << 1;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = MixDirection.mixOut;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case SUBSEQUENT:\r\n if (!drawOrder && timeline instanceof DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case HOLD_SUBSEQUENT:\r\n timelineBlend = blend;\r\n alpha = alphaHold;\r\n break;\r\n case HOLD_FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (!shortestRotation && timeline instanceof RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);\r\n else if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments);\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(alpha, blend);\r\n if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)\r\n direction = MixDirection.mixIn;\r\n timeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyAttachmentTimeline = function (timeline, skeleton, time, blend, attachments) {\r\n var slot = skeleton.slots[timeline.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n if (time < timeline.frames[0]) { // Time is before first frame.\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\r\n }\r\n else\r\n this.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search1(timeline.frames, time)], attachments);\r\n // If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\r\n if (slot.attachmentState <= this.unkeyedState)\r\n slot.attachmentState = this.unkeyedState + SETUP;\r\n };\r\n AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {\r\n slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n if (attachments)\r\n slot.attachmentState = this.unkeyedState + CURRENT;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\r\n return;\r\n }\r\n var bone = skeleton.bones[timeline.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = timeline.frames;\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n r2 = bone.data.rotation + timeline.getCurveValue(time);\r\n }\r\n // Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops.\r\n lastDiff = timelinesRotation[i + 1]; // Difference between bones.\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n // Detect cross at 0 (not 180).\r\n if (MathUtils.signum(lastDiff) != MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n // A cross after a 360 rotation is a loop.\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360; // Store loops as part of lastTotal.\r\n if (dir != current)\r\n total += 360 * MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n bone.rotation = r1 + total * alpha;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n // Queue events before complete.\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_1);\r\n }\r\n // Queue complete if completed a loop iteration or the animation.\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n // Queue events after complete.\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_2);\r\n }\r\n };\r\n /** Removes all animations from all tracks, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n /** Removes all animations from the track, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (!current)\r\n return;\r\n this.queue.end(current);\r\n this.clearNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (!from)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n current.previous = null;\r\n if (from) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n // Store the interrupted mix percentage.\r\n if (from.mixingFrom && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\r\n }\r\n this.queue.start(current);\r\n };\r\n /** Sets an animation by name.\r\n *\r\n * See {@link #setAnimationWith()}. */\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n if (loop === void 0) { loop = false; }\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (!animation)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never\r\n * applied to a skeleton, it is replaced (not mixed from).\r\n * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\r\n * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (loop === void 0) { loop = false; }\r\n if (!animation)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current) {\r\n if (current.nextTrackLast == -1) {\r\n // Don't mix from an entry that was never applied.\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.clearNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.clearNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n /** Queues an animation by name.\r\n *\r\n * See {@link #addAnimationWith()}. */\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n if (loop === void 0) { loop = false; }\r\n if (delay === void 0) { delay = 0; }\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (!animation)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is\r\n * equivalent to calling {@link #setAnimationWith()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix\r\n * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the\r\n * previous entry is looping, its next loop completion is used instead of its duration.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (loop === void 0) { loop = false; }\r\n if (delay === void 0) { delay = 0; }\r\n if (!animation)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last) {\r\n while (last.next)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (!last) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n entry.previous = last;\r\n if (delay <= 0)\r\n delay += last.getTrackComplete() - entry.mixDuration;\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\r\n * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n *\r\n * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\r\n * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\r\n * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\r\n * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\r\n * 0 still mixes out over one frame.\r\n *\r\n * Mixing in is done by first setting an empty animation, then adding an animation using\r\n * {@link #addAnimation()} and on the returned track entry, set the\r\n * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\r\n * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\r\n * setup pose value if no lower tracks key the property to the value keyed in the new animation. */\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n if (mixDuration === void 0) { mixDuration = 0; }\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation(), false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\r\n * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling\r\n * {@link #setEmptyAnimation()}.\r\n *\r\n * See {@link #setEmptyAnimation()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or\r\n * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next\r\n * loop completion is used instead of its duration.\r\n * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (mixDuration === void 0) { mixDuration = 0; }\r\n if (delay === void 0) { delay = 0; }\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation(), false, delay);\r\n if (delay <= 0)\r\n entry.delay += entry.mixDuration - mixDuration;\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix\r\n * duration. */\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n if (mixDuration === void 0) { mixDuration = 0; }\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n /** @param last May be null. */\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.reset();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.reverse = false;\r\n entry.shortestRotation = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation);\r\n entry.interruptAlpha = 1;\r\n entry.totalAlpha = 0;\r\n entry.mixBlend = MixBlend.replace;\r\n return entry;\r\n };\r\n /** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */\r\n AnimationState.prototype.clearNext = function (entry) {\r\n var next = entry.next;\r\n while (next) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var entry = tracks[i];\r\n if (!entry)\r\n continue;\r\n while (entry.mixingFrom)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (!entry.mixingTo || entry.mixBlend != MixBlend.add)\r\n this.computeHold(entry);\r\n entry = entry.mixingTo;\r\n } while (entry);\r\n }\r\n };\r\n AnimationState.prototype.computeHold = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = entry.timelineMode;\r\n timelineMode.length = timelinesCount;\r\n var timelineHoldMix = entry.timelineHoldMix;\r\n timelineHoldMix.length = 0;\r\n var propertyIDs = this.propertyIDs;\r\n if (to && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++)\r\n timelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT;\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var timeline = timelines[i];\r\n var ids = timeline.getPropertyIds();\r\n if (!propertyIDs.addAll(ids))\r\n timelineMode[i] = SUBSEQUENT;\r\n else if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\r\n || timeline instanceof EventTimeline || !to.animation.hasTimeline(ids)) {\r\n timelineMode[i] = FIRST;\r\n }\r\n else {\r\n for (var next = to.mixingTo; next; next = next.mixingTo) {\r\n if (next.animation.hasTimeline(ids))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = HOLD_MIX;\r\n timelineHoldMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = HOLD_FIRST;\r\n }\r\n }\r\n };\r\n /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n /** Adds a listener to receive events for all track entries. */\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (!listener)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n /** Removes the listener added with {@link #addListener()}. */\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n /** Removes all listeners added with {@link #addListener()}. */\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\r\n * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\r\n * are not wanted because new animations are being set. */\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.prototype.setAnimationByName = function (trackIndex, animationName, loop) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n };\r\n AnimationState.prototype.addAnimationByName = function (trackIndex, animationName, loop, delay) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n };\r\n AnimationState.prototype.hasAnimation = function (animationName) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n };\r\n AnimationState.prototype.hasAnimationByName = function (animationName) {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n return this.hasAnimation(animationName);\r\n };\r\n AnimationState._emptyAnimation = new Animation(\"\", [], 0);\r\n AnimationState.deprecatedWarning1 = false;\r\n AnimationState.deprecatedWarning2 = false;\r\n AnimationState.deprecatedWarning3 = false;\r\n return AnimationState;\r\n}());\r\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\r\n *\r\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs.\r\n * @public\r\n * */\r\nvar TrackEntry = /** @class */ (function () {\r\n function TrackEntry() {\r\n /** The animation to apply for this track entry. */\r\n this.animation = null;\r\n this.previous = null;\r\n /** The animation queued to start after this animation, or null. `next` makes up a linked list. */\r\n this.next = null;\r\n /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no\r\n * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */\r\n this.mixingFrom = null;\r\n /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is\r\n * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */\r\n this.mixingTo = null;\r\n /** The listener for events generated by this track entry, or null.\r\n *\r\n * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation\r\n * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */\r\n this.listener = null;\r\n /** The index of the track where this track entry is either current or queued.\r\n *\r\n * See {@link AnimationState#getCurrent()}. */\r\n this.trackIndex = 0;\r\n /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\r\n * duration. */\r\n this.loop = false;\r\n /** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead\r\n * of being mixed out.\r\n *\r\n * When mixing between animations that key the same property, if a lower track also keys that property then the value will\r\n * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%\r\n * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation\r\n * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which\r\n * keys the property, only when a higher track also keys the property.\r\n *\r\n * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the\r\n * previous animation. */\r\n this.holdPrevious = false;\r\n this.reverse = false;\r\n this.shortestRotation = false;\r\n /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\r\n * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event\r\n * timelines are not applied while this animation is being mixed out. */\r\n this.eventThreshold = 0;\r\n /** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the\r\n * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to\r\n * 0, so attachment timelines are not applied while this animation is being mixed out. */\r\n this.attachmentThreshold = 0;\r\n /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\r\n * `drawOrderThreshold`, draw order timelines are applied while this animation is being mixed out. Defaults to 0,\r\n * so draw order timelines are not applied while this animation is being mixed out. */\r\n this.drawOrderThreshold = 0;\r\n /** Seconds when this animation starts, both initially and after looping. Defaults to 0.\r\n *\r\n * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same\r\n * value to prevent timeline keys before the start time from triggering. */\r\n this.animationStart = 0;\r\n /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will\r\n * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */\r\n this.animationEnd = 0;\r\n /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this\r\n * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and\r\n * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation\r\n * is applied. */\r\n this.animationLast = 0;\r\n this.nextAnimationLast = 0;\r\n /** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`\r\n * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from\r\n * the start of the previous animation to when this track entry will become the current track entry (ie when the previous\r\n * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).\r\n *\r\n * {@link #timeScale} affects the delay. */\r\n this.delay = 0;\r\n /** Current time in seconds this track entry has been the current track entry. The track time determines\r\n * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting\r\n * looping. */\r\n this.trackTime = 0;\r\n this.trackLast = 0;\r\n this.nextTrackLast = 0;\r\n /** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float\r\n * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time\r\n * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the\r\n * properties keyed by the animation are set to the setup pose and the track is cleared.\r\n *\r\n * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation\r\n * abruptly cease being applied. */\r\n this.trackEnd = 0;\r\n /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or\r\n * faster. Defaults to 1.\r\n *\r\n * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to\r\n * match the animation speed.\r\n *\r\n * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\r\n * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If\r\n * the time scale is not 1, the delay may need to be adjusted.\r\n *\r\n * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */\r\n this.timeScale = 0;\r\n /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults\r\n * to 1, which overwrites the skeleton's current pose with this animation.\r\n *\r\n * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to\r\n * use alpha on track 0 if the skeleton pose is from the last frame render. */\r\n this.alpha = 0;\r\n /** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be\r\n * slightly more than `mixDuration` when the mix is complete. */\r\n this.mixTime = 0;\r\n /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData\r\n * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).\r\n *\r\n * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the\r\n * properties it was animating.\r\n *\r\n * The `mixDuration` can be set manually rather than use the value from\r\n * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new\r\n * track entry only before {@link AnimationState#update(float)} is first called.\r\n *\r\n * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\r\n * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set\r\n * afterward. */\r\n this.mixDuration = 0;\r\n this.interruptAlpha = 0;\r\n this.totalAlpha = 0;\r\n /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\r\n * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\r\n * the values from the lower tracks.\r\n *\r\n * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first\r\n * called. */\r\n this.mixBlend = MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.previous = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\r\n * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\r\n * `animationStart` time. */\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n /** Returns true if at least one loop has been completed.\r\n *\r\n * See {@link AnimationStateListener#complete()}. */\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\r\n * long way around when using {@link #alpha} and starting animations on other tracks.\r\n *\r\n * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\r\n * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\r\n * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\r\n * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n TrackEntry.prototype.getTrackComplete = function () {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration != 0) {\r\n if (this.loop)\r\n return duration * (1 + ((this.trackTime / duration) | 0)); // Completion of next loop.\r\n if (this.trackTime < duration)\r\n return duration; // Before duration.\r\n }\r\n return this.trackTime; // Next update.\r\n };\r\n Object.defineProperty(TrackEntry.prototype, \"time\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TrackEntry.prototype, \"endTime\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n TrackEntry.prototype.loopsCount = function () {\r\n return Math.floor(this.trackTime / this.trackEnd);\r\n };\r\n TrackEntry.deprecatedWarning1 = false;\r\n TrackEntry.deprecatedWarning2 = false;\r\n return TrackEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.start)\r\n listener.start(entry);\r\n }\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.interrupt)\r\n listener.interrupt(entry);\r\n }\r\n break;\r\n case EventType.end:\r\n if (entry.listener && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.end)\r\n listener.end(entry);\r\n }\r\n // Fall through.\r\n case EventType.dispose:\r\n if (entry.listener && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.dispose)\r\n listener.dispose(entry);\r\n }\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.complete)\r\n listener.complete(entry);\r\n }\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.event)\r\n listener.event(entry, event_3);\r\n }\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n return EventQueue;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventType;\r\n(function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n})(EventType || (EventType = {}));\r\n/**\r\n * @public\r\n */\r\nvar AnimationStateAdapter = /** @class */ (function () {\r\n function AnimationStateAdapter() {\r\n }\r\n AnimationStateAdapter.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter;\r\n}());\r\n/** 1. A previously applied timeline has set this property.\r\n *\r\n * Result: Mix from the current pose to the timeline pose. */\r\nvar SUBSEQUENT = 0;\r\n/** 1. This is the first timeline to set this property.\r\n * 2. The next track entry applied after this one does not have a timeline to set this property.\r\n *\r\n * Result: Mix from the setup pose to the timeline pose. */\r\nvar FIRST = 1;\r\n/** 1) A previously applied timeline has set this property.
\r\n * 2) The next track entry to be applied does have a timeline to set this property.
\r\n * 3) The next track entry after that one does not have a timeline to set this property.
\r\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\r\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\r\nvar HOLD_SUBSEQUENT = 2;\r\n/** 1) This is the first timeline to set this property.
\r\n * 2) The next track entry to be applied does have a timeline to set this property.
\r\n * 3) The next track entry after that one does not have a timeline to set this property.
\r\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\r\n * that key the same property. A subsequent timeline will set this property using a mix. */\r\nvar HOLD_FIRST = 3;\r\n/** 1. This is the first timeline to set this property.\r\n * 2. The next track entry to be applied does have a timeline to set this property.\r\n * 3. The next track entry after that one does have a timeline to set this property.\r\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\r\n *\r\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\r\n * 2 track entries in a row have a timeline that sets the same property.\r\n *\r\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\r\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\r\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\r\n * place. */\r\nvar HOLD_MIX = 4;\r\nvar SETUP = 1;\r\nvar CURRENT = 2;\n\n/** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed.\r\n * @public\r\n * */\r\nvar AnimationStateData = /** @class */ (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n /** The mix duration to use when no mix duration has been defined between two animations. */\r\n this.defaultMix = 0;\r\n if (!skeletonData)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n /** Sets a mix duration by animation name.\r\n *\r\n * See {@link #setMixWith()}. */\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (!from)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (!to)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n /** Sets the mix duration when changing from the specified animation to the other.\r\n *\r\n * See {@link TrackEntry#mixDuration}. */\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (!from)\r\n throw new Error(\"from cannot be null.\");\r\n if (!to)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n /** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if\r\n * no mix duration has been set. */\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n return AnimationStateData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AtlasAttachmentLoader = /** @class */ (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n AtlasAttachmentLoader.prototype.loadSequence = function (name, basePath, sequence) {\r\n var regions = sequence.regions;\r\n for (var i = 0, n = regions.length; i < n; i++) {\r\n var path = sequence.getPath(basePath, i);\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (sequence: \" + name + \")\");\r\n regions[i] = region;\r\n regions[i].renderObject = regions[i];\r\n }\r\n };\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path, sequence) {\r\n var attachment = new RegionAttachment(name, path);\r\n if (sequence != null) {\r\n this.loadSequence(name, path, sequence);\r\n }\r\n else {\r\n var region = this.atlas.findRegion(path);\r\n if (!region)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n attachment.region = region;\r\n }\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path, sequence) {\r\n var attachment = new MeshAttachment(name, path);\r\n if (sequence != null) {\r\n this.loadSequence(name, path, sequence);\r\n }\r\n else {\r\n var region = this.atlas.findRegion(path);\r\n if (!region)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n attachment.region = region;\r\n }\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new BoundingBoxAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n}());\n\n/** Stores a bone's current pose.\r\n *\r\n * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a\r\n * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a\r\n * constraint or application code modifies the world transform after it was computed from the local transform.\r\n * @public\r\n * */\r\nvar Bone = /** @class */ (function () {\r\n /** @param parent May be null. */\r\n function Bone(data, skeleton, parent) {\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n this.matrix = new Matrix();\r\n /** The parent bone, or null if this is the root bone. */\r\n this.parent = null;\r\n /** The immediate children of this bone. */\r\n this.children = new Array();\r\n /** The local x translation. */\r\n this.x = 0;\r\n /** The local y translation. */\r\n this.y = 0;\r\n /** The local rotation in degrees, counter clockwise. */\r\n this.rotation = 0;\r\n /** The local scaleX. */\r\n this.scaleX = 0;\r\n /** The local scaleY. */\r\n this.scaleY = 0;\r\n /** The local shearX. */\r\n this.shearX = 0;\r\n /** The local shearY. */\r\n this.shearY = 0;\r\n /** The applied local x translation. */\r\n this.ax = 0;\r\n /** The applied local y translation. */\r\n this.ay = 0;\r\n /** The applied local rotation in degrees, counter clockwise. */\r\n this.arotation = 0;\r\n /** The applied local scaleX. */\r\n this.ascaleX = 0;\r\n /** The applied local scaleY. */\r\n this.ascaleY = 0;\r\n /** The applied local shearX. */\r\n this.ashearX = 0;\r\n /** The applied local shearY. */\r\n this.ashearY = 0;\r\n this.sorted = false;\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Object.defineProperty(Bone.prototype, \"worldX\", {\r\n get: function () {\r\n return this.matrix.tx;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bone.prototype, \"worldY\", {\r\n get: function () {\r\n return this.matrix.ty;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the\r\n * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */\r\n Bone.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local applied transform. */\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.ax, this.ay, this.arotation, this.ascaleX, this.ascaleY, this.ashearX, this.ashearY);\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local transform.\r\n *\r\n * See {@link #updateWorldTransformWith()}. */\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the\r\n * specified local transform. Child bones are not updated.\r\n *\r\n * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\r\n * Runtimes Guide. */\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n var sx = this.skeleton.scaleX;\r\n var sy = settings.yDown ? -this.skeleton.scaleY : this.skeleton.scaleY;\r\n if (!parent) { // Root bone.\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n m.tx = x * sx + skeleton.x;\r\n m.ty = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n switch (this.data.transformMode) {\r\n case TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pa /= sx;\r\n pc /= sy;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = MathUtils.cosDeg(rx) * scaleX;\r\n var lb = MathUtils.cosDeg(ry) * scaleY;\r\n var lc = MathUtils.sinDeg(rx) * scaleX;\r\n var ld = MathUtils.sinDeg(ry) * scaleY;\r\n m.a = pa * la - pb * lc;\r\n m.c = pa * lb - pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection: {\r\n var cos = MathUtils.cosDeg(rotation);\r\n var sin = MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / sx;\r\n var zc = (pc * cos + pd * sin) / sy;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(90 + shearY) * scaleY;\r\n m.a = za * la + zb * lc;\r\n m.c = za * lb + zb * ld;\r\n m.b = zc * la + zd * lc;\r\n m.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n m.a *= sx;\r\n m.c *= sx;\r\n m.b *= sy;\r\n m.d *= sy;\r\n };\r\n /** Sets this bone's local transform to the setup pose. */\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n };\r\n /** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n };\r\n /** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */\r\n Bone.prototype.getWorldScaleX = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.a * m.a + m.b * m.b);\r\n };\r\n /** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */\r\n Bone.prototype.getWorldScaleY = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.c * m.c + m.d * m.d);\r\n };\r\n /** Computes the applied transform values from the world transform.\r\n *\r\n * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so\r\n * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other\r\n * constraints).\r\n *\r\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after\r\n * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */\r\n Bone.prototype.updateAppliedTransform = function () {\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n if (!parent) {\r\n this.ax = m.tx - this.skeleton.x;\r\n this.ay = m.ty - this.skeleton.y;\r\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\r\n return;\r\n }\r\n var pm = parent.matrix;\r\n var pid = 1 / (pm.a * pm.d - pm.b * pm.c);\r\n var dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\r\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\r\n var ia = pid * pm.d;\r\n var id = pid * pm.a;\r\n var ib = pid * pm.c;\r\n var ic = pid * pm.b;\r\n var ra = ia * m.a - ib * m.b;\r\n var rb = ia * m.c - ib * m.d;\r\n var rc = id * m.b - ic * m.a;\r\n var rd = id * m.d - ic * m.c;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n };\r\n /** Transforms a point from world coordinates to the bone's local coordinates. */\r\n Bone.prototype.worldToLocal = function (world) {\r\n var m = this.matrix;\r\n var a = m.a, b = m.c, c = m.b, d = m.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n /** Transforms a point from the bone's local coordinates to world coordinates. */\r\n Bone.prototype.localToWorld = function (local) {\r\n var m = this.matrix;\r\n var x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n };\r\n /** Transforms a world rotation to a local rotation. */\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(mat.a * sin - mat.b * cos, mat.d * cos - mat.c * sin) * MathUtils.radDeg;\r\n };\r\n /** Transforms a local rotation to a world rotation. */\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n localRotation -= this.rotation - this.shearX;\r\n var sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(cos * mat.b + sin * mat.d, cos * mat.a + sin * mat.c) * MathUtils.radDeg;\r\n };\r\n /** Rotates the world transform the specified amount.\r\n *

\r\n * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and {@link #update()} will\r\n * need to be called on any child bones, recursively. */\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var mat = this.matrix;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n };\r\n return Bone;\r\n}());\n\n/** Stores the setup pose for a {@link Bone}.\r\n * @public\r\n * */\r\nvar BoneData = /** @class */ (function () {\r\n function BoneData(index, name, parent) {\r\n /** The index of the bone in {@link Skeleton#getBones()}. */\r\n this.index = 0;\r\n /** @returns May be null. */\r\n this.parent = null;\r\n /** The bone's length. */\r\n this.length = 0;\r\n /** The local x translation. */\r\n this.x = 0;\r\n /** The local y translation. */\r\n this.y = 0;\r\n /** The local rotation. */\r\n this.rotation = 0;\r\n /** The local scaleX. */\r\n this.scaleX = 1;\r\n /** The local scaleY. */\r\n this.scaleY = 1;\r\n /** The local shearX. */\r\n this.shearX = 0;\r\n /** The local shearX. */\r\n this.shearY = 0;\r\n /** The transform mode for how parent world transforms affect this bone. */\r\n this.transformMode = TransformMode.Normal;\r\n /** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this\r\n * bone.\r\n * @see Skin#bones */\r\n this.skinRequired = false;\r\n /** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually\r\n * rendered at runtime. */\r\n this.color = new Color();\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n}());\n\n/** The base class for all constraint datas.\r\n * @public\r\n * */\r\nvar ConstraintData = /** @class */ (function () {\r\n function ConstraintData(name, order, skinRequired) {\r\n this.name = name;\r\n this.order = order;\r\n this.skinRequired = skinRequired;\r\n }\r\n return ConstraintData;\r\n}());\n\n/** Stores the current pose values for an {@link Event}.\r\n *\r\n * See Timeline {@link Timeline#apply()},\r\n * AnimationStateListener {@link AnimationStateListener#event()}, and\r\n * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar Event = /** @class */ (function () {\r\n function Event(time, data) {\r\n this.intValue = 0;\r\n this.floatValue = 0;\r\n this.stringValue = null;\r\n this.time = 0;\r\n this.volume = 0;\r\n this.balance = 0;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n}());\n\n/** Stores the setup pose values for an {@link Event}.\r\n *\r\n * See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar EventData = /** @class */ (function () {\r\n function EventData(name) {\r\n this.intValue = 0;\r\n this.floatValue = 0;\r\n this.stringValue = null;\r\n this.audioPath = null;\r\n this.volume = 0;\r\n this.balance = 0;\r\n this.name = name;\r\n }\r\n return EventData;\r\n}());\n\n/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of\r\n * the last bone is as close to the target bone as possible.\r\n *\r\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar IkConstraint = /** @class */ (function () {\r\n function IkConstraint(data, skeleton) {\r\n /** Controls the bend direction of the IK bones, either 1 or -1. */\r\n this.bendDirection = 0;\r\n /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\r\n this.compress = false;\r\n /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\r\n * and the parent bone has local nonuniform scale, stretch is not applied. */\r\n this.stretch = false;\r\n /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\r\n this.mix = 1;\r\n /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\r\n this.softness = 0;\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.softness = data.softness;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var bone = skeleton.findBone(data.bones[i].name);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + data.bones[i].name);\r\n this.bones.push(bone);\r\n }\r\n var target = skeleton.findBone(data.target.name);\r\n if (!target)\r\n throw new Error(\"Couldn't find bone \" + data.target.name);\r\n this.target = target;\r\n }\r\n IkConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n IkConstraint.prototype.update = function () {\r\n if (this.mix == 0)\r\n return;\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.data.uniform, this.softness, this.mix);\r\n break;\r\n }\r\n };\r\n /** Applies 1 bone IK. The target is specified in the world coordinate system. */\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n var p = bone.parent.matrix;\r\n if (!p)\r\n throw new Error(\"IK bone must have parent.\");\r\n var pa = p.a, pb = p.c, pc = p.b, pd = p.d;\r\n var rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\r\n var skelX = bone.skeleton.scaleX;\r\n var skelY = settings.yDown ? -bone.skeleton.scaleY : bone.skeleton.scaleY;\r\n switch (bone.data.transformMode) {\r\n case TransformMode.OnlyTranslation:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n //TODO: possible bug in spine-ts runtime!\r\n if (settings.yDown) {\r\n ty = -ty;\r\n }\r\n break;\r\n case TransformMode.NoRotationOrReflection:\r\n var s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\r\n var sa = pa / skelX;\r\n var sc = pc / skelY;\r\n pb = -sc * s * skelX;\r\n pd = sa * s * skelY;\r\n rotationIK += Math.atan2(sc, sa) * MathUtils.radDeg;\r\n // Fall through\r\n default:\r\n var x = targetX - p.tx, y = targetY - p.ty;\r\n var d = pa * pd - pb * pc;\r\n tx = (x * pd - y * pb) / d - bone.ax;\r\n ty = (y * pa - x * pc) / d - bone.ay;\r\n }\r\n rotationIK += Math.atan2(ty, tx) * MathUtils.radDeg;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n switch (bone.data.transformMode) {\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n }\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n /** Applies 2 bone IK. The target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, uniform, softness, alpha) {\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX;\r\n var pmat = parent.matrix;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pmat.a, b = pmat.c, c = pmat.b, d = pmat.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u || stretch) {\r\n cy = 0;\r\n cwx = a * cx + pmat.tx;\r\n cwy = c * cx + pmat.ty;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + pmat.tx;\r\n cwy = c * cx + d * cy + pmat.ty;\r\n }\r\n var pp = parent.parent.matrix;\r\n if (!pp)\r\n throw new Error(\"IK parent must itself have a parent.\");\r\n a = pp.a;\r\n b = pp.c;\r\n c = pp.b;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = cwx - pp.tx, y = cwy - pp.ty;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\r\n if (l1 < 0.0001) {\r\n this.apply1(parent, targetX, targetY, false, stretch, false, alpha);\r\n child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n return;\r\n }\r\n x = targetX - pp.tx;\r\n y = targetY - pp.ty;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\r\n var dd = tx * tx + ty * ty;\r\n if (softness != 0) {\r\n softness *= psx * (csx + 1) * 0.5;\r\n var td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\r\n if (sd > 0) {\r\n var p = Math.min(1, sd / (softness * 2)) - 1;\r\n p = (sd - softness * (1 - p * p)) / td;\r\n tx -= p * tx;\r\n ty -= p * ty;\r\n dd = tx * tx + ty * ty;\r\n }\r\n }\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1) {\r\n cos = -1;\r\n a2 = Math.PI * bendDir;\r\n }\r\n else if (cos > 1) {\r\n cos = 1;\r\n a2 = 0;\r\n if (stretch) {\r\n a = (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n sx *= a;\r\n if (uniform)\r\n sy *= a;\r\n }\r\n }\r\n else\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) * 0.5;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) * 0.5) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180) //\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, sy, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180) //\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n}());\n\n/** Stores the setup pose for an {@link IkConstraint}.\r\n *

\r\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar IkConstraintData = /** @class */ (function (_super) {\r\n __extends(IkConstraintData, _super);\r\n function IkConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n /** The bones that are constrained by this IK constraint. */\r\n _this.bones = new Array();\r\n /** The bone that is the IK target. */\r\n _this._target = null;\r\n /** Controls the bend direction of the IK bones, either 1 or -1. */\r\n _this.bendDirection = 1;\r\n /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\r\n _this.compress = false;\r\n /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\r\n * and the parent bone has local nonuniform scale, stretch is not applied. */\r\n _this.stretch = false;\r\n /** When true, only a single bone is being constrained, and {@link #getCompress()} or {@link #getStretch()} is used, the bone\r\n * is scaled on both the X and Y axes. */\r\n _this.uniform = false;\r\n /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\r\n _this.mix = 1;\r\n /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\r\n _this.softness = 0;\r\n return _this;\r\n }\r\n Object.defineProperty(IkConstraintData.prototype, \"target\", {\r\n get: function () {\r\n if (!this._target)\r\n throw new Error(\"BoneData not set.\");\r\n else\r\n return this._target;\r\n },\r\n set: function (boneData) { this._target = boneData; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return IkConstraintData;\r\n}(ConstraintData));\n\n/** Stores the setup pose for a {@link PathConstraint}.\r\n *\r\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar PathConstraintData = /** @class */ (function (_super) {\r\n __extends(PathConstraintData, _super);\r\n function PathConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n /** The bones that will be modified by this path constraint. */\r\n _this.bones = new Array();\r\n /** The slot whose path attachment will be used to constrained the bones. */\r\n _this._target = null;\r\n /** The mode for positioning the first bone on the path. */\r\n _this.positionMode = PositionMode.Fixed;\r\n /** The mode for positioning the bones after the first bone on the path. */\r\n _this.spacingMode = SpacingMode.Fixed;\r\n /** The mode for adjusting the rotation of the bones. */\r\n _this.rotateMode = RotateMode.Chain;\r\n /** An offset added to the constrained bone rotation. */\r\n _this.offsetRotation = 0;\r\n /** The position along the path. */\r\n _this.position = 0;\r\n /** The spacing between bones. */\r\n _this.spacing = 0;\r\n _this.mixRotate = 0;\r\n _this.mixX = 0;\r\n _this.mixY = 0;\r\n return _this;\r\n }\r\n Object.defineProperty(PathConstraintData.prototype, \"target\", {\r\n get: function () {\r\n if (!this._target)\r\n throw new Error(\"SlotData not set.\");\r\n else\r\n return this._target;\r\n },\r\n set: function (slotData) { this._target = slotData; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return PathConstraintData;\r\n}(ConstraintData));\r\n/** Controls how bones after the first bone are positioned along the path.\r\n *\r\n * [Spacing mode](http://esotericsoftware.com/spine-path-constraints#Spacing-mode) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar SpacingMode;\r\n(function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n SpacingMode[SpacingMode[\"Proportional\"] = 3] = \"Proportional\";\r\n})(SpacingMode || (SpacingMode = {}));\n\n/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the\r\n * constrained bones so they follow a {@link PathAttachment}.\r\n *\r\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar PathConstraint = /** @class */ (function () {\r\n function PathConstraint(data, skeleton) {\r\n /** The position along the path. */\r\n this.position = 0;\r\n /** The spacing between bones. */\r\n this.spacing = 0;\r\n this.mixRotate = 0;\r\n this.mixX = 0;\r\n this.mixY = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++) {\r\n var bone = skeleton.findBone(data.bones[i].name);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + data.bones[i].name + \".\");\r\n this.bones.push(bone);\r\n }\r\n var target = skeleton.findSlot(data.target.name);\r\n if (!target)\r\n throw new Error(\"Couldn't find target bone \" + data.target.name);\r\n this.target = target;\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.mixRotate = data.mixRotate;\r\n this.mixX = data.mixX;\r\n this.mixY = data.mixY;\r\n }\r\n PathConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;\r\n if (mixRotate == 0 && mixX == 0 && mixY == 0)\r\n return;\r\n var data = this.data;\r\n var tangents = data.rotateMode == RotateMode.Tangent, scale = data.rotateMode == RotateMode.ChainScale;\r\n var bones = this.bones;\r\n var boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : [];\r\n var spacing = this.spacing;\r\n switch (data.spacingMode) {\r\n case SpacingMode.Percent:\r\n if (scale) {\r\n for (var i = 0, n = spacesCount - 1; i < n; i++) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon)\r\n lengths[i] = 0;\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n lengths[i] = Math.sqrt(x * x + y * y);\r\n }\r\n }\r\n }\r\n Utils.arrayFill(spaces, 1, spacesCount, spacing);\r\n break;\r\n case SpacingMode.Proportional:\r\n var sum = 0;\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = spacing;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_1;\r\n spaces[++i] = length_1;\r\n sum += length_1;\r\n }\r\n }\r\n if (sum > 0) {\r\n sum = spacesCount / sum * spacing;\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] *= sum;\r\n }\r\n break;\r\n default:\r\n var lengthSpacing = data.spacingMode == SpacingMode.Length;\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = spacing;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_2 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_2;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\r\n }\r\n }\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = data.rotateMode == RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone.matrix;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n mat.tx += (boneX - mat.tx) * mixX;\r\n mat.ty += (boneY - mat.ty) * mixY;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_3 = lengths[i];\r\n if (length_3 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * mixRotate + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (mixRotate > 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_4 = bone.data.length;\r\n boneX += (length_4 * (cos * a - sin * c) - dx) * mixRotate;\r\n boneY += (length_4 * (sin * a + cos * c) - dy) * mixRotate;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= mixRotate;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n bone.updateAppliedTransform();\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = this.world;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (this.data.positionMode == PositionMode.Percent)\r\n position *= pathLength_1;\r\n var multiplier_1;\r\n switch (this.data.spacingMode) {\r\n case SpacingMode.Percent:\r\n multiplier_1 = pathLength_1;\r\n break;\r\n case SpacingMode.Proportional:\r\n multiplier_1 = pathLength_1 / spacesCount;\r\n break;\r\n default:\r\n multiplier_1 = 1;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i] * multiplier_1;\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_5 = lengths[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n // Curve lengths.\r\n var curves = Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (this.data.positionMode == PositionMode.Percent)\r\n position *= pathLength;\r\n var multiplier;\r\n switch (this.data.spacingMode) {\r\n case SpacingMode.Percent:\r\n multiplier = pathLength;\r\n break;\r\n case SpacingMode.Proportional:\r\n multiplier = pathLength / spacesCount;\r\n break;\r\n default:\r\n multiplier = 1;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i] * multiplier;\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_6 = curves[curve];\r\n if (p > length_6)\r\n continue;\r\n if (curve == 0)\r\n p /= length_6;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_7 = segments[segment];\r\n if (p > length_7)\r\n continue;\r\n if (segment == 0)\r\n p /= length_7;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_7 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p)) {\r\n out[o] = x1;\r\n out[o + 1] = y1;\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n return;\r\n }\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents) {\r\n if (p < 0.001)\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n else\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n }\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n}());\n\n/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store\r\n * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared\r\n * across multiple skeletons.\r\n * @public\r\n * */\r\nvar Slot = /** @class */ (function () {\r\n function Slot(data, bone) {\r\n /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\r\n * color's alpha is not used. */\r\n this.darkColor = null;\r\n this.attachment = null;\r\n this.attachmentState = 0;\r\n /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the\r\n * {@link Sequence#getSetupIndex()}. */\r\n this.sequenceIndex = -1;\r\n /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a\r\n * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.\r\n *\r\n * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */\r\n this.deform = new Array();\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!bone)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.darkColor = !data.darkColor ? null : new Color();\r\n this.setToSetupPose();\r\n this.blendMode = this.data.blendMode;\r\n }\r\n /** The skeleton this slot belongs to. */\r\n Slot.prototype.getSkeleton = function () {\r\n return this.bone.skeleton;\r\n };\r\n /** The current attachment for the slot, or null if the slot has no attachment. */\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.\r\n * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the\r\n * specified attachment. */\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)\r\n || attachment.timelineAttachment != this.attachment.timelineAttachment) {\r\n this.deform.length = 0;\r\n }\r\n this.attachment = attachment;\r\n this.sequenceIndex = -1;\r\n };\r\n /** Sets this slot to the setup pose. */\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (!this.data.attachmentName)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n}());\n\n/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained\r\n * bones to match that of the target bone.\r\n *\r\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar TransformConstraint = /** @class */ (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.mixRotate = 0;\r\n this.mixX = 0;\r\n this.mixY = 0;\r\n this.mixScaleX = 0;\r\n this.mixScaleY = 0;\r\n this.mixShearY = 0;\r\n this.temp = new Vector2();\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mixRotate = data.mixRotate;\r\n this.mixX = data.mixX;\r\n this.mixY = data.mixY;\r\n this.mixScaleX = data.mixScaleX;\r\n this.mixScaleY = data.mixScaleY;\r\n this.mixShearY = data.mixShearY;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var bone = skeleton.findBone(data.bones[i].name);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + data.bones[i].name + \".\");\r\n this.bones.push(bone);\r\n }\r\n var target = skeleton.findBone(data.target.name);\r\n if (!target)\r\n throw new Error(\"Couldn't find target bone \" + data.target.name + \".\");\r\n this.target = target;\r\n }\r\n TransformConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.mixRotate == 0 && this.mixX == 0 && this.mixY == 0 && this.mixScaleX == 0 && this.mixScaleX == 0 && this.mixShearY == 0)\r\n return;\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var translate = mixX != 0 || mixY != 0;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n if (mixRotate != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= mixRotate;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n if (translate) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += (temp.x - mat.tx) * mixX;\r\n mat.ty += (temp.y - mat.ty) * mixY;\r\n }\r\n if (mixScaleX != 0) {\r\n var s = Math.sqrt(mat.a * mat.a + mat.b * mat.b);\r\n if (s != 0)\r\n s = (s + (Math.sqrt(ta * ta + tc * tc) - s + this.data.offsetScaleX) * mixScaleX) / s;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n if (mixScaleY != 0) {\r\n var s = Math.sqrt(mat.c * mat.c + mat.d * mat.d);\r\n if (s != 0)\r\n s = (s + (Math.sqrt(tb * tb + td * td) - s + this.data.offsetScaleY) * mixScaleY) / s;\r\n mat.c *= s;\r\n mat.d *= s;\r\n }\r\n if (mixShearY > 0) {\r\n var b = mat.c, d = mat.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(mat.b, mat.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r = by + (r + offsetShearY) * mixShearY;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n }\r\n bone.updateAppliedTransform();\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var translate = mixX != 0 || mixY != 0;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n if (mixRotate != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= mixRotate;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n if (translate) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += temp.x * mixX;\r\n mat.ty += temp.y * mixY;\r\n }\r\n if (mixScaleX != 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * mixScaleX + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n if (mixScaleY != 0) {\r\n var s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * mixScaleY + 1;\r\n mat.c *= s;\r\n mat.d *= s;\r\n }\r\n if (mixShearY > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n var b = mat.c, d = mat.d;\r\n r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * mixShearY;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n }\r\n bone.updateAppliedTransform();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var target = this.target;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var rotation = bone.arotation;\r\n if (mixRotate != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * mixRotate;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n x += (target.ax - x + this.data.offsetX) * mixX;\r\n y += (target.ay - y + this.data.offsetY) * mixY;\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (mixScaleX != 0 && scaleX != 0)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * mixScaleX) / scaleX;\r\n if (mixScaleY != 0 && scaleY != 0)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;\r\n var shearY = bone.ashearY;\r\n if (mixShearY != 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n shearY += r * mixShearY;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var target = this.target;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var rotation = bone.arotation + (target.arotation + this.data.offsetRotation) * mixRotate;\r\n var x = bone.ax + (target.ax + this.data.offsetX) * mixX;\r\n var y = bone.ay + (target.ay + this.data.offsetY) * mixY;\r\n var scaleX = bone.ascaleX * (((target.ascaleX - 1 + this.data.offsetScaleX) * mixScaleX) + 1);\r\n var scaleY = bone.ascaleY * (((target.ascaleY - 1 + this.data.offsetScaleY) * mixScaleY) + 1);\r\n var shearY = bone.ashearY + (target.ashearY + this.data.offsetShearY) * mixShearY;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n return TransformConstraint;\r\n}());\n\n/** Stores the current pose for a skeleton.\r\n *\r\n * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide.\r\n * @public\r\n * */\r\nvar Skeleton = /** @class */ (function () {\r\n function Skeleton(data) {\r\n /** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */\r\n this._updateCache = new Array();\r\n /** The skeleton's current skin. May be null. */\r\n this.skin = null;\r\n /** Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale\r\n * inheritance. */\r\n this.scaleX = 1;\r\n /** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale\r\n * inheritance. */\r\n this.scaleY = 1;\r\n /** Sets the skeleton X position, which is added to the root bone worldX position. */\r\n this.x = 0;\r\n /** Sets the skeleton Y position, which is added to the root bone worldY position. */\r\n this.y = 0;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (!boneData.parent)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n /** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones,\r\n * constraints, or weighted path attachments are added or removed. */\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n bone.sorted = bone.data.skinRequired;\r\n bone.active = !bone.sorted;\r\n }\r\n if (this.skin) {\r\n var skinBones = this.skin.bones;\r\n for (var i = 0, n = this.skin.bones.length; i < n; i++) {\r\n var bone = this.bones[skinBones[i].index];\r\n do {\r\n bone.sorted = false;\r\n bone.active = true;\r\n bone = bone.parent;\r\n } while (bone);\r\n }\r\n }\r\n // IK first, lowest hierarchy depth first.\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length == 1) {\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n }\r\n else {\r\n var child = constrained[constrained.length - 1];\r\n this.sortBone(child);\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n child.sorted = true;\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n this.sortBone(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (!pathBones)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n for (var i = 0, n = pathBones.length; i < n;) {\r\n var nn = pathBones[i++];\r\n nn += i;\r\n while (i < nn)\r\n this.sortBone(bones[pathBones[i++]]);\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (!bone)\r\n return;\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.active)\r\n continue;\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n /** Updates the world transform for each bone and applies all constraints.\r\n *\r\n * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\r\n * Runtimes Guide. */\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n Skeleton.prototype.updateWorldTransformWith = function (parent) {\r\n // Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection.\r\n var rootBone = this.getRootBone();\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n rootBone.matrix.tx = pa * this.x + pb * this.y + parent.worldX;\r\n rootBone.matrix.ty = pc * this.x + pd * this.y + parent.worldY;\r\n var rotationY = rootBone.rotation + 90 + rootBone.shearY;\r\n var la = MathUtils.cosDeg(rootBone.rotation + rootBone.shearX) * rootBone.scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * rootBone.scaleY;\r\n var lc = MathUtils.sinDeg(rootBone.rotation + rootBone.shearX) * rootBone.scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * rootBone.scaleY;\r\n var sx = this.scaleX;\r\n var sy = settings.yDown ? -this.scaleY : this.scaleY;\r\n rootBone.matrix.a = (pa * la + pb * lc) * sx;\r\n rootBone.matrix.c = (pa * lb + pb * ld) * sx;\r\n rootBone.matrix.b = (pc * la + pd * lc) * sy;\r\n rootBone.matrix.d = (pc * lb + pd * ld) * sy;\r\n // Update everything except root bone.\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++) {\r\n var updatable = updateCache[i];\r\n if (updatable != rootBone)\r\n updatable.update();\r\n }\r\n };\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n /** Sets the bones and constraints to their setup pose values. */\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.mixRotate = data.mixRotate;\r\n constraint.mixX = data.mixX;\r\n constraint.mixY = data.mixY;\r\n constraint.mixScaleX = data.mixScaleX;\r\n constraint.mixScaleY = data.mixScaleY;\r\n constraint.mixShearY = data.mixShearY;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.mixRotate = data.mixRotate;\r\n constraint.mixX = data.mixX;\r\n constraint.mixY = data.mixY;\r\n }\r\n };\r\n /** Sets the slots and draw order to their setup pose values. */\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n /** @returns May return null. */\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n /** @returns May be null. */\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** @returns -1 if the bone was not found. */\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\r\n * repeatedly.\r\n * @returns May be null. */\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** @returns -1 if the bone was not found. */\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Sets a skin by name.\r\n *\r\n * See {@link #setSkin()}. */\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (!skin)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the\r\n * skin is changed, {@link #updateCache()} is called.\r\n *\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n *\r\n * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling\r\n * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the\r\n * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.\r\n * @param newSkin May be null. */\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin == this.skin)\r\n return;\r\n if (newSkin) {\r\n if (this.skin)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n this.updateCache();\r\n };\r\n /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment\r\n * name.\r\n *\r\n * See {@link #getAttachment()}.\r\n * @returns May be null. */\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n var slot = this.data.findSlot(slotName);\r\n if (!slot)\r\n throw new Error(\"Can't find slot with name \" + slotName);\r\n return this.getAttachment(slot.index, attachmentName);\r\n };\r\n /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and\r\n * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.\r\n *\r\n * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\r\n * @returns May be null. */\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (!attachmentName)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n /** A convenience method to set an attachment by finding the slot with {@link #findSlot()}, finding the attachment with\r\n * {@link #getAttachment()}, then setting the slot's {@link Slot#attachment}.\r\n * @param attachmentName May be null to clear the slot's attachment. */\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (!attachment)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\r\n * than to call it repeatedly.\r\n * @return May be null. */\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\r\n * this method than to call it repeatedly.\r\n * @return May be null. */\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\r\n * than to call it repeatedly.\r\n * @return May be null. */\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`.\r\n * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */\r\n Skeleton.prototype.getBoundsRect = function () {\r\n var offset = new Vector2();\r\n var size = new Vector2();\r\n this.getBounds(offset, size);\r\n return { x: offset.x, y: offset.y, width: size.x, height: size.y };\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size An output value, the width and height of the AABB.\r\n * @param temp Working memory to temporarily store attachments' computed world vertices. */\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (temp === void 0) { temp = new Array(2); }\r\n if (!offset)\r\n throw new Error(\"offset cannot be null.\");\r\n if (!size)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Object.defineProperty(Skeleton.prototype, \"flipX\", {\r\n get: function () {\r\n return this.scaleX == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleX = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Skeleton.prototype, \"flipY\", {\r\n get: function () {\r\n return this.scaleY == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleY = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Skeleton.deprecatedWarning1 = false;\r\n return Skeleton;\r\n}());\n\n/** Stores the setup pose and all of the stateless data for a skeleton.\r\n *\r\n * See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes\r\n * Guide.\r\n * @public\r\n * */\r\nvar SkeletonData = /** @class */ (function () {\r\n function SkeletonData() {\r\n /** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */\r\n this.name = null;\r\n /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\r\n this.bones = new Array(); // Ordered parents first.\r\n /** The skeleton's slots. */\r\n this.slots = new Array(); // Setup pose draw order.\r\n this.skins = new Array();\r\n /** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.\r\n *\r\n * See {@link Skeleton#getAttachmentByName()}.\r\n * May be null. */\r\n this.defaultSkin = null;\r\n /** The skeleton's events. */\r\n this.events = new Array();\r\n /** The skeleton's animations. */\r\n this.animations = new Array();\r\n /** The skeleton's IK constraints. */\r\n this.ikConstraints = new Array();\r\n /** The skeleton's transform constraints. */\r\n this.transformConstraints = new Array();\r\n /** The skeleton's path constraints. */\r\n this.pathConstraints = new Array();\r\n /** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.x = 0;\r\n /** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.y = 0;\r\n /** The width of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.width = 0;\r\n /** The height of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.height = 0;\r\n /** The Spine version used to export the skeleton data, or null. */\r\n this.version = null;\r\n /** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */\r\n this.hash = null;\r\n // Nonessential\r\n /** The dopesheet FPS in Spine. Available only when nonessential data was exported. */\r\n this.fps = 0;\r\n /** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */\r\n this.imagesPath = null;\r\n /** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */\r\n this.audioPath = null;\r\n }\r\n /** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** removed from spine-ts runtime **/\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** removed from spine-ts runtime **/\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (!skinName)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n /** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (!eventDataName)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.name == eventDataName)\r\n return event_1;\r\n }\r\n return null;\r\n };\r\n /** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to\r\n * call it multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (!animationName)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\r\n * than to call it multiple times.\r\n * @return May be null. */\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\r\n * this method than to call it multiple times.\r\n * @return May be null. */\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\r\n * than to call it multiple times.\r\n * @return May be null. */\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** removed from spine-ts runtime **/ SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n}());\n\n/** Stores the setup pose for a {@link Slot}.\r\n * @public\r\n * */\r\nvar SlotData = /** @class */ (function () {\r\n function SlotData(index, name, boneData) {\r\n /** The index of the slot in {@link Skeleton#getSlots()}. */\r\n this.index = 0;\r\n /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\r\n * color tinting. */\r\n this.color = new Color(1, 1, 1, 1);\r\n /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\r\n * color's alpha is not used. */\r\n this.darkColor = null;\r\n /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */\r\n this.attachmentName = null;\r\n /** The blend mode for drawing the slot's attachment. */\r\n this.blendMode = BLEND_MODES.NORMAL;\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n if (!boneData)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n}());\n\n/** Stores the setup pose for a {@link TransformConstraint}.\r\n *\r\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar TransformConstraintData = /** @class */ (function (_super) {\r\n __extends(TransformConstraintData, _super);\r\n function TransformConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n /** The bones that will be modified by this transform constraint. */\r\n _this.bones = new Array();\r\n /** The target bone whose world transform will be copied to the constrained bones. */\r\n _this._target = null;\r\n _this.mixRotate = 0;\r\n _this.mixX = 0;\r\n _this.mixY = 0;\r\n _this.mixScaleX = 0;\r\n _this.mixScaleY = 0;\r\n _this.mixShearY = 0;\r\n /** An offset added to the constrained bone rotation. */\r\n _this.offsetRotation = 0;\r\n /** An offset added to the constrained bone X translation. */\r\n _this.offsetX = 0;\r\n /** An offset added to the constrained bone Y translation. */\r\n _this.offsetY = 0;\r\n /** An offset added to the constrained bone scaleX. */\r\n _this.offsetScaleX = 0;\r\n /** An offset added to the constrained bone scaleY. */\r\n _this.offsetScaleY = 0;\r\n /** An offset added to the constrained bone shearY. */\r\n _this.offsetShearY = 0;\r\n _this.relative = false;\r\n _this.local = false;\r\n return _this;\r\n }\r\n Object.defineProperty(TransformConstraintData.prototype, \"target\", {\r\n get: function () {\r\n if (!this._target)\r\n throw new Error(\"BoneData not set.\");\r\n else\r\n return this._target;\r\n },\r\n set: function (boneData) { this._target = boneData; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return TransformConstraintData;\r\n}(ConstraintData));\n\n/** Stores an entry in the skin consisting of the slot index, name, and attachment\r\n * @public\r\n * **/\r\nvar SkinEntry = /** @class */ (function () {\r\n function SkinEntry(slotIndex, name, attachment) {\r\n this.slotIndex = slotIndex;\r\n this.name = name;\r\n this.attachment = attachment;\r\n }\r\n return SkinEntry;\r\n}());\r\n/** Stores attachments by slot index and attachment name.\r\n *\r\n * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and\r\n * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\r\n * @public\r\n * */\r\nvar Skin = /** @class */ (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n this.bones = Array();\r\n this.constraints = new Array();\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n /** Adds an attachment to the skin for the specified slot index and name. */\r\n Skin.prototype.setAttachment = function (slotIndex, name, attachment) {\r\n if (!attachment)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n /** Adds all attachments, bones, and constraints from the specified skin to this skin. */\r\n Skin.prototype.addSkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.bones.length; ii++) {\r\n if (this.bones[ii] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.constraints.length; ii++) {\r\n if (this.constraints[ii] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n };\r\n /** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not\r\n * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */\r\n Skin.prototype.copySkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.bones.length; ii++) {\r\n if (this.bones[ii] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.constraints.length; ii++) {\r\n if (this.constraints[ii] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n if (!attachment.attachment)\r\n continue;\r\n if (attachment.attachment instanceof MeshAttachment) {\r\n attachment.attachment = attachment.attachment.newLinkedMesh();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n else {\r\n attachment.attachment = attachment.attachment.copy();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n }\r\n };\r\n /** Returns the attachment for the specified slot index and name, or null. */\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n /** Removes the attachment in the skin for the specified slot index and name, if any. */\r\n Skin.prototype.removeAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n if (dictionary)\r\n delete dictionary[name];\r\n };\r\n /** Returns all attachments in this skin. */\r\n Skin.prototype.getAttachments = function () {\r\n var entries = new Array();\r\n for (var i = 0; i < this.attachments.length; i++) {\r\n var slotAttachments = this.attachments[i];\r\n if (slotAttachments) {\r\n for (var name_1 in slotAttachments) {\r\n var attachment = slotAttachments[name_1];\r\n if (attachment)\r\n entries.push(new SkinEntry(i, name_1, attachment));\r\n }\r\n }\r\n }\r\n return entries;\r\n };\r\n /** Returns all attachments in this skin for the specified slot index. */\r\n Skin.prototype.getAttachmentsForSlot = function (slotIndex, attachments) {\r\n var slotAttachments = this.attachments[slotIndex];\r\n if (slotAttachments) {\r\n for (var name_2 in slotAttachments) {\r\n var attachment = slotAttachments[name_2];\r\n if (attachment)\r\n attachments.push(new SkinEntry(slotIndex, name_2, attachment));\r\n }\r\n }\r\n };\r\n /** Clears all attachments, bones, and constraints. */\r\n Skin.prototype.clear = function () {\r\n this.attachments.length = 0;\r\n this.bones.length = 0;\r\n this.constraints.length = 0;\r\n };\r\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n}());\n\n/** Loads skeleton data in the Spine binary format.\r\n *\r\n * See [Spine binary format](http://esotericsoftware.com/spine-binary-format) and\r\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\r\n * Runtimes Guide.\r\n * @public\r\n * */\r\nvar SkeletonBinary = /** @class */ (function () {\r\n function SkeletonBinary(attachmentLoader) {\r\n this.ver40 = false;\r\n /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\r\n * runtime than were used in Spine.\r\n *\r\n * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonBinary.prototype.readSkeletonData = function (binary) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n skeletonData.name = \"\"; // BOZO\r\n var input = new BinaryInput(binary);\r\n var lowHash = input.readInt32();\r\n var highHash = input.readInt32();\r\n skeletonData.hash = highHash == 0 && lowHash == 0 ? null : highHash.toString(16) + lowHash.toString(16);\r\n skeletonData.version = input.readString();\r\n var verShort = skeletonData.version.substr(0, 3);\r\n if (verShort !== '4.0' && verShort !== '4.1') {\r\n var error = \"Spine 4.1 loader cant load version \" + skeletonData.version + \". Please configure your pixi-spine bundle\";\r\n console.error(error);\r\n }\r\n this.ver40 = verShort === '4.0';\r\n skeletonData.x = input.readFloat();\r\n skeletonData.y = input.readFloat();\r\n skeletonData.width = input.readFloat();\r\n skeletonData.height = input.readFloat();\r\n var nonessential = input.readBoolean();\r\n if (nonessential) {\r\n skeletonData.fps = input.readFloat();\r\n skeletonData.imagesPath = input.readString();\r\n skeletonData.audioPath = input.readString();\r\n }\r\n var n = 0;\r\n // Strings.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var str = input.readString();\r\n if (!str)\r\n throw new Error(\"String in string table must not be null.\");\r\n input.strings.push(str);\r\n }\r\n // Bones.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var name_1 = input.readString();\r\n if (!name_1)\r\n throw new Error(\"Bone name must not be null.\");\r\n var parent_1 = i == 0 ? null : skeletonData.bones[input.readInt(true)];\r\n var data = new BoneData(i, name_1, parent_1);\r\n data.rotation = input.readFloat();\r\n data.x = input.readFloat() * scale;\r\n data.y = input.readFloat() * scale;\r\n data.scaleX = input.readFloat();\r\n data.scaleY = input.readFloat();\r\n data.shearX = input.readFloat();\r\n data.shearY = input.readFloat();\r\n data.length = input.readFloat() * scale;\r\n data.transformMode = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n if (nonessential)\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n skeletonData.bones.push(data);\r\n }\r\n // Slots.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var slotName = input.readString();\r\n if (!slotName)\r\n throw new Error(\"Slot name must not be null.\");\r\n var boneData = skeletonData.bones[input.readInt(true)];\r\n var data = new SlotData(i, slotName, boneData);\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n var darkColor = input.readInt32();\r\n if (darkColor != -1)\r\n Color.rgb888ToColor(data.darkColor = new Color(), darkColor);\r\n data.attachmentName = input.readStringRef();\r\n data.blendMode = input.readInt(true);\r\n skeletonData.slots.push(data);\r\n }\r\n // IK constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var name_2 = input.readString();\r\n if (!name_2)\r\n throw new Error(\"IK constraint data name must not be null.\");\r\n var data = new IkConstraintData(name_2);\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.mix = input.readFloat();\r\n data.softness = input.readFloat() * scale;\r\n data.bendDirection = input.readByte();\r\n data.compress = input.readBoolean();\r\n data.stretch = input.readBoolean();\r\n data.uniform = input.readBoolean();\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n // Transform constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var name_3 = input.readString();\r\n if (!name_3)\r\n throw new Error(\"Transform constraint data name must not be null.\");\r\n var data = new TransformConstraintData(name_3);\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.local = input.readBoolean();\r\n data.relative = input.readBoolean();\r\n data.offsetRotation = input.readFloat();\r\n data.offsetX = input.readFloat() * scale;\r\n data.offsetY = input.readFloat() * scale;\r\n data.offsetScaleX = input.readFloat();\r\n data.offsetScaleY = input.readFloat();\r\n data.offsetShearY = input.readFloat();\r\n data.mixRotate = input.readFloat();\r\n data.mixX = input.readFloat();\r\n data.mixY = input.readFloat();\r\n data.mixScaleX = input.readFloat();\r\n data.mixScaleY = input.readFloat();\r\n data.mixShearY = input.readFloat();\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n // Path constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var name_4 = input.readString();\r\n if (!name_4)\r\n throw new Error(\"Path constraint data name must not be null.\");\r\n var data = new PathConstraintData(name_4);\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.slots[input.readInt(true)];\r\n data.positionMode = input.readInt(true);\r\n data.spacingMode = input.readInt(true);\r\n data.rotateMode = input.readInt(true);\r\n data.offsetRotation = input.readFloat();\r\n data.position = input.readFloat();\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = input.readFloat();\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.mixRotate = input.readFloat();\r\n data.mixX = input.readFloat();\r\n data.mixY = input.readFloat();\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n // Default skin.\r\n var defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\r\n if (defaultSkin) {\r\n skeletonData.defaultSkin = defaultSkin;\r\n skeletonData.skins.push(defaultSkin);\r\n }\r\n // Skins.\r\n {\r\n var i = skeletonData.skins.length;\r\n Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\r\n for (; i < n; i++) {\r\n var skin = this.readSkin(input, skeletonData, false, nonessential);\r\n if (!skin)\r\n throw new Error(\"readSkin() should not have returned null.\");\r\n skeletonData.skins[i] = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n n = this.linkedMeshes.length;\r\n for (var i = 0; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (!skin)\r\n throw new Error(\"Not skin found for linked mesh.\");\r\n if (!linkedMesh.parent)\r\n throw new Error(\"Linked mesh parent must not be null\");\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (!parent_2)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var eventName = input.readStringRef();\r\n if (!eventName)\r\n throw new Error;\r\n var data = new EventData(eventName);\r\n data.intValue = input.readInt(false);\r\n data.floatValue = input.readFloat();\r\n data.stringValue = input.readString();\r\n data.audioPath = input.readString();\r\n if (data.audioPath) {\r\n data.volume = input.readFloat();\r\n data.balance = input.readFloat();\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n // Animations.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var animationName = input.readString();\r\n if (!animationName)\r\n throw new Error(\"Animatio name must not be null.\");\r\n skeletonData.animations.push(this.readAnimation(input, animationName, skeletonData));\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonBinary.prototype.readSkin = function (input, skeletonData, defaultSkin, nonessential) {\r\n var skin = null;\r\n var slotCount = 0;\r\n if (defaultSkin) {\r\n slotCount = input.readInt(true);\r\n if (slotCount == 0)\r\n return null;\r\n skin = new Skin(\"default\");\r\n }\r\n else {\r\n var skinName = input.readStringRef();\r\n if (!skinName)\r\n throw new Error(\"Skin name must not be null.\");\r\n skin = new Skin(skinName);\r\n skin.bones.length = input.readInt(true);\r\n for (var i = 0, n = skin.bones.length; i < n; i++)\r\n skin.bones[i] = skeletonData.bones[input.readInt(true)];\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\r\n slotCount = input.readInt(true);\r\n }\r\n for (var i = 0; i < slotCount; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var name_5 = input.readStringRef();\r\n if (!name_5)\r\n throw new Error(\"Attachment name must not be null\");\r\n var attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name_5, nonessential);\r\n if (attachment)\r\n skin.setAttachment(slotIndex, name_5, attachment);\r\n }\r\n }\r\n return skin;\r\n };\r\n SkeletonBinary.prototype.readAttachment = function (input, skeletonData, skin, slotIndex, attachmentName, nonessential) {\r\n var scale = this.scale;\r\n var name = input.readStringRef();\r\n if (!name)\r\n name = attachmentName;\r\n switch (input.readByte()) {\r\n case AttachmentType.Region: {\r\n var path = input.readStringRef();\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var scaleX = input.readFloat();\r\n var scaleY = input.readFloat();\r\n var width = input.readFloat();\r\n var height = input.readFloat();\r\n var color = input.readInt32();\r\n var sequence = this.readSequence(input);\r\n if (!path)\r\n path = name;\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\r\n if (!region)\r\n return null;\r\n region.path = path;\r\n region.x = x * scale;\r\n region.y = y * scale;\r\n region.scaleX = scaleX;\r\n region.scaleY = scaleY;\r\n region.rotation = rotation;\r\n region.width = width * scale;\r\n region.height = height * scale;\r\n Color.rgba8888ToColor(region.color, color);\r\n region.sequence = sequence;\r\n if (sequence == null)\r\n region.updateRegion();\r\n return region;\r\n }\r\n case AttachmentType.BoundingBox: {\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (!box)\r\n return null;\r\n box.worldVerticesLength = vertexCount << 1;\r\n box.vertices = vertices.vertices;\r\n box.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(box.color, color);\r\n return box;\r\n }\r\n case AttachmentType.Mesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var vertexCount = input.readInt(true);\r\n var uvs = this.readFloatArray(input, vertexCount << 1, 1);\r\n var triangles = this.readShortArray(input);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var hullLength = input.readInt(true);\r\n var sequence = this.readSequence(input);\r\n var edges = [];\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n edges = this.readShortArray(input);\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (!path)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\r\n if (!mesh)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n mesh.bones = vertices.bones;\r\n mesh.vertices = vertices.vertices;\r\n mesh.worldVerticesLength = vertexCount << 1;\r\n mesh.triangles = triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // if (sequence == null) mesh.updateRegion();\r\n mesh.hullLength = hullLength << 1;\r\n mesh.sequence = sequence;\r\n if (nonessential) {\r\n mesh.edges = edges;\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n return mesh;\r\n }\r\n case AttachmentType.LinkedMesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var skinName = input.readStringRef();\r\n var parent_3 = input.readStringRef();\r\n var inheritTimelines = input.readBoolean();\r\n var sequence = this.readSequence(input);\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (!path)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\r\n if (!mesh)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n mesh.sequence = sequence;\r\n if (nonessential) {\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n this.linkedMeshes.push(new LinkedMesh$1(mesh, skinName, slotIndex, parent_3, inheritTimelines));\r\n return mesh;\r\n }\r\n case AttachmentType.Path: {\r\n var closed_1 = input.readBoolean();\r\n var constantSpeed = input.readBoolean();\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0, n = lengths.length; i < n; i++)\r\n lengths[i] = input.readFloat() * scale;\r\n var color = nonessential ? input.readInt32() : 0;\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (!path)\r\n return null;\r\n path.closed = closed_1;\r\n path.constantSpeed = constantSpeed;\r\n path.worldVerticesLength = vertexCount << 1;\r\n path.vertices = vertices.vertices;\r\n path.bones = vertices.bones;\r\n path.lengths = lengths;\r\n if (nonessential)\r\n Color.rgba8888ToColor(path.color, color);\r\n return path;\r\n }\r\n case AttachmentType.Point: {\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var color = nonessential ? input.readInt32() : 0;\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (!point)\r\n return null;\r\n point.x = x * scale;\r\n point.y = y * scale;\r\n point.rotation = rotation;\r\n if (nonessential)\r\n Color.rgba8888ToColor(point.color, color);\r\n return point;\r\n }\r\n case AttachmentType.Clipping: {\r\n var endSlotIndex = input.readInt(true);\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (!clip)\r\n return null;\r\n clip.endSlot = skeletonData.slots[endSlotIndex];\r\n clip.worldVerticesLength = vertexCount << 1;\r\n clip.vertices = vertices.vertices;\r\n clip.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(clip.color, color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonBinary.prototype.readSequence = function (input) {\r\n if (this.ver40 || !input.readBoolean())\r\n return null;\r\n var sequence = new Sequence(input.readInt(true));\r\n sequence.start = input.readInt(true);\r\n sequence.digits = input.readInt(true);\r\n sequence.setupIndex = input.readInt(true);\r\n return sequence;\r\n };\r\n SkeletonBinary.prototype.readDeformTimelineType = function (input) {\r\n if (this.ver40)\r\n return ATTACHMENT_DEFORM;\r\n return input.readByte();\r\n };\r\n SkeletonBinary.prototype.readVertices = function (input, vertexCount) {\r\n var scale = this.scale;\r\n var verticesLength = vertexCount << 1;\r\n var vertices = new Vertices();\r\n if (!input.readBoolean()) {\r\n vertices.vertices = this.readFloatArray(input, verticesLength, scale);\r\n return vertices;\r\n }\r\n var weights = new Array();\r\n var bonesArray = new Array();\r\n for (var i = 0; i < vertexCount; i++) {\r\n var boneCount = input.readInt(true);\r\n bonesArray.push(boneCount);\r\n for (var ii = 0; ii < boneCount; ii++) {\r\n bonesArray.push(input.readInt(true));\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat());\r\n }\r\n }\r\n vertices.vertices = Utils.toFloatArray(weights);\r\n vertices.bones = bonesArray;\r\n return vertices;\r\n };\r\n SkeletonBinary.prototype.readFloatArray = function (input, n, scale) {\r\n var array = new Array(n);\r\n if (scale == 1) {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat();\r\n }\r\n else {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat() * scale;\r\n }\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readShortArray = function (input) {\r\n var n = input.readInt(true);\r\n var array = new Array(n);\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readShort();\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readAnimation = function (input, name, skeletonData) {\r\n input.readInt(true); // Number of timelines.\r\n var timelines = new Array();\r\n var scale = this.scale;\r\n // Slot timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n var frameLast = frameCount - 1;\r\n switch (timelineType) {\r\n case SLOT_ATTACHMENT: {\r\n var timeline = new AttachmentTimeline(frameCount, slotIndex);\r\n for (var frame = 0; frame < frameCount; frame++)\r\n timeline.setFrame(frame, input.readFloat(), input.readStringRef());\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGBA: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGBATimeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n var a = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b, a);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n var a2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);\r\n }\r\n time = time2;\r\n r = r2;\r\n g = g2;\r\n b = b2;\r\n a = a2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGB: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGBTimeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\r\n }\r\n time = time2;\r\n r = r2;\r\n g = g2;\r\n b = b2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGBA2: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n var a = input.readUnsignedByte() / 255.0;\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b, a, r2, g2, b2);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var nr = input.readUnsignedByte() / 255.0;\r\n var ng = input.readUnsignedByte() / 255.0;\r\n var nb = input.readUnsignedByte() / 255.0;\r\n var na = input.readUnsignedByte() / 255.0;\r\n var nr2 = input.readUnsignedByte() / 255.0;\r\n var ng2 = input.readUnsignedByte() / 255.0;\r\n var nb2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);\r\n setBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);\r\n setBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);\r\n setBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);\r\n }\r\n time = time2;\r\n r = nr;\r\n g = ng;\r\n b = nb;\r\n a = na;\r\n r2 = nr2;\r\n g2 = ng2;\r\n b2 = nb2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGB2: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b, r2, g2, b2);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var nr = input.readUnsignedByte() / 255.0;\r\n var ng = input.readUnsignedByte() / 255.0;\r\n var nb = input.readUnsignedByte() / 255.0;\r\n var nr2 = input.readUnsignedByte() / 255.0;\r\n var ng2 = input.readUnsignedByte() / 255.0;\r\n var nb2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);\r\n setBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);\r\n setBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);\r\n }\r\n time = time2;\r\n r = nr;\r\n g = ng;\r\n b = nb;\r\n r2 = nr2;\r\n g2 = ng2;\r\n b2 = nb2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_ALPHA: {\r\n var timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);\r\n var time = input.readFloat(), a = input.readUnsignedByte() / 255;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, a);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var a2 = input.readUnsignedByte() / 255;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);\r\n }\r\n time = time2;\r\n a = a2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var boneIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);\r\n switch (type) {\r\n case BONE_ROTATE:\r\n timelines.push(readTimeline1$1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_TRANSLATE:\r\n timelines.push(readTimeline2$1(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));\r\n break;\r\n case BONE_TRANSLATEX:\r\n timelines.push(readTimeline1$1(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));\r\n break;\r\n case BONE_TRANSLATEY:\r\n timelines.push(readTimeline1$1(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));\r\n break;\r\n case BONE_SCALE:\r\n timelines.push(readTimeline2$1(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SCALEX:\r\n timelines.push(readTimeline1$1(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SCALEY:\r\n timelines.push(readTimeline1$1(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SHEAR:\r\n timelines.push(readTimeline2$1(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SHEARX:\r\n timelines.push(readTimeline1$1(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SHEARY:\r\n timelines.push(readTimeline1$1(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\r\n var timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);\r\n var time = input.readFloat(), mix = input.readFloat(), softness = input.readFloat() * scale;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mix, softness, input.readByte(), input.readBoolean(), input.readBoolean());\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), mix2 = input.readFloat(), softness2 = input.readFloat() * scale;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);\r\n }\r\n time = time2;\r\n mix = mix2;\r\n softness = softness2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Transform constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\r\n var timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);\r\n var time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(), mixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat();\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(), mixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat();\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\r\n setBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\r\n setBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n mixScaleX = mixScaleX2;\r\n mixScaleY = mixScaleY2;\r\n mixShearY = mixShearY2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Path constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n switch (input.readByte()) {\r\n case PATH_POSITION:\r\n timelines\r\n .push(readTimeline1$1(input, new PathConstraintPositionTimeline(input.readInt(true), input.readInt(true), index), data.positionMode == PositionMode.Fixed ? scale : 1));\r\n break;\r\n case PATH_SPACING:\r\n timelines\r\n .push(readTimeline1$1(input, new PathConstraintSpacingTimeline(input.readInt(true), input.readInt(true), index), data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed ? scale : 1));\r\n break;\r\n case PATH_MIX:\r\n var timeline = new PathConstraintMixTimeline(input.readInt(true), input.readInt(true), index);\r\n var time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat();\r\n for (var frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat();\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var skin = skeletonData.skins[input.readInt(true)];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var slotIndex = input.readInt(true);\r\n for (var iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\r\n var attachmentName = input.readStringRef();\r\n if (!attachmentName)\r\n throw new Error(\"attachmentName must not be null.\");\r\n var attachment = skin.getAttachment(slotIndex, attachmentName);\r\n var timelineType = this.readDeformTimelineType(input);\r\n var frameCount = input.readInt(true);\r\n var frameLast = frameCount - 1;\r\n switch (timelineType) {\r\n case ATTACHMENT_DEFORM: {\r\n var vertexAttachment = attachment;\r\n var weighted = vertexAttachment.bones;\r\n var vertices = vertexAttachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var bezierCount = input.readInt(true);\r\n var timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment);\r\n var time = input.readFloat();\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n var deform = void 0;\r\n var end = input.readInt(true);\r\n if (end == 0)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = input.readInt(true);\r\n end += start;\r\n if (scale == 1) {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat();\r\n }\r\n else {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat() * scale;\r\n }\r\n if (!weighted) {\r\n for (var v = 0, vn = deform.length; v < vn; v++)\r\n deform[v] += vertices[v];\r\n }\r\n }\r\n timeline.setFrame(frame, time, deform);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);\r\n }\r\n time = time2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case ATTACHMENT_SEQUENCE: {\r\n var timeline = new SequenceTimeline(frameCount, slotIndex, attachment);\r\n for (var frame = 0; frame < frameCount; frame++) {\r\n var time = input.readFloat();\r\n var modeAndIndex = input.readInt32();\r\n timeline.setFrame(frame, time, SequenceModeValues[modeAndIndex & 0xf], modeAndIndex >> 4, input.readFloat());\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderCount = input.readInt(true);\r\n if (drawOrderCount > 0) {\r\n var timeline = new DrawOrderTimeline(drawOrderCount);\r\n var slotCount = skeletonData.slots.length;\r\n for (var i = 0; i < drawOrderCount; i++) {\r\n var time = input.readFloat();\r\n var offsetCount = input.readInt(true);\r\n var drawOrder = Utils.newArray(slotCount, 0);\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n drawOrder[ii] = -1;\r\n var unchanged = Utils.newArray(slotCount - offsetCount, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var ii = 0; ii < offsetCount; ii++) {\r\n var slotIndex = input.readInt(true);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + input.readInt(true)] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n if (drawOrder[ii] == -1)\r\n drawOrder[ii] = unchanged[--unchangedIndex];\r\n timeline.setFrame(i, time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Event timeline.\r\n var eventCount = input.readInt(true);\r\n if (eventCount > 0) {\r\n var timeline = new EventTimeline(eventCount);\r\n for (var i = 0; i < eventCount; i++) {\r\n var time = input.readFloat();\r\n var eventData = skeletonData.events[input.readInt(true)];\r\n var event_1 = new Event(time, eventData);\r\n event_1.intValue = input.readInt(false);\r\n event_1.floatValue = input.readFloat();\r\n event_1.stringValue = input.readBoolean() ? input.readString() : eventData.stringValue;\r\n if (event_1.data.audioPath) {\r\n event_1.volume = input.readFloat();\r\n event_1.balance = input.readFloat();\r\n }\r\n timeline.setFrame(i, event_1);\r\n }\r\n timelines.push(timeline);\r\n }\r\n var duration = 0;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n duration = Math.max(duration, timelines[i].getDuration());\r\n return new Animation(name, timelines, duration);\r\n };\r\n SkeletonBinary.BlendModeValues = [BLEND_MODES.NORMAL, BLEND_MODES.ADD, BLEND_MODES.MULTIPLY, BLEND_MODES.SCREEN];\r\n return SkeletonBinary;\r\n}());\r\nvar LinkedMesh$1 = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritTimeline = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\r\nvar Vertices = /** @class */ (function () {\r\n function Vertices(bones, vertices) {\r\n if (bones === void 0) { bones = null; }\r\n if (vertices === void 0) { vertices = null; }\r\n this.bones = bones;\r\n this.vertices = vertices;\r\n }\r\n return Vertices;\r\n}());\r\nfunction readTimeline1$1(input, timeline, scale) {\r\n var time = input.readFloat(), value = input.readFloat() * scale;\r\n for (var frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1;; frame++) {\r\n timeline.setFrame(frame, time, value);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), value2 = input.readFloat() * scale;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);\r\n }\r\n time = time2;\r\n value = value2;\r\n }\r\n return timeline;\r\n}\r\nfunction readTimeline2$1(input, timeline, scale) {\r\n var time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale;\r\n for (var frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1;; frame++) {\r\n timeline.setFrame(frame, time, value1, value2);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);\r\n }\r\n time = time2;\r\n value1 = nvalue1;\r\n value2 = nvalue2;\r\n }\r\n return timeline;\r\n}\r\nfunction setBezier(input, timeline, bezier, frame, value, time1, time2, value1, value2, scale) {\r\n timeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2);\r\n}\r\nvar BONE_ROTATE = 0;\r\nvar BONE_TRANSLATE = 1;\r\nvar BONE_TRANSLATEX = 2;\r\nvar BONE_TRANSLATEY = 3;\r\nvar BONE_SCALE = 4;\r\nvar BONE_SCALEX = 5;\r\nvar BONE_SCALEY = 6;\r\nvar BONE_SHEAR = 7;\r\nvar BONE_SHEARX = 8;\r\nvar BONE_SHEARY = 9;\r\nvar SLOT_ATTACHMENT = 0;\r\nvar SLOT_RGBA = 1;\r\nvar SLOT_RGB = 2;\r\nvar SLOT_RGBA2 = 3;\r\nvar SLOT_RGB2 = 4;\r\nvar SLOT_ALPHA = 5;\r\nvar ATTACHMENT_DEFORM = 0;\r\nvar ATTACHMENT_SEQUENCE = 1;\r\nvar PATH_POSITION = 0;\r\nvar PATH_SPACING = 1;\r\nvar PATH_MIX = 2;\r\n// const CURVE_LINEAR = 0;\r\nvar CURVE_STEPPED = 1;\r\nvar CURVE_BEZIER = 2;\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBounds = /** @class */ (function (_super) {\r\n __extends(SkeletonBounds, _super);\r\n function SkeletonBounds() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return SkeletonBounds;\r\n}(SkeletonBoundsBase));\n\n/** Loads skeleton data in the Spine JSON format.\r\n *\r\n * See [Spine JSON format](http://esotericsoftware.com/spine-json-format) and\r\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\r\n * Runtimes Guide.\r\n * @public\r\n * */\r\nvar SkeletonJson = /** @class */ (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\r\n * runtime than were used in Spine.\r\n *\r\n * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n // Skeleton\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n var verShort = skeletonData.version.substr(0, 3);\r\n if (verShort !== '4.0' && verShort !== '4.1') {\r\n var error = \"Spine 4.1 loader cant load version \" + skeletonMap.spine + \". Please configure your pixi-spine bundle\";\r\n console.error(error);\r\n }\r\n skeletonData.x = skeletonMap.x;\r\n skeletonData.y = skeletonMap.y;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n // Bones\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_1 = null;\r\n var parentName = getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_1 = skeletonData.findBone(parentName);\r\n if (parent_1 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new BoneData(skeletonData.bones.length, boneMap.name, parent_1);\r\n data.length = getValue(boneMap, \"length\", 0) * scale;\r\n data.x = getValue(boneMap, \"x\", 0) * scale;\r\n data.y = getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = getValue(boneMap, \"shearX\", 0);\r\n data.shearY = getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = Utils.enumValue(TransformMode, getValue(boneMap, \"transform\", \"Normal\"));\r\n data.skinRequired = getValue(boneMap, \"skin\", false);\r\n var color = getValue(boneMap, \"color\", null);\r\n if (color)\r\n data.color.setFromString(color);\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n // Slots.\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var boneData = skeletonData.findBone(slotMap.bone);\r\n if (!boneData)\r\n throw new Error(\"Couldn't find bone \" + slotMap.bone + \" for slot \" + slotMap.name);\r\n var data = new SlotData(skeletonData.slots.length, slotMap.name, boneData);\r\n var color = getValue(slotMap, \"color\", null);\r\n if (color)\r\n data.color.setFromString(color);\r\n var dark = getValue(slotMap, \"dark\", null);\r\n if (dark)\r\n data.darkColor = Color.fromString(dark);\r\n data.attachmentName = getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n // IK constraints\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new IkConstraintData(constraintMap.name);\r\n data.order = getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = getValue(constraintMap, \"skin\", false);\r\n for (var ii = 0; ii < constraintMap.bones.length; ii++) {\r\n var boneName = constraintMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n data.target = skeletonData.findBone(constraintMap.target);\r\n data.mix = getValue(constraintMap, \"mix\", 1);\r\n data.softness = getValue(constraintMap, \"softness\", 0) * scale;\r\n data.bendDirection = getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.compress = getValue(constraintMap, \"compress\", false);\r\n data.stretch = getValue(constraintMap, \"stretch\", false);\r\n data.uniform = getValue(constraintMap, \"uniform\", false);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new TransformConstraintData(constraintMap.name);\r\n data.order = getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = getValue(constraintMap, \"skin\", false);\r\n for (var ii = 0; ii < constraintMap.bones.length; ii++) {\r\n var boneName = constraintMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + boneName + \" for transform constraint \" + constraintMap.name + \".\");\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n var target = skeletonData.findBone(targetName);\r\n if (!target)\r\n throw new Error(\"Couldn't find target bone \" + targetName + \" for transform constraint \" + constraintMap.name + \".\");\r\n data.target = target;\r\n data.local = getValue(constraintMap, \"local\", false);\r\n data.relative = getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = getValue(constraintMap, \"shearY\", 0);\r\n data.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\r\n data.mixX = getValue(constraintMap, \"mixX\", 1);\r\n data.mixY = getValue(constraintMap, \"mixY\", data.mixX);\r\n data.mixScaleX = getValue(constraintMap, \"mixScaleX\", 1);\r\n data.mixScaleY = getValue(constraintMap, \"mixScaleY\", data.mixScaleX);\r\n data.mixShearY = getValue(constraintMap, \"mixShearY\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n // Path constraints.\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new PathConstraintData(constraintMap.name);\r\n data.order = getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = getValue(constraintMap, \"skin\", false);\r\n for (var ii = 0; ii < constraintMap.bones.length; ii++) {\r\n var boneName = constraintMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + boneName + \" for path constraint \" + constraintMap.name + \".\");\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n var target = skeletonData.findSlot(targetName);\r\n if (!target)\r\n throw new Error(\"Couldn't find target slot \" + targetName + \" for path constraint \" + constraintMap.name + \".\");\r\n data.target = target;\r\n data.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, \"positionMode\", \"Percent\"));\r\n data.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, \"spacingMode\", \"Length\"));\r\n data.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, \"rotateMode\", \"Tangent\"));\r\n data.offsetRotation = getValue(constraintMap, \"rotation\", 0);\r\n data.position = getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\r\n data.mixX = getValue(constraintMap, \"mixX\", 1);\r\n data.mixY = getValue(constraintMap, \"mixY\", data.mixX);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n // Skins.\r\n if (root.skins) {\r\n for (var i = 0; i < root.skins.length; i++) {\r\n var skinMap = root.skins[i];\r\n var skin = new Skin(skinMap.name);\r\n if (skinMap.bones) {\r\n for (var ii = 0; ii < skinMap.bones.length; ii++) {\r\n var boneName = skinMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + boneName + \" for skin \" + skinMap.name + \".\");\r\n skin.bones.push(bone);\r\n }\r\n }\r\n if (skinMap.ik) {\r\n for (var ii = 0; ii < skinMap.ik.length; ii++) {\r\n var constraintName = skinMap.ik[ii];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Couldn't find IK constraint \" + constraintName + \" for skin \" + skinMap.name + \".\");\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.transform) {\r\n for (var ii = 0; ii < skinMap.transform.length; ii++) {\r\n var constraintName = skinMap.transform[ii];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Couldn't find transform constraint \" + constraintName + \" for skin \" + skinMap.name + \".\");\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.path) {\r\n for (var ii = 0; ii < skinMap.path.length; ii++) {\r\n var constraintName = skinMap.path[ii];\r\n var constraint = skeletonData.findPathConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Couldn't find path constraint \" + constraintName + \" for skin \" + skinMap.name + \".\");\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n for (var slotName in skinMap.attachments) {\r\n var slot = skeletonData.findSlot(slotName);\r\n if (!slot)\r\n throw new Error(\"Couldn't find slot \" + slotName + \" for skin \" + skinMap.name + \".\");\r\n var slotMap = skinMap.attachments[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\r\n if (attachment)\r\n skin.setAttachment(slot.index, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (!skin)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (!parent_2)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new EventData(eventName);\r\n data.intValue = getValue(eventMap, \"int\", 0);\r\n data.floatValue = getValue(eventMap, \"float\", 0);\r\n data.stringValue = getValue(eventMap, \"string\", \"\");\r\n data.audioPath = getValue(eventMap, \"audio\", null);\r\n if (data.audioPath) {\r\n data.volume = getValue(eventMap, \"volume\", 1);\r\n data.balance = getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n // Animations.\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = getValue(map, \"name\", name);\r\n switch (getValue(map, \"type\", \"region\")) {\r\n case \"region\": {\r\n var path = getValue(map, \"path\", name);\r\n var sequence = this.readSequence(getValue(map, \"sequence\", null));\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\r\n if (!region)\r\n return null;\r\n region.path = path;\r\n region.x = getValue(map, \"x\", 0) * scale;\r\n region.y = getValue(map, \"y\", 0) * scale;\r\n region.scaleX = getValue(map, \"scaleX\", 1);\r\n region.scaleY = getValue(map, \"scaleY\", 1);\r\n region.rotation = getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n region.sequence = sequence;\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n region.color.setFromString(color);\r\n // if (region.region != null) region.updateRegion();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (!box)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = getValue(map, \"path\", name);\r\n var sequence = this.readSequence(getValue(map, \"sequence\", null));\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\r\n if (!mesh)\r\n return null;\r\n mesh.path = path;\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n mesh.color.setFromString(color);\r\n mesh.width = getValue(map, \"width\", 0) * scale;\r\n mesh.height = getValue(map, \"height\", 0) * scale;\r\n mesh.sequence = sequence;\r\n var parent_3 = getValue(map, \"parent\", null);\r\n if (parent_3) {\r\n this.linkedMeshes.push(new LinkedMesh(mesh, getValue(map, \"skin\", null), slotIndex, parent_3, getValue(map, \"timelines\", true)));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // if (mesh.region != null) mesh.updateRegion();\r\n mesh.edges = getValue(map, \"edges\", null);\r\n mesh.hullLength = getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (!path)\r\n return null;\r\n path.closed = getValue(map, \"closed\", false);\r\n path.constantSpeed = getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (!point)\r\n return null;\r\n point.x = getValue(map, \"x\", 0) * scale;\r\n point.y = getValue(map, \"y\", 0) * scale;\r\n point.rotation = getValue(map, \"rotation\", 0);\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (!clip)\r\n return null;\r\n var end = getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readSequence = function (map) {\r\n if (map == null)\r\n return null;\r\n var sequence = new Sequence(getValue(map, \"count\", 0));\r\n sequence.start = getValue(map, \"start\", 1);\r\n sequence.digits = getValue(map, \"digits\", 0);\r\n sequence.setupIndex = getValue(map, \"setup\", 0);\r\n return sequence;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slot = skeletonData.findSlot(slotName);\r\n if (!slot)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotIndex = slot.index;\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (!timelineMap)\r\n continue;\r\n var frames_1 = timelineMap.length;\r\n if (timelineName == \"attachment\") {\r\n var timeline = new AttachmentTimeline(frames_1, slotIndex);\r\n for (var frame = 0; frame < frames_1; frame++) {\r\n var keyMap = timelineMap[frame];\r\n timeline.setFrame(frame, getValue(keyMap, \"time\", 0), getValue(keyMap, \"name\", null));\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"rgba\") {\r\n var timeline = new RGBATimeline(frames_1, frames_1 << 2, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.color);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b, color.a);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.color);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"rgb\") {\r\n var timeline = new RGBTimeline(frames_1, frames_1 * 3, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.color);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.color);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"alpha\") {\r\n timelines.push(readTimeline1(timelineMap, new AlphaTimeline(frames_1, frames_1, slotIndex), 0, 1));\r\n }\r\n else if (timelineName == \"rgba2\") {\r\n var timeline = new RGBA2Timeline(frames_1, frames_1 * 7, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.light);\r\n var color2 = Color.fromString(keyMap.dark);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.light);\r\n var newColor2 = Color.fromString(nextMap.dark);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n color2 = newColor2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"rgb2\") {\r\n var timeline = new RGB2Timeline(frames_1, frames_1 * 6, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.light);\r\n var color2 = Color.fromString(keyMap.dark);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.light);\r\n var newColor2 = Color.fromString(nextMap.dark);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n color2 = newColor2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n var boneIndex = bone.index;\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n var frames_2 = timelineMap.length;\r\n if (frames_2 == 0)\r\n continue;\r\n if (timelineName === \"rotate\") {\r\n timelines.push(readTimeline1(timelineMap, new RotateTimeline(frames_2, frames_2, boneIndex), 0, 1));\r\n }\r\n else if (timelineName === \"translate\") {\r\n var timeline = new TranslateTimeline(frames_2, frames_2 << 1, boneIndex);\r\n timelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, scale));\r\n }\r\n else if (timelineName === \"translatex\") {\r\n var timeline = new TranslateXTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, scale));\r\n }\r\n else if (timelineName === \"translatey\") {\r\n var timeline = new TranslateYTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, scale));\r\n }\r\n else if (timelineName === \"scale\") {\r\n var timeline = new ScaleTimeline(frames_2, frames_2 << 1, boneIndex);\r\n timelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 1, 1));\r\n }\r\n else if (timelineName === \"scalex\") {\r\n var timeline = new ScaleXTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 1, 1));\r\n }\r\n else if (timelineName === \"scaley\") {\r\n var timeline = new ScaleYTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 1, 1));\r\n }\r\n else if (timelineName === \"shear\") {\r\n var timeline = new ShearTimeline(frames_2, frames_2 << 1, boneIndex);\r\n timelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, 1));\r\n }\r\n else if (timelineName === \"shearx\") {\r\n var timeline = new ShearXTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, 1));\r\n }\r\n else if (timelineName === \"sheary\") {\r\n var timeline = new ShearYTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, 1));\r\n }\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var keyMap = constraintMap[0];\r\n if (!keyMap)\r\n continue;\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"IK Constraint not found: \" + constraintName);\r\n var constraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1, constraintIndex);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mix = getValue(keyMap, \"mix\", 1);\r\n var softness = getValue(keyMap, \"softness\", 0) * scale;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mix, softness, getValue(keyMap, \"bendPositive\", true) ? 1 : -1, getValue(keyMap, \"compress\", false), getValue(keyMap, \"stretch\", false));\r\n var nextMap = constraintMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var mix2 = getValue(nextMap, \"mix\", 1);\r\n var softness2 = getValue(nextMap, \"softness\", 0) * scale;\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale);\r\n }\r\n time = time2;\r\n mix = mix2;\r\n softness = softness2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var timelineMap = map.transform[constraintName];\r\n var keyMap = timelineMap[0];\r\n if (!keyMap)\r\n continue;\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Transform constraint not found: \" + constraintName);\r\n var constraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6, constraintIndex);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mixRotate = getValue(keyMap, \"mixRotate\", 1);\r\n var mixX = getValue(keyMap, \"mixX\", 1);\r\n var mixY = getValue(keyMap, \"mixY\", mixX);\r\n var mixScaleX = getValue(keyMap, \"mixScaleX\", 1);\r\n var mixScaleY = getValue(keyMap, \"mixScaleY\", mixScaleX);\r\n var mixShearY = getValue(keyMap, \"mixShearY\", 1);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\r\n var mixX2 = getValue(nextMap, \"mixX\", 1);\r\n var mixY2 = getValue(nextMap, \"mixY\", mixX2);\r\n var mixScaleX2 = getValue(nextMap, \"mixScaleX\", 1);\r\n var mixScaleY2 = getValue(nextMap, \"mixScaleY\", mixScaleX2);\r\n var mixShearY2 = getValue(nextMap, \"mixShearY\", 1);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n mixScaleX = mixScaleX2;\r\n mixScaleY = mixScaleY2;\r\n mixScaleX = mixScaleX2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n // Path constraint timelines.\r\n if (map.path) {\r\n for (var constraintName in map.path) {\r\n var constraintMap = map.path[constraintName];\r\n var constraint = skeletonData.findPathConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var constraintIndex = skeletonData.pathConstraints.indexOf(constraint);\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n var keyMap = timelineMap[0];\r\n if (!keyMap)\r\n continue;\r\n var frames_3 = timelineMap.length;\r\n if (timelineName === \"position\") {\r\n var timeline = new PathConstraintPositionTimeline(frames_3, frames_3, constraintIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, constraint.positionMode == PositionMode.Fixed ? scale : 1));\r\n }\r\n else if (timelineName === \"spacing\") {\r\n var timeline = new PathConstraintSpacingTimeline(frames_3, frames_3, constraintIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, constraint.spacingMode == SpacingMode.Length || constraint.spacingMode == SpacingMode.Fixed ? scale : 1));\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new PathConstraintMixTimeline(frames_3, frames_3 * 3, constraintIndex);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mixRotate = getValue(keyMap, \"mixRotate\", 1);\r\n var mixX = getValue(keyMap, \"mixX\", 1);\r\n var mixY = getValue(keyMap, \"mixY\", mixX);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\r\n var mixX2 = getValue(nextMap, \"mixX\", 1);\r\n var mixY2 = getValue(nextMap, \"mixY\", mixX2);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n // ver40 compatibility\r\n if (map.deform) {\r\n map.attachments = {};\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var outMap = map.attachments[deformName] = {};\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var outMap2 = outMap[slotName] = {};\r\n for (var innerMapName in slotMap) {\r\n outMap2[innerMapName] = {\r\n deform: slotMap[innerMapName]\r\n };\r\n }\r\n }\r\n }\r\n }\r\n // Attachment timelines.\r\n if (map.attachments) {\r\n for (var attachmentsName in map.attachments) {\r\n var attachmentsMap = map.attachments[attachmentsName];\r\n var skin = skeletonData.findSkin(attachmentsName);\r\n if (skin == null) {\r\n if (settings.FAIL_ON_NON_EXISTING_SKIN) {\r\n throw new Error(\"Skin not found: \" + attachmentsName);\r\n }\r\n else {\r\n continue;\r\n }\r\n }\r\n for (var slotMapName in attachmentsMap) {\r\n var slotMap = attachmentsMap[slotMapName];\r\n var slot = skeletonData.findSlot(slotMapName);\r\n if (!slot)\r\n throw new Error(\"Slot not found: \" + slotMapName);\r\n var slotIndex = slot.index;\r\n for (var attachmentMapName in slotMap) {\r\n var attachmentMap = slotMap[attachmentMapName];\r\n var attachment = skin.getAttachment(slotIndex, attachmentMapName);\r\n for (var timelineMapName in attachmentMap) {\r\n var timelineMap = attachmentMap[timelineMapName];\r\n var keyMap = timelineMap[0];\r\n if (!keyMap)\r\n continue;\r\n if (timelineMapName == \"deform\") {\r\n var weighted = attachment.bones;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment);\r\n var time = getValue(keyMap, \"time\", 0);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n var deform = void 0;\r\n var verticesValue = getValue(keyMap, \"vertices\", null);\r\n if (!verticesValue)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = getValue(keyMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frame, time, deform);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var curve = keyMap.curve;\r\n if (curve)\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);\r\n time = time2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineMapName == \"sequence\") {\r\n var timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment);\r\n var lastDelay = 0;\r\n for (var frame = 0; frame < timelineMap.length; frame++) {\r\n var delay = getValue(keyMap, \"delay\", lastDelay);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mode = SequenceMode[getValue(keyMap, \"mode\", \"hold\")];\r\n var index = getValue(keyMap, \"index\", 0);\r\n timeline.setFrame(frame, time, mode, index, delay);\r\n lastDelay = delay;\r\n keyMap = timelineMap[frame + 1];\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timelines.\r\n if (map.drawOrder) {\r\n var timeline = new DrawOrderTimeline(map.drawOrder.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frame = 0;\r\n for (var i = 0; i < map.drawOrder.length; i++, frame++) {\r\n var drawOrderMap = map.drawOrder[i];\r\n var drawOrder = null;\r\n var offsets = getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n var unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var ii = 0; ii < offsets.length; ii++) {\r\n var offsetMap = offsets[ii];\r\n var slot = skeletonData.findSlot(offsetMap.slot);\r\n if (!slot)\r\n throw new Error(\"Slot not found: \" + slot);\r\n var slotIndex = slot.index;\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n if (drawOrder[ii] == -1)\r\n drawOrder[ii] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frame, getValue(drawOrderMap, \"time\", 0), drawOrder);\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Event timelines.\r\n if (map.events) {\r\n var timeline = new EventTimeline(map.events.length);\r\n var frame = 0;\r\n for (var i = 0; i < map.events.length; i++, frame++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (!eventData)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_1 = new Event(Utils.toSinglePrecision(getValue(eventMap, \"time\", 0)), eventData);\r\n event_1.intValue = getValue(eventMap, \"int\", eventData.intValue);\r\n event_1.floatValue = getValue(eventMap, \"float\", eventData.floatValue);\r\n event_1.stringValue = getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_1.data.audioPath) {\r\n event_1.volume = getValue(eventMap, \"volume\", 1);\r\n event_1.balance = getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frame, event_1);\r\n }\r\n timelines.push(timeline);\r\n }\r\n var duration = 0;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n duration = Math.max(duration, timelines[i].getDuration());\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return BLEND_MODES.NORMAL;\r\n if (str == \"additive\")\r\n return BLEND_MODES.ADD;\r\n if (str == \"multiply\")\r\n return BLEND_MODES.MULTIPLY;\r\n if (str == \"screen\")\r\n return BLEND_MODES.SCREEN;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n}());\r\nvar LinkedMesh = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritTimeline = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\r\nfunction readTimeline1(keys, timeline, defaultValue, scale) {\r\n var keyMap = keys[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var value = getValue(keyMap, \"value\", defaultValue) * scale;\r\n var bezier = 0;\r\n for (var frame = 0;; frame++) {\r\n timeline.setFrame(frame, time, value);\r\n var nextMap = keys[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n return timeline;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var value2 = getValue(nextMap, \"value\", defaultValue) * scale;\r\n if (keyMap.curve)\r\n bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale);\r\n time = time2;\r\n value = value2;\r\n keyMap = nextMap;\r\n }\r\n}\r\nfunction readTimeline2(keys, timeline, name1, name2, defaultValue, scale) {\r\n var keyMap = keys[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var value1 = getValue(keyMap, name1, defaultValue) * scale;\r\n var value2 = getValue(keyMap, name2, defaultValue) * scale;\r\n var bezier = 0;\r\n for (var frame = 0;; frame++) {\r\n timeline.setFrame(frame, time, value1, value2);\r\n var nextMap = keys[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n return timeline;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var nvalue1 = getValue(nextMap, name1, defaultValue) * scale;\r\n var nvalue2 = getValue(nextMap, name2, defaultValue) * scale;\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale);\r\n }\r\n time = time2;\r\n value1 = nvalue1;\r\n value2 = nvalue2;\r\n keyMap = nextMap;\r\n }\r\n}\r\nfunction readCurve(curve, timeline, bezier, frame, value, time1, time2, value1, value2, scale) {\r\n if (curve == \"stepped\") {\r\n timeline.setStepped(frame);\r\n return bezier;\r\n }\r\n var i = value << 2;\r\n var cx1 = curve[i];\r\n var cy1 = curve[i + 1] * scale;\r\n var cx2 = curve[i + 2];\r\n var cy2 = curve[i + 3] * scale;\r\n timeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);\r\n return bezier + 1;\r\n}\r\nfunction getValue(map, property, defaultValue) {\r\n return map[property] !== undefined ? map[property] : defaultValue;\r\n}\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n this.skeleton = new Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new AnimationStateData(spineData);\r\n this.state = new AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { AlphaTimeline, Animation, AnimationState, AnimationStateAdapter, AnimationStateData, AtlasAttachmentLoader, Attachment, AttachmentTimeline, Bone, BoneData, BoundingBoxAttachment, ClippingAttachment, ConstraintData, CurveTimeline, CurveTimeline1, CurveTimeline2, DeformTimeline, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, IkConstraint, IkConstraintData, IkConstraintTimeline, MeshAttachment, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PointAttachment, RGB2Timeline, RGBA2Timeline, RGBATimeline, RGBTimeline, RegionAttachment, RotateTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, Sequence, SequenceMode, SequenceModeValues, SequenceTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, Skeleton, SkeletonBinary, SkeletonBounds, SkeletonData, SkeletonJson, Skin, SkinEntry, Slot, SlotData, SpacingMode, Spine, Timeline, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, VertexAttachment };\n//# sourceMappingURL=runtime-4.1.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/loader-uni - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:38 UTC\n *\n * @pixi-spine/loader-uni is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Mat Groves, All Rights Reserved\n */\nimport { AbstractSpineParser } from '@pixi-spine/loader-base';\nimport { BinaryInput, SpineBase } from '@pixi-spine/base';\nimport { Loader } from '@pixi/loaders';\nimport * as spine38 from '@pixi-spine/runtime-3.8';\nimport * as spine37 from '@pixi-spine/runtime-3.7';\nimport * as spine41 from '@pixi-spine/runtime-4.1';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nvar SPINE_VERSION;\r\n(function (SPINE_VERSION) {\r\n SPINE_VERSION[SPINE_VERSION[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER37\"] = 37] = \"VER37\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER38\"] = 38] = \"VER38\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER40\"] = 40] = \"VER40\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER41\"] = 41] = \"VER41\";\r\n})(SPINE_VERSION || (SPINE_VERSION = {}));\r\n/**\r\n * @public\r\n */\r\nfunction detectSpineVersion(version) {\r\n var ver3 = version.substr(0, 3);\r\n var verNum = Math.floor(+ver3 * 10 + 1e-3);\r\n if (ver3 === '3.7') {\r\n return SPINE_VERSION.VER37;\r\n }\r\n if (ver3 === '3.8') {\r\n return SPINE_VERSION.VER38;\r\n }\r\n if (ver3 === '4.0') {\r\n return SPINE_VERSION.VER40;\r\n }\r\n if (ver3 === '4.1') {\r\n return SPINE_VERSION.VER41;\r\n }\r\n // try parse old versions with 3.7\r\n if (verNum < SPINE_VERSION.VER37) {\r\n return SPINE_VERSION.VER37;\r\n }\r\n return SPINE_VERSION.UNKNOWN;\r\n}\n\nvar UniBinaryParser = /** @class */ (function () {\r\n function UniBinaryParser() {\r\n this.scale = 1;\r\n }\r\n UniBinaryParser.prototype.readSkeletonData = function (atlas, dataToParse) {\r\n var parser = null;\r\n var version = this.readVersionOldFormat(dataToParse);\r\n var ver = detectSpineVersion(version);\r\n if (ver === SPINE_VERSION.VER38) {\r\n parser = new spine38.SkeletonBinary(new spine38.AtlasAttachmentLoader(atlas));\r\n }\r\n version = this.readVersionNewFormat(dataToParse);\r\n ver = detectSpineVersion(version);\r\n if (ver === SPINE_VERSION.VER40 || ver === SPINE_VERSION.VER41) {\r\n parser = new spine41.SkeletonBinary(new spine41.AtlasAttachmentLoader(atlas));\r\n }\r\n if (!parser) {\r\n var error = \"Unsupported version of spine model \" + version + \", please update pixi-spine\";\r\n console.error(error);\r\n }\r\n parser.scale = this.scale;\r\n return parser.readSkeletonData(dataToParse);\r\n };\r\n UniBinaryParser.prototype.readVersionOldFormat = function (dataToParse) {\r\n var input = new BinaryInput(dataToParse);\r\n var version;\r\n try {\r\n input.readString();\r\n version = input.readString();\r\n }\r\n catch (e) {\r\n version = \"\";\r\n }\r\n return version || \"\";\r\n };\r\n UniBinaryParser.prototype.readVersionNewFormat = function (dataToParse) {\r\n var input = new BinaryInput(dataToParse);\r\n input.readInt32();\r\n input.readInt32();\r\n var version;\r\n try {\r\n version = input.readString();\r\n }\r\n catch (e) {\r\n version = \"\";\r\n }\r\n return version || \"\";\r\n };\r\n return UniBinaryParser;\r\n}());\r\nvar UniJsonParser = /** @class */ (function () {\r\n function UniJsonParser() {\r\n this.scale = 1;\r\n }\r\n UniJsonParser.prototype.readSkeletonData = function (atlas, dataToParse) {\r\n var version = dataToParse.skeleton.spine;\r\n var ver = detectSpineVersion(version);\r\n var parser = null;\r\n if (ver === SPINE_VERSION.VER37) {\r\n parser = new spine37.SkeletonJson(new spine37.AtlasAttachmentLoader(atlas));\r\n }\r\n if (ver === SPINE_VERSION.VER38) {\r\n parser = new spine38.SkeletonJson(new spine38.AtlasAttachmentLoader(atlas));\r\n }\r\n if (ver === SPINE_VERSION.VER40 || ver === SPINE_VERSION.VER41) {\r\n parser = new spine41.SkeletonJson(new spine41.AtlasAttachmentLoader(atlas));\r\n }\r\n if (!parser) {\r\n var error = \"Unsupported version of spine model \" + version + \", please update pixi-spine\";\r\n console.error(error);\r\n }\r\n parser.scale = this.scale;\r\n return parser.readSkeletonData(dataToParse);\r\n };\r\n return UniJsonParser;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar SpineParser = /** @class */ (function (_super) {\r\n __extends(SpineParser, _super);\r\n function SpineParser() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SpineParser.prototype.createBinaryParser = function () {\r\n return new UniBinaryParser();\r\n };\r\n SpineParser.prototype.createJsonParser = function () {\r\n return new UniJsonParser();\r\n };\r\n SpineParser.prototype.parseData = function (resource, parser, atlas, dataToParse) {\r\n var parserCast = parser;\r\n resource.spineData = parserCast.readSkeletonData(atlas, dataToParse);\r\n resource.spineAtlas = atlas;\r\n };\r\n SpineParser.registerLoaderPlugin = function () {\r\n Loader.registerPlugin(SpineParser);\r\n };\r\n SpineParser.use = new SpineParser().genMiddleware().use;\r\n return SpineParser;\r\n}(AbstractSpineParser));\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n var ver = detectSpineVersion(spineData.version);\r\n var spine = null;\r\n if (ver === SPINE_VERSION.VER37) {\r\n spine = spine37;\r\n }\r\n if (ver === SPINE_VERSION.VER38) {\r\n spine = spine38;\r\n }\r\n if (ver === SPINE_VERSION.VER40 || ver === SPINE_VERSION.VER41) {\r\n spine = spine41;\r\n }\r\n if (!spine) {\r\n var error = \"Cant detect version of spine model \" + spineData.version;\r\n console.error(error);\r\n }\r\n this.skeleton = new spine.Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new spine.AnimationStateData(spineData);\r\n this.state = new spine.AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { SPINE_VERSION, Spine, SpineParser, detectSpineVersion };\n//# sourceMappingURL=loader-uni.es.js.map\n","/* eslint-disable */\n \n/*!\n * pixi-spine - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:40 UTC\n *\n * pixi-spine is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev , All Rights Reserved\n */\nimport { SpineParser } from '@pixi-spine/loader-uni';\nexport { Spine, SpineParser } from '@pixi-spine/loader-uni';\nexport * from '@pixi-spine/base';\nexport { SkeletonBounds } from '@pixi-spine/runtime-4.1';\n\nSpineParser.registerLoaderPlugin();\n//# sourceMappingURL=all.es.js.map\n","import * as PIXI from 'pixi.js';\nimport { v4 as uuid } from 'uuid';\nimport { webgalStore } from '@/store/store';\nimport { setStage, stageActions } from '@/store/stageReducer';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { IEffect, IFigureAssociatedAnimation } from '@/store/stageInterface';\nimport { logger } from '@/Core/util/logger';\nimport { isIOS } from '@/Core/initializeScript';\nimport { WebGALPixiContainer } from '@/Core/controller/stage/pixi/WebGALPixiContainer';\nimport { WebGAL } from '@/Core/WebGAL';\nimport 'pixi-spine'; // Do this once at the very start of your code. This registers the loader!\nimport { Spine } from 'pixi-spine';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n// import { figureCash } from '@/Core/gameScripts/vocal/conentsCash'; // 如果要使用 Live2D,取消这里的注释\n// import { Live2DModel, SoundManager } from 'pixi-live2d-display'; // 如果要使用 Live2D,取消这里的注释\n\nexport interface IAnimationObject {\n setStartState: Function;\n setEndState: Function;\n tickerFunc: PIXI.TickerCallback;\n getEndFilterEffect?: Function;\n}\n\ninterface IStageAnimationObject {\n // 唯一标识\n uuid: string;\n // 一般与作用目标有关\n key: string;\n targetKey?: string;\n type: 'common' | 'preset';\n animationObject: IAnimationObject;\n}\n\nexport interface IStageObject {\n // 唯一标识\n uuid: string;\n // 一般与作用目标有关\n key: string;\n pixiContainer: WebGALPixiContainer;\n // 相关的源 url\n sourceUrl: string;\n sourceExt: string;\n sourceType: 'img' | 'live2d' | 'spine' | 'gif' | 'video';\n}\n\nexport interface ILive2DRecord {\n target: string;\n motion: string;\n expression: string;\n}\n\n// export interface IRegisterTickerOpr {\n// tickerGeneratorFn: (targetKey: string, duration: number) => PIXI.TickerCallback;\n// key: string;\n// target: string;\n// duration: number;\n// }\n\n// @ts-ignore\nwindow.PIXI = PIXI;\n\nexport default class PixiStage {\n /**\n * 当前的 PIXI App\n */\n public currentApp: PIXI.Application | null = null;\n public readonly effectsContainer: PIXI.Container;\n public frameDuration = 16.67;\n public notUpdateBacklogEffects = false;\n private readonly figureContainer: PIXI.Container;\n private figureObjects: Array = [];\n private readonly backgroundContainer: PIXI.Container;\n private backgroundObjects: Array = [];\n\n // 注册到 Ticker 上的函数\n private stageAnimations: Array = [];\n private assetLoader = new PIXI.Loader();\n private loadQueue: { url: string; callback: () => void; name?: string }[] = [];\n private live2dFigureRecorder: Array = [];\n\n // 锁定变换对象(对象可能正在执行动画,不能应用变换)\n private lockTransformTarget: Array = [];\n private stageWidth = SCREEN_CONSTANTS.width;\n private stageHeight = SCREEN_CONSTANTS.height;\n /**\n * 暂时没用上,以后可能用\n * @private\n */\n private MAX_TEX_COUNT = 10;\n\n public constructor() {\n const app = new PIXI.Application({\n backgroundAlpha: 0,\n preserveDrawingBuffer: true,\n });\n // @ts-ignore\n\n window.PIXIapp = this; // @ts-ignore\n window.__PIXI_APP__ = app;\n // 清空原节点\n const pixiContainer = document.getElementById('pixiContianer');\n if (pixiContainer) {\n pixiContainer.innerHTML = '';\n pixiContainer.appendChild(app.view);\n }\n\n // 设置样式\n app.renderer.view.style.position = 'absolute';\n app.renderer.view.style.display = 'block';\n app.renderer.view.id = 'pixiCanvas';\n // @ts-ignore\n app.renderer.autoResize = true;\n const appRoot = document.getElementById('root');\n if (appRoot) {\n app.renderer.resize(appRoot.clientWidth, appRoot.clientHeight);\n }\n if (isIOS) {\n app.renderer.view.style.zIndex = '-5';\n }\n\n // 设置可排序\n app.stage.sortableChildren = true;\n\n // 添加 3 个 Container 用于做渲染\n this.effectsContainer = new PIXI.Container();\n this.effectsContainer.zIndex = 3;\n this.figureContainer = new PIXI.Container();\n this.figureContainer.zIndex = 2;\n this.backgroundContainer = new PIXI.Container();\n this.backgroundContainer.zIndex = 0;\n app.stage.addChild(this.effectsContainer, this.figureContainer, this.backgroundContainer);\n this.currentApp = app;\n // 每 5s 获取帧率,并且防 loader 死\n const update = () => {\n this.updateFps();\n setTimeout(update, 10000);\n };\n update();\n // loader 防死\n const reload = () => {\n setTimeout(reload, 500);\n this.callLoader();\n };\n reload();\n }\n\n public getFigureObjects() {\n return this.figureObjects;\n }\n\n public getAllLockedObject() {\n return this.lockTransformTarget;\n }\n\n /**\n * 注册动画\n * @param animationObject\n * @param key\n * @param target\n */\n public registerAnimation(animationObject: IAnimationObject | null, key: string, target = 'default') {\n if (!animationObject) return;\n this.stageAnimations.push({ uuid: uuid(), animationObject, key: key, targetKey: target, type: 'common' });\n // 上锁\n this.lockStageObject(target);\n animationObject.setStartState();\n this.currentApp?.ticker.add(animationObject.tickerFunc);\n }\n\n /**\n * 注册预设动画\n * @param animationObject\n * @param key\n * @param target\n * @param currentEffects\n */\n // eslint-disable-next-line max-params\n public registerPresetAnimation(\n animationObject: IAnimationObject | null,\n key: string,\n target = 'default',\n currentEffects: IEffect[],\n ) {\n if (!animationObject) return;\n const effect = currentEffects.find((effect) => effect.target === target);\n if (effect) {\n const targetPixiContainer = this.getStageObjByKey(target);\n if (targetPixiContainer) {\n const container = targetPixiContainer.pixiContainer;\n Object.assign(container, effect.transform);\n }\n return;\n }\n this.stageAnimations.push({ uuid: uuid(), animationObject, key: key, targetKey: target, type: 'preset' });\n // 上锁\n this.lockStageObject(target);\n animationObject.setStartState();\n this.currentApp?.ticker.add(animationObject.tickerFunc);\n }\n\n public stopPresetAnimationOnTarget(target: string) {\n const targetPresetAnimations = this.stageAnimations.find((e) => e.targetKey === target && e.type === 'preset');\n if (targetPresetAnimations) {\n this.removeAnimation(targetPresetAnimations.key);\n }\n }\n\n /**\n * 移除动画\n * @param key\n */\n public removeAnimation(key: string) {\n const index = this.stageAnimations.findIndex((e) => e.key === key);\n if (index >= 0) {\n const thisTickerFunc = this.stageAnimations[index];\n this.currentApp?.ticker.remove(thisTickerFunc.animationObject.tickerFunc);\n thisTickerFunc.animationObject.setEndState();\n this.unlockStageObject(thisTickerFunc.targetKey ?? 'default');\n this.stageAnimations.splice(index, 1);\n }\n }\n\n public removeAnimationWithSetEffects(key: string) {\n const index = this.stageAnimations.findIndex((e) => e.key === key);\n if (index >= 0) {\n const thisTickerFunc = this.stageAnimations[index];\n this.currentApp?.ticker.remove(thisTickerFunc.animationObject.tickerFunc);\n thisTickerFunc.animationObject.setEndState();\n const webgalFilters = thisTickerFunc.animationObject.getEndFilterEffect?.() ?? {};\n this.unlockStageObject(thisTickerFunc.targetKey ?? 'default');\n if (thisTickerFunc.targetKey) {\n const target = this.getStageObjByKey(thisTickerFunc.targetKey);\n if (target) {\n const targetTransform = {\n alpha: target.pixiContainer.alphaFilterVal,\n scale: {\n x: target.pixiContainer.scale.x,\n y: target.pixiContainer.scale.y,\n },\n // pivot: {\n // x: target.pixiContainer.pivot.x,\n // y: target.pixiContainer.pivot.y,\n // },\n position: {\n x: target.pixiContainer.x,\n y: target.pixiContainer.y,\n },\n rotation: target.pixiContainer.rotation,\n // @ts-ignore\n blur: target.pixiContainer.blur,\n ...webgalFilters,\n };\n let effect: IEffect = {\n target: thisTickerFunc.targetKey,\n transform: targetTransform,\n };\n webgalStore.dispatch(stageActions.updateEffect(effect));\n // if (!this.notUpdateBacklogEffects) updateCurrentBacklogEffects(webgalStore.getState().stage.effects);\n }\n }\n this.stageAnimations.splice(index, 1);\n }\n }\n\n // eslint-disable-next-line max-params\n public performMouthSyncAnimation(\n key: string,\n targetAnimation: IFigureAssociatedAnimation,\n mouthState: string,\n presetPosition: string,\n ) {\n const currentFigure = this.getStageObjByKey(key)?.pixiContainer as WebGALPixiContainer;\n\n if (!currentFigure) {\n return;\n }\n\n const mouthTextureUrls: any = {\n open: targetAnimation.mouthAnimation.open,\n half_open: targetAnimation.mouthAnimation.halfOpen,\n closed: targetAnimation.mouthAnimation.close,\n };\n\n // Load mouth texture (reuse if already loaded)\n this.loadAsset(mouthTextureUrls[mouthState], () => {\n const texture = this.assetLoader.resources[mouthTextureUrls[mouthState]].texture;\n const sprite = currentFigure?.children?.[0] as PIXI.Sprite;\n if (!texture || !sprite) {\n return;\n }\n sprite.texture = texture;\n });\n }\n\n // eslint-disable-next-line max-params\n public performBlinkAnimation(\n key: string,\n targetAnimation: IFigureAssociatedAnimation,\n blinkState: string,\n presetPosition: string,\n ) {\n const currentFigure = this.getStageObjByKey(key)?.pixiContainer as WebGALPixiContainer;\n\n if (!currentFigure) {\n return;\n }\n const blinkTextureUrls: any = {\n open: targetAnimation.blinkAnimation.open,\n closed: targetAnimation.blinkAnimation.close,\n };\n\n // Load eye texture (reuse if already loaded)\n this.loadAsset(blinkTextureUrls[blinkState], () => {\n const texture = this.assetLoader.resources[blinkTextureUrls[blinkState]].texture;\n const sprite = currentFigure?.children?.[0] as PIXI.Sprite;\n if (!texture || !sprite) {\n return;\n }\n sprite.texture = texture;\n });\n }\n\n /**\n * 添加背景\n * @param key 背景的标识,一般和背景类型有关\n * @param url 背景图片url\n */\n public addBg(key: string, url: string) {\n // const loader = this.assetLoader;\n const loader = this.assetLoader;\n // 准备用于存放这个背景的 Container\n const thisBgContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的背景\n const setBgIndex = this.backgroundObjects.findIndex((e) => e.key === key);\n const isBgSet = setBgIndex >= 0;\n\n // 已经有一个这个 key 的背景存在了\n if (isBgSet) {\n // 挤占\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.backgroundContainer.addChild(thisBgContainer);\n const bgUuid = uuid();\n this.backgroundObjects.push({\n uuid: bgUuid,\n key: key,\n pixiContainer: thisBgContainer,\n sourceUrl: url,\n sourceType: 'img',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n\n setTimeout(() => {\n const texture = loader.resources?.[url]?.texture;\n if (texture && this.getStageObjByUuid(bgUuid)) {\n /**\n * 重设大小\n */\n const originalWidth = texture.width;\n const originalHeight = texture.height;\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n const targetScale = Math.max(scaleX, scaleY);\n const bgSprite = new PIXI.Sprite(texture);\n bgSprite.scale.x = targetScale;\n bgSprite.scale.y = targetScale;\n bgSprite.anchor.set(0.5);\n bgSprite.position.y = this.stageHeight / 2;\n thisBgContainer.setBaseX(this.stageWidth / 2);\n thisBgContainer.setBaseY(this.stageHeight / 2);\n thisBgContainer.pivot.set(0, this.stageHeight / 2);\n\n // 挂载\n thisBgContainer.addChild(bgSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]?.texture) {\n this.loadAsset(url, setup);\n } else {\n // 复用\n setup();\n }\n }\n\n public addSpineBg(key: string, url: string) {\n const spineId = `spine-${url}`;\n const loader = this.assetLoader;\n // 准备用于存放这个背景的 Container\n const thisBgContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的背景\n const setBgIndex = this.backgroundObjects.findIndex((e) => e.key === key);\n const isBgSet = setBgIndex >= 0;\n\n // 已经有一个这个 key 的背景存在了\n if (isBgSet) {\n // 挤占\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.backgroundContainer.addChild(thisBgContainer);\n const bgUuid = uuid();\n this.backgroundObjects.push({\n uuid: bgUuid,\n key: key,\n pixiContainer: thisBgContainer,\n sourceUrl: url,\n sourceType: 'live2d',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n const spineResource: any = this.assetLoader.resources?.[spineId];\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n setTimeout(() => {\n if (spineResource && this.getStageObjByUuid(bgUuid)) {\n const bgSpine = new Spine(spineResource.spineData);\n const transY = spineResource?.spineData?.y ?? 0;\n /**\n * 重设大小\n */\n const originalWidth = bgSpine.width; // TODO: 视图大小可能小于画布大小,应提供参数指定视图大小\n const originalHeight = bgSpine.height; // TODO: 视图大小可能小于画布大小,应提供参数指定视图大小\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n logger.debug('bgSpine state', bgSpine.state);\n // TODO: 也许应该使用 setAnimation 播放初始动画\n if (bgSpine.spineData.animations.length > 0) {\n // 播放首个动画\n bgSpine.state.setAnimation(0, bgSpine.spineData.animations[0].name, true);\n }\n const targetScale = Math.max(scaleX, scaleY);\n const bgSprite = new PIXI.Sprite();\n bgSprite.addChild(bgSpine);\n bgSprite.scale.x = targetScale;\n bgSprite.scale.y = targetScale;\n bgSprite.anchor.set(0.5);\n bgSprite.position.y = this.stageHeight / 2;\n thisBgContainer.setBaseX(this.stageWidth / 2);\n thisBgContainer.setBaseY(this.stageHeight / 2);\n thisBgContainer.pivot.set(0, this.stageHeight / 2);\n\n // 挂载\n thisBgContainer.addChild(bgSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]) {\n this.loadAsset(url, setup, spineId);\n } else {\n // 复用\n setup();\n }\n }\n\n /**\n * 添加立绘\n * @param key 立绘的标识,一般和立绘位置有关\n * @param url 立绘图片url\n * @param presetPosition\n */\n public addFigure(key: string, url: string, presetPosition: 'left' | 'center' | 'right' = 'center') {\n const loader = this.assetLoader;\n // 准备用于存放这个立绘的 Container\n const thisFigureContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的立绘\n const setFigIndex = this.figureObjects.findIndex((e) => e.key === key);\n const isFigSet = setFigIndex >= 0;\n\n // 已经有一个这个 key 的立绘存在了\n if (isFigSet) {\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.figureContainer.addChild(thisFigureContainer);\n const figureUuid = uuid();\n this.figureObjects.push({\n uuid: figureUuid,\n key: key,\n pixiContainer: thisFigureContainer,\n sourceUrl: url,\n sourceType: 'img',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n setTimeout(() => {\n const texture = loader.resources?.[url]?.texture;\n if (texture && this.getStageObjByUuid(figureUuid)) {\n /**\n * 重设大小\n */\n const originalWidth = texture.width;\n const originalHeight = texture.height;\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n const targetScale = Math.min(scaleX, scaleY);\n const figureSprite = new PIXI.Sprite(texture);\n figureSprite.scale.x = targetScale;\n figureSprite.scale.y = targetScale;\n figureSprite.anchor.set(0.5);\n figureSprite.position.y = this.stageHeight / 2;\n const targetWidth = originalWidth * targetScale;\n const targetHeight = originalHeight * targetScale;\n thisFigureContainer.setBaseY(this.stageHeight / 2);\n if (targetHeight < this.stageHeight) {\n thisFigureContainer.setBaseY(this.stageHeight / 2 + this.stageHeight - targetHeight / 2);\n }\n if (presetPosition === 'center') {\n thisFigureContainer.setBaseX(this.stageWidth / 2);\n }\n if (presetPosition === 'left') {\n thisFigureContainer.setBaseX(targetWidth / 2);\n }\n if (presetPosition === 'right') {\n thisFigureContainer.setBaseX(this.stageWidth - targetWidth / 2);\n }\n thisFigureContainer.pivot.set(0, this.stageHeight / 2);\n thisFigureContainer.addChild(figureSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]?.texture) {\n this.loadAsset(url, setup);\n } else {\n // 复用\n setup();\n }\n }\n\n /**\n * 添加 Spine 立绘\n * @param key 立绘的标识,一般和立绘位置有关\n * @param url 立绘图片url\n * @param presetPosition\n */\n public addSpineFigure(key: string, url: string, presetPosition: 'left' | 'center' | 'right' = 'center') {\n const spineId = `spine-${url}`;\n const loader = this.assetLoader;\n // 准备用于存放这个立绘的 Container\n const thisFigureContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的立绘\n const setFigIndex = this.figureObjects.findIndex((e) => e.key === key);\n const isFigSet = setFigIndex >= 0;\n\n // 已经有一个这个 key 的立绘存在了\n if (isFigSet) {\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.figureContainer.addChild(thisFigureContainer);\n const figureUuid = uuid();\n this.figureObjects.push({\n uuid: figureUuid,\n key: key,\n pixiContainer: thisFigureContainer,\n sourceUrl: url,\n sourceType: 'live2d',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n const spineResource: any = this.assetLoader.resources?.[spineId];\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n setTimeout(() => {\n if (spineResource && this.getStageObjByUuid(figureUuid)) {\n const figureSpine = new Spine(spineResource.spineData);\n const transY = spineResource?.spineData?.y ?? 0;\n /**\n * 重设大小\n */\n const originalWidth = figureSpine.width;\n const originalHeight = figureSpine.height;\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n // 我也不知道为什么啊啊啊啊\n figureSpine.y = -(scaleY * transY) / 2;\n figureSpine.state.setAnimation(0, '07', true);\n const targetScale = Math.min(scaleX, scaleY);\n const figureSprite = new PIXI.Sprite();\n figureSprite.addChild(figureSpine);\n figureSprite.scale.x = targetScale;\n figureSprite.scale.y = targetScale;\n figureSprite.anchor.set(0.5);\n figureSprite.position.y = this.stageHeight / 2;\n const targetWidth = originalWidth * targetScale;\n const targetHeight = originalHeight * targetScale;\n thisFigureContainer.setBaseY(this.stageHeight / 2);\n if (targetHeight < this.stageHeight) {\n thisFigureContainer.setBaseY(this.stageHeight / 2 + this.stageHeight - targetHeight / 2);\n }\n if (presetPosition === 'center') {\n thisFigureContainer.setBaseX(this.stageWidth / 2);\n }\n if (presetPosition === 'left') {\n thisFigureContainer.setBaseX(targetWidth / 2);\n }\n if (presetPosition === 'right') {\n thisFigureContainer.setBaseX(this.stageWidth - targetWidth / 2);\n }\n thisFigureContainer.pivot.set(0, this.stageHeight / 2);\n thisFigureContainer.addChild(figureSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]) {\n this.loadAsset(url, setup, spineId);\n } else {\n // 复用\n setup();\n }\n }\n\n /**\n * Live2d立绘,如果要使用 Live2D,取消这里的注释\n * @param jsonPath\n */\n // eslint-disable-next-line max-params\n // public addLive2dFigure(key: string, jsonPath: string, pos: string, motion: string, expression: string) {\n // let stageWidth = this.stageWidth;\n // let stageHeight = this.stageHeight;\n // logger.debug('Using motion:', motion);\n //\n // figureCash.push(jsonPath);\n //\n // const loader = this.assetLoader;\n // // 准备用于存放这个立绘的 Container\n // const thisFigureContainer = new WebGALPixiContainer();\n //\n // // 是否有相同 key 的立绘\n // const setFigIndex = this.figureObjects.findIndex((e) => e.key === key);\n // const isFigSet = setFigIndex >= 0;\n //\n // // 已经有一个这个 key 的立绘存在了\n // if (isFigSet) {\n // this.removeStageObjectByKey(key);\n // }\n //\n // // 挂载\n // this.figureContainer.addChild(thisFigureContainer);\n // this.figureObjects.push({\n // uuid: uuid(),\n // key: key,\n // pixiContainer: thisFigureContainer,\n // sourceUrl: jsonPath,\n // sourceType: 'live2d',\n // sourceExt: 'json',\n // });\n // // eslint-disable-next-line @typescript-eslint/no-this-alias\n // const instance = this;\n //\n // const setup = () => {\n // if (thisFigureContainer) {\n // (async function () {\n // const models = await Promise.all([Live2DModel.from(jsonPath, { autoInteract: false })]);\n //\n // models.forEach((model) => {\n // const scaleX = stageWidth / model.width;\n // const scaleY = stageHeight / model.height;\n // const targetScale = Math.min(scaleX, scaleY) * 1.5;\n // const targetWidth = model.width * targetScale;\n // // const targetHeight = model.height * targetScale;\n //\n // model.scale.set(targetScale);\n // model.anchor.set(0.5);\n // model.position.x = stageWidth / 2;\n // model.position.y = stageHeight / 1.2;\n //\n // if (pos === 'left') {\n // model.position.x = targetWidth / 2;\n // }\n // if (pos === 'right') {\n // model.position.x = stageWidth - targetWidth / 2;\n // }\n //\n // let motionToSet = motion;\n // let animation_index = 0;\n // let priority_number = 3;\n // // var audio_link = voiceCash.pop();\n //\n // // model.motion(category_name, animation_index, priority_number,location.href + audio_link);\n // /**\n // * 检查 Motion 和 Expression\n // */\n // const motionFromState = webgalStore.getState().stage.live2dMotion.find((e) => e.target === key);\n // const expressionFromState = webgalStore.getState().stage.live2dExpression.find((e) => e.target === key);\n // if (motionFromState) {\n // motionToSet = motionFromState.motion;\n // }\n // instance.updateL2dMotionByKey(key, motionToSet);\n // model.motion(motionToSet, animation_index, priority_number);\n // let expressionToSet = expression;\n // if (expressionFromState) {\n // expressionToSet = expressionFromState.expression;\n // }\n // instance.updateL2dExpressionByKey(key, expressionToSet);\n // model.expression(expressionToSet);\n // // @ts-ignore\n // if (model.internalModel.eyeBlink) {\n // // @ts-ignore\n // model.internalModel.eyeBlink.blinkInterval = 1000 * 60 * 60 * 24; // @ts-ignore\n // model.internalModel.eyeBlink.nextBlinkTimeLeft = 1000 * 60 * 60 * 24;\n // }\n //\n // // lip-sync is still a problem and you can not.\n // SoundManager.volume = 0; // @ts-ignore\n // if (model.internalModel.angleXParamIndex !== undefined) model.internalModel.angleXParamIndex = 999; // @ts-ignore\n // if (model.internalModel.angleYParamIndex !== undefined) model.internalModel.angleYParamIndex = 999; // @ts-ignore\n // if (model.internalModel.angleZParamIndex !== undefined) model.internalModel.angleZParamIndex = 999;\n // thisFigureContainer.addChild(model);\n // });\n // })();\n // }\n // };\n //\n // /**\n // * 加载器部分\n // */\n // const resourses = Object.keys(loader.resources);\n // this.cacheGC();\n // if (!resourses.includes(jsonPath)) {\n // this.loadAsset(jsonPath, setup);\n // } else {\n // // 复用\n // setup();\n // }\n // }\n\n public changeModelMotionByKey(key: string, motion: string) {\n // logger.debug(`Applying motion ${motion} to ${key}`);\n const target = this.figureObjects.find((e) => e.key === key);\n if (target?.sourceType !== 'live2d') return;\n const figureRecordTarget = this.live2dFigureRecorder.find((e) => e.target === key);\n if (target && figureRecordTarget?.motion !== motion) {\n const container = target.pixiContainer;\n const children = container.children;\n for (const model of children) {\n let category_name = motion;\n let animation_index = 0;\n let priority_number = 3; // @ts-ignore\n const internalModel = model?.internalModel ?? undefined; // 安全访问\n internalModel?.motionManager?.stopAllMotions?.();\n // @ts-ignore\n model.motion(category_name, animation_index, priority_number);\n }\n this.updateL2dMotionByKey(key, motion);\n }\n }\n\n public changeModelExpressionByKey(key: string, expression: string) {\n // logger.debug(`Applying expression ${expression} to ${key}`);\n const target = this.figureObjects.find((e) => e.key === key);\n if (target?.sourceType !== 'live2d') return;\n const figureRecordTarget = this.live2dFigureRecorder.find((e) => e.target === key);\n if (target && figureRecordTarget?.expression !== expression) {\n const container = target.pixiContainer;\n const children = container.children;\n for (const model of children) {\n // @ts-ignore\n model.expression(expression);\n }\n this.updateL2dExpressionByKey(key, expression);\n }\n }\n\n public setModelMouthY(key: string, y: number) {\n function mapToZeroOne(value: number) {\n return value < 50 ? 0 : (value - 50) / 50;\n }\n\n const paramY = mapToZeroOne(y);\n const target = this.figureObjects.find((e) => e.key === key);\n if (target) {\n const container = target.pixiContainer;\n const children = container.children;\n for (const model of children) {\n // @ts-ignore\n if (model?.internalModel) {\n // @ts-ignore\n if (model?.internalModel?.coreModel?.setParamFloat)\n // @ts-ignore\n model?.internalModel?.coreModel?.setParamFloat?.('PARAM_MOUTH_OPEN_Y', paramY);\n // @ts-ignore\n if (model?.internalModel?.coreModel?.setParameterValueById)\n // @ts-ignore\n model?.internalModel?.coreModel?.setParameterValueById('ParamMouthOpenY', paramY);\n }\n }\n }\n }\n\n /**\n * 根据 key 获取舞台上的对象\n * @param key\n */\n public getStageObjByKey(key: string) {\n return [...this.figureObjects, ...this.backgroundObjects].find((e) => e.key === key);\n }\n\n public getStageObjByUuid(objUuid: string) {\n return [...this.figureObjects, ...this.backgroundObjects].find((e) => e.uuid === objUuid);\n }\n\n public getAllStageObj() {\n return [...this.figureObjects, ...this.backgroundObjects];\n }\n\n /**\n * 根据 key 删除舞台上的对象\n * @param key\n */\n public removeStageObjectByKey(key: string) {\n const indexFig = this.figureObjects.findIndex((e) => e.key === key);\n const indexBg = this.backgroundObjects.findIndex((e) => e.key === key);\n if (indexFig >= 0) {\n const bgSprite = this.figureObjects[indexFig];\n for (const element of bgSprite.pixiContainer.children) {\n element.destroy();\n }\n bgSprite.pixiContainer.destroy();\n this.figureContainer.removeChild(bgSprite.pixiContainer);\n this.figureObjects.splice(indexFig, 1);\n }\n if (indexBg >= 0) {\n const bgSprite = this.backgroundObjects[indexBg];\n for (const element of bgSprite.pixiContainer.children) {\n element.destroy();\n }\n bgSprite.pixiContainer.destroy();\n this.backgroundContainer.removeChild(bgSprite.pixiContainer);\n this.backgroundObjects.splice(indexBg, 1);\n }\n // /**\n // * 删掉相关 Effects,因为已经移除了\n // */\n // const prevEffects = webgalStore.getState().stage.effects;\n // const newEffects = __.cloneDeep(prevEffects);\n // const index = newEffects.findIndex((e) => e.target === key);\n // if (index >= 0) {\n // newEffects.splice(index, 1);\n // }\n // updateCurrentEffects(newEffects);\n }\n\n public cacheGC() {\n PIXI.utils.clearTextureCache();\n }\n\n private updateL2dMotionByKey(target: string, motion: string) {\n const figureTargetIndex = this.live2dFigureRecorder.findIndex((e) => e.target === target);\n if (figureTargetIndex >= 0) {\n this.live2dFigureRecorder[figureTargetIndex].motion = motion;\n } else {\n this.live2dFigureRecorder.push({ target, motion, expression: '' });\n }\n }\n\n private updateL2dExpressionByKey(target: string, expression: string) {\n const figureTargetIndex = this.live2dFigureRecorder.findIndex((e) => e.target === target);\n if (figureTargetIndex >= 0) {\n this.live2dFigureRecorder[figureTargetIndex].expression = expression;\n } else {\n this.live2dFigureRecorder.push({ target, motion: '', expression });\n }\n }\n\n private loadAsset(url: string, callback: () => void, name?: string) {\n /**\n * Loader 复用疑似有问题,转而采用先前的单独方式\n */\n this.loadQueue.unshift({ url, callback, name });\n /**\n * 尝试启动加载\n */\n this.callLoader();\n }\n\n private callLoader() {\n if (!this.assetLoader.loading) {\n const front = this.loadQueue.shift();\n if (front) {\n try {\n if (this.assetLoader.resources[front.url]) {\n front.callback();\n this.callLoader();\n } else {\n if (front.name) {\n this.assetLoader.add(front.name, front.url).load(() => {\n front.callback();\n this.callLoader();\n });\n } else {\n this.assetLoader.add(front.url).load(() => {\n front.callback();\n this.callLoader();\n });\n }\n }\n } catch (error) {\n logger.fatal('PIXI Loader 故障', error);\n front.callback();\n // this.assetLoader.reset(); // 暂时先不用重置\n this.callLoader();\n }\n }\n }\n }\n\n private updateFps() {\n getScreenFps?.(120).then((fps) => {\n this.frameDuration = 1000 / (fps as number);\n // logger.info('当前帧率', fps);\n });\n }\n\n private lockStageObject(targetName: string) {\n this.lockTransformTarget.push(targetName);\n }\n\n private unlockStageObject(targetName: string) {\n const index = this.lockTransformTarget.findIndex((name) => name === targetName);\n if (index >= 0) this.lockTransformTarget.splice(index, 1);\n }\n\n private getExtName(url: string) {\n return url.split('.').pop() ?? 'png';\n }\n}\n\nfunction updateCurrentBacklogEffects(newEffects: IEffect[]) {\n /**\n * 更新当前 backlog 条目的 effects 记录\n */\n setTimeout(() => {\n WebGAL.backlogManager.editLastBacklogItemEffect(cloneDeep(newEffects));\n }, 50);\n\n webgalStore.dispatch(setStage({ key: 'effects', value: newEffects }));\n}\n\n/**\n * @param {number} targetCount 不小于1的整数,表示经过targetCount帧之后返回结果\n * @return {Promise}\n */\nconst getScreenFps = (() => {\n // 先做一下兼容性处理\n const nextFrame = [\n window.requestAnimationFrame,\n // @ts-ignore\n window.webkitRequestAnimationFrame,\n // @ts-ignore\n window.mozRequestAnimationFrame,\n ].find((fn) => fn);\n if (!nextFrame) {\n console.error('requestAnimationFrame is not supported!');\n return;\n }\n return (targetCount = 60) => {\n // 判断参数是否合规\n if (targetCount < 1) throw new Error('targetCount cannot be less than 1.');\n const beginDate = Date.now();\n let count = 0;\n return new Promise((resolve) => {\n (function log() {\n nextFrame(() => {\n if (++count >= targetCount) {\n const diffDate = Date.now() - beginDate;\n const fps = (count / diffDate) * 1000;\n return resolve(fps);\n }\n log();\n });\n })();\n });\n };\n})();\n","export const __INFO = {\n version: 'WebGAL 4.5.5',\n contributors: [\n // 现在改为跳转到 GitHub 了\n ],\n};\n","/**\n * @file 引擎初始化时会执行的脚本,包括获取游戏信息,初始化运行时变量,初始化用户数据存储\n */\nimport { logger } from './util/logger';\nimport { infoFetcher } from './util/coreInitialFunction/infoFetcher';\nimport { assetSetter, fileType } from './util/gameAssetsAccess/assetSetter';\nimport { sceneFetcher } from './controller/scene/sceneFetcher';\nimport { sceneParser } from './parser/sceneParser';\nimport { bindExtraFunc } from '@/Core/util/coreInitialFunction/bindExtraFunc';\nimport { webSocketFunc } from '@/Core/util/syncWithEditor/webSocketFunc';\nimport uniqWith from 'lodash/uniqWith';\nimport { scenePrefetcher } from './util/prefetcher/scenePrefetcher';\nimport PixiStage from '@/Core/controller/stage/pixi/PixiController';\nimport axios from 'axios';\nimport { __INFO } from '@/config/info';\nimport { WebGAL } from '@/Core/WebGAL';\n\nconst u = navigator.userAgent;\nexport const isIOS = !!u.match(/\\(i[^;]+;( U;)? CPU.+Mac OS X/); // 判断是否是 iOS终端\n\n/**\n * 引擎初始化函数\n */\nexport const initializeScript = (): void => {\n // 打印初始log信息\n logger.info(__INFO.version);\n logger.info('Github: https://github.com/OpenWebGAL/WebGAL ');\n logger.info('Made with ❤ by OpenWebGAL');\n // 激活强制缩放\n // 在调整窗口大小时重新计算宽高,设计稿按照 1600*900。\n if (isIOS) {\n /**\n * iOS\n */\n alert(\n `iOS 用户请横屏使用以获得最佳体验\n| Please use landscape mode on iOS for the best experience\n| iOS ユーザーは横画面での使用をお勧めします`,\n );\n }\n\n // 获得 userAnimation\n loadStyle('./game/userStyleSheet.css');\n // 获得 user Animation\n getUserAnimation();\n // 获取游戏信息\n infoFetcher('./game/config.txt');\n // 获取start场景\n const sceneUrl: string = assetSetter('start.txt', fileType.scene);\n // 场景写入到运行时\n sceneFetcher(sceneUrl).then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, 'start.txt', sceneUrl);\n // 开始场景的预加载\n const subSceneList = WebGAL.sceneManager.sceneData.currentScene.subSceneList;\n WebGAL.sceneManager.settledScenes.push(sceneUrl); // 放入已加载场景列表,避免递归加载相同场景\n const subSceneListUniq = uniqWith(subSceneList); // 去重\n scenePrefetcher(subSceneListUniq);\n });\n /**\n * 启动Pixi\n */\n WebGAL.gameplay.pixiStage = new PixiStage();\n\n /**\n * iOS 设备 卸载所有 Service Worker\n */\n // if ('serviceWorker' in navigator && isIOS) {\n // navigator.serviceWorker.getRegistrations().then((registrations) => {\n // for (const registration of registrations) {\n // registration.unregister().then(() => {\n // logger.info('已卸载 Service Worker');\n // });\n // }\n // });\n // }\n\n /**\n * 绑定工具函数\n */\n bindExtraFunc();\n webSocketFunc();\n};\n\nfunction loadStyle(url: string) {\n const link = document.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n const head = document.getElementsByTagName('head')[0];\n head.appendChild(link);\n}\n\nfunction getUserAnimation() {\n axios.get('./game/animation/animationTable.json').then((res) => {\n const animations: Array = res.data;\n for (const animationName of animations) {\n axios.get(`./game/animation/${animationName}.json`).then((res) => {\n if (res.data) {\n const userAnimation = {\n name: animationName,\n effects: res.data,\n };\n WebGAL.animationManager.addAnimation(userAnimation);\n }\n });\n }\n });\n}\n","var _excluded = [\"size\", \"strokeWidth\", \"strokeLinecap\", \"strokeLinejoin\", \"theme\", \"fill\", \"className\", \"spin\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { createContext, useContext, useMemo } from 'react';\nexport var DEFAULT_ICON_CONFIGS = {\n size: '1em',\n strokeWidth: 4,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n rtl: false,\n theme: 'outline',\n colors: {\n outline: {\n fill: '#333',\n background: 'transparent'\n },\n filled: {\n fill: '#333',\n background: '#FFF'\n },\n twoTone: {\n fill: '#333',\n twoTone: '#2F88FF'\n },\n multiColor: {\n outStrokeColor: '#333',\n outFillColor: '#2F88FF',\n innerStrokeColor: '#FFF',\n innerFillColor: '#43CCF8'\n }\n },\n prefix: 'i'\n};\n\nfunction guid() {\n return 'icon-' + ((1 + Math.random()) * 0x100000000 | 0).toString(16).substring(1);\n}\n\nexport function IconConverter(id, icon, config) {\n var fill = typeof icon.fill === 'string' ? [icon.fill] : icon.fill || [];\n var colors = [];\n var theme = icon.theme || config.theme;\n\n switch (theme) {\n case 'outline':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push('none');\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push('none');\n break;\n\n case 'filled':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push('#FFF');\n colors.push('#FFF');\n break;\n\n case 'two-tone':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[1] === 'string' ? fill[1] : config.colors.twoTone.twoTone);\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[1] === 'string' ? fill[1] : config.colors.twoTone.twoTone);\n break;\n\n case 'multi-color':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[1] === 'string' ? fill[1] : config.colors.multiColor.outFillColor);\n colors.push(typeof fill[2] === 'string' ? fill[2] : config.colors.multiColor.innerStrokeColor);\n colors.push(typeof fill[3] === 'string' ? fill[3] : config.colors.multiColor.innerFillColor);\n break;\n }\n\n return {\n size: icon.size || config.size,\n strokeWidth: icon.strokeWidth || config.strokeWidth,\n strokeLinecap: icon.strokeLinecap || config.strokeLinecap,\n strokeLinejoin: icon.strokeLinejoin || config.strokeLinejoin,\n colors: colors,\n id: id\n };\n}\nvar IconContext = /*#__PURE__*/createContext(DEFAULT_ICON_CONFIGS);\nexport var IconProvider = IconContext.Provider;\nexport function IconWrapper(name, rtl, render) {\n return function (props) {\n var size = props.size,\n strokeWidth = props.strokeWidth,\n strokeLinecap = props.strokeLinecap,\n strokeLinejoin = props.strokeLinejoin,\n theme = props.theme,\n fill = props.fill,\n className = props.className,\n spin = props.spin,\n extra = _objectWithoutProperties(props, _excluded);\n\n var ICON_CONFIGS = useContext(IconContext);\n var id = useMemo(guid, []);\n var svgProps = IconConverter(id, {\n size: size,\n strokeWidth: strokeWidth,\n strokeLinecap: strokeLinecap,\n strokeLinejoin: strokeLinejoin,\n theme: theme,\n fill: fill\n }, ICON_CONFIGS);\n var cls = [ICON_CONFIGS.prefix + '-icon'];\n cls.push(ICON_CONFIGS.prefix + '-icon' + '-' + name);\n\n if (rtl && ICON_CONFIGS.rtl) {\n cls.push(ICON_CONFIGS.prefix + '-icon-rtl');\n }\n\n if (spin) {\n cls.push(ICON_CONFIGS.prefix + '-icon-spin');\n }\n\n if (className) {\n cls.push(className);\n }\n\n return /*#__PURE__*/React.createElement(\"span\", _objectSpread(_objectSpread({}, extra), {}, {\n className: cls.join(' ')\n }), render(svgProps));\n };\n}","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('align-text-left-one', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39 6H9C7.34315 6 6 7.34315 6 9V39C6 40.6569 7.34315 42 9 42H39C40.6569 42 42 40.6569 42 39V9C42 7.34315 40.6569 6 39 6Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26 24H14\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 15H14\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32 33H14\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('close-small', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 14L34 34\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 34L34 14\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('double-down', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36 12L24 24L12 12\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36 24L24 36L12 24\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('double-right', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 12L24 24L12 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 12L36 24L24 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('double-up', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 24L24 12L36 24\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 36L24 24L36 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('folder-open', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4 9V41L9 21H39.5V15C39.5 13.8954 38.6046 13 37.5 13H24L19 7H6C4.89543 7 4 7.89543 4 9Z\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40 41L44 21H8.8125L4 41H40Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('go-end', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 12L26 24L14 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 12V36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('go-start', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 36L22 24L34 12\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 12V36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('hamburger-button', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.94971 11.9497H39.9497\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.94971 23.9497H39.9497\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.94971 35.9497H39.9497\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('home', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 18V42H39V18L24 6L9 18Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 29V42H29V29H19Z\",\n fill: props.colors[3],\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 42H39\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('left', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31 36L19 24L31 12\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('lock', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: \"6\",\n y: \"22\",\n width: \"36\",\n height: \"22\",\n rx: \"2\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 22V14C14 8.47715 18.4772 4 24 4C29.5228 4 34 8.47715 34 14V22\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 30V36\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('logout', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.9917 6H6V42H24\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M33 33L42 24L33 15\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 23.9917H42\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('music-list', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 19H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 10H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 38H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 28H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 10L16 15L8 20V10Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('play-one', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 24V11.8756L25.5 17.9378L36 24L25.5 30.0622L15 36.1244V24Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('preview-close-one', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42 42L6 6\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('preview-open', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 36C35.0457 36 44 24 44 24C44 24 35.0457 12 24 12C12.9543 12 4 24 4 24C4 24 12.9543 36 24 36Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 29C26.7614 29 29 26.7614 29 24C29 21.2386 26.7614 19 24 19C21.2386 19 19 21.2386 19 24C19 26.7614 21.2386 29 24 29Z\",\n fill: props.colors[3],\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('replay-music', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21 24V18L26 21L31 24L26 27L21 30V24Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.2721 36.7279C14.5294 39.9853 19.0294 42 24 42C33.9411 42 42 33.9411 42 24C42 14.0589 33.9411 6 24 6C19.0294 6 14.5294 8.01472 11.2721 11.2721C9.6141 12.9301 6 17 6 17\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 9V17H14\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('return', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.9998 8L6 14L12.9998 21\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('save', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 9C6 7.34315 7.34315 6 9 6H34.2814L42 13.2065V39C42 40.6569 40.6569 42 39 42H9C7.34315 42 6 40.6569 6 39V9Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M24.0083 6L24 13.3846C24 13.7245 23.5523 14 23 14H15C14.4477 14 14 13.7245 14 13.3846L14 6\",\n fill: props.colors[3]\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.0083 6L24 13.3846C24 13.7245 23.5523 14 23 14H15C14.4477 14 14 13.7245 14 13.3846L14 6H24.0083Z\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 6H34.2814\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 26H34\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 34H24.0083\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('setting-two', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.2838 43.1713C14.9327 42.1736 11.9498 40.3213 9.58787 37.867C10.469 36.8227 11 35.4734 11 34.0001C11 30.6864 8.31371 28.0001 5 28.0001C4.79955 28.0001 4.60139 28.01 4.40599 28.0292C4.13979 26.7277 4 25.3803 4 24.0001C4 21.9095 4.32077 19.8938 4.91579 17.9995C4.94381 17.9999 4.97188 18.0001 5 18.0001C8.31371 18.0001 11 15.3138 11 12.0001C11 11.0488 10.7786 10.1493 10.3846 9.35011C12.6975 7.1995 15.5205 5.59002 18.6521 4.72314C19.6444 6.66819 21.6667 8.00013 24 8.00013C26.3333 8.00013 28.3556 6.66819 29.3479 4.72314C32.4795 5.59002 35.3025 7.1995 37.6154 9.35011C37.2214 10.1493 37 11.0488 37 12.0001C37 15.3138 39.6863 18.0001 43 18.0001C43.0281 18.0001 43.0562 17.9999 43.0842 17.9995C43.6792 19.8938 44 21.9095 44 24.0001C44 25.3803 43.8602 26.7277 43.594 28.0292C43.3986 28.01 43.2005 28.0001 43 28.0001C39.6863 28.0001 37 30.6864 37 34.0001C37 35.4734 37.531 36.8227 38.4121 37.867C36.0502 40.3213 33.0673 42.1736 29.7162 43.1713C28.9428 40.752 26.676 39.0001 24 39.0001C21.324 39.0001 19.0572 40.752 18.2838 43.1713Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 31C27.866 31 31 27.866 31 24C31 20.134 27.866 17 24 17C20.134 17 17 20.134 17 24C17 27.866 20.134 31 24 31Z\",\n fill: props.colors[3],\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('square-small', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 12H14C12.8954 12 12 12.8954 12 14V34C12 35.1046 12.8954 36 14 36H34C35.1046 36 36 35.1046 36 34V14C36 12.8954 35.1046 12 34 12Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('unlock', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: \"7\",\n y: \"22.0476\",\n width: \"34\",\n height: \"22\",\n rx: \"2\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 22V14.0047C13.9948 8.87022 17.9227 4.56718 23.0859 4.05117C28.249 3.53516 32.9673 6.97408 34 12.0059\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 30V36\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('volume-notice', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.2359 41.1857C40.0836 37.6953 44 31.305 44 24C44 16.8085 40.2043 10.5035 34.507 6.97906\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap\n }));\n});","import { IMenuPanel } from '@/UI/Menu/MenuPanel/menuPanelInterface';\nimport { FolderOpen, Home, Logout, Save, SettingTwo } from '@icon-park/react';\n\n/**\n * 通过图标名称返回正确的图标\n * @param props\n * @constructor\n */\nexport const MenuIconMap = (props: IMenuPanel) => {\n let returnIcon;\n switch (props.iconName) {\n case 'save':\n returnIcon = ;\n break;\n case 'load':\n returnIcon = ;\n break;\n case 'option':\n returnIcon = ;\n break;\n case 'title':\n returnIcon = ;\n break;\n case 'exit':\n returnIcon = ;\n break;\n default:\n returnIcon =

;\n }\n\n return returnIcon;\n};\n","import styles from './menuPanel.module.scss';\nimport { MenuIconMap } from './MenuIconMap';\nimport { IMenuPanel } from '@/UI/Menu/MenuPanel/menuPanelInterface';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\n/**\n * 菜单标签页切换按钮\n * @param props\n * @constructor\n */\nexport const MenuPanelButton = (props: IMenuPanel) => {\n const { playSePageChange, playSeEnter } = useSoundEffect();\n let buttonClassName = styles.MenuPanel_button;\n if (props.hasOwnProperty('buttonOnClassName')) {\n buttonClassName = buttonClassName + props.buttonOnClassName;\n }\n return (\n {\n props.clickFunc();\n // playSePageChange();\n }}\n onMouseEnter={playSeEnter}\n style={{ ...props.style, color: props.tagColor }}\n >\n
\n \n
\n {props.tagName}\n
\n );\n};\n","import { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { stopAllPerform } from '@/Core/controller/gamePlay/stopAllPerform';\nimport { stopAuto } from '@/Core/controller/gamePlay/autoPlay';\nimport { stopFast } from '@/Core/controller/gamePlay/fastSkip';\nimport { setEbg } from '@/Core/gameScripts/changeBg/setEbg';\n\nexport const backToTitle = () => {\n const dispatch = webgalStore.dispatch;\n stopAllPerform();\n stopAuto();\n stopFast();\n // 清除语音\n dispatch(setStage({ key: 'playVocal', value: '' }));\n // 重新打开标题界面\n dispatch(setVisibility({ component: 'showTitle', visibility: true }));\n /**\n * 重设为标题背景\n */\n setEbg(webgalStore.getState().GUI.titleBg);\n};\n","import styles from './globalDialog.module.scss';\nimport ReactDOM from 'react-dom';\nimport { useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { useSEByWebgalStore } from '@/hooks/useSoundEffect';\n\nexport default function GlobalDialog() {\n const isGlobalDialogShow = useSelector((state: RootState) => state.GUI.showGlobalDialog);\n return <>{isGlobalDialogShow &&
};\n}\n\ninterface IShowGlobalDialogProps {\n title: string;\n leftText: string;\n rightText: string;\n leftFunc: Function;\n rightFunc: Function;\n}\n\nexport function showGlogalDialog(props: IShowGlobalDialogProps) {\n const { playSeClick, playSeEnter } = useSEByWebgalStore();\n webgalStore.dispatch(setVisibility({ component: 'showGlobalDialog', visibility: true }));\n const handleLeft = () => {\n playSeClick();\n props.leftFunc();\n hideGlobalDialog();\n };\n const handleRight = () => {\n playSeClick();\n props.rightFunc();\n hideGlobalDialog();\n };\n const renderElement = (\n
\n
\n
\n
{props.title}
\n
\n
\n {props.leftText}\n
\n
\n {props.rightText}\n
\n
\n
\n
\n
\n );\n setTimeout(() => {\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(renderElement, document.getElementById('globalDialogContainer'));\n }, 100);\n}\n\nexport function hideGlobalDialog() {\n webgalStore.dispatch(setVisibility({ component: 'showGlobalDialog', visibility: false }));\n}\n\nexport function showControls() {\n webgalStore.dispatch(setVisibility({ component: 'showControls', visibility: true }));\n}\n\nexport function hideControls() {\n webgalStore.dispatch(setVisibility({ component: 'showControls', visibility: false }));\n}\n\nexport function switchControls() {\n if (webgalStore.getState().GUI.showControls === true) {\n hideControls();\n } else {\n showControls();\n }\n}\n","import styles from './menuPanel.module.scss';\nimport { MenuPanelButton } from './MenuPanelButton';\nimport { playBgm } from '@/Core/controller/stage/playBgm';\nimport { MenuPanelTag } from '@/store/guiInterface';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setMenuPanelTag, setVisibility } from '@/store/GUIReducer';\nimport { backToTitle } from '@/Core/controller/gamePlay/backToTitle';\nimport useTrans from '@/hooks/useTrans';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';\n\n/**\n * Menu页的底栏\n * @constructor\n */\nexport const MenuPanel = () => {\n // 国际化\n const t = useTrans('menu.');\n\n const { playSeClick, playSeDialogOpen, playSePageChange } = useSoundEffect();\n const GUIState = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n // 设置Menu按钮的高亮\n const SaveTagOn = GUIState.currentMenuTag === MenuPanelTag.Save ? ` ${styles.MenuPanel_button_hl}` : ``;\n const LoadTagOn = GUIState.currentMenuTag === MenuPanelTag.Load ? ` ${styles.MenuPanel_button_hl}` : ``;\n const OptionTagOn = GUIState.currentMenuTag === MenuPanelTag.Option ? ` ${styles.MenuPanel_button_hl}` : ``;\n\n // 设置Menu按钮的颜色\n const SaveTagColor = GUIState.currentMenuTag === MenuPanelTag.Save ? `rgba(74, 34, 93, 0.9)` : `rgba(123,144,169,1)`;\n const LoadTagColor = GUIState.currentMenuTag === MenuPanelTag.Load ? `rgba(11, 52, 110, 0.9)` : `rgba(123,144,169,1)`;\n const OptionTagColor =\n GUIState.currentMenuTag === MenuPanelTag.Option ? `rgba(81, 110, 65, 0.9)` : `rgba(123,144,169,1)`;\n\n // 设置Menu图标的颜色\n const SaveIconColor = GUIState.currentMenuTag === MenuPanelTag.Save ? `rgba(74, 34, 93, 0.9)` : `rgba(123,144,169,1)`;\n const LoadIconColor =\n GUIState.currentMenuTag === MenuPanelTag.Load ? `rgba(11, 52, 110, 0.9)` : `rgba(123,144,169,1)`;\n const OptionIconColor =\n GUIState.currentMenuTag === MenuPanelTag.Option ? `rgba(81, 110, 65, 0.9)` : `rgba(123,144,169,1)`;\n\n return (\n
\n {\n playSePageChange();\n if (GUIState.showTitle) return;\n dispatch(setMenuPanelTag(MenuPanelTag.Save));\n }}\n tagName={t('saving.title')}\n key=\"saveButton\"\n />\n {\n playSePageChange();\n dispatch(setMenuPanelTag(MenuPanelTag.Load));\n }}\n tagName={t('loadSaving.title')}\n key=\"loadButton\"\n />\n {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('$gaming.buttons.titleTips'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n backToTitle();\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: false }));\n },\n rightFunc: () => {},\n });\n }}\n tagName={t('title.title')}\n key=\"titleIcon\"\n />\n {\n playSePageChange();\n dispatch(setMenuPanelTag(MenuPanelTag.Option));\n }}\n tagName={t('options.title')}\n key=\"optionButton\"\n />\n\n {\n playSeClick();\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: false }));\n }}\n tagName={t('exit.title')}\n key=\"exitIcon\"\n />\n
\n );\n};\n","import { CSSProperties, FC, useEffect } from 'react';\nimport styles from '../SaveAndLoad.module.scss';\nimport { saveGame } from '@/Core/controller/storage/saveGame';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setSlPage } from '@/store/userDataReducer';\nimport { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';\nimport useTrans from '@/hooks/useTrans';\nimport { useTranslation } from 'react-i18next';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { getSavesFromStorage } from '@/Core/controller/storage/savesController';\n\nexport const Save: FC = () => {\n const { playSePageChange, playSeEnter, playSeDialogOpen } = useSoundEffect();\n const userDataState = useSelector((state: RootState) => state.userData);\n const savesDataState = useSelector((state: RootState) => state.saveData);\n const dispatch = useDispatch();\n const page = [];\n for (let i = 1; i <= 20; i++) {\n let classNameOfElement = styles.Save_Load_top_button;\n if (i === userDataState.optionData.slPage) {\n classNameOfElement = classNameOfElement + ' ' + styles.Save_Load_top_button_on;\n }\n const element = (\n {\n dispatch(setSlPage(i));\n setStorage();\n playSePageChange();\n }}\n onMouseEnter={playSeEnter}\n key={'Save_element_page' + i}\n className={classNameOfElement}\n >\n
{i}
\n
\n );\n page.push(element);\n }\n\n const tCommon = useTrans('common.');\n\n const showSaves = [];\n // 现在尝试设置10个存档每页\n const start = (userDataState.optionData.slPage - 1) * 10 + 1;\n const end = start + 9;\n\n useEffect(() => {\n getSavesFromStorage(start, end);\n }, [start, end]);\n\n let animationIndex = 0;\n for (let i = start; i <= end; i++) {\n animationIndex++;\n const saveData = savesDataState.saveData[i];\n let saveElementContent =
;\n if (saveData) {\n const speaker = saveData.nowStageState.showName === '' ? '\\u00A0' : `${saveData.nowStageState.showName}`;\n saveElementContent = (\n <>\n
\n
{saveData.index}
\n
{saveData.saveTime}
\n
\n
\n \"Save_img_preview\"\n
\n
\n
{speaker}
\n
{saveData.nowStageState.showText}
\n
\n \n );\n }\n // else {\n\n // }\n const saveElement = (\n {\n if (savesDataState.saveData[i]) {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('saving.isOverwrite'),\n leftText: tCommon('yes'),\n rightText: tCommon('no'),\n leftFunc: () => {\n saveGame(i);\n setStorage();\n },\n rightFunc: () => {},\n });\n } else {\n playSePageChange();\n saveGame(i);\n }\n }}\n onMouseEnter={playSeEnter}\n key={'saveElement_' + i}\n className={styles.Save_Load_content_element}\n style={{ animationDelay: `${animationIndex * 30}ms` }}\n >\n {saveElementContent}\n
\n );\n showSaves.push(saveElement);\n }\n\n const t = useTrans('menu.');\n\n return (\n
\n
\n
\n
{t('saving.title')}
\n
\n
{page}
\n
\n
\n {showSaves}\n
\n
\n );\n};\n","import { CSSProperties, FC, useEffect } from 'react';\nimport { loadGame } from '@/Core/controller/storage/loadGame';\nimport styles from '../SaveAndLoad.module.scss';\n// import {saveGame} from '@/Core/controller/storage/saveGame';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setSlPage } from '@/store/userDataReducer';\nimport useTrans from '@/hooks/useTrans';\nimport { useTranslation } from 'react-i18next';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { getSavesFromStorage } from '@/Core/controller/storage/savesController';\n\nexport const Load: FC = () => {\n const { playSeClick, playSeEnter, playSePageChange } = useSoundEffect();\n const userDataState = useSelector((state: RootState) => state.userData);\n const saveDataState = useSelector((state: RootState) => state.saveData);\n const dispatch = useDispatch();\n const page = [];\n for (let i = 1; i <= 20; i++) {\n let classNameOfElement = styles.Save_Load_top_button + ' ' + styles.Load_top_button;\n if (i === userDataState.optionData.slPage) {\n classNameOfElement = classNameOfElement + ' ' + styles.Save_Load_top_button_on + ' ' + styles.Load_top_button_on;\n }\n const element = (\n {\n dispatch(setSlPage(i));\n setStorage();\n playSePageChange();\n }}\n onMouseEnter={playSeEnter}\n key={'Load_element_page' + i}\n className={classNameOfElement}\n >\n
{i}
\n \n );\n page.push(element);\n }\n\n const showSaves = [];\n // 现在尝试设置10个存档每页\n const start = (userDataState.optionData.slPage - 1) * 10 + 1;\n const end = start + 9;\n\n useEffect(() => {\n getSavesFromStorage(start, end);\n }, [start, end]);\n\n let animationIndex = 0;\n for (let i = start; i <= end; i++) {\n animationIndex++;\n const saveData = saveDataState.saveData[i];\n let saveElementContent =
;\n if (saveData) {\n const speaker = saveData.nowStageState.showName === '' ? '\\u00A0' : `${saveData.nowStageState.showName}`;\n saveElementContent = (\n <>\n
\n
\n {saveData.index}\n
\n
\n {saveData.saveTime}\n
\n
\n
\n \"Save_img_preview\"\n
\n
\n
{speaker}
\n
{saveData.nowStageState.showText}
\n
\n \n );\n }\n // else {\n\n // }\n const saveElement = (\n {\n loadGame(i);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n key={'loadElement_' + i}\n className={styles.Save_Load_content_element}\n style={{ animationDelay: `${animationIndex * 30}ms` }}\n >\n {saveElementContent}\n
\n );\n showSaves.push(saveElement);\n }\n\n const t = useTrans('menu.');\n\n return (\n
\n
\n
\n
{t('loadSaving.title')}
\n
\n
{page}
\n
\n
\n {showSaves}\n
\n
\n );\n};\n","import styles from './normalOption.module.scss';\n\nexport const NormalOption = (props: any) => {\n return (\n
\n {/*
{props.title}
*/}\n {/*
{props.title}
*/}\n
{props.title}
\n
\n {props.children}\n
\n
\n );\n};\n","import { ReactElement } from 'react';\nimport { INormalButton } from '@/UI/Menu/Options/OptionInterface';\nimport styles from './normalButton.module.scss';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport const NormalButton = (props: INormalButton) => {\n const len: number = props.textList.length;\n const buttonList: Array = [];\n const { playSeEnter, playSeSwitch } = useSoundEffect();\n for (let i = 0; i < len; i++) {\n if (i === props.currentChecked) {\n const t = (\n {\n playSeSwitch();\n props.functionList[i]();\n }}\n onMouseEnter={playSeEnter}\n >\n {props.textList[i]}\n \n );\n buttonList.push(t);\n } else {\n const t = (\n {\n playSeSwitch();\n props.functionList[i]();\n }}\n onMouseEnter={playSeEnter}\n >\n {props.textList[i]}\n \n );\n buttonList.push(t);\n }\n }\n return <>{buttonList};\n};\n","import { RootState } from '@/store/store';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { useTranslation } from 'react-i18next';\nimport { useDispatch } from 'react-redux';\nimport { useGenSyncRef } from './useGenSyncRef';\nimport { logger } from '@/Core/util/logger';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { language } from '@/config/language';\n\nexport function getLanguageName(lang: language): string {\n return language[lang];\n}\n\nexport default function useLanguage() {\n const { i18n } = useTranslation();\n const userDataRef = useGenSyncRef((state: RootState) => state.userData);\n const dispatch = useDispatch();\n\n return (_lang?: language, isSyncStorage = true) => {\n const lang = _lang ?? userDataRef.current?.optionData.language ?? language.zhCn;\n\n const languageName = getLanguageName(lang);\n i18n.changeLanguage(languageName);\n\n dispatch(setOptionData({ key: 'language', value: lang }));\n logger.info('设置语言: ' + languageName);\n window?.localStorage.setItem('lang', lang.toString());\n if (isSyncStorage) {\n setStorage();\n }\n };\n}\n","import useTrans from '@/hooks/useTrans';\nimport { Left } from '@icon-park/react';\nimport s from './about.module.scss';\nimport { __INFO } from '@/config/info';\n\nexport default function About(props: { onClose: () => void }) {\n const t = useTrans('menu.options.pages.system.options.about.');\n return (\n
\n
\n \n
\n
{t('subTitle')}
\n
{t('version')}
\n
{__INFO.version}
\n
{t('source')}
\n \n
{t('contributors')}
\n \n
{t('website')}
\n \n
\n );\n}\n","import styles from '@/UI/Menu/Options/options.module.scss';\nimport { NormalOption } from '@/UI/Menu/Options/NormalOption';\nimport { NormalButton } from '@/UI/Menu/Options/NormalButton';\nimport { resetAllData, resetOptionSet, setOptionData } from '@/store/userDataReducer';\nimport { IUserData, playSpeed } from '@/store/userDataInterface';\nimport { getStorage, setStorage, dumpToStorageFast } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';\nimport localforage from 'localforage';\nimport { logger } from '@/Core/util/logger';\nimport useTrans from '@/hooks/useTrans';\nimport useLanguage from '@/hooks/useLanguage';\nimport languages, { language } from '@/config/language';\nimport { useState } from 'react';\nimport About from '@/UI/Menu/Options/System/About';\nimport { WebGAL } from '@/Core/WebGAL';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport savesReducer, { ISavesData, saveActions } from '@/store/savesReducer';\nimport { dumpFastSaveToStorage, dumpSavesToStorage } from '@/Core/controller/storage/savesController';\n\ninterface IExportGameData {\n userData: IUserData;\n saves: ISavesData;\n}\n\nexport function System() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const userSavesState = useSelector((state: RootState) => state.saveData);\n const dispatch = useDispatch();\n const setLanguage = useLanguage();\n const t = useTrans('menu.options.pages.system.options.');\n const { playSeDialogOpen } = useSoundEffect();\n\n function exportSaves() {\n const gameData: IExportGameData = {\n userData: userDataState,\n saves: userSavesState,\n };\n\n const saves = JSON.stringify(gameData);\n if (saves !== null) {\n // @ts-ignore\n const blob = new Blob([saves], { type: 'application/json' });\n const blobUrl = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = blobUrl;\n a.download = 'saves.json';\n a.click();\n a.remove();\n }\n }\n\n function importSavesEventHandler(ev: any) {\n // const t = useTrans('menu.options.pages.system.options.');\n\n const file = ev.target.files[0];\n const reader = new FileReader();\n reader.onload = (evR) => {\n const saves = evR!.target!.result as string;\n try {\n const saveAsObj: IExportGameData = JSON.parse(saves);\n playSeDialogOpen();\n showGlogalDialog({\n title: t('gameSave.dialogs.import.title'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: async () => {\n await localforage.setItem(WebGAL.gameKey, saveAsObj.userData).then(() => {\n logger.info(t('gameSave.dialogs.import.tip'));\n });\n getStorage();\n webgalStore.dispatch(saveActions.replaceSaveGame(saveAsObj.saves.saveData));\n webgalStore.dispatch(saveActions.setFastSave(saveAsObj.saves.quickSaveData));\n dumpFastSaveToStorage();\n dumpSavesToStorage(0, 200);\n },\n rightFunc: () => {},\n });\n } catch (e) {\n logger.error(t('gameSave.dialogs.import.error'), e);\n }\n // window.location.reload(); // dirty: 强制刷新 UI\n };\n reader.readAsText(file, 'UTF-8');\n }\n\n function importSaves() {\n const inputElement = document.createElement('input');\n inputElement.type = 'file';\n inputElement.onchange = importSavesEventHandler;\n inputElement.click();\n }\n\n const [showAbout, setShowAbout] = useState(false);\n\n function toggleAbout() {\n setShowAbout(!showAbout);\n }\n\n return (\n
\n {showAbout && }\n {!showAbout && (\n <>\n \n {\n dispatch(setOptionData({ key: 'autoSpeed', value: playSpeed.slow }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'autoSpeed', value: playSpeed.normal }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'autoSpeed', value: playSpeed.fast }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.autoSpeed}\n />\n \n \n () => setLanguage(language[k as unknown as number] as unknown as language),\n )}\n />\n \n \n {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('resetData.dialogs.clearGameSave'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n dispatch(saveActions.resetSaves());\n dumpSavesToStorage(0, 200);\n dumpFastSaveToStorage();\n },\n rightFunc: () => {},\n });\n },\n () => {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('resetData.dialogs.resetSettings'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n dispatch(resetOptionSet());\n dumpToStorageFast();\n },\n rightFunc: () => {},\n });\n },\n () => {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('resetData.dialogs.clearAll'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n dispatch(resetAllData());\n dumpToStorageFast();\n dispatch(saveActions.resetSaves());\n dumpSavesToStorage(0, 200);\n dumpFastSaveToStorage();\n },\n rightFunc: () => {},\n });\n },\n ]}\n currentChecked={3}\n />\n \n \n \n \n
\n {t('about.title')}\n
\n \n )}\n
\n );\n}\n","import styles from './textPreview.module.scss';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useFontFamily } from '@/hooks/useFontFamily';\nimport { useTextAnimationDuration, useTextDelay } from '@/hooks/useTextOptions';\nimport useTrans from '@/hooks/useTrans';\nimport { getTextSize } from '@/UI/getTextSize';\nimport IMSSTextbox from '@/Stage/TextBox/IMSSTextbox';\nimport { compileSentence } from '@/Stage/TextBox/TextBox';\n\nexport const TextPreview = (props: any) => {\n const t = useTrans('menu.options.pages.display.options.');\n const userDataState = useSelector((state: RootState) => state.userData);\n const stageState = useSelector((state: RootState) => state.stage);\n const previewBackground = stageState.bgName;\n const textDelay = useTextDelay(userDataState.optionData.textSpeed);\n const textDuration = useTextAnimationDuration(userDataState.optionData.textSpeed);\n const textboxOpacity = userDataState.optionData.textboxOpacity;\n const size = getTextSize(userDataState.optionData.textSize) + '%';\n const font = useFontFamily();\n const userAgent = navigator.userAgent;\n const isFirefox = /firefox/i.test(userAgent);\n const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);\n const previewText = t('textPreview.text');\n const previewTextArray = compileSentence(previewText, 3);\n\n const Textbox = IMSSTextbox;\n\n const textboxProps = {\n textArray: previewTextArray,\n isText: true,\n textDelay: textDelay,\n showName: t('textPreview.title'),\n currentConcatDialogPrev: '',\n fontSize: size,\n currentDialogKey: '',\n isSafari: isSafari,\n isFirefox: isFirefox,\n miniAvatar: '',\n textDuration: textDuration,\n font: font,\n textSizeState: size as unknown as number,\n lineLimit: 3,\n isUseStroke: true,\n textboxOpacity: textboxOpacity,\n };\n\n return (\n \n
\n \n
\n \n );\n};\n","import './slider.css';\nimport { ISlider } from '@/UI/Menu/Options/OptionInterface';\nimport { useEffect } from 'react';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport const OptionSlider = (props: ISlider) => {\n const { playSeEnter } = useSoundEffect();\n useEffect(() => {\n setTimeout(() => {\n const input = document.getElementById(props.uniqueID);\n if (input !== null) input.setAttribute('value', props.initValue.toString());\n }, 1);\n }, []);\n return (\n
\n \n
\n );\n};\n","import styles from '@/UI/Menu/Options/options.module.scss';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { NormalOption } from '@/UI/Menu/Options/NormalOption';\nimport { NormalButton } from '@/UI/Menu/Options/NormalButton';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { fullScreenOption, playSpeed, textFont, textSize } from '@/store/userDataInterface';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { TextPreview } from '@/UI/Menu/Options/TextPreview/TextPreview';\nimport useTrans from '@/hooks/useTrans';\nimport { OptionSlider } from '../OptionSlider';\n\nexport function Display() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const dispatch = useDispatch();\n const t = useTrans('menu.options.pages.display.options.');\n\n return (\n
\n \n {\n dispatch(setOptionData({ key: 'fullScreen', value: fullScreenOption.on }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'fullScreen', value: fullScreenOption.off }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.fullScreen}\n />\n \n \n {\n dispatch(setOptionData({ key: 'textSpeed', value: playSpeed.slow }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSpeed', value: playSpeed.normal }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSpeed', value: playSpeed.fast }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.textSpeed}\n />\n \n \n {\n dispatch(setOptionData({ key: 'textSize', value: textSize.small }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSize', value: textSize.medium }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSize', value: textSize.large }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.textSize}\n />\n \n \n {\n dispatch(setOptionData({ key: 'textboxFont', value: textFont.song }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textboxFont', value: textFont.hei }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textboxFont', value: textFont.lxgw }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.textboxFont}\n />\n \n \n {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'textboxOpacity', value: Number(newValue) }));\n setStorage();\n }}\n />\n \n \n {/* 这是一个临时的组件,用于模拟文本预览的效果 */}\n \n \n
\n );\n}\n","import styles from '@/UI/Menu/Options/options.module.scss';\nimport { NormalOption } from '@/UI/Menu/Options/NormalOption';\nimport { OptionSlider } from '@/UI/Menu/Options/OptionSlider';\nimport { NormalButton } from '@/UI/Menu/Options//NormalButton';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport useTrans from '@/hooks/useTrans';\nimport { voiceOption } from '@/store/userDataInterface';\n\nexport function Sound() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const dispatch = useDispatch();\n const t = useTrans('menu.options.pages.sound.options.');\n\n return (\n
\n \n {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'volumeMain', value: Number(newValue) }));\n setStorage();\n }}\n />\n \n \n {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'vocalVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n \n \n {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'bgmVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n \n \n {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'seVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n \n \n {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'uiSeVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n \n \n {\n dispatch(setOptionData({ key: 'voiceInterruption', value: voiceOption.yes }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'voiceInterruption', value: voiceOption.no }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.voiceInterruption}\n />\n \n
\n );\n}\n","import { FC, useEffect } from 'react';\nimport styles from './options.module.scss';\nimport { getStorage } from '@/Core/controller/storage/storageController';\nimport { useValue } from '@/hooks/useValue';\nimport { System } from '@/UI/Menu/Options/System/System';\nimport { Display } from '@/UI/Menu/Options/Display/Display';\nimport { Sound } from '@/UI/Menu/Options/Sound/Sound';\nimport useTrans from '@/hooks/useTrans';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nenum optionPage {\n 'System',\n 'Display',\n 'Sound',\n}\n\nexport const Options: FC = () => {\n const { playSeEnter, playSeSwitch } = useSoundEffect();\n const currentOptionPage = useValue(optionPage.System);\n useEffect(getStorage, []);\n\n function getClassName(page: optionPage) {\n if (page === currentOptionPage.value) {\n return styles.Options_page_button + ' ' + styles.Options_page_button_active;\n } else return styles.Options_page_button;\n }\n\n const t = useTrans('menu.options.');\n\n return (\n
\n
\n
\n
{t('title')}
\n
\n
\n
\n
\n {\n currentOptionPage.set(optionPage.System);\n playSeSwitch();\n }}\n className={getClassName(optionPage.System)}\n onMouseEnter={playSeEnter}\n >\n {t('pages.system.title')}\n
\n {\n currentOptionPage.set(optionPage.Display);\n playSeSwitch();\n }}\n className={getClassName(optionPage.Display)}\n onMouseEnter={playSeEnter}\n >\n {t('pages.display.title')}\n
\n {\n currentOptionPage.set(optionPage.Sound);\n playSeSwitch();\n }}\n className={getClassName(optionPage.Sound)}\n onMouseEnter={playSeEnter}\n >\n {t('pages.sound.title')}\n
\n \n
\n {currentOptionPage.value === optionPage.Display && }\n {currentOptionPage.value === optionPage.System && }\n {currentOptionPage.value === optionPage.Sound && }\n
\n \n \n );\n};\n","import { FC } from 'react';\nimport styles from './menu.module.scss';\nimport { MenuPanel } from './MenuPanel/MenuPanel';\nimport { Save } from './SaveAndLoad/Save/Save';\nimport { Load } from './SaveAndLoad/Load/Load';\nimport { Options } from './Options/Options';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { MenuPanelTag } from '@/store/guiInterface';\n\n/**\n * Menu 页面,包括存读档、选项等\n * @constructor\n */\nconst Menu: FC = () => {\n const GUIState = useSelector((state: RootState) => state.GUI);\n let currentTag;\n // let menuBgColor = 'linear-gradient(135deg, rgba(253,251,251,0.95) 0%, rgba(235,237,238,1) 100%)';\n switch (GUIState.currentMenuTag) {\n case MenuPanelTag.Save:\n currentTag = ;\n // menuBgColor = 'linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%)';\n break;\n case MenuPanelTag.Load:\n currentTag = ;\n // menuBgColor = 'linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%)';\n break;\n case MenuPanelTag.Option:\n currentTag = ;\n // menuBgColor = 'linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%)';\n break;\n }\n return (\n <>\n {GUIState.showMenuPanel && (\n
\n
{currentTag}
\n \n
\n )}\n \n );\n};\n\nexport default Menu;\n","import { useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { useEffect, useState } from 'react';\nimport { logger } from '@/Core/util/logger';\n\nexport const AudioContainer = () => {\n const stageStore = useSelector((webgalStore: RootState) => webgalStore.stage);\n const titleBgm = useSelector((webgalStore: RootState) => webgalStore.GUI.titleBgm);\n const isShowTitle = useSelector((webgalStore: RootState) => webgalStore.GUI.showTitle);\n const userDataState = useSelector((state: RootState) => state.userData);\n const mainVol = userDataState.optionData.volumeMain;\n const vocalVol = mainVol * 0.01 * userDataState.optionData.vocalVolume * 0.01 * stageStore.vocalVolume * 0.01;\n const bgmVol = mainVol * 0.01 * userDataState.optionData.bgmVolume * 0.01 * stageStore.bgm.volume * 0.01;\n const bgmEnter = stageStore.bgm.enter;\n const uiSoundEffects = stageStore.uiSe;\n const seVol = mainVol * 0.01 * (userDataState.optionData?.seVolume ?? 100) * 0.01;\n const uiSeVol = mainVol * 0.01 * (userDataState.optionData.uiSeVolume ?? 50) * 0.01;\n const isEnterGame = useSelector((state: RootState) => state.GUI.isEnterGame);\n\n // 淡入淡出定时器\n const [fadeTimer, setFadeTimer] = useState(setTimeout(() => {}, 0));\n\n /**\n * 淡入BGM\n * @param bgm 背景音乐\n * @param maxVol 最大音量\n * @param time 淡入时间\n */\n const bgmFadeIn = (bgm: HTMLAudioElement, maxVol: number, time: number) => {\n // 设置初始音量\n time >= 0 ? (bgm.volume = 0) : (bgm.volume = maxVol);\n // 设置音量递增时间间隔\n const duration = 10;\n // 计算每duration的音量增量\n const volumeStep = (maxVol / time) * duration;\n // 基于递归调用实现淡入淡出效果\n const fade = () => {\n const timer = setTimeout(() => {\n if (bgm.volume + volumeStep >= maxVol) {\n // 如果音量接近或达到最大值,则设置最终音量(淡入)\n bgm.volume = maxVol;\n } else if (bgm.volume + volumeStep <= 0) {\n // 如果音量接近或达到最小值,则设置最终音量(淡出)\n bgm.volume = 0;\n // 淡出效果结束后,将 bgm 置空\n webgalStore.dispatch(setStage({ key: 'bgm', value: { src: '', enter: 0, volume: 100 } }));\n } else {\n // 否则增加音量,并递归调用\n bgm.volume += volumeStep;\n fade();\n }\n }, duration);\n // 将定时器引用存储到 fadeTimer 中\n setFadeTimer(timer);\n };\n // 调用淡入淡出函数\n fade();\n };\n\n useEffect(() => {\n // 清除之前的淡入淡出定时器\n clearTimeout(fadeTimer);\n // 获取当前背景音乐元素\n const bgmElement = document.getElementById('currentBgm') as HTMLAudioElement;\n // 如果当前背景音乐元素存在,则淡入淡出\n if (bgmElement) {\n bgmEnter === 0 ? (bgmElement.volume = bgmVol) : bgmFadeIn(bgmElement, bgmVol, bgmEnter);\n }\n }, [isShowTitle, titleBgm, stageStore.bgm.src, bgmVol, bgmEnter]);\n\n useEffect(() => {\n logger.debug(`设置背景音量:${bgmVol}`);\n }, [bgmVol]);\n\n useEffect(() => {\n logger.debug(`设置背景音量淡入时间: ${bgmEnter}`);\n }, [bgmEnter]);\n\n useEffect(() => {\n logger.debug(`设置语音音量:${vocalVol}`);\n const vocalElement: any = document.getElementById('currentVocal');\n if (vocalElement) {\n vocalElement.volume = vocalVol.toString();\n }\n }, [vocalVol]);\n\n useEffect(() => {\n if (uiSoundEffects === '') return;\n const uiSeAudioElement = document.createElement('audio');\n uiSeAudioElement.src = uiSoundEffects;\n uiSeAudioElement.loop = false;\n // 设置音量\n if (!isNaN(uiSeVol)) {\n uiSeAudioElement.volume = uiSeVol;\n } else {\n // 针对原来使用 WebGAL version <= 4.4.2 的用户数据中不存在UI音效音量的情况\n logger.error('UI SE Vol is NaN');\n uiSeAudioElement.volume = isNaN(seVol) ? mainVol / 100 : seVol / 100;\n }\n // 播放UI音效\n uiSeAudioElement.play();\n uiSeAudioElement.addEventListener('ended', () => {\n // Processing after sound effects are played\n uiSeAudioElement.remove();\n });\n webgalStore.dispatch(setStage({ key: 'uiSe', value: '' }));\n }, [uiSoundEffects]);\n\n useEffect(() => {\n logger.debug(`设置音效音量: ${seVol}`);\n }, [seVol]);\n\n useEffect(() => {\n logger.debug(`设置用户界面音效音量: ${uiSeVol}`);\n }, [uiSeVol]);\n\n return (\n
\n \n
\n );\n};\n","import styles from './fullScreenPerform.module.scss';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\n\nexport const FullScreenPerform = () => {\n const stageState = useSelector((state: RootState) => state.stage);\n let stageWidth = '100%';\n let stageHeight = '100%';\n let top = '0';\n if (stageState.enableFilm !== '') {\n stageHeight = '76%';\n top = '12%';\n }\n return (\n
\n
\n
\n );\n};\n","import styles from './textboxFilm.module.scss';\nimport { useEffect } from 'react';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\n\nimport { PERFORM_CONFIG } from '@/config';\n\nexport const TextBoxFilm = () => {\n const stageState = useSelector((state: RootState) => state.stage);\n const userDataState = useSelector((state: RootState) => state.userData);\n useEffect(() => {});\n const textDelay = PERFORM_CONFIG.textInitialDelay - 20 * userDataState.optionData.textSpeed;\n const size = userDataState.optionData.textSize * 50 + 200 + '%';\n\n // 拆字\n const textArray: Array = stageState.showText.split('');\n const textElementList = textArray.map((e, index) => {\n let delay = index * textDelay;\n let prevLength = stageState.currentConcatDialogPrev.length;\n if (stageState.currentConcatDialogPrev !== '' && index >= prevLength) {\n delay = delay - prevLength * textDelay;\n }\n if (index < prevLength) {\n return (\n \n {e}\n \n );\n }\n return (\n \n {e}\n \n );\n });\n return (\n
\n {/*
*/}\n {/* {stageState.miniAvatar !== '' && */}\n {/* \"miniAvatar\"} */}\n {/*
*/}\n {/* {stageState.showName !== '' && */}\n {/*
{stageState.showName}
} */}\n
{textElementList}
\n
\n );\n};\n","import { IStageState } from '@/store/stageInterface';\nimport { useEffect } from 'react';\nimport { logger } from '@/Core/util/logger';\nimport { IStageObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { setEbg } from '@/Core/gameScripts/changeBg/setEbg';\n\nimport { getEnterExitAnimation } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport function useSetBg(stageState: IStageState) {\n const bgName = stageState.bgName;\n\n /**\n * 设置背景\n */\n useEffect(() => {\n const thisBgKey = 'bg-main';\n if (bgName !== '') {\n const currentBg = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisBgKey);\n if (currentBg) {\n if (currentBg.sourceUrl !== bgName) {\n removeBg(currentBg);\n }\n }\n addBg(undefined, thisBgKey, bgName);\n setEbg(bgName);\n logger.debug('重设背景');\n const { duration, animation } = getEnterExitAnimation('bg-main', 'enter', true);\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, 'bg-main-softin', thisBgKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects('bg-main-softin'), duration);\n } else {\n const currentBg = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisBgKey);\n if (currentBg) {\n removeBg(currentBg);\n }\n }\n }, [bgName]);\n}\n\nfunction removeBg(bgObject: IStageObject) {\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects('bg-main-softin');\n const oldBgKey = bgObject.key;\n bgObject.key = 'bg-main-off';\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(oldBgKey);\n const { duration, animation } = getEnterExitAnimation('bg-main-off', 'exit', true);\n WebGAL.gameplay.pixiStage!.registerAnimation(animation, 'bg-main-softoff', 'bg-main-off');\n setTimeout(() => {\n WebGAL.gameplay.pixiStage?.removeAnimation('bg-main-softoff');\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey('bg-main-off');\n }, duration);\n}\n\nfunction addBg(type?: 'image' | 'spine', ...args: any[]) {\n const url = args[1];\n if (url.endsWith('.skel')) {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addSpineBg(...args);\n } else {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addBg(...args);\n }\n}\n","import { IEffect, IStageState } from '@/store/stageInterface';\nimport { useEffect } from 'react';\nimport { logger } from '@/Core/util/logger';\nimport { generateUniversalSoftInAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftIn';\nimport { IStageObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { generateUniversalSoftOffAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftOff';\n\nimport { getEnterExitAnimation } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport function useSetFigure(stageState: IStageState) {\n const { figNameLeft, figName, figNameRight, freeFigure, live2dMotion, live2dExpression } = stageState;\n\n /**\n * 同步 motion\n */\n useEffect(() => {\n for (const motion of live2dMotion) {\n WebGAL.gameplay.pixiStage?.changeModelMotionByKey(motion.target, motion.motion);\n }\n }, [live2dMotion]);\n\n /**\n * 同步 expression\n */\n useEffect(() => {\n for (const expression of live2dExpression) {\n WebGAL.gameplay.pixiStage?.changeModelExpressionByKey(expression.target, expression.expression);\n }\n }, [live2dExpression]);\n\n /**\n * 设置立绘\n */\n useEffect(() => {\n /**\n * 特殊处理:中间立绘\n */\n const thisFigKey = 'fig-center';\n const softInAniKey = 'fig-center-softin';\n if (figName !== '') {\n const currentFigCenter = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigCenter) {\n if (currentFigCenter.sourceUrl !== figName) {\n removeFig(currentFigCenter, softInAniKey, stageState.effects);\n }\n }\n addFigure(undefined, thisFigKey, figName, 'center');\n logger.debug('中立绘已重设');\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n } else {\n logger.debug('移除中立绘');\n const currentFigCenter = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigCenter) {\n if (currentFigCenter.sourceUrl !== figName) {\n removeFig(currentFigCenter, softInAniKey, stageState.effects);\n }\n }\n }\n }, [figName]);\n\n useEffect(() => {\n /**\n * 特殊处理:左侧立绘\n */\n const thisFigKey = 'fig-left';\n const softInAniKey = 'fig-left-softin';\n if (figNameLeft !== '') {\n const currentFigLeft = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigLeft) {\n if (currentFigLeft.sourceUrl !== figNameLeft) {\n removeFig(currentFigLeft, softInAniKey, stageState.effects);\n }\n }\n addFigure(undefined, thisFigKey, figNameLeft, 'left');\n logger.debug('左立绘已重设');\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n } else {\n logger.debug('移除左立绘');\n const currentFigLeft = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigLeft) {\n if (currentFigLeft.sourceUrl !== figNameLeft) {\n removeFig(currentFigLeft, softInAniKey, stageState.effects);\n }\n }\n }\n }, [figNameLeft]);\n\n useEffect(() => {\n /**\n * 特殊处理:右侧立绘\n */\n const thisFigKey = 'fig-right';\n const softInAniKey = 'fig-right-softin';\n if (figNameRight !== '') {\n const currentFigRight = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigRight) {\n if (currentFigRight.sourceUrl !== figNameRight) {\n removeFig(currentFigRight, softInAniKey, stageState.effects);\n }\n }\n addFigure(undefined, thisFigKey, figNameRight, 'right');\n logger.debug('右立绘已重设');\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n } else {\n const currentFigRight = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigRight) {\n if (currentFigRight.sourceUrl !== figNameRight) {\n removeFig(currentFigRight, softInAniKey, stageState.effects);\n }\n }\n }\n }, [figNameRight]);\n\n useEffect(() => {\n // 自由立绘\n for (const fig of freeFigure) {\n /**\n * 特殊处理:自由立绘\n */\n const thisFigKey = `${fig.key}`;\n const softInAniKey = `${fig.key}-softin`;\n /**\n * 非空\n */\n if (fig.name !== '') {\n const currentFigThisKey = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigThisKey) {\n if (currentFigThisKey.sourceUrl !== fig.name) {\n removeFig(currentFigThisKey, softInAniKey, stageState.effects);\n addFigure(undefined, thisFigKey, fig.name, fig.basePosition);\n logger.debug(`${fig.key}立绘已重设`);\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n }\n } else {\n addFigure(undefined, thisFigKey, fig.name, fig.basePosition);\n logger.debug(`${fig.key}立绘已重设`);\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n }\n } else {\n const currentFigThisKey = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigThisKey) {\n if (currentFigThisKey.sourceUrl !== fig.name) {\n removeFig(currentFigThisKey, softInAniKey, stageState.effects);\n }\n }\n }\n }\n\n /**\n * 移除不在状态表中的立绘\n */\n const currentFigures = WebGAL.gameplay.pixiStage?.getFigureObjects();\n if (currentFigures) {\n for (const existFigure of currentFigures) {\n if (\n existFigure.key === 'fig-left' ||\n existFigure.key === 'fig-center' ||\n existFigure.key === 'fig-right' ||\n existFigure.key.endsWith('-off')\n ) {\n // 什么也不做\n } else {\n const existKey = existFigure.key;\n const existFigInState = freeFigure.findIndex((fig) => fig.key === existKey);\n if (existFigInState < 0) {\n const softInAniKey = `${existFigure.key}-softin`;\n removeFig(existFigure, softInAniKey, stageState.effects);\n }\n }\n }\n }\n }, [freeFigure]);\n}\n\nfunction removeFig(figObj: IStageObject, enterTikerKey: string, effects: IEffect[]) {\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects(enterTikerKey);\n // 快进,跳过退出动画\n if (WebGAL.gameplay.isFast) {\n logger.debug('快速模式,立刻关闭立绘');\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(figObj.key);\n return;\n }\n const oldFigKey = figObj.key;\n figObj.key = figObj.key + '-off';\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(oldFigKey);\n const figKey = figObj.key;\n const leaveKey = figKey + '-softoff';\n const { duration, animation } = getEnterExitAnimation(figKey, 'exit');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, leaveKey, figKey, effects);\n setTimeout(() => {\n WebGAL.gameplay.pixiStage?.removeAnimation(leaveKey);\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(figKey);\n }, duration);\n}\n\nfunction addFigure(type?: 'image' | 'live2D' | 'spine', ...args: any[]) {\n const url = args[1];\n if (url.endsWith('.json')) {\n return addLive2dFigure(...args);\n } else if (url.endsWith('.skel')) {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addSpineFigure(...args);\n } else {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addFigure(...args);\n }\n}\n\n/**\n * 如果要使用 Live2D,取消这里的注释\n * @param args\n */\nfunction addLive2dFigure(...args: any[]) {\n // @ts-ignore\n // return WebGAL.gameplay.pixiStage?.addLive2dFigure(...args);\n}\n","import { baseTransform, IEffect, IStageState, ITransform } from '@/store/stageInterface';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport function setStageObjectEffects(stageState: IStageState) {\n const effects = stageState.effects;\n setTimeout(() => {\n setStageEffects(effects);\n }, 10);\n}\n\nexport function setStageEffects(effects: IEffect[]) {\n const stageObjects = WebGAL.gameplay.pixiStage?.getAllStageObj() ?? [];\n for (const stageObj of stageObjects) {\n const key = stageObj.key;\n const effect = effects.find((effect) => effect.target === key);\n const lockedStageTargets = WebGAL.gameplay.pixiStage?.getAllLockedObject() ?? [];\n if (!lockedStageTargets.includes(key)) {\n if (effect) {\n // logger.debug('应用effects', key);\n const targetPixiContainer = WebGAL.gameplay.pixiStage?.getStageObjByKey(key);\n if (targetPixiContainer) {\n const container = targetPixiContainer.pixiContainer;\n Object.assign(container, convertTransform(effect.transform));\n }\n } else {\n const targetPixiContainer = WebGAL.gameplay.pixiStage?.getStageObjByKey(key);\n if (targetPixiContainer) {\n const container = targetPixiContainer.pixiContainer;\n Object.assign(container, convertTransform(baseTransform));\n }\n }\n }\n }\n}\n\nfunction convertTransform(transform: ITransform | undefined) {\n if (!transform) {\n return {};\n }\n const { position, alpha, ...rest } = transform;\n return { ...rest, x: position.x, y: position.y, alphaFilterVal: alpha };\n}\n","import { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useSetBg } from '@/Stage/MainStage/useSetBg';\nimport { useSetFigure } from '@/Stage/MainStage/useSetFigure';\nimport { setStageObjectEffects } from '@/Stage/MainStage/useSetEffects';\n\nexport function MainStage() {\n const stageState = useSelector((state: RootState) => state.stage);\n useSetBg(stageState);\n useSetFigure(stageState);\n setStageObjectEffects(stageState);\n return
;\n}\n","import styles from './introContainer.module.scss';\n\nexport default function IntroContainer() {\n return
;\n}\n","import React, { FC } from 'react';\nimport styles from './stage.module.scss';\nimport { TextBox } from './TextBox/TextBox';\nimport { AudioContainer } from './AudioContainer/AudioContainer';\nimport { FullScreenPerform } from './FullScreenPerform/FullScreenPerform';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport { stopAll } from '@/Core/controller/gamePlay/fastSkip';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { TextBoxFilm } from '@/Stage/TextBox/TextBoxFilm';\nimport { useHotkey } from '@/hooks/useHotkey';\nimport { MainStage } from '@/Stage/MainStage/MainStage';\nimport IntroContainer from '@/Stage/introContainer/IntroContainer';\nimport { isIOS } from '@/Core/initializeScript';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { IGuiState } from '@/store/guiInterface';\nimport { IStageState } from '@/store/stageInterface';\n// import OldStage from '@/Components/Stage/OldStage/OldStage';\n\nfunction inTextBox(event: React.MouseEvent) {\n const tb = document.getElementById('textBoxMain');\n if (!tb) {\n return false;\n }\n let bounds = tb.getBoundingClientRect();\n return (\n event.clientX > bounds.left &&\n event.clientX < bounds.right &&\n event.clientY > bounds.top &&\n event.clientY < bounds.bottom\n );\n}\n\nfunction checkMousePosition(event: React.MouseEvent, GUIState: IGuiState, dispatch: ReturnType) {\n if (!GUIState.controlsVisibility && inTextBox(event)) {\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: true }));\n }\n if (GUIState.controlsVisibility && !inTextBox(event)) {\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: false }));\n }\n}\n\nfunction isTextboxHidden(stageState: IStageState, GUIState: IGuiState) {\n if (!GUIState.showTextBox) {\n return true;\n }\n\n if (stageState.isDisableTextbox) {\n return true;\n }\n\n const isText = stageState.showText !== '' || stageState.showName !== '';\n if (!isText) {\n return true;\n }\n\n const isInIntro = document.getElementById('introContainer')?.style.display === 'block';\n if (isInIntro) {\n return true;\n }\n\n return false;\n}\n\nlet timeoutEventHandle: ReturnType | null = null;\n\n/**\n * 检查并更新控制可见性\n * @param event 鼠标移动事件\n * @param stageState 场景状态\n * @param GUIState GUI状态\n * @param dispatch Redux dispatch函数\n */\n// eslint-disable-next-line max-params\nfunction updateControlsVisibility(\n event: React.MouseEvent,\n stageState: IStageState,\n GUIState: IGuiState,\n dispatch: ReturnType,\n) {\n if (isTextboxHidden(stageState, GUIState)) {\n // 当文本框被隐藏时\n // 逻辑:鼠标移动时显示,一段时间(默认:1秒)后隐藏\n if (timeoutEventHandle) {\n clearTimeout(timeoutEventHandle);\n }\n\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: true }));\n timeoutEventHandle = setTimeout(() => {\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: false }));\n }, 1000);\n } else {\n // 当文本框正常显示时\n // 逻辑:鼠标位置在文本框内时显示\n checkMousePosition(event, GUIState, dispatch);\n }\n}\n\nexport const Stage: FC = () => {\n const stageState = useSelector((state: RootState) => state.stage);\n const GUIState = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n\n useHotkey();\n\n return (\n
\n \n {/* 已弃用旧的立绘与背景舞台 */}\n {/* */}\n \n
\n
\n {GUIState.showTextBox && stageState.enableFilm === '' && !stageState.isDisableTextbox && }\n {GUIState.showTextBox && stageState.enableFilm !== '' && }\n \n {\n // 如果文本框没有显示,则显示文本框\n if (!GUIState.showTextBox) {\n dispatch(setVisibility({ component: 'showTextBox', visibility: true }));\n return;\n }\n stopAll();\n nextSentence();\n }}\n onDoubleClick={() => {\n WebGAL.events.fullscreenDbClick.emit();\n }}\n id=\"FullScreenClick\"\n style={{ width: '100%', height: '100%', position: 'absolute', zIndex: '12', top: '0' }}\n onMouseMove={(e) => !GUIState.showControls && updateControlsVisibility(e, stageState, GUIState, dispatch)}\n />\n \n
\n );\n};\n","import {\n AlignTextLeftOne,\n DoubleRight,\n FolderOpen,\n Home,\n PlayOne,\n PreviewCloseOne,\n PreviewOpen,\n ReplayMusic,\n Save,\n SettingTwo,\n DoubleDown,\n DoubleUp,\n Lock,\n Unlock,\n} from '@icon-park/react';\nimport styles from './bottomControlPanel.module.scss';\nimport { switchAuto } from '@/Core/controller/gamePlay/autoPlay';\nimport { switchFast } from '@/Core/controller/gamePlay/fastSkip';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setMenuPanelTag, setVisibility } from '@/store/GUIReducer';\nimport { componentsVisibility, MenuPanelTag } from '@/store/guiInterface';\nimport { backToTitle } from '@/Core/controller/gamePlay/backToTitle';\nimport { saveGame } from '@/Core/controller/storage/saveGame';\nimport { loadGame } from '@/Core/controller/storage/loadGame';\nimport useTrans from '@/hooks/useTrans';\nimport { useTranslation } from 'react-i18next';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { showGlogalDialog, switchControls } from '@/UI/GlobalDialog/GlobalDialog';\nimport { useEffect } from 'react';\nimport { getSavesFromStorage } from '@/Core/controller/storage/savesController';\n\nexport const BottomControlPanel = () => {\n const t = useTrans('gaming.');\n const strokeWidth = 2.5;\n const { i18n } = useTranslation();\n const { playSeEnter, playSeClick, playSeDialogOpen } = useSoundEffect();\n const lang = i18n.language;\n const isFr = lang === 'fr';\n let size = 42;\n let fontSize = '150%';\n if (isFr) {\n fontSize = '125%';\n size = 40;\n }\n const GUIStore = useSelector((state: RootState) => state.GUI);\n const stageState = useSelector((state: RootState) => state.stage);\n const dispatch = useDispatch();\n const setComponentVisibility = (component: keyof componentsVisibility, visibility: boolean) => {\n dispatch(setVisibility({ component, visibility }));\n };\n const setMenuPanel = (menuPanel: MenuPanelTag) => {\n dispatch(setMenuPanelTag(menuPanel));\n };\n\n const saveData = useSelector((state: RootState) => state.saveData.saveData);\n let fastSlPreview = (\n
\n
{t('noSaving')}
\n
\n );\n if (saveData[0]) {\n const data = saveData[0];\n fastSlPreview = (\n
\n
\n \"q-save-preview\n
\n
\n
{data.nowStageState.showName}
\n
{data.nowStageState.showText}
\n
\n
\n );\n }\n\n return (\n //
\n <>\n {GUIStore.showTextBox && stageState.enableFilm === '' && (\n
\n {GUIStore.showTextBox && (\n {\n setComponentVisibility('showTextBox', false);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.hide')}\n \n )}\n {!GUIStore.showTextBox && (\n {\n setComponentVisibility('showTextBox', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.show')}\n \n )}\n {\n setComponentVisibility('showBacklog', true);\n setComponentVisibility('showTextBox', false);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.backlog')}\n \n {\n let VocalControl: any = document.getElementById('currentVocal');\n if (VocalControl !== null) {\n VocalControl.currentTime = 0;\n VocalControl.pause();\n VocalControl?.play();\n }\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.replay')}\n \n {\n switchAuto();\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.auto')}\n \n {\n switchFast();\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.forward')}\n \n {\n saveGame(0);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.quicklySave')}\n
{fastSlPreview}
\n \n {\n loadGame(0);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.quicklyLoad')}\n
{fastSlPreview}
\n \n {\n setMenuPanel(MenuPanelTag.Save);\n setComponentVisibility('showMenuPanel', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.save')}\n \n {\n setMenuPanel(MenuPanelTag.Load);\n setComponentVisibility('showMenuPanel', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.load')}\n \n {\n setMenuPanel(MenuPanelTag.Option);\n setComponentVisibility('showMenuPanel', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.options')}\n \n {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('buttons.titleTips'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n backToTitle();\n },\n rightFunc: () => {},\n });\n }}\n onMouseEnter={playSeEnter}\n >\n \n {t('buttons.title')}\n \n {\n switchControls();\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n {GUIStore.showControls ? (\n \n ) : (\n \n )}\n \n
\n )}\n \n //
\n );\n};\n","import styles from './backlog.module.scss';\nimport { CloseSmall, Return, VolumeNotice } from '@icon-park/react';\nimport { jumpFromBacklog } from '@/Core/controller/storage/jumpFromBacklog';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { logger } from '@/Core/util/logger';\nimport { ReactNode, useEffect, useMemo, useRef, useState } from 'react';\nimport useTrans from '@/hooks/useTrans';\nimport { compileSentence, EnhancedNode, splitChars } from '@/Stage/TextBox/TextBox';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport const Backlog = () => {\n const t = useTrans('gaming.');\n // logger.info('Backlog render');\n const { playSeEnter, playSeClick } = useSoundEffect();\n const GUIStore = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n const iconSize = '0.8em';\n const [indexHide, setIndexHide] = useState(false);\n const [isDisableScroll, setIsDisableScroll] = useState(false);\n let timeRef = useRef>();\n // 缓存一下vdom\n const backlogList = useMemo(() => {\n let backlogs = [];\n // logger.info('backlogList render');\n for (let i = 0; i < WebGAL.backlogManager.getBacklog().length; i++) {\n const backlogItem = WebGAL.backlogManager.getBacklog()[i];\n const showTextArray = compileSentence(backlogItem.currentStageState.showText, 3, true);\n const showTextArray2 = showTextArray.map((line) => {\n return line.map((c) => {\n return c.reactNode;\n });\n });\n const showTextArrayReduced = mergeStringsAndKeepObjects(showTextArray2);\n const showTextElementList = showTextArrayReduced.map((line, index) => {\n return (\n
\n {line.map((e, index) => {\n if (e === '
') {\n return
;\n } else {\n return e;\n }\n })}\n
\n );\n });\n const singleBacklogView = (\n \n
\n
\n {\n playSeClick();\n jumpFromBacklog(i);\n e.preventDefault();\n e.stopPropagation();\n }}\n onMouseEnter={playSeEnter}\n className={styles.backlog_item_button_element}\n >\n \n
\n {backlogItem.currentStageState.vocal ? (\n {\n playSeClick();\n // 获取到播放 backlog 语音的元素\n const backlog_audio_element: any = document.getElementById('backlog_audio_play_element_' + i);\n if (backlog_audio_element) {\n backlog_audio_element.currentTime = 0;\n const userDataStore = webgalStore.getState().userData;\n const mainVol = userDataStore.optionData.volumeMain;\n backlog_audio_element.volume = mainVol * 0.01 * userDataStore.optionData.vocalVolume * 0.01;\n backlog_audio_element?.play();\n }\n }}\n onMouseEnter={playSeEnter}\n className={styles.backlog_item_button_element}\n >\n \n
\n ) : null}\n
\n
{backlogItem.currentStageState.showName}
\n
\n
\n {showTextElementList}\n
\n
\n );\n backlogs.unshift(singleBacklogView);\n }\n return backlogs;\n }, [\n WebGAL.backlogManager.getBacklog()[WebGAL.backlogManager.getBacklog().length - 1]?.saveScene?.currentSentenceId ??\n 0,\n ]);\n useEffect(() => {\n /* 切换为展示历史记录时触发 */\n if (GUIStore.showBacklog) {\n // logger.info('展示backlog');\n // 立即清除 防止来回滚动时可能导致的错乱\n if (timeRef.current) {\n clearTimeout(timeRef.current);\n }\n // setIsDisableScroll(false);\n // 重新把index调回正数\n setIndexHide(false);\n // 向上滑动触发回想时会带着backlog一起滑一下 我也不知道为什么,可能是我的鼠标问题 所以先ban掉滚动\n setIsDisableScroll(true);\n // nextTick开启滚动\n setTimeout(() => {\n setIsDisableScroll(false);\n }, 0);\n } else {\n /* 隐藏历史记录触发 */\n // 这里是为了让backlog的z-index降低\n timeRef.current = setTimeout(() => {\n setIndexHide(true);\n // setIsDisableScroll(false);\n // setIsDisableScroll(true);\n timeRef.current = undefined;\n // 700是和动画一样的延时 保险起见多个80ms\n // 不加也没啥 问题不大\n }, 700 + 80);\n }\n }, [GUIStore.showBacklog]);\n return (\n <>\n {\n // ${indexHide ? styles.Backlog_main_out_IndexHide : ''}\n \n
\n {\n playSeClick();\n dispatch(setVisibility({ component: 'showBacklog', visibility: false }));\n dispatch(setVisibility({ component: 'showTextBox', visibility: true }));\n }}\n onMouseEnter={playSeEnter}\n theme=\"outline\"\n size=\"4em\"\n fill=\"#ffffff\"\n strokeWidth={3}\n />\n {\n logger.info('Rua! Testing');\n }}\n >\n {t('buttons.backlog')}\n
\n
\n {GUIStore.showBacklog && (\n
\n {backlogList}\n
\n )}\n
\n }\n \n );\n};\n\nfunction mergeStringsAndKeepObjects(arr: ReactNode[]): ReactNode[][] {\n let result = [];\n let currentString = '';\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < arr.length; i++) {\n const currentItem = arr[i];\n\n if (typeof currentItem === 'string') {\n currentString += currentItem;\n } else {\n if (currentString !== '') {\n result.push(currentString);\n currentString = '';\n }\n result.push(currentItem);\n }\n }\n\n if (currentString !== '') {\n result.push(currentString);\n }\n\n return result as ReactNode[][];\n}\n","import { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport React from 'react';\nimport styles from '@/UI/Extra/extra.module.scss';\nimport { useValue } from '@/hooks/useValue';\nimport { setStage } from '@/store/stageReducer';\nimport { GoEnd, GoStart, MusicList, PlayOne, SquareSmall } from '@icon-park/react';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { setGuiAsset } from '@/store/GUIReducer';\n\nexport function ExtraBgm() {\n const { playSeClick, playSeEnter } = useSoundEffect();\n // 检查当前正在播放的bgm是否在bgm列表内\n const currentBgmSrc = useSelector((state: RootState) => state.GUI.titleBgm);\n const extraState = useSelector((state: RootState) => state.userData.appreciationData);\n const initName = 'Title_BGM';\n // 是否展示 bgm 列表\n const isShowBgmList = useValue(false);\n let foundCurrentBgmName = initName;\n let foundCurrentBgmIndex = -1;\n const iconSize = 39;\n const bgmPlayerHeight = isShowBgmList.value ? '80%' : '10%';\n const bgmListLen = extraState.bgm.length;\n extraState.bgm.forEach((e, i) => {\n if (e.url === currentBgmSrc) {\n foundCurrentBgmName = e.name;\n foundCurrentBgmIndex = i;\n }\n });\n const currentPlayingBgmName = useValue('');\n if (foundCurrentBgmName !== initName && foundCurrentBgmName !== currentPlayingBgmName.value) {\n currentPlayingBgmName.set(foundCurrentBgmName);\n }\n const dispatch = useDispatch();\n\n function setBgmByIndex(index: number) {\n const e = extraState.bgm[index];\n currentPlayingBgmName.set(e.name);\n dispatch(setGuiAsset({ asset: 'titleBgm', value: e.url }));\n }\n\n const showBgmList = extraState.bgm.map((e, i) => {\n let className = styles.bgmElement;\n if (e.name === currentPlayingBgmName.value) {\n className = className + ' ' + styles.bgmElement_active;\n }\n return (\n {\n playSeClick();\n currentPlayingBgmName.set(e.name);\n dispatch(setGuiAsset({ asset: 'titleBgm', value: e.url }));\n }}\n key={e.name}\n className={className}\n style={{\n animationDelay: `${i * 150}ms`,\n }}\n onMouseEnter={playSeEnter}\n >\n {e.name}\n \n );\n });\n return (\n
\n
\n {\n playSeClick();\n if (foundCurrentBgmIndex <= 0) {\n setBgmByIndex(bgmListLen - 1);\n } else {\n setBgmByIndex(foundCurrentBgmIndex - 1);\n }\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n \n
\n {\n playSeClick();\n const bgmControl: HTMLAudioElement = document.getElementById('currentBgm') as HTMLAudioElement;\n bgmControl?.play().then();\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n \n
\n {\n playSeClick();\n if (foundCurrentBgmIndex >= bgmListLen - 1) {\n setBgmByIndex(0);\n } else {\n setBgmByIndex(foundCurrentBgmIndex + 1);\n }\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n \n \n {\n playSeClick();\n const bgmControl: HTMLAudioElement = document.getElementById('currentBgm') as HTMLAudioElement;\n bgmControl.pause();\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n \n \n
{foundCurrentBgmName}
\n {\n playSeClick();\n isShowBgmList.set(!isShowBgmList.value);\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n style={{ marginLeft: 'auto' }}\n >\n \n \n \n {isShowBgmList.value &&
{showBgmList}
}\n \n );\n}\n","import { useValue } from '@/hooks/useValue';\nimport styles from '@/UI/Extra/extra.module.scss';\nimport React from 'react';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\ninterface IProps {\n name: string;\n imgUrl: string;\n transformDeg: number;\n index: number;\n}\n\nexport function ExtraCgElement(props: IProps) {\n const showFull = useValue(false);\n const { playSeEnter, playSeClick } = useSoundEffect();\n return (\n <>\n {showFull.value && (\n {\n showFull.set(!showFull.value);\n playSeClick();\n }}\n className={styles.showFullContainer}\n onMouseEnter={playSeEnter}\n >\n
\n \n
\n \n )}\n {\n showFull.set(!showFull.value);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n style={{\n // transform: `rotate(${deg}deg)`,\n animation: `cg_softIn_${props.transformDeg} 1.5s ease-out ${100 + props.index * 100}ms forwards `,\n }}\n key={props.name}\n className={styles.cgElement}\n >\n \n \n \n );\n}\n","import styles from '@/UI/Extra/extra.module.scss';\nimport React from 'react';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useValue } from '@/hooks/useValue';\nimport './extraCG_animation_List.scss';\nimport { ExtraCgElement } from '@/UI/Extra/ExtraCgElement';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport function ExtraCg() {\n const cgPerPage = 8;\n const extraState = useSelector((state: RootState) => state.userData.appreciationData);\n const pageNumber = Math.ceil(extraState.cg.length / cgPerPage);\n // const pageNumber = 10;\n const currentPage = useValue(1);\n const { playSeEnter, playSeClick } = useSoundEffect();\n\n // 开始生成立绘鉴赏的图片\n const showCgList = [];\n const len = extraState.cg.length;\n for (\n let i = (currentPage.value - 1) * cgPerPage;\n i < Math.min(len, (currentPage.value - 1) * cgPerPage + cgPerPage);\n i++\n ) {\n const index = i - (currentPage.value - 1) * cgPerPage;\n const deg = Random(-5, 5);\n const temp = (\n \n );\n showCgList.push(temp);\n }\n\n // 生成cg鉴赏的导航\n const showNav = [];\n for (let i = 1; i <= pageNumber; i++) {\n let className = styles.cgNav;\n if (currentPage.value === i) {\n className = className + ' ' + styles.cgNav_active;\n }\n const temp = (\n {\n currentPage.set(i);\n playSeClick();\n }}\n key={'nav' + i}\n onMouseEnter={playSeEnter}\n className={className}\n >\n {i}\n \n );\n showNav.push(temp);\n }\n\n return (\n
\n
\n
{showNav}
\n
\n
{showCgList}
\n
\n );\n}\n\nfunction Random(min: number, max: number) {\n return Math.round(Math.random() * (max - min)) + min;\n}\n","import styles from './extra.module.scss';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { CloseSmall } from '@icon-park/react';\nimport { ExtraBgm } from '@/UI/Extra/ExtraBgm';\nimport { ExtraCg } from './ExtraCg';\nimport useTrans from '@/hooks/useTrans';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport function Extra() {\n const { playSeClick } = useSoundEffect();\n const showExtra = useSelector((state: RootState) => state.GUI.showExtra);\n const dispatch = useDispatch();\n\n const t = useTrans('extra.');\n return (\n <>\n {showExtra && (\n
\n
\n {\n dispatch(setVisibility({ component: 'showExtra', visibility: false }));\n playSeClick();\n }}\n onMouseEnter={playSeClick}\n theme=\"outline\"\n size=\"4em\"\n fill=\"#fff\"\n strokeWidth={3}\n />\n
{t('title')}
\n
\n
\n \n \n
\n
\n )}\n \n );\n}\n","import styles from './bottomControlPanelFilm.module.scss';\nimport { switchAuto } from '@/Core/controller/gamePlay/autoPlay';\nimport { switchFast } from '@/Core/controller/gamePlay/fastSkip';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setMenuPanelTag, setVisibility } from '@/store/GUIReducer';\nimport { componentsVisibility, MenuPanelTag } from '@/store/guiInterface';\nimport { backToTitle } from '@/Core/controller/gamePlay/backToTitle';\nimport { useValue } from '@/hooks/useValue';\nimport { HamburgerButton } from '@icon-park/react';\n\nexport const BottomControlPanelFilm = () => {\n const showPanel = useValue(false);\n const stageState = useSelector((state: RootState) => state.stage);\n const dispatch = useDispatch();\n const setComponentVisibility = (component: keyof componentsVisibility, visibility: boolean) => {\n dispatch(setVisibility({ component, visibility }));\n };\n const setMenuPanel = (menuPanel: MenuPanelTag) => {\n dispatch(setMenuPanelTag(menuPanel));\n };\n return (\n <>\n {stageState.enableFilm !== '' && (\n <>\n {\n showPanel.set(!showPanel.value);\n }}\n >\n \n \n {showPanel.value && (\n
\n {\n setComponentVisibility('showBacklog', true);\n setComponentVisibility('showTextBox', false);\n showPanel.set(!showPanel.value);\n }}\n >\n 剧情回想 / BACKLOG\n \n {\n showPanel.set(!showPanel.value);\n let VocalControl: any = document.getElementById('currentVocal');\n if (VocalControl !== null) {\n VocalControl.currentTime = 0;\n VocalControl.pause();\n VocalControl?.play();\n }\n }}\n >\n 重播语音 / REPLAY VOICE\n \n {\n switchAuto();\n showPanel.set(!showPanel.value);\n }}\n >\n 自动模式 / AUTO\n \n {\n switchFast();\n showPanel.set(!showPanel.value);\n }}\n >\n 快进 / FAST\n \n {\n showPanel.set(!showPanel.value);\n setMenuPanel(MenuPanelTag.Save);\n setComponentVisibility('showMenuPanel', true);\n }}\n >\n 存档 / SAVE\n \n {\n showPanel.set(!showPanel.value);\n setMenuPanel(MenuPanelTag.Load);\n setComponentVisibility('showMenuPanel', true);\n }}\n >\n 读档 / LOAD\n \n {\n showPanel.set(!showPanel.value);\n setMenuPanel(MenuPanelTag.Option);\n setComponentVisibility('showMenuPanel', true);\n }}\n >\n 选项 / OPTIONS\n \n {\n showPanel.set(!showPanel.value);\n backToTitle();\n }}\n >\n 标题 / TITLE\n \n
\n )}\n \n )}\n \n );\n};\n","export function getPixiSscreenshot() {\n const canvas: HTMLCanvasElement = document.getElementById('pixiCanvas')! as HTMLCanvasElement;\n canvas.toBlob((b) => {\n if (b) {\n const a = document.createElement('a');\n document.body.append(a);\n a.download = 'screenshot';\n a.href = URL.createObjectURL(b);\n a.click();\n a.remove();\n }\n }, 'image/png');\n}\n","import styles from './devPanel.module.scss';\nimport { useValue } from '@/hooks/useValue';\nimport { getPixiSscreenshot } from '@/UI/DevPanel/devFunctions/getPixiSscreenshot';\nimport { useEffect } from 'react';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useTranslation } from 'react-i18next';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport default function DevPanel() {\n // 控制显隐\n function isShowDevPanel() {\n const hash = window.location.hash;\n return !!hash.match(/dev/);\n }\n const isOpenDevPanel = useValue(false);\n const hash = useValue(window.location.hash);\n const stageState = useSelector((state: RootState) => state.stage);\n useEffect(() => {\n window.onhashchange = () => {\n hash.set(window.location.hash);\n };\n }, []);\n const isShow = isShowDevPanel();\n\n const { t, i18n } = useTranslation();\n\n const devMainArea = (\n <>\n
getPixiSscreenshot()}>Save PIXI Screenshot
\n
Current Language:{i18n.language}
\n
WebGAL.gameplay.pixiStage?.removeAnimation('snow-Ticker')}>Remove Snow Ticker
\n
Stage State
\n
{JSON.stringify(stageState, null, ' ')}
\n \n );\n return (\n <>\n {isShow && isOpenDevPanel.value && (\n
\n
\n isOpenDevPanel.set(false)}\n style={{ fontSize: '150%', padding: '0 0 0 15px', cursor: 'pointer' }}\n >\n ×\n
\n
WebGAL DEV PANEL
\n
\n
{devMainArea}
\n \n )}\n {!isOpenDevPanel.value && isShow && (\n
isOpenDevPanel.set(true)} className={styles.devPanelOpener}>\n Open Dev Panel\n
\n )}\n \n );\n}\n","import useLanguage from '@/hooks/useLanguage';\nimport { useEffect, useState } from 'react';\nimport s from './translation.module.scss';\nimport languages, { language } from '@/config/language';\n\nexport default function Translation() {\n const setLanguage = useLanguage();\n\n const [isShowSelectLanguage, setIsShowSelectLanguage] = useState(false);\n\n useEffect(() => {\n const lang = window?.localStorage.getItem('lang');\n if (!lang) {\n setIsShowSelectLanguage(true);\n } else {\n setLanguage(Number(window?.localStorage.getItem('lang')), false);\n }\n }, []);\n\n const setLang = (langId: language) => {\n setIsShowSelectLanguage(false);\n setLanguage(langId);\n };\n\n return (\n <>\n {isShowSelectLanguage && (\n
\n
\n
LANGUAGE SELECT
\n
\n {Object.keys(languages).map((key) => (\n setLang(language[key as unknown as language] as unknown as language)}\n >\n {languages[key]}\n
\n ))}\n
\n
\n \n )}\n \n );\n}\n","import styles from './panicYoozle.module.scss';\nimport { useEffect } from 'react';\n\nexport const PanicYoozle = () => {\n useEffect(() => {\n const panicTitle = 'Yoozle Search';\n const originalTitle = document.title;\n document.title = panicTitle;\n return () => {\n document.title = originalTitle;\n };\n }, []);\n return (\n
\n
\n \n \n Y\n \n o\n o\n z\n l\n e\n \n
\n
\n \n
\n \n \n
\n
\n
\n );\n};\n","import styles from './panicOverlay.module.scss';\nimport { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { PanicYoozle } from '@/UI/PanicOverlay/PanicYoozle/PanicYoozle';\n\nexport const PanicOverlay = () => {\n const GUIStore = useSelector((state: RootState) => state.GUI);\n const [showOverlay, setShowOverlay] = useState(false);\n useEffect(() => {\n setShowOverlay(GUIStore.showPanicOverlay);\n }, [GUIStore.showPanicOverlay]);\n return ReactDOM.createPortal(\n
{showOverlay && }
,\n document.querySelector('div#panic-overlay')!,\n );\n};\n","import { setStorage } from '@/Core/controller/storage/storageController';\nimport { RootState } from '@/store/store';\nimport { fullScreenOption } from '@/store/userDataInterface';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { useEffect } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { keyboard } from './useHotkey';\n\nexport function useFullScreen() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const GUIState = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n const fullScreen = userDataState.optionData.fullScreen;\n const isEnterGame = GUIState.isEnterGame;\n\n useEffect(() => {\n switch (fullScreen) {\n case fullScreenOption.on: {\n if (isEnterGame) {\n document.documentElement.requestFullscreen();\n if (keyboard) keyboard.lock(['Escape', 'F11']);\n }\n break;\n }\n case fullScreenOption.off: {\n if (document.fullscreenElement) {\n document.exitFullscreen();\n if (keyboard) keyboard.unlock();\n }\n break;\n }\n }\n }, [fullScreen]);\n}\n","import Title from '@/UI/Title/Title';\nimport Logo from '@/UI/Logo/Logo';\nimport { useEffect } from 'react';\nimport { initializeScript } from './Core/initializeScript';\nimport Menu from '@/UI/Menu/Menu';\nimport { Stage } from '@/Stage/Stage';\nimport { BottomControlPanel } from '@/UI/BottomControlPanel/BottomControlPanel';\nimport { Backlog } from '@/UI/Backlog/Backlog';\nimport { Extra } from '@/UI/Extra/Extra';\nimport { BottomControlPanelFilm } from '@/UI/BottomControlPanel/BottomControlPanelFilm';\nimport GlobalDialog from '@/UI/GlobalDialog/GlobalDialog';\nimport DevPanel from '@/UI/DevPanel/DevPanel';\nimport Translation from '@/UI/Translation/Translation';\nimport { PanicOverlay } from '@/UI/PanicOverlay/PanicOverlay';\nimport { useFullScreen } from './hooks/useFullScreen';\n\nfunction App() {\n useEffect(() => {\n initializeScript();\n }, []);\n\n useFullScreen();\n\n // Provider用于对各组件提供状态\n return (\n
\n \n \n \n \n \n \n <Logo />\n <Extra />\n <Menu />\n <GlobalDialog />\n <PanicOverlay />\n <DevPanel />\n </div>\n );\n}\n\nexport default App;\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();\n}","import _typeof from '@babel/runtime/helpers/esm/typeof';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';\nimport _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';\nimport _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport _toArray from '@babel/runtime/helpers/esm/toArray';\n\nfunction ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nvar consoleLogger = {\n type: 'logger',\n log: function log(args) {\n this.output('log', args);\n },\n warn: function warn(args) {\n this.output('warn', args);\n },\n error: function error(args) {\n this.output('error', args);\n },\n output: function output(type, args) {\n if (console && console[type]) console[type].apply(console, args);\n }\n};\nvar Logger = function () {\n function Logger(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Logger);\n this.init(concreteLogger, options);\n }\n _createClass(Logger, [{\n key: \"init\",\n value: function init(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.prefix = options.prefix || 'i18next:';\n this.logger = concreteLogger || consoleLogger;\n this.options = options;\n this.debug = options.debug;\n }\n }, {\n key: \"setDebug\",\n value: function setDebug(bool) {\n this.debug = bool;\n }\n }, {\n key: \"log\",\n value: function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return this.forward(args, 'log', '', true);\n }\n }, {\n key: \"warn\",\n value: function warn() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return this.forward(args, 'warn', '', true);\n }\n }, {\n key: \"error\",\n value: function error() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n return this.forward(args, 'error', '');\n }\n }, {\n key: \"deprecate\",\n value: function deprecate() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);\n }\n }, {\n key: \"forward\",\n value: function forward(args, lvl, prefix, debugOnly) {\n if (debugOnly && !this.debug) return null;\n if (typeof args[0] === 'string') args[0] = \"\".concat(prefix).concat(this.prefix, \" \").concat(args[0]);\n return this.logger[lvl](args);\n }\n }, {\n key: \"create\",\n value: function create(moduleName) {\n return new Logger(this.logger, _objectSpread$6(_objectSpread$6({}, {\n prefix: \"\".concat(this.prefix, \":\").concat(moduleName, \":\")\n }), this.options));\n }\n }, {\n key: \"clone\",\n value: function clone(options) {\n options = options || this.options;\n options.prefix = options.prefix || this.prefix;\n return new Logger(this.logger, options);\n }\n }]);\n return Logger;\n}();\nvar baseLogger = new Logger();\n\nvar EventEmitter = function () {\n function EventEmitter() {\n _classCallCheck(this, EventEmitter);\n this.observers = {};\n }\n _createClass(EventEmitter, [{\n key: \"on\",\n value: function on(events, listener) {\n var _this = this;\n events.split(' ').forEach(function (event) {\n _this.observers[event] = _this.observers[event] || [];\n _this.observers[event].push(listener);\n });\n return this;\n }\n }, {\n key: \"off\",\n value: function off(event, listener) {\n if (!this.observers[event]) return;\n if (!listener) {\n delete this.observers[event];\n return;\n }\n this.observers[event] = this.observers[event].filter(function (l) {\n return l !== listener;\n });\n }\n }, {\n key: \"emit\",\n value: function emit(event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (this.observers[event]) {\n var cloned = [].concat(this.observers[event]);\n cloned.forEach(function (observer) {\n observer.apply(void 0, args);\n });\n }\n if (this.observers['*']) {\n var _cloned = [].concat(this.observers['*']);\n _cloned.forEach(function (observer) {\n observer.apply(observer, [event].concat(args));\n });\n }\n }\n }]);\n return EventEmitter;\n}();\n\nfunction defer() {\n var res;\n var rej;\n var promise = new Promise(function (resolve, reject) {\n res = resolve;\n rej = reject;\n });\n promise.resolve = res;\n promise.reject = rej;\n return promise;\n}\nfunction makeString(object) {\n if (object == null) return '';\n return '' + object;\n}\nfunction copy(a, s, t) {\n a.forEach(function (m) {\n if (s[m]) t[m] = s[m];\n });\n}\nfunction getLastOfPath(object, path, Empty) {\n function cleanKey(key) {\n return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;\n }\n function canNotTraverseDeeper() {\n return !object || typeof object === 'string';\n }\n var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');\n while (stack.length > 1) {\n if (canNotTraverseDeeper()) return {};\n var key = cleanKey(stack.shift());\n if (!object[key] && Empty) object[key] = new Empty();\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n object = object[key];\n } else {\n object = {};\n }\n }\n if (canNotTraverseDeeper()) return {};\n return {\n obj: object,\n k: cleanKey(stack.shift())\n };\n}\nfunction setPath(object, path, newValue) {\n var _getLastOfPath = getLastOfPath(object, path, Object),\n obj = _getLastOfPath.obj,\n k = _getLastOfPath.k;\n obj[k] = newValue;\n}\nfunction pushPath(object, path, newValue, concat) {\n var _getLastOfPath2 = getLastOfPath(object, path, Object),\n obj = _getLastOfPath2.obj,\n k = _getLastOfPath2.k;\n obj[k] = obj[k] || [];\n if (concat) obj[k] = obj[k].concat(newValue);\n if (!concat) obj[k].push(newValue);\n}\nfunction getPath(object, path) {\n var _getLastOfPath3 = getLastOfPath(object, path),\n obj = _getLastOfPath3.obj,\n k = _getLastOfPath3.k;\n if (!obj) return undefined;\n return obj[k];\n}\nfunction getPathWithDefaults(data, defaultData, key) {\n var value = getPath(data, key);\n if (value !== undefined) {\n return value;\n }\n return getPath(defaultData, key);\n}\nfunction deepExtend(target, source, overwrite) {\n for (var prop in source) {\n if (prop !== '__proto__' && prop !== 'constructor') {\n if (prop in target) {\n if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) {\n if (overwrite) target[prop] = source[prop];\n } else {\n deepExtend(target[prop], source[prop], overwrite);\n }\n } else {\n target[prop] = source[prop];\n }\n }\n }\n return target;\n}\nfunction regexEscape(str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\nvar _entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\nfunction escape(data) {\n if (typeof data === 'string') {\n return data.replace(/[&<>\"'\\/]/g, function (s) {\n return _entityMap[s];\n });\n }\n return data;\n}\nvar isIE10 = typeof window !== 'undefined' && window.navigator && typeof window.navigator.userAgentData === 'undefined' && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;\nvar chars = [' ', ',', '?', '!', ';'];\nfunction looksLikeObjectPath(key, nsSeparator, keySeparator) {\n nsSeparator = nsSeparator || '';\n keySeparator = keySeparator || '';\n var possibleChars = chars.filter(function (c) {\n return nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0;\n });\n if (possibleChars.length === 0) return true;\n var r = new RegExp(\"(\".concat(possibleChars.map(function (c) {\n return c === '?' ? '\\\\?' : c;\n }).join('|'), \")\"));\n var matched = !r.test(key);\n if (!matched) {\n var ki = key.indexOf(keySeparator);\n if (ki > 0 && !r.test(key.substring(0, ki))) {\n matched = true;\n }\n }\n return matched;\n}\nfunction deepFind(obj, path) {\n var keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';\n if (!obj) return undefined;\n if (obj[path]) return obj[path];\n var paths = path.split(keySeparator);\n var current = obj;\n for (var i = 0; i < paths.length; ++i) {\n if (!current) return undefined;\n if (typeof current[paths[i]] === 'string' && i + 1 < paths.length) {\n return undefined;\n }\n if (current[paths[i]] === undefined) {\n var j = 2;\n var p = paths.slice(i, i + j).join(keySeparator);\n var mix = current[p];\n while (mix === undefined && paths.length > i + j) {\n j++;\n p = paths.slice(i, i + j).join(keySeparator);\n mix = current[p];\n }\n if (mix === undefined) return undefined;\n if (mix === null) return null;\n if (path.endsWith(p)) {\n if (typeof mix === 'string') return mix;\n if (p && typeof mix[p] === 'string') return mix[p];\n }\n var joinedPath = paths.slice(i + j).join(keySeparator);\n if (joinedPath) return deepFind(mix, joinedPath, keySeparator);\n return undefined;\n }\n current = current[paths[i]];\n }\n return current;\n}\n\nfunction ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct$3() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nvar ResourceStore = function (_EventEmitter) {\n _inherits(ResourceStore, _EventEmitter);\n var _super = _createSuper$3(ResourceStore);\n function ResourceStore(data) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n ns: ['translation'],\n defaultNS: 'translation'\n };\n _classCallCheck(this, ResourceStore);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n _this.data = data || {};\n _this.options = options;\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n if (_this.options.ignoreJSONStructure === undefined) {\n _this.options.ignoreJSONStructure = true;\n }\n return _this;\n }\n _createClass(ResourceStore, [{\n key: \"addNamespaces\",\n value: function addNamespaces(ns) {\n if (this.options.ns.indexOf(ns) < 0) {\n this.options.ns.push(ns);\n }\n }\n }, {\n key: \"removeNamespaces\",\n value: function removeNamespaces(ns) {\n var index = this.options.ns.indexOf(ns);\n if (index > -1) {\n this.options.ns.splice(index, 1);\n }\n }\n }, {\n key: \"getResource\",\n value: function getResource(lng, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;\n var path = [lng, ns];\n if (key && typeof key !== 'string') path = path.concat(key);\n if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n }\n var result = getPath(this.data, path);\n if (result || !ignoreJSONStructure || typeof key !== 'string') return result;\n return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);\n }\n }, {\n key: \"addResource\",\n value: function addResource(lng, ns, key, value) {\n var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n silent: false\n };\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var path = [lng, ns];\n if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n value = ns;\n ns = path[1];\n }\n this.addNamespaces(ns);\n setPath(this.data, path, value);\n if (!options.silent) this.emit('added', lng, ns, key, value);\n }\n }, {\n key: \"addResources\",\n value: function addResources(lng, ns, resources) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n silent: false\n };\n for (var m in resources) {\n if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {\n silent: true\n });\n }\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"addResourceBundle\",\n value: function addResourceBundle(lng, ns, resources, deep, overwrite) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {\n silent: false\n };\n var path = [lng, ns];\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n deep = resources;\n resources = ns;\n ns = path[1];\n }\n this.addNamespaces(ns);\n var pack = getPath(this.data, path) || {};\n if (deep) {\n deepExtend(pack, resources, overwrite);\n } else {\n pack = _objectSpread$5(_objectSpread$5({}, pack), resources);\n }\n setPath(this.data, path, pack);\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"removeResourceBundle\",\n value: function removeResourceBundle(lng, ns) {\n if (this.hasResourceBundle(lng, ns)) {\n delete this.data[lng][ns];\n }\n this.removeNamespaces(ns);\n this.emit('removed', lng, ns);\n }\n }, {\n key: \"hasResourceBundle\",\n value: function hasResourceBundle(lng, ns) {\n return this.getResource(lng, ns) !== undefined;\n }\n }, {\n key: \"getResourceBundle\",\n value: function getResourceBundle(lng, ns) {\n if (!ns) ns = this.options.defaultNS;\n if (this.options.compatibilityAPI === 'v1') return _objectSpread$5(_objectSpread$5({}, {}), this.getResource(lng, ns));\n return this.getResource(lng, ns);\n }\n }, {\n key: \"getDataByLanguage\",\n value: function getDataByLanguage(lng) {\n return this.data[lng];\n }\n }, {\n key: \"hasLanguageSomeTranslations\",\n value: function hasLanguageSomeTranslations(lng) {\n var data = this.getDataByLanguage(lng);\n var n = data && Object.keys(data) || [];\n return !!n.find(function (v) {\n return data[v] && Object.keys(data[v]).length > 0;\n });\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return this.data;\n }\n }]);\n return ResourceStore;\n}(EventEmitter);\n\nvar postProcessor = {\n processors: {},\n addPostProcessor: function addPostProcessor(module) {\n this.processors[module.name] = module;\n },\n handle: function handle(processors, value, key, options, translator) {\n var _this = this;\n processors.forEach(function (processor) {\n if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);\n });\n return value;\n }\n};\n\nfunction ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct$2() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nvar checkedLoadedFor = {};\nvar Translator = function (_EventEmitter) {\n _inherits(Translator, _EventEmitter);\n var _super = _createSuper$2(Translator);\n function Translator(services) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Translator);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, _assertThisInitialized(_this));\n _this.options = options;\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n _this.logger = baseLogger.create('translator');\n return _this;\n }\n _createClass(Translator, [{\n key: \"changeLanguage\",\n value: function changeLanguage(lng) {\n if (lng) this.language = lng;\n }\n }, {\n key: \"exists\",\n value: function exists(key) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n if (key === undefined || key === null) {\n return false;\n }\n var resolved = this.resolve(key, options);\n return resolved && resolved.res !== undefined;\n }\n }, {\n key: \"extractFromKey\",\n value: function extractFromKey(key, options) {\n var nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;\n if (nsSeparator === undefined) nsSeparator = ':';\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var namespaces = options.ns || this.options.defaultNS || [];\n var wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;\n var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);\n if (wouldCheckForNsInKey && !seemsNaturalLanguage) {\n var m = key.match(this.interpolator.nestingRegexp);\n if (m && m.length > 0) {\n return {\n key: key,\n namespaces: namespaces\n };\n }\n var parts = key.split(nsSeparator);\n if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();\n key = parts.join(keySeparator);\n }\n if (typeof namespaces === 'string') namespaces = [namespaces];\n return {\n key: key,\n namespaces: namespaces\n };\n }\n }, {\n key: \"translate\",\n value: function translate(keys, options, lastKey) {\n var _this2 = this;\n if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {\n options = this.options.overloadTranslationOptionHandler(arguments);\n }\n if (_typeof(options) === 'object') options = _objectSpread$4({}, options);\n if (!options) options = {};\n if (keys === undefined || keys === null) return '';\n if (!Array.isArray(keys)) keys = [String(keys)];\n var returnDetails = options.returnDetails !== undefined ? options.returnDetails : this.options.returnDetails;\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),\n key = _this$extractFromKey.key,\n namespaces = _this$extractFromKey.namespaces;\n var namespace = namespaces[namespaces.length - 1];\n var lng = options.lng || this.language;\n var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;\n if (lng && lng.toLowerCase() === 'cimode') {\n if (appendNamespaceToCIMode) {\n var nsSeparator = options.nsSeparator || this.options.nsSeparator;\n if (returnDetails) {\n return {\n res: \"\".concat(namespace).concat(nsSeparator).concat(key),\n usedKey: key,\n exactUsedKey: key,\n usedLng: lng,\n usedNS: namespace\n };\n }\n return \"\".concat(namespace).concat(nsSeparator).concat(key);\n }\n if (returnDetails) {\n return {\n res: key,\n usedKey: key,\n exactUsedKey: key,\n usedLng: lng,\n usedNS: namespace\n };\n }\n return key;\n }\n var resolved = this.resolve(keys, options);\n var res = resolved && resolved.res;\n var resUsedKey = resolved && resolved.usedKey || key;\n var resExactUsedKey = resolved && resolved.exactUsedKey || key;\n var resType = Object.prototype.toString.apply(res);\n var noObject = ['[object Number]', '[object Function]', '[object RegExp]'];\n var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;\n var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;\n var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';\n if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {\n if (!options.returnObjects && !this.options.returnObjects) {\n if (!this.options.returnedObjectHandler) {\n this.logger.warn('accessing an object - but returnObjects options is not enabled!');\n }\n var r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread$4(_objectSpread$4({}, options), {}, {\n ns: namespaces\n })) : \"key '\".concat(key, \" (\").concat(this.language, \")' returned an object instead of string.\");\n if (returnDetails) {\n resolved.res = r;\n return resolved;\n }\n return r;\n }\n if (keySeparator) {\n var resTypeIsArray = resType === '[object Array]';\n var copy = resTypeIsArray ? [] : {};\n var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;\n for (var m in res) {\n if (Object.prototype.hasOwnProperty.call(res, m)) {\n var deepKey = \"\".concat(newKeyToUse).concat(keySeparator).concat(m);\n copy[m] = this.translate(deepKey, _objectSpread$4(_objectSpread$4({}, options), {\n joinArrays: false,\n ns: namespaces\n }));\n if (copy[m] === deepKey) copy[m] = res[m];\n }\n }\n res = copy;\n }\n } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {\n res = res.join(joinArrays);\n if (res) res = this.extendTranslation(res, keys, options, lastKey);\n } else {\n var usedDefault = false;\n var usedKey = false;\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n var hasDefaultValue = Translator.hasDefaultValue(options);\n var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';\n var defaultValue = options[\"defaultValue\".concat(defaultValueSuffix)] || options.defaultValue;\n if (!this.isValidLookup(res) && hasDefaultValue) {\n usedDefault = true;\n res = defaultValue;\n }\n if (!this.isValidLookup(res)) {\n usedKey = true;\n res = key;\n }\n var missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;\n var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;\n var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;\n if (usedKey || usedDefault || updateMissing) {\n this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);\n if (keySeparator) {\n var fk = this.resolve(key, _objectSpread$4(_objectSpread$4({}, options), {}, {\n keySeparator: false\n }));\n if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');\n }\n var lngs = [];\n var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);\n if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {\n for (var i = 0; i < fallbackLngs.length; i++) {\n lngs.push(fallbackLngs[i]);\n }\n } else if (this.options.saveMissingTo === 'all') {\n lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);\n } else {\n lngs.push(options.lng || this.language);\n }\n var send = function send(l, k, specificDefaultValue) {\n var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;\n if (_this2.options.missingKeyHandler) {\n _this2.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);\n } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {\n _this2.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);\n }\n _this2.emit('missingKey', l, namespace, k, res);\n };\n if (this.options.saveMissing) {\n if (this.options.saveMissingPlurals && needsPluralHandling) {\n lngs.forEach(function (language) {\n _this2.pluralResolver.getSuffixes(language, options).forEach(function (suffix) {\n send([language], key + suffix, options[\"defaultValue\".concat(suffix)] || defaultValue);\n });\n });\n } else {\n send(lngs, key, defaultValue);\n }\n }\n }\n res = this.extendTranslation(res, keys, options, resolved, lastKey);\n if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = \"\".concat(namespace, \":\").concat(key);\n if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {\n if (this.options.compatibilityAPI !== 'v1') {\n res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? \"\".concat(namespace, \":\").concat(key) : key, usedDefault ? res : undefined);\n } else {\n res = this.options.parseMissingKeyHandler(res);\n }\n }\n }\n if (returnDetails) {\n resolved.res = res;\n return resolved;\n }\n return res;\n }\n }, {\n key: \"extendTranslation\",\n value: function extendTranslation(res, key, options, resolved, lastKey) {\n var _this3 = this;\n if (this.i18nFormat && this.i18nFormat.parse) {\n res = this.i18nFormat.parse(res, _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), options), resolved.usedLng, resolved.usedNS, resolved.usedKey, {\n resolved: resolved\n });\n } else if (!options.skipInterpolation) {\n if (options.interpolation) this.interpolator.init(_objectSpread$4(_objectSpread$4({}, options), {\n interpolation: _objectSpread$4(_objectSpread$4({}, this.options.interpolation), options.interpolation)\n }));\n var skipOnVariables = typeof res === 'string' && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);\n var nestBef;\n if (skipOnVariables) {\n var nb = res.match(this.interpolator.nestingRegexp);\n nestBef = nb && nb.length;\n }\n var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;\n if (this.options.interpolation.defaultVariables) data = _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), data);\n res = this.interpolator.interpolate(res, data, options.lng || this.language, options);\n if (skipOnVariables) {\n var na = res.match(this.interpolator.nestingRegexp);\n var nestAft = na && na.length;\n if (nestBef < nestAft) options.nest = false;\n }\n if (!options.lng && this.options.compatibilityAPI !== 'v1' && resolved && resolved.res) options.lng = resolved.usedLng;\n if (options.nest !== false) res = this.interpolator.nest(res, function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (lastKey && lastKey[0] === args[0] && !options.context) {\n _this3.logger.warn(\"It seems you are nesting recursively key: \".concat(args[0], \" in key: \").concat(key[0]));\n return null;\n }\n return _this3.translate.apply(_this3, args.concat([key]));\n }, options);\n if (options.interpolation) this.interpolator.reset();\n }\n var postProcess = options.postProcess || this.options.postProcess;\n var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;\n if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {\n res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread$4({\n i18nResolved: resolved\n }, options) : options, this);\n }\n return res;\n }\n }, {\n key: \"resolve\",\n value: function resolve(keys) {\n var _this4 = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var found;\n var usedKey;\n var exactUsedKey;\n var usedLng;\n var usedNS;\n if (typeof keys === 'string') keys = [keys];\n keys.forEach(function (k) {\n if (_this4.isValidLookup(found)) return;\n var extracted = _this4.extractFromKey(k, options);\n var key = extracted.key;\n usedKey = key;\n var namespaces = extracted.namespaces;\n if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n var needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && _this4.pluralResolver.shouldUseIntlApi();\n var needsContextHandling = options.context !== undefined && (typeof options.context === 'string' || typeof options.context === 'number') && options.context !== '';\n var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);\n namespaces.forEach(function (ns) {\n if (_this4.isValidLookup(found)) return;\n usedNS = ns;\n if (!checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {\n checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] = true;\n _this4.logger.warn(\"key \\\"\".concat(usedKey, \"\\\" for languages \\\"\").concat(codes.join(', '), \"\\\" won't get resolved as namespace \\\"\").concat(usedNS, \"\\\" was not yet loaded\"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n }\n codes.forEach(function (code) {\n if (_this4.isValidLookup(found)) return;\n usedLng = code;\n var finalKeys = [key];\n if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {\n _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);\n } else {\n var pluralSuffix;\n if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count, options);\n var zeroSuffix = \"\".concat(_this4.options.pluralSeparator, \"zero\");\n if (needsPluralHandling) {\n finalKeys.push(key + pluralSuffix);\n if (needsZeroSuffixLookup) {\n finalKeys.push(key + zeroSuffix);\n }\n }\n if (needsContextHandling) {\n var contextKey = \"\".concat(key).concat(_this4.options.contextSeparator).concat(options.context);\n finalKeys.push(contextKey);\n if (needsPluralHandling) {\n finalKeys.push(contextKey + pluralSuffix);\n if (needsZeroSuffixLookup) {\n finalKeys.push(contextKey + zeroSuffix);\n }\n }\n }\n }\n var possibleKey;\n while (possibleKey = finalKeys.pop()) {\n if (!_this4.isValidLookup(found)) {\n exactUsedKey = possibleKey;\n found = _this4.getResource(code, ns, possibleKey, options);\n }\n }\n });\n });\n });\n return {\n res: found,\n usedKey: usedKey,\n exactUsedKey: exactUsedKey,\n usedLng: usedLng,\n usedNS: usedNS\n };\n }\n }, {\n key: \"isValidLookup\",\n value: function isValidLookup(res) {\n return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');\n }\n }, {\n key: \"getResource\",\n value: function getResource(code, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);\n return this.resourceStore.getResource(code, ns, key, options);\n }\n }], [{\n key: \"hasDefaultValue\",\n value: function hasDefaultValue(options) {\n var prefix = 'defaultValue';\n for (var option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {\n return true;\n }\n }\n return false;\n }\n }]);\n return Translator;\n}(EventEmitter);\n\nfunction capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\nvar LanguageUtil = function () {\n function LanguageUtil(options) {\n _classCallCheck(this, LanguageUtil);\n this.options = options;\n this.supportedLngs = this.options.supportedLngs || false;\n this.logger = baseLogger.create('languageUtils');\n }\n _createClass(LanguageUtil, [{\n key: \"getScriptPartFromCode\",\n value: function getScriptPartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return null;\n var p = code.split('-');\n if (p.length === 2) return null;\n p.pop();\n if (p[p.length - 1].toLowerCase() === 'x') return null;\n return this.formatLanguageCode(p.join('-'));\n }\n }, {\n key: \"getLanguagePartFromCode\",\n value: function getLanguagePartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return code;\n var p = code.split('-');\n return this.formatLanguageCode(p[0]);\n }\n }, {\n key: \"formatLanguageCode\",\n value: function formatLanguageCode(code) {\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];\n var p = code.split('-');\n if (this.options.lowerCaseLng) {\n p = p.map(function (part) {\n return part.toLowerCase();\n });\n } else if (p.length === 2) {\n p[0] = p[0].toLowerCase();\n p[1] = p[1].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n } else if (p.length === 3) {\n p[0] = p[0].toLowerCase();\n if (p[1].length === 2) p[1] = p[1].toUpperCase();\n if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());\n }\n return p.join('-');\n }\n return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;\n }\n }, {\n key: \"isSupportedCode\",\n value: function isSupportedCode(code) {\n if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {\n code = this.getLanguagePartFromCode(code);\n }\n return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;\n }\n }, {\n key: \"getBestMatchFromCodes\",\n value: function getBestMatchFromCodes(codes) {\n var _this = this;\n if (!codes) return null;\n var found;\n codes.forEach(function (code) {\n if (found) return;\n var cleanedLng = _this.formatLanguageCode(code);\n if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng;\n });\n if (!found && this.options.supportedLngs) {\n codes.forEach(function (code) {\n if (found) return;\n var lngOnly = _this.getLanguagePartFromCode(code);\n if (_this.isSupportedCode(lngOnly)) return found = lngOnly;\n found = _this.options.supportedLngs.find(function (supportedLng) {\n if (supportedLng === lngOnly) return supportedLng;\n if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;\n if (supportedLng.indexOf(lngOnly) === 0) return supportedLng;\n });\n });\n }\n if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];\n return found;\n }\n }, {\n key: \"getFallbackCodes\",\n value: function getFallbackCodes(fallbacks, code) {\n if (!fallbacks) return [];\n if (typeof fallbacks === 'function') fallbacks = fallbacks(code);\n if (typeof fallbacks === 'string') fallbacks = [fallbacks];\n if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;\n if (!code) return fallbacks[\"default\"] || [];\n var found = fallbacks[code];\n if (!found) found = fallbacks[this.getScriptPartFromCode(code)];\n if (!found) found = fallbacks[this.formatLanguageCode(code)];\n if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];\n if (!found) found = fallbacks[\"default\"];\n return found || [];\n }\n }, {\n key: \"toResolveHierarchy\",\n value: function toResolveHierarchy(code, fallbackCode) {\n var _this2 = this;\n var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);\n var codes = [];\n var addCode = function addCode(c) {\n if (!c) return;\n if (_this2.isSupportedCode(c)) {\n codes.push(c);\n } else {\n _this2.logger.warn(\"rejecting language code not found in supportedLngs: \".concat(c));\n }\n };\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));\n if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));\n if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));\n } else if (typeof code === 'string') {\n addCode(this.formatLanguageCode(code));\n }\n fallbackCodes.forEach(function (fc) {\n if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc));\n });\n return codes;\n }\n }]);\n return LanguageUtil;\n}();\n\nvar sets = [{\n lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],\n nr: [1, 2],\n fc: 1\n}, {\n lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kk', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],\n nr: [1, 2],\n fc: 2\n}, {\n lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],\n nr: [1],\n fc: 3\n}, {\n lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],\n nr: [1, 2, 5],\n fc: 4\n}, {\n lngs: ['ar'],\n nr: [0, 1, 2, 3, 11, 100],\n fc: 5\n}, {\n lngs: ['cs', 'sk'],\n nr: [1, 2, 5],\n fc: 6\n}, {\n lngs: ['csb', 'pl'],\n nr: [1, 2, 5],\n fc: 7\n}, {\n lngs: ['cy'],\n nr: [1, 2, 3, 8],\n fc: 8\n}, {\n lngs: ['fr'],\n nr: [1, 2],\n fc: 9\n}, {\n lngs: ['ga'],\n nr: [1, 2, 3, 7, 11],\n fc: 10\n}, {\n lngs: ['gd'],\n nr: [1, 2, 3, 20],\n fc: 11\n}, {\n lngs: ['is'],\n nr: [1, 2],\n fc: 12\n}, {\n lngs: ['jv'],\n nr: [0, 1],\n fc: 13\n}, {\n lngs: ['kw'],\n nr: [1, 2, 3, 4],\n fc: 14\n}, {\n lngs: ['lt'],\n nr: [1, 2, 10],\n fc: 15\n}, {\n lngs: ['lv'],\n nr: [1, 2, 0],\n fc: 16\n}, {\n lngs: ['mk'],\n nr: [1, 2],\n fc: 17\n}, {\n lngs: ['mnk'],\n nr: [0, 1, 2],\n fc: 18\n}, {\n lngs: ['mt'],\n nr: [1, 2, 11, 20],\n fc: 19\n}, {\n lngs: ['or'],\n nr: [2, 1],\n fc: 2\n}, {\n lngs: ['ro'],\n nr: [1, 2, 20],\n fc: 20\n}, {\n lngs: ['sl'],\n nr: [5, 1, 2, 3],\n fc: 21\n}, {\n lngs: ['he', 'iw'],\n nr: [1, 2, 20, 21],\n fc: 22\n}];\nvar _rulesPluralsTypes = {\n 1: function _(n) {\n return Number(n > 1);\n },\n 2: function _(n) {\n return Number(n != 1);\n },\n 3: function _(n) {\n return 0;\n },\n 4: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 5: function _(n) {\n return Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);\n },\n 6: function _(n) {\n return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);\n },\n 7: function _(n) {\n return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 8: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);\n },\n 9: function _(n) {\n return Number(n >= 2);\n },\n 10: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);\n },\n 11: function _(n) {\n return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);\n },\n 12: function _(n) {\n return Number(n % 10 != 1 || n % 100 == 11);\n },\n 13: function _(n) {\n return Number(n !== 0);\n },\n 14: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);\n },\n 15: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 16: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);\n },\n 17: function _(n) {\n return Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1);\n },\n 18: function _(n) {\n return Number(n == 0 ? 0 : n == 1 ? 1 : 2);\n },\n 19: function _(n) {\n return Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3);\n },\n 20: function _(n) {\n return Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2);\n },\n 21: function _(n) {\n return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);\n },\n 22: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);\n }\n};\nvar deprecatedJsonVersions = ['v1', 'v2', 'v3'];\nvar suffixesOrder = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 4,\n other: 5\n};\nfunction createRules() {\n var rules = {};\n sets.forEach(function (set) {\n set.lngs.forEach(function (l) {\n rules[l] = {\n numbers: set.nr,\n plurals: _rulesPluralsTypes[set.fc]\n };\n });\n });\n return rules;\n}\nvar PluralResolver = function () {\n function PluralResolver(languageUtils) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, PluralResolver);\n this.languageUtils = languageUtils;\n this.options = options;\n this.logger = baseLogger.create('pluralResolver');\n if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === 'v4') && (typeof Intl === 'undefined' || !Intl.PluralRules)) {\n this.options.compatibilityJSON = 'v3';\n this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');\n }\n this.rules = createRules();\n }\n _createClass(PluralResolver, [{\n key: \"addRule\",\n value: function addRule(lng, obj) {\n this.rules[lng] = obj;\n }\n }, {\n key: \"getRule\",\n value: function getRule(code) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.shouldUseIntlApi()) {\n try {\n return new Intl.PluralRules(code, {\n type: options.ordinal ? 'ordinal' : 'cardinal'\n });\n } catch (_unused) {\n return;\n }\n }\n return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];\n }\n }, {\n key: \"needsPlural\",\n value: function needsPlural(code) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var rule = this.getRule(code, options);\n if (this.shouldUseIntlApi()) {\n return rule && rule.resolvedOptions().pluralCategories.length > 1;\n }\n return rule && rule.numbers.length > 1;\n }\n }, {\n key: \"getPluralFormsOfKey\",\n value: function getPluralFormsOfKey(code, key) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return this.getSuffixes(code, options).map(function (suffix) {\n return \"\".concat(key).concat(suffix);\n });\n }\n }, {\n key: \"getSuffixes\",\n value: function getSuffixes(code) {\n var _this = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var rule = this.getRule(code, options);\n if (!rule) {\n return [];\n }\n if (this.shouldUseIntlApi()) {\n return rule.resolvedOptions().pluralCategories.sort(function (pluralCategory1, pluralCategory2) {\n return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2];\n }).map(function (pluralCategory) {\n return \"\".concat(_this.options.prepend).concat(pluralCategory);\n });\n }\n return rule.numbers.map(function (number) {\n return _this.getSuffix(code, number, options);\n });\n }\n }, {\n key: \"getSuffix\",\n value: function getSuffix(code, count) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var rule = this.getRule(code, options);\n if (rule) {\n if (this.shouldUseIntlApi()) {\n return \"\".concat(this.options.prepend).concat(rule.select(count));\n }\n return this.getSuffixRetroCompatible(rule, count);\n }\n this.logger.warn(\"no plural rule found for: \".concat(code));\n return '';\n }\n }, {\n key: \"getSuffixRetroCompatible\",\n value: function getSuffixRetroCompatible(rule, count) {\n var _this2 = this;\n var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));\n var suffix = rule.numbers[idx];\n if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n if (suffix === 2) {\n suffix = 'plural';\n } else if (suffix === 1) {\n suffix = '';\n }\n }\n var returnSuffix = function returnSuffix() {\n return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();\n };\n if (this.options.compatibilityJSON === 'v1') {\n if (suffix === 1) return '';\n if (typeof suffix === 'number') return \"_plural_\".concat(suffix.toString());\n return returnSuffix();\n } else if (this.options.compatibilityJSON === 'v2') {\n return returnSuffix();\n } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n return returnSuffix();\n }\n return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();\n }\n }, {\n key: \"shouldUseIntlApi\",\n value: function shouldUseIntlApi() {\n return !deprecatedJsonVersions.includes(this.options.compatibilityJSON);\n }\n }]);\n return PluralResolver;\n}();\n\nfunction ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction deepFindWithDefaults(data, defaultData, key) {\n var keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';\n var ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var path = getPathWithDefaults(data, defaultData, key);\n if (!path && ignoreJSONStructure && typeof key === 'string') {\n path = deepFind(data, key, keySeparator);\n if (path === undefined) path = deepFind(defaultData, key, keySeparator);\n }\n return path;\n}\nvar Interpolator = function () {\n function Interpolator() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Interpolator);\n this.logger = baseLogger.create('interpolator');\n this.options = options;\n this.format = options.interpolation && options.interpolation.format || function (value) {\n return value;\n };\n this.init(options);\n }\n _createClass(Interpolator, [{\n key: \"init\",\n value: function init() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!options.interpolation) options.interpolation = {\n escapeValue: true\n };\n var iOpts = options.interpolation;\n this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;\n this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;\n this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;\n this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';\n this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';\n this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';\n this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';\n this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';\n this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t(');\n this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')');\n this.nestingOptionsSeparator = iOpts.nestingOptionsSeparator ? iOpts.nestingOptionsSeparator : iOpts.nestingOptionsSeparator || ',';\n this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000;\n this.alwaysFormat = iOpts.alwaysFormat !== undefined ? iOpts.alwaysFormat : false;\n this.resetRegExp();\n }\n }, {\n key: \"reset\",\n value: function reset() {\n if (this.options) this.init(this.options);\n }\n }, {\n key: \"resetRegExp\",\n value: function resetRegExp() {\n var regexpStr = \"\".concat(this.prefix, \"(.+?)\").concat(this.suffix);\n this.regexp = new RegExp(regexpStr, 'g');\n var regexpUnescapeStr = \"\".concat(this.prefix).concat(this.unescapePrefix, \"(.+?)\").concat(this.unescapeSuffix).concat(this.suffix);\n this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');\n var nestingRegexpStr = \"\".concat(this.nestingPrefix, \"(.+?)\").concat(this.nestingSuffix);\n this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');\n }\n }, {\n key: \"interpolate\",\n value: function interpolate(str, data, lng, options) {\n var _this = this;\n var match;\n var value;\n var replaces;\n var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};\n function regexSafe(val) {\n return val.replace(/\\$/g, '$$$$');\n }\n var handleFormat = function handleFormat(key) {\n if (key.indexOf(_this.formatSeparator) < 0) {\n var path = deepFindWithDefaults(data, defaultData, key, _this.options.keySeparator, _this.options.ignoreJSONStructure);\n return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {\n interpolationkey: key\n })) : path;\n }\n var p = key.split(_this.formatSeparator);\n var k = p.shift().trim();\n var f = p.join(_this.formatSeparator).trim();\n return _this.format(deepFindWithDefaults(data, defaultData, k, _this.options.keySeparator, _this.options.ignoreJSONStructure), f, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {\n interpolationkey: k\n }));\n };\n this.resetRegExp();\n var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;\n var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;\n var todos = [{\n regex: this.regexpUnescape,\n safeValue: function safeValue(val) {\n return regexSafe(val);\n }\n }, {\n regex: this.regexp,\n safeValue: function safeValue(val) {\n return _this.escapeValue ? regexSafe(_this.escape(val)) : regexSafe(val);\n }\n }];\n todos.forEach(function (todo) {\n replaces = 0;\n while (match = todo.regex.exec(str)) {\n var matchedVar = match[1].trim();\n value = handleFormat(matchedVar);\n if (value === undefined) {\n if (typeof missingInterpolationHandler === 'function') {\n var temp = missingInterpolationHandler(str, match, options);\n value = typeof temp === 'string' ? temp : '';\n } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {\n value = '';\n } else if (skipOnVariables) {\n value = match[0];\n continue;\n } else {\n _this.logger.warn(\"missed to pass in variable \".concat(matchedVar, \" for interpolating \").concat(str));\n value = '';\n }\n } else if (typeof value !== 'string' && !_this.useRawValueToEscape) {\n value = makeString(value);\n }\n var safeValue = todo.safeValue(value);\n str = str.replace(match[0], safeValue);\n if (skipOnVariables) {\n todo.regex.lastIndex += value.length;\n todo.regex.lastIndex -= match[0].length;\n } else {\n todo.regex.lastIndex = 0;\n }\n replaces++;\n if (replaces >= _this.maxReplaces) {\n break;\n }\n }\n });\n return str;\n }\n }, {\n key: \"nest\",\n value: function nest(str, fc) {\n var _this2 = this;\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var match;\n var value;\n var clonedOptions;\n function handleHasOptions(key, inheritedOptions) {\n var sep = this.nestingOptionsSeparator;\n if (key.indexOf(sep) < 0) return key;\n var c = key.split(new RegExp(\"\".concat(sep, \"[ ]*{\")));\n var optionsString = \"{\".concat(c[1]);\n key = c[0];\n optionsString = this.interpolate(optionsString, clonedOptions);\n var matchedSingleQuotes = optionsString.match(/'/g);\n var matchedDoubleQuotes = optionsString.match(/\"/g);\n if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {\n optionsString = optionsString.replace(/'/g, '\"');\n }\n try {\n clonedOptions = JSON.parse(optionsString);\n if (inheritedOptions) clonedOptions = _objectSpread$3(_objectSpread$3({}, inheritedOptions), clonedOptions);\n } catch (e) {\n this.logger.warn(\"failed parsing options string in nesting for key \".concat(key), e);\n return \"\".concat(key).concat(sep).concat(optionsString);\n }\n delete clonedOptions.defaultValue;\n return key;\n }\n while (match = this.nestingRegexp.exec(str)) {\n var formatters = [];\n clonedOptions = _objectSpread$3({}, options);\n clonedOptions = clonedOptions.replace && typeof clonedOptions.replace !== 'string' ? clonedOptions.replace : clonedOptions;\n clonedOptions.applyPostProcessor = false;\n delete clonedOptions.defaultValue;\n var doReduce = false;\n if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {\n var r = match[1].split(this.formatSeparator).map(function (elem) {\n return elem.trim();\n });\n match[1] = r.shift();\n formatters = r;\n doReduce = true;\n }\n value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);\n if (value && match[0] === str && typeof value !== 'string') return value;\n if (typeof value !== 'string') value = makeString(value);\n if (!value) {\n this.logger.warn(\"missed to resolve \".concat(match[1], \" for nesting \").concat(str));\n value = '';\n }\n if (doReduce) {\n value = formatters.reduce(function (v, f) {\n return _this2.format(v, f, options.lng, _objectSpread$3(_objectSpread$3({}, options), {}, {\n interpolationkey: match[1].trim()\n }));\n }, value.trim());\n }\n str = str.replace(match[0], value);\n this.regexp.lastIndex = 0;\n }\n return str;\n }\n }]);\n return Interpolator;\n}();\n\nfunction ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction parseFormatStr(formatStr) {\n var formatName = formatStr.toLowerCase().trim();\n var formatOptions = {};\n if (formatStr.indexOf('(') > -1) {\n var p = formatStr.split('(');\n formatName = p[0].toLowerCase().trim();\n var optStr = p[1].substring(0, p[1].length - 1);\n if (formatName === 'currency' && optStr.indexOf(':') < 0) {\n if (!formatOptions.currency) formatOptions.currency = optStr.trim();\n } else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {\n if (!formatOptions.range) formatOptions.range = optStr.trim();\n } else {\n var opts = optStr.split(';');\n opts.forEach(function (opt) {\n if (!opt) return;\n var _opt$split = opt.split(':'),\n _opt$split2 = _toArray(_opt$split),\n key = _opt$split2[0],\n rest = _opt$split2.slice(1);\n var val = rest.join(':').trim().replace(/^'+|'+$/g, '');\n if (!formatOptions[key.trim()]) formatOptions[key.trim()] = val;\n if (val === 'false') formatOptions[key.trim()] = false;\n if (val === 'true') formatOptions[key.trim()] = true;\n if (!isNaN(val)) formatOptions[key.trim()] = parseInt(val, 10);\n });\n }\n }\n return {\n formatName: formatName,\n formatOptions: formatOptions\n };\n}\nfunction createCachedFormatter(fn) {\n var cache = {};\n return function invokeFormatter(val, lng, options) {\n var key = lng + JSON.stringify(options);\n var formatter = cache[key];\n if (!formatter) {\n formatter = fn(lng, options);\n cache[key] = formatter;\n }\n return formatter(val);\n };\n}\nvar Formatter = function () {\n function Formatter() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Formatter);\n this.logger = baseLogger.create('formatter');\n this.options = options;\n this.formats = {\n number: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.NumberFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val);\n };\n }),\n currency: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.NumberFormat(lng, _objectSpread$2(_objectSpread$2({}, opt), {}, {\n style: 'currency'\n }));\n return function (val) {\n return formatter.format(val);\n };\n }),\n datetime: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.DateTimeFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val);\n };\n }),\n relativetime: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val, opt.range || 'day');\n };\n }),\n list: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.ListFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val);\n };\n })\n };\n this.init(options);\n }\n _createClass(Formatter, [{\n key: \"init\",\n value: function init(services) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n var iOpts = options.interpolation;\n this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';\n }\n }, {\n key: \"add\",\n value: function add(name, fc) {\n this.formats[name.toLowerCase().trim()] = fc;\n }\n }, {\n key: \"addCached\",\n value: function addCached(name, fc) {\n this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);\n }\n }, {\n key: \"format\",\n value: function format(value, _format, lng) {\n var _this = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var formats = _format.split(this.formatSeparator);\n var result = formats.reduce(function (mem, f) {\n var _parseFormatStr = parseFormatStr(f),\n formatName = _parseFormatStr.formatName,\n formatOptions = _parseFormatStr.formatOptions;\n if (_this.formats[formatName]) {\n var formatted = mem;\n try {\n var valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};\n var l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;\n formatted = _this.formats[formatName](mem, l, _objectSpread$2(_objectSpread$2(_objectSpread$2({}, formatOptions), options), valOptions));\n } catch (error) {\n _this.logger.warn(error);\n }\n return formatted;\n } else {\n _this.logger.warn(\"there was no format function for \".concat(formatName));\n }\n return mem;\n }, value);\n return result;\n }\n }]);\n return Formatter;\n}();\n\nfunction ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct$1() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction removePending(q, name) {\n if (q.pending[name] !== undefined) {\n delete q.pending[name];\n q.pendingCount--;\n }\n}\nvar Connector = function (_EventEmitter) {\n _inherits(Connector, _EventEmitter);\n var _super = _createSuper$1(Connector);\n function Connector(backend, store, services) {\n var _this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n _classCallCheck(this, Connector);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n _this.backend = backend;\n _this.store = store;\n _this.services = services;\n _this.languageUtils = services.languageUtils;\n _this.options = options;\n _this.logger = baseLogger.create('backendConnector');\n _this.waitingReads = [];\n _this.maxParallelReads = options.maxParallelReads || 10;\n _this.readingCalls = 0;\n _this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;\n _this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;\n _this.state = {};\n _this.queue = [];\n if (_this.backend && _this.backend.init) {\n _this.backend.init(services, options.backend, options);\n }\n return _this;\n }\n _createClass(Connector, [{\n key: \"queueLoad\",\n value: function queueLoad(languages, namespaces, options, callback) {\n var _this2 = this;\n var toLoad = {};\n var pending = {};\n var toLoadLanguages = {};\n var toLoadNamespaces = {};\n languages.forEach(function (lng) {\n var hasAllNamespaces = true;\n namespaces.forEach(function (ns) {\n var name = \"\".concat(lng, \"|\").concat(ns);\n if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {\n _this2.state[name] = 2;\n } else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {\n if (pending[name] === undefined) pending[name] = true;\n } else {\n _this2.state[name] = 1;\n hasAllNamespaces = false;\n if (pending[name] === undefined) pending[name] = true;\n if (toLoad[name] === undefined) toLoad[name] = true;\n if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;\n }\n });\n if (!hasAllNamespaces) toLoadLanguages[lng] = true;\n });\n if (Object.keys(toLoad).length || Object.keys(pending).length) {\n this.queue.push({\n pending: pending,\n pendingCount: Object.keys(pending).length,\n loaded: {},\n errors: [],\n callback: callback\n });\n }\n return {\n toLoad: Object.keys(toLoad),\n pending: Object.keys(pending),\n toLoadLanguages: Object.keys(toLoadLanguages),\n toLoadNamespaces: Object.keys(toLoadNamespaces)\n };\n }\n }, {\n key: \"loaded\",\n value: function loaded(name, err, data) {\n var s = name.split('|');\n var lng = s[0];\n var ns = s[1];\n if (err) this.emit('failedLoading', lng, ns, err);\n if (data) {\n this.store.addResourceBundle(lng, ns, data);\n }\n this.state[name] = err ? -1 : 2;\n var loaded = {};\n this.queue.forEach(function (q) {\n pushPath(q.loaded, [lng], ns);\n removePending(q, name);\n if (err) q.errors.push(err);\n if (q.pendingCount === 0 && !q.done) {\n Object.keys(q.loaded).forEach(function (l) {\n if (!loaded[l]) loaded[l] = {};\n var loadedKeys = q.loaded[l];\n if (loadedKeys.length) {\n loadedKeys.forEach(function (n) {\n if (loaded[l][n] === undefined) loaded[l][n] = true;\n });\n }\n });\n q.done = true;\n if (q.errors.length) {\n q.callback(q.errors);\n } else {\n q.callback();\n }\n }\n });\n this.emit('loaded', loaded);\n this.queue = this.queue.filter(function (q) {\n return !q.done;\n });\n }\n }, {\n key: \"read\",\n value: function read(lng, ns, fcName) {\n var _this3 = this;\n var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;\n var callback = arguments.length > 5 ? arguments[5] : undefined;\n if (!lng.length) return callback(null, {});\n if (this.readingCalls >= this.maxParallelReads) {\n this.waitingReads.push({\n lng: lng,\n ns: ns,\n fcName: fcName,\n tried: tried,\n wait: wait,\n callback: callback\n });\n return;\n }\n this.readingCalls++;\n var resolver = function resolver(err, data) {\n _this3.readingCalls--;\n if (_this3.waitingReads.length > 0) {\n var next = _this3.waitingReads.shift();\n _this3.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);\n }\n if (err && data && tried < _this3.maxRetries) {\n setTimeout(function () {\n _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);\n }, wait);\n return;\n }\n callback(err, data);\n };\n var fc = this.backend[fcName].bind(this.backend);\n if (fc.length === 2) {\n try {\n var r = fc(lng, ns);\n if (r && typeof r.then === 'function') {\n r.then(function (data) {\n return resolver(null, data);\n })[\"catch\"](resolver);\n } else {\n resolver(null, r);\n }\n } catch (err) {\n resolver(err);\n }\n return;\n }\n return fc(lng, ns, resolver);\n }\n }, {\n key: \"prepareLoading\",\n value: function prepareLoading(languages, namespaces) {\n var _this4 = this;\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var callback = arguments.length > 3 ? arguments[3] : undefined;\n if (!this.backend) {\n this.logger.warn('No backend was added via i18next.use. Will not load resources.');\n return callback && callback();\n }\n if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);\n if (typeof namespaces === 'string') namespaces = [namespaces];\n var toLoad = this.queueLoad(languages, namespaces, options, callback);\n if (!toLoad.toLoad.length) {\n if (!toLoad.pending.length) callback();\n return null;\n }\n toLoad.toLoad.forEach(function (name) {\n _this4.loadOne(name);\n });\n }\n }, {\n key: \"load\",\n value: function load(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {}, callback);\n }\n }, {\n key: \"reload\",\n value: function reload(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {\n reload: true\n }, callback);\n }\n }, {\n key: \"loadOne\",\n value: function loadOne(name) {\n var _this5 = this;\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var s = name.split('|');\n var lng = s[0];\n var ns = s[1];\n this.read(lng, ns, 'read', undefined, undefined, function (err, data) {\n if (err) _this5.logger.warn(\"\".concat(prefix, \"loading namespace \").concat(ns, \" for language \").concat(lng, \" failed\"), err);\n if (!err && data) _this5.logger.log(\"\".concat(prefix, \"loaded namespace \").concat(ns, \" for language \").concat(lng), data);\n _this5.loaded(name, err, data);\n });\n }\n }, {\n key: \"saveMissing\",\n value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n var clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : function () {};\n if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {\n this.logger.warn(\"did not save key \\\"\".concat(key, \"\\\" as the namespace \\\"\").concat(namespace, \"\\\" was not yet loaded\"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n return;\n }\n if (key === undefined || key === null || key === '') return;\n if (this.backend && this.backend.create) {\n var opts = _objectSpread$1(_objectSpread$1({}, options), {}, {\n isUpdate: isUpdate\n });\n var fc = this.backend.create.bind(this.backend);\n if (fc.length < 6) {\n try {\n var r;\n if (fc.length === 5) {\n r = fc(languages, namespace, key, fallbackValue, opts);\n } else {\n r = fc(languages, namespace, key, fallbackValue);\n }\n if (r && typeof r.then === 'function') {\n r.then(function (data) {\n return clb(null, data);\n })[\"catch\"](clb);\n } else {\n clb(null, r);\n }\n } catch (err) {\n clb(err);\n }\n } else {\n fc(languages, namespace, key, fallbackValue, clb, opts);\n }\n }\n if (!languages || !languages[0]) return;\n this.store.addResource(languages[0], namespace, key, fallbackValue);\n }\n }]);\n return Connector;\n}(EventEmitter);\n\nfunction get() {\n return {\n debug: false,\n initImmediate: true,\n ns: ['translation'],\n defaultNS: ['translation'],\n fallbackLng: ['dev'],\n fallbackNS: false,\n supportedLngs: false,\n nonExplicitSupportedLngs: false,\n load: 'all',\n preload: false,\n simplifyPluralSuffix: true,\n keySeparator: '.',\n nsSeparator: ':',\n pluralSeparator: '_',\n contextSeparator: '_',\n partialBundledLanguages: false,\n saveMissing: false,\n updateMissing: false,\n saveMissingTo: 'fallback',\n saveMissingPlurals: true,\n missingKeyHandler: false,\n missingInterpolationHandler: false,\n postProcess: false,\n postProcessPassResolved: false,\n returnNull: true,\n returnEmptyString: true,\n returnObjects: false,\n joinArrays: false,\n returnedObjectHandler: false,\n parseMissingKeyHandler: false,\n appendNamespaceToMissingKey: false,\n appendNamespaceToCIMode: false,\n overloadTranslationOptionHandler: function handle(args) {\n var ret = {};\n if (_typeof(args[1]) === 'object') ret = args[1];\n if (typeof args[1] === 'string') ret.defaultValue = args[1];\n if (typeof args[2] === 'string') ret.tDescription = args[2];\n if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {\n var options = args[3] || args[2];\n Object.keys(options).forEach(function (key) {\n ret[key] = options[key];\n });\n }\n return ret;\n },\n interpolation: {\n escapeValue: true,\n format: function format(value, _format, lng, options) {\n return value;\n },\n prefix: '{{',\n suffix: '}}',\n formatSeparator: ',',\n unescapePrefix: '-',\n nestingPrefix: '$t(',\n nestingSuffix: ')',\n nestingOptionsSeparator: ',',\n maxReplaces: 1000,\n skipOnVariables: true\n }\n };\n}\nfunction transformOptions(options) {\n if (typeof options.ns === 'string') options.ns = [options.ns];\n if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];\n if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];\n if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {\n options.supportedLngs = options.supportedLngs.concat(['cimode']);\n }\n return options;\n}\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction noop() {}\nfunction bindMemberFunctions(inst) {\n var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));\n mems.forEach(function (mem) {\n if (typeof inst[mem] === 'function') {\n inst[mem] = inst[mem].bind(inst);\n }\n });\n}\nvar I18n = function (_EventEmitter) {\n _inherits(I18n, _EventEmitter);\n var _super = _createSuper(I18n);\n function I18n() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n _classCallCheck(this, I18n);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n _this.options = transformOptions(options);\n _this.services = {};\n _this.logger = baseLogger;\n _this.modules = {\n external: []\n };\n bindMemberFunctions(_assertThisInitialized(_this));\n if (callback && !_this.isInitialized && !options.isClone) {\n if (!_this.options.initImmediate) {\n _this.init(options, callback);\n return _possibleConstructorReturn(_this, _assertThisInitialized(_this));\n }\n setTimeout(function () {\n _this.init(options, callback);\n }, 0);\n }\n return _this;\n }\n _createClass(I18n, [{\n key: \"init\",\n value: function init() {\n var _this2 = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n if (!options.defaultNS && options.defaultNS !== false && options.ns) {\n if (typeof options.ns === 'string') {\n options.defaultNS = options.ns;\n } else if (options.ns.indexOf('translation') < 0) {\n options.defaultNS = options.ns[0];\n }\n }\n var defOpts = get();\n this.options = _objectSpread(_objectSpread(_objectSpread({}, defOpts), this.options), transformOptions(options));\n if (this.options.compatibilityAPI !== 'v1') {\n this.options.interpolation = _objectSpread(_objectSpread({}, defOpts.interpolation), this.options.interpolation);\n }\n if (options.keySeparator !== undefined) {\n this.options.userDefinedKeySeparator = options.keySeparator;\n }\n if (options.nsSeparator !== undefined) {\n this.options.userDefinedNsSeparator = options.nsSeparator;\n }\n function createClassOnDemand(ClassOrObject) {\n if (!ClassOrObject) return null;\n if (typeof ClassOrObject === 'function') return new ClassOrObject();\n return ClassOrObject;\n }\n if (!this.options.isClone) {\n if (this.modules.logger) {\n baseLogger.init(createClassOnDemand(this.modules.logger), this.options);\n } else {\n baseLogger.init(null, this.options);\n }\n var formatter;\n if (this.modules.formatter) {\n formatter = this.modules.formatter;\n } else if (typeof Intl !== 'undefined') {\n formatter = Formatter;\n }\n var lu = new LanguageUtil(this.options);\n this.store = new ResourceStore(this.options.resources, this.options);\n var s = this.services;\n s.logger = baseLogger;\n s.resourceStore = this.store;\n s.languageUtils = lu;\n s.pluralResolver = new PluralResolver(lu, {\n prepend: this.options.pluralSeparator,\n compatibilityJSON: this.options.compatibilityJSON,\n simplifyPluralSuffix: this.options.simplifyPluralSuffix\n });\n if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {\n s.formatter = createClassOnDemand(formatter);\n s.formatter.init(s, this.options);\n this.options.interpolation.format = s.formatter.format.bind(s.formatter);\n }\n s.interpolator = new Interpolator(this.options);\n s.utils = {\n hasLoadedNamespace: this.hasLoadedNamespace.bind(this)\n };\n s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);\n s.backendConnector.on('*', function (event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n _this2.emit.apply(_this2, [event].concat(args));\n });\n if (this.modules.languageDetector) {\n s.languageDetector = createClassOnDemand(this.modules.languageDetector);\n if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);\n }\n if (this.modules.i18nFormat) {\n s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);\n if (s.i18nFormat.init) s.i18nFormat.init(this);\n }\n this.translator = new Translator(this.services, this.options);\n this.translator.on('*', function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n _this2.emit.apply(_this2, [event].concat(args));\n });\n this.modules.external.forEach(function (m) {\n if (m.init) m.init(_this2);\n });\n }\n this.format = this.options.interpolation.format;\n if (!callback) callback = noop;\n if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {\n var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];\n }\n if (!this.services.languageDetector && !this.options.lng) {\n this.logger.warn('init: no languageDetector is used and no lng is defined');\n }\n var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];\n storeApi.forEach(function (fcName) {\n _this2[fcName] = function () {\n var _this2$store;\n return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);\n };\n });\n var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];\n storeApiChained.forEach(function (fcName) {\n _this2[fcName] = function () {\n var _this2$store2;\n (_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);\n return _this2;\n };\n });\n var deferred = defer();\n var load = function load() {\n var finish = function finish(err, t) {\n if (_this2.isInitialized && !_this2.initializedStoreOnce) _this2.logger.warn('init: i18next is already initialized. You should call init just once!');\n _this2.isInitialized = true;\n if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);\n _this2.emit('initialized', _this2.options);\n deferred.resolve(t);\n callback(err, t);\n };\n if (_this2.languages && _this2.options.compatibilityAPI !== 'v1' && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2));\n _this2.changeLanguage(_this2.options.lng, finish);\n };\n if (this.options.resources || !this.options.initImmediate) {\n load();\n } else {\n setTimeout(load, 0);\n }\n return deferred;\n }\n }, {\n key: \"loadResources\",\n value: function loadResources(language) {\n var _this3 = this;\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n var usedCallback = callback;\n var usedLng = typeof language === 'string' ? language : this.language;\n if (typeof language === 'function') usedCallback = language;\n if (!this.options.resources || this.options.partialBundledLanguages) {\n if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback();\n var toLoad = [];\n var append = function append(lng) {\n if (!lng) return;\n var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);\n lngs.forEach(function (l) {\n if (toLoad.indexOf(l) < 0) toLoad.push(l);\n });\n };\n if (!usedLng) {\n var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n fallbacks.forEach(function (l) {\n return append(l);\n });\n } else {\n append(usedLng);\n }\n if (this.options.preload) {\n this.options.preload.forEach(function (l) {\n return append(l);\n });\n }\n this.services.backendConnector.load(toLoad, this.options.ns, function (e) {\n if (!e && !_this3.resolvedLanguage && _this3.language) _this3.setResolvedLanguage(_this3.language);\n usedCallback(e);\n });\n } else {\n usedCallback(null);\n }\n }\n }, {\n key: \"reloadResources\",\n value: function reloadResources(lngs, ns, callback) {\n var deferred = defer();\n if (!lngs) lngs = this.languages;\n if (!ns) ns = this.options.ns;\n if (!callback) callback = noop;\n this.services.backendConnector.reload(lngs, ns, function (err) {\n deferred.resolve();\n callback(err);\n });\n return deferred;\n }\n }, {\n key: \"use\",\n value: function use(module) {\n if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');\n if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');\n if (module.type === 'backend') {\n this.modules.backend = module;\n }\n if (module.type === 'logger' || module.log && module.warn && module.error) {\n this.modules.logger = module;\n }\n if (module.type === 'languageDetector') {\n this.modules.languageDetector = module;\n }\n if (module.type === 'i18nFormat') {\n this.modules.i18nFormat = module;\n }\n if (module.type === 'postProcessor') {\n postProcessor.addPostProcessor(module);\n }\n if (module.type === 'formatter') {\n this.modules.formatter = module;\n }\n if (module.type === '3rdParty') {\n this.modules.external.push(module);\n }\n return this;\n }\n }, {\n key: \"setResolvedLanguage\",\n value: function setResolvedLanguage(l) {\n if (!l || !this.languages) return;\n if (['cimode', 'dev'].indexOf(l) > -1) return;\n for (var li = 0; li < this.languages.length; li++) {\n var lngInLngs = this.languages[li];\n if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;\n if (this.store.hasLanguageSomeTranslations(lngInLngs)) {\n this.resolvedLanguage = lngInLngs;\n break;\n }\n }\n }\n }, {\n key: \"changeLanguage\",\n value: function changeLanguage(lng, callback) {\n var _this4 = this;\n this.isLanguageChangingTo = lng;\n var deferred = defer();\n this.emit('languageChanging', lng);\n var setLngProps = function setLngProps(l) {\n _this4.language = l;\n _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);\n _this4.resolvedLanguage = undefined;\n _this4.setResolvedLanguage(l);\n };\n var done = function done(err, l) {\n if (l) {\n setLngProps(l);\n _this4.translator.changeLanguage(l);\n _this4.isLanguageChangingTo = undefined;\n _this4.emit('languageChanged', l);\n _this4.logger.log('languageChanged', l);\n } else {\n _this4.isLanguageChangingTo = undefined;\n }\n deferred.resolve(function () {\n return _this4.t.apply(_this4, arguments);\n });\n if (callback) callback(err, function () {\n return _this4.t.apply(_this4, arguments);\n });\n };\n var setLng = function setLng(lngs) {\n if (!lng && !lngs && _this4.services.languageDetector) lngs = [];\n var l = typeof lngs === 'string' ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);\n if (l) {\n if (!_this4.language) {\n setLngProps(l);\n }\n if (!_this4.translator.language) _this4.translator.changeLanguage(l);\n if (_this4.services.languageDetector && _this4.services.languageDetector.cacheUserLanguage) _this4.services.languageDetector.cacheUserLanguage(l);\n }\n _this4.loadResources(l, function (err) {\n done(err, l);\n });\n };\n if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {\n setLng(this.services.languageDetector.detect());\n } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {\n if (this.services.languageDetector.detect.length === 0) {\n this.services.languageDetector.detect().then(setLng);\n } else {\n this.services.languageDetector.detect(setLng);\n }\n } else {\n setLng(lng);\n }\n return deferred;\n }\n }, {\n key: \"getFixedT\",\n value: function getFixedT(lng, ns, keyPrefix) {\n var _this5 = this;\n var fixedT = function fixedT(key, opts) {\n var options;\n if (_typeof(opts) !== 'object') {\n for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n rest[_key3 - 2] = arguments[_key3];\n }\n options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));\n } else {\n options = _objectSpread({}, opts);\n }\n options.lng = options.lng || fixedT.lng;\n options.lngs = options.lngs || fixedT.lngs;\n options.ns = options.ns || fixedT.ns;\n options.keyPrefix = options.keyPrefix || keyPrefix || fixedT.keyPrefix;\n var keySeparator = _this5.options.keySeparator || '.';\n var resultKey;\n if (options.keyPrefix && Array.isArray(key)) {\n resultKey = key.map(function (k) {\n return \"\".concat(options.keyPrefix).concat(keySeparator).concat(k);\n });\n } else {\n resultKey = options.keyPrefix ? \"\".concat(options.keyPrefix).concat(keySeparator).concat(key) : key;\n }\n return _this5.t(resultKey, options);\n };\n if (typeof lng === 'string') {\n fixedT.lng = lng;\n } else {\n fixedT.lngs = lng;\n }\n fixedT.ns = ns;\n fixedT.keyPrefix = keyPrefix;\n return fixedT;\n }\n }, {\n key: \"t\",\n value: function t() {\n var _this$translator;\n return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);\n }\n }, {\n key: \"exists\",\n value: function exists() {\n var _this$translator2;\n return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);\n }\n }, {\n key: \"setDefaultNamespace\",\n value: function setDefaultNamespace(ns) {\n this.options.defaultNS = ns;\n }\n }, {\n key: \"hasLoadedNamespace\",\n value: function hasLoadedNamespace(ns) {\n var _this6 = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!this.isInitialized) {\n this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);\n return false;\n }\n if (!this.languages || !this.languages.length) {\n this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);\n return false;\n }\n var lng = options.lng || this.resolvedLanguage || this.languages[0];\n var fallbackLng = this.options ? this.options.fallbackLng : false;\n var lastLng = this.languages[this.languages.length - 1];\n if (lng.toLowerCase() === 'cimode') return true;\n var loadNotPending = function loadNotPending(l, n) {\n var loadState = _this6.services.backendConnector.state[\"\".concat(l, \"|\").concat(n)];\n return loadState === -1 || loadState === 2;\n };\n if (options.precheck) {\n var preResult = options.precheck(this, loadNotPending);\n if (preResult !== undefined) return preResult;\n }\n if (this.hasResourceBundle(lng, ns)) return true;\n if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;\n if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;\n return false;\n }\n }, {\n key: \"loadNamespaces\",\n value: function loadNamespaces(ns, callback) {\n var _this7 = this;\n var deferred = defer();\n if (!this.options.ns) {\n if (callback) callback();\n return Promise.resolve();\n }\n if (typeof ns === 'string') ns = [ns];\n ns.forEach(function (n) {\n if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);\n });\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"loadLanguages\",\n value: function loadLanguages(lngs, callback) {\n var deferred = defer();\n if (typeof lngs === 'string') lngs = [lngs];\n var preloaded = this.options.preload || [];\n var newLngs = lngs.filter(function (lng) {\n return preloaded.indexOf(lng) < 0;\n });\n if (!newLngs.length) {\n if (callback) callback();\n return Promise.resolve();\n }\n this.options.preload = preloaded.concat(newLngs);\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"dir\",\n value: function dir(lng) {\n if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);\n if (!lng) return 'rtl';\n var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];\n var languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());\n return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';\n }\n }, {\n key: \"cloneInstance\",\n value: function cloneInstance() {\n var _this8 = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n var mergedOptions = _objectSpread(_objectSpread(_objectSpread({}, this.options), options), {\n isClone: true\n });\n var clone = new I18n(mergedOptions);\n if (options.debug !== undefined || options.prefix !== undefined) {\n clone.logger = clone.logger.clone(options);\n }\n var membersToCopy = ['store', 'services', 'language'];\n membersToCopy.forEach(function (m) {\n clone[m] = _this8[m];\n });\n clone.services = _objectSpread({}, this.services);\n clone.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n clone.translator = new Translator(clone.services, clone.options);\n clone.translator.on('*', function (event) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n clone.emit.apply(clone, [event].concat(args));\n });\n clone.init(mergedOptions, callback);\n clone.translator.options = clone.options;\n clone.translator.backendConnector.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n return clone;\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return {\n options: this.options,\n store: this.store,\n language: this.language,\n languages: this.languages,\n resolvedLanguage: this.resolvedLanguage\n };\n }\n }]);\n return I18n;\n}(EventEmitter);\n_defineProperty(I18n, \"createInstance\", function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n return new I18n(options, callback);\n});\nvar instance = I18n.createInstance();\ninstance.createInstance = I18n.createInstance;\n\nvar createInstance = instance.createInstance;\nvar dir = instance.dir;\nvar init = instance.init;\nvar loadResources = instance.loadResources;\nvar reloadResources = instance.reloadResources;\nvar use = instance.use;\nvar changeLanguage = instance.changeLanguage;\nvar getFixedT = instance.getFixedT;\nvar t = instance.t;\nvar exists = instance.exists;\nvar setDefaultNamespace = instance.setDefaultNamespace;\nvar hasLoadedNamespace = instance.hasLoadedNamespace;\nvar loadNamespaces = instance.loadNamespaces;\nvar loadLanguages = instance.loadLanguages;\n\nexport { changeLanguage, createInstance, instance as default, dir, exists, getFixedT, hasLoadedNamespace, init, loadLanguages, loadNamespaces, loadResources, reloadResources, setDefaultNamespace, t, use };\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.scss';\nimport App from './App';\nimport './assets/style/animation.scss';\nimport 'modern-css-reset/dist/reset.min.css';\n\n/**\n * i18n\n */\nimport i18n from 'i18next';\nimport { initReactI18next, Trans } from 'react-i18next';\nimport { defaultLanguage, i18nTranslationResources, language } from './config/language';\nimport { webgalStore } from './store/store';\nimport { Provider } from 'react-redux';\n\ni18n\n .use(initReactI18next) // passes i18n down to react-i18next\n .init({\n // the translations\n // (tip move them in a JSON file and import them,\n // or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui)\n resources: i18nTranslationResources || {},\n lng: language[defaultLanguage] || 'zhCn', // if you're using a language detector, do not define the lng option\n fallbackLng: 'zhCn',\n\n interpolation: {\n escapeValue: false, // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape\n },\n })\n .then(() => console.log('WebGAL i18n Ready!'));\n\n// eslint-disable-next-line react/no-deprecated\nReactDOM.render(\n <React.StrictMode>\n <Trans>\n <Provider store={webgalStore}>\n <App />\n </Provider>\n </Trans>\n </React.StrictMode>,\n document.getElementById('root'),\n);\n"],"file":"assets/index-2d7a304e.js"} \ No newline at end of file +{"version":3,"mappings":";;;;EAQA,IAAIA,GAAwB,OAAO,sBAC/BC,GAAiB,OAAO,UAAU,eAClCC,GAAmB,OAAO,UAAU,qBAExC,SAASC,GAASC,EAAK,CACtB,GAAIA,GAAQ,KACX,MAAM,IAAI,UAAU,uDAAuD,EAG5E,OAAO,OAAOA,CAAG,CAClB,CAEA,SAASC,IAAkB,CAC1B,GAAI,CACH,GAAI,CAAC,OAAO,OACX,MAAO,GAMR,IAAIC,EAAQ,IAAI,OAAO,KAAK,EAE5B,GADAA,EAAM,CAAC,EAAI,KACP,OAAO,oBAAoBA,CAAK,EAAE,CAAC,IAAM,IAC5C,MAAO,GAKR,Q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Q,SACR,KAAM,OACN,QAAS,OACT,YAAa,aACb,YAAa,aACb,KAAM,OACN,KAAM,OACN,QAAS,SACT,MAAO,OACP,UAAW,eACb,CACF,EAEA,MAAO,CACL,MAAO,OACT,CACF,ECzLMC,GAAO,CAEX,OAAQ,CACN,IAAK,IACL,GAAI,GACN,EAEA,KAAM,CACJ,QAAS,CACP,MAAO,KACP,MAAO,CACL,OAAQ,CACN,MAAO,KACP,QAAS,CACP,UAAW,CACT,MAAO,SACP,QAAS,CACP,KAAM,IACN,OAAQ,IACR,KAAM,GACR,CACF,EACA,SAAU,CACR,MAAO,IACT,EACA,UAAW,CACT,MAAO,UACP,QAAS,CACP,cAAe,SACf,cAAe,SACf,SAAU,QACZ,EACA,QAAS,CACP,cAAe,WACf,cAAe,aACf,SAAU,YACZ,CACF,EACA,SAAU,CACR,MAAO,aACP,QAAS,CACP,OAAQ,UACR,OAAQ,SACV,EACA,QAAS,CACP,OAAQ,CACN,MAAO,cACP,IAAK,OACL,MAAO,QACT,CACF,CACF,EACA,MAAO,CACL,MAAO,YACP,SAAU,sBACV,QAAS,MACT,OAAQ,QACR,aAAc,MACd,QAAS,IACX,CACF,CACF,EACA,QAAS,CACP,MAAO,KACP,QAAS,CACP,WAAY,CACV,MAAO,OACP,QAAS,CACP,GAAI,KACJ,IAAK,IACP,CACF,EACA,UAAW,CACT,MAAO,SACP,QAAS,CACP,KAAM,IACN,OAAQ,IACR,KAAM,GACR,CACF,EACA,SAAU,CACR,MAAO,OACP,QAAS,CACP,MAAO,IACP,OAAQ,IACR,MAAO,GACT,CACF,EACA,SAAU,CACR,MAAO,OACP,QAAS,CACP,aAAc,OACd,OAAQ,KACR,KAAM,MACR,CACF,EACA,eAAgB,CACd,MAAO,SACT,EACA,YAAa,CACX,MAAO,SACP,KAAM,yCACR,CACF,CACF,EACA,MAAO,CACL,MAAO,KACP,QAAS,CACP,WAAY,CAAE,MAAO,KAAM,EAC3B,YAAa,CAAE,MAAO,MAAO,EAC7B,UAA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AAS,mBACbA,GAAS,eACVA,GAAS,cCh8E7B42D,GACG,IAAIoG,GAAgB,EACpB,KAAK,CAIJ,UAAW/kD,IAA4B,CAAC,EACxC,IAAKH,GAASI,EAAe,GAAK,OAClC,YAAa,OAEb,cAAe,CACb,YAAa,EACf,CACF,CAAC,EACA,KAAK,IAAM,QAAQ,IAAI,oBAAoB,CAAC,EAG/CyhC,GAAS,OACNC,MAAAm2H,GAAM,WAAN,CACC,eAACl0G,IACC,UAAAjiB,MAAC/L,GAAS,OAAOzzB,GACf,SAAAw/B,EAAA,IAAC0kI,IAAI,IACP,CACF,GACF,EACA,SAAS,eAAe,MAAM,CAChC","names":["getOwnPropertySymbols","hasOwnProperty","propIsEnumerable","toObject","val","shouldUseNative","test1","test2","i","order2","n","test3","letter","objectAssign","target","source","from","to","symbols","s","key","l","require$$0","p","react_production_min","q","r","t","u","v","w","x","y","a","z","b","c","A","B","C","D","E","F","G","H","I","J","e","d","k","h","g","f","m","K","L","escape","M","N","O","P","Q","R","S","T","reactModule","require$$1","reactJsxRuntime_production_min","jsxRuntimeModule","exports","U","V","W","schedulerModule","aa","require$$2","ba","ca","da","ea","fa","ha","ia","ja","ka","la","ma","na","oa","pa","qa","ra","sa","ta","ua","wa","xa","ya","za","Aa","Ba","Ca","Da","Ea","Fa","Ga","Ha","Ia","Ja","Ka","La","Ma","Na","Oa","Pa","Qa","Ra","Sa","Ta","Ua","Va","Wa","Xa","Ya","Za","$a","ab","bb","cb","db","eb","fb","gb","hb","ib","jb","kb","lb","mb","nb","ob","pb","qb","rb","sb","tb","ub","vb","wb","xb","yb","zb","Ab","Bb","Cb","Db","Eb","Fb","Gb","Hb","Ib","Jb","Kb","Lb","Mb","Nb","Ob","Pb","Qb","Rb","Sb","Tb","Ub","Vb","Wb","Xb","Yb","Zb","$b","ac","bc","cc","dc","ec","fc","gc","hc","ic","jc","kc","lc","mc","nc","oc","pc","qc","rc","sc","tc","uc","vc","wc","xc","yc","zc","Ac","Bc","Cc","Dc","Ec","Fc","Gc","Hc","Ic","Jc","Kc","Lc","Mc","Nc","Oc","Pc","Qc","Rc","Sc","Tc","Uc","Vc","Wc","Xc","Yc","Zc","$c","ad","bd","cd","dd","ed","fd","gd","hd","id","jd","kd","ld","md","nd","od","pd","qd","rd","sd","td","ud","vd","wd","xd","yd","Ad","zd","Bd","Cd","Dd","Ed","Fd","Gd","Hd","Id","Jd","Kd","Ld","Md","Nd","Od","Pd","Qd","Rd","Sd","Td","Ud","Vd","Wd","Xd","Yd","Zd","$d","ae","be","ce","de","ee","fe","ge","he","ie","je","ke","le","me","ne","oe","pe","qe","re","se","te","ue","ve","we","xe","ye","ze","Ae","Be","Ce","De","Ee","Fe","Ge","He","Ie","Je","Ke","Le","Me","Ne","Oe","Pe","Qe","Re","Se","Te","Ue","Ve","We","Xe","Ye","Ze","$e","af","bf","cf","df","ef","ff","gf","hf","jf","kf","lf","mf","nf","of","pf","qf","rf","sf","tf","uf","vf","wf","xf","yf","zf","Af","Bf","Cf","Df","Ef","Ff","Gf","Hf","If","Jf","Kf","Lf","Mf","Nf","Of","Pf","Qf","Rf","Sf","Tf","Uf","Vf","Wf","Xf","Yf","Zf","$f","ag","bg","cg","dg","eg","fg","gg","hg","ig","jg","kg","lg","mg","ng","og","pg","qg","rg","sg","tg","ug","vg","wg","xg","yg","zg","Ag","Bg","Cg","Dg","Eg","Fg","Gg","Kg","Hg","Ig","Jg","Lg","Mg","Ng","Og","Pg","Qg","Rg","Sg","Tg","Ug","Vg","Wg","Xg","Yg","Zg","$g","ah","bh","ch","dh","eh","fh","gh","hh","ih","jh","kh","lh","mh","nh","oh","ph","qh","rh","sh","th","uh","vh","wh","xh","yh","zh","Ah","Bh","Ch","Dh","Eh","Fh","Gh","Hh","Ih","Jh","Kh","Lh","Mh","Nh","Oh","Ph","Qh","Rh","Sh","Th","Uh","Vh","Wh","Xh","Yh","Zh","$h","ai","bi","ci","di","ei","fi","gi","hi","ii","ji","ki","li","mi","ni","oi","pi","qi","ri","si","ti","ui","vi","wi","xi","yi","zi","Ai","Bi","Ci","Di","Ei","Fi","Gi","Hi","Ii","Ji","Ki","Li","Mi","Ni","Oi","Pi","Qi","Ri","Si","Ti","Ui","Vi","Wi","Xi","Yi","Zi","$i","aj","bj","cj","dj","ej","fj","gj","hj","ij","jj","kj","lj","mj","nj","oj","pj","X","Y","qj","rj","sj","tj","uj","vj","wj","Z","xj","yj","zj","Aj","Bj","Cj","Dj","Ej","Fj","Gj","Hj","Ij","Jj","Kj","Lj","Mj","Nj","Oj","Pj","Qj","Rj","Sj","Tj","Uj","Vj","Wj","Xj","Yj","Zj","va","ak","bk","ck","dk","ek","fk","gk","hk","ik","jk","kk","lk","mk","nk","ok","pk","qk","rk","sk","tk","uk","vk","wk","xk","yk","reactDom_production_min","checkDCE","err","reactDomModule","o","nn","rn","tn","_","j","en","on","un","an","fn","_typeof","toPrimitive","toPropertyKey","_defineProperty","obj","value","ownKeys","_objectSpread2","defineProperty","formatProdErrorMessage","code","$$observable","randomString","ActionTypes","isPlainObject","proto","createStore","reducer","preloadedState","enhancer","_ref2","currentReducer","currentState","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","getState","subscribe","listener","isSubscribed","index","dispatch","action","listeners","replaceReducer","nextReducer","observable","_ref","outerSubscribe","observer","observeState","unsubscribe","assertReducerShape","reducers","initialState","combineReducers","reducerKeys","finalReducers","finalReducerKeys","shapeAssertionError","state","hasChanged","nextState","_i","_key","previousStateForKey","nextStateForKey","compose","_len","funcs","arg","applyMiddleware","middlewares","store","_dispatch","middlewareAPI","chain","middleware","_objectSpread","createThunkMiddleware","extraArgument","next","thunk","thunkMiddleware","__extends","this","extendStatics","__","__generator","thisArg","body","verb","step","op","__spreadArray","il","__defProp","__defProps","__getOwnPropDescs","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__defNormalProp","__spreadValues","prop","_c","__spreadProps","__async","__this","__arguments","generator","resolve","reject","fulfilled","rejected","composeWithDevTools","baseProto","createAction","type","prepareAction","actionCreator","args","prepared","MiddlewareArray","_super","_this","arr","EnhancerArray","freezeDraftable","isDraftable","createNextState","isBoolean","curryGetDefaultMiddleware","options","getDefaultMiddleware","middlewareArray","IS_PRODUCTION","configureStore","curriedGetDefaultMiddleware","_d","_e","_f","devTools","_g","_h","enhancers","rootReducer","finalMiddleware","middlewareEnhancer","finalCompose","compose2","defaultEnhancers","storeEnhancers","composedEnhancer","executeReducerBuilderCallback","builderCallback","actionsMap","actionMatchers","defaultCaseReducer","builder","typeOrActionCreator","matcher","isStateFunction","createReducer","mapOrBuilderCallback","finalActionMatchers","finalDefaultCaseReducer","getInitialState","frozenInitialState_1","caseReducers","reducer2","cr","previousState","caseReducer","isDraft2","draft","result","isDraftable2","createNextState2","getType2","slice","actionKey","createSlice","name","reducerNames","sliceCaseReducersByName","sliceCaseReducersByType","actionCreators","reducerName","maybeReducerWithPrepare","prepareCallback","buildReducer","extraReducers","finalCaseReducers","actionMatchers_1","_reducer","urlAlphabet","nanoid","size","commonProperties","RejectWithValue","payload","meta","FulfillWithMeta","miniSerializeError","simpleError","commonProperties_1","property","createAsyncThunk2","typePrefix","payloadCreator","requestId","pending","error","AC","class_1","extra","abortController","abortReason","abort","reason","promise2","_a","_b","finalAction","conditionResult","abortedPromise","err_1","skipDispatch","isThenable","unwrapResult","alm","promise","enableES5","listCacheClear","_listCacheClear","eq","other","eq_1","assocIndexOf","array","length","_assocIndexOf","arrayProto","splice","listCacheDelete","data","lastIndex","_listCacheDelete","listCacheGet","_listCacheGet","listCacheHas","_listCacheHas","listCacheSet","_listCacheSet","require$$3","require$$4","ListCache","entries","entry","_ListCache","stackClear","_stackClear","stackDelete","_stackDelete","stackGet","_stackGet","stackHas","_stackHas","freeGlobal","global","_freeGlobal","freeSelf","root","_root","Symbol","_Symbol","objectProto","nativeObjectToString","symToStringTag","getRawTag","isOwn","tag","unmasked","_getRawTag","objectToString","_objectToString","nullTag","undefinedTag","baseGetTag","_baseGetTag","isObject","isObject_1","asyncTag","funcTag","genTag","proxyTag","isFunction","isFunction_1","coreJsData","_coreJsData","maskSrcKey","uid","isMasked","func","_isMasked","funcProto","funcToString","toSource","_toSource","reRegExpChar","reIsHostCtor","reIsNative","baseIsNative","pattern","_baseIsNative","getValue","object","_getValue","getNative","_getNative","Map","_Map","nativeCreate","_nativeCreate","hashClear","_hashClear","hashDelete","_hashDelete","HASH_UNDEFINED","hashGet","_hashGet","hashHas","_hashHas","hashSet","_hashSet","Hash","_Hash","mapCacheClear","_mapCacheClear","isKeyable","_isKeyable","getMapData","map","_getMapData","mapCacheDelete","_mapCacheDelete","mapCacheGet","_mapCacheGet","mapCacheHas","_mapCacheHas","mapCacheSet","_mapCacheSet","MapCache","_MapCache","LARGE_ARRAY_SIZE","stackSet","pairs","_stackSet","require$$5","Stack","_Stack","arrayEach","iteratee","_arrayEach","baseAssignValue","_baseAssignValue","assignValue","objValue","_assignValue","copyObject","props","customizer","isNew","newValue","_copyObject","baseTimes","_baseTimes","isObjectLike","isObjectLike_1","argsTag","baseIsArguments","_baseIsArguments","propertyIsEnumerable","isArguments","isArguments_1","isArray","isArray_1","stubFalse","stubFalse_1","freeExports","freeModule","module","moduleExports","Buffer","nativeIsBuffer","isBuffer","MAX_SAFE_INTEGER","reIsUint","isIndex","_isIndex","isLength","isLength_1","arrayTag","boolTag","dateTag","errorTag","mapTag","numberTag","objectTag","regexpTag","setTag","stringTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","baseIsTypedArray","_baseIsTypedArray","baseUnary","_baseUnary","freeProcess","nodeUtil","types","nodeIsTypedArray","isTypedArray","isTypedArray_1","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","_arrayLikeKeys","isPrototype","Ctor","_isPrototype","overArg","transform","_overArg","nativeKeys","_nativeKeys","baseKeys","_baseKeys","isArrayLike","isArrayLike_1","keys","keys_1","baseAssign","_baseAssign","nativeKeysIn","_nativeKeysIn","baseKeysIn","isProto","_baseKeysIn","keysIn","keysIn_1","baseAssignIn","_baseAssignIn","allocUnsafe","cloneBuffer","buffer","isDeep","copyArray","_copyArray","arrayFilter","predicate","resIndex","_arrayFilter","stubArray","stubArray_1","nativeGetSymbols","getSymbols","symbol","_getSymbols","copySymbols","_copySymbols","arrayPush","values","offset","_arrayPush","getPrototype","_getPrototype","getSymbolsIn","_getSymbolsIn","copySymbolsIn","_copySymbolsIn","baseGetAllKeys","keysFunc","symbolsFunc","_baseGetAllKeys","getAllKeys","_getAllKeys","getAllKeysIn","_getAllKeysIn","DataView","_DataView","Promise","_Promise","Set","_Set","WeakMap","_WeakMap","require$$6","promiseTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ctorString","_getTag","initCloneArray","_initCloneArray","Uint8Array","_Uint8Array","cloneArrayBuffer","arrayBuffer","_cloneArrayBuffer","cloneDataView","dataView","_cloneDataView","reFlags","cloneRegExp","regexp","_cloneRegExp","symbolProto","symbolValueOf","cloneSymbol","_cloneSymbol","cloneTypedArray","typedArray","_cloneTypedArray","symbolTag","initCloneByTag","_initCloneByTag","objectCreate","baseCreate","_baseCreate","initCloneObject","_initCloneObject","baseIsMap","_baseIsMap","nodeIsMap","isMap","isMap_1","baseIsSet","_baseIsSet","nodeIsSet","isSet","isSet_1","require$$7","require$$8","require$$9","require$$10","require$$11","require$$12","require$$13","require$$14","require$$15","require$$16","require$$17","require$$18","require$$19","require$$20","require$$21","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","cloneableTags","baseClone","bitmask","stack","isFlat","isFull","isFunc","stacked","subValue","_baseClone","cloneDeep","cloneDeep_1","commandType","commandType2","initState","stageSlice","effectIndex","currentFreeFigures","newFigure","figure","figureAssociatedAnimationIndex","motion","expression","resetStageState","setStage","setStageVar","stageActions","stageReducer","require","_dereq_","Mutation","scheduleDrain","called","nextTick","element","channel","scriptEl","draining","queue","oldQueue","len","immediate","task","INTERNAL","handlers","REJECTED","FULFILLED","PENDING","resolver","safelyResolveThenable","onRejected","onFulfilled","unwrap","QueueItem","returnValue","self","tryCatch","getThen","thenable","then","onError","onSuccess","tryToUnwrap","out","all","iterable","resolved","allResolver","resolveFromAll","outValue","race","response","_classCallCheck","instance","Constructor","getIDB","idb","isIndexedDBValid","isSafari","hasFetch","createBlob","parts","properties","Builder","Promise$1","executeCallback","callback","executeTwoCallbacks","errorCallback","normalizeKey","getCallback","DETECT_BLOB_SUPPORT_STORE","supportsBlobs","dbContexts","toString","READ_ONLY","READ_WRITE","_binStringToArrayBuffer","bin","buf","_checkBlobSupportWithoutCaching","txn","blob","matchedChrome","matchedEdge","_checkBlobSupport","_deferReadiness","dbInfo","dbContext","deferredOperation","_advanceReadiness","_rejectReadiness","_getConnection","upgradeNeeded","createDbContext","dbArgs","openreq","ex","_getOriginalConnection","_getUpgradedConnection","_isUpgradeNeeded","defaultVersion","isNewStore","isDowngrade","isUpgrade","incVersion","_encodeBlob","reader","base64","_decodeBlob","encodedBlob","arrayBuff","_isEncodedBlob","_fullyReady","_tryReconnect","forages","forage","createTransaction","mode","retries","tx","_initStorage","initPromises","ignoreErrors","getItem","transaction","req","iterate","iterator","iterationNumber","cursor","setItem","blobSupport","removeItem","clear","advanced","dropInstance","currentConfig","isCurrentDb","dbPromise","newVersion","dropObjectPromise","_forage2","dropDBPromise","_forage","asyncStorage","isWebSQLValid","BASE_CHARS","BLOB_TYPE_PREFIX","BLOB_TYPE_PREFIX_REGEX","SERIALIZED_MARKER","SERIALIZED_MARKER_LENGTH","TYPE_ARRAYBUFFER","TYPE_BLOB","TYPE_INT8ARRAY","TYPE_UINT8ARRAY","TYPE_UINT8CLAMPEDARRAY","TYPE_INT16ARRAY","TYPE_INT32ARRAY","TYPE_UINT16ARRAY","TYPE_UINT32ARRAY","TYPE_FLOAT32ARRAY","TYPE_FLOAT64ARRAY","TYPE_SERIALIZED_MARKER_LENGTH","toString$1","stringToBuffer","serializedString","bufferLength","encoded1","encoded2","encoded3","encoded4","bytes","bufferToString","base64String","serialize","valueType","marker","fileReader","str","deserialize","blobType","localforageSerializer","createDbTable","_initStorage$1","dbInfoPromise","tryExecuteSql","sqlStatement","results","getItem$1","iterate$1","rows","item","_setItem","retriesLeft","originalValue","sqlError","setItem$1","removeItem$1","clear$1","length$1","key$1","keys$1","getAllStoreNames","storeNames","dropInstance$1","operationInfo","dropTable","storeName","operations","webSQLStorage","isLocalStorageValid","_getKeyPrefix","defaultConfig","keyPrefix","checkIfLocalStorageThrows","localStorageTestKey","_isLocalStorageUsable","_initStorage$2","clear$2","getItem$2","iterate$2","keyPrefixLength","key$2","keys$2","itemKey","length$2","removeItem$2","setItem$2","dropInstance$2","localStorageWrapper","sameValue","includes","searchElement","DefinedDrivers","DriverSupport","DefaultDrivers","DefaultDriverOrder","OptionalDriverMethods","LibraryMethods","DefaultConfig","callWhenReady","localForageInstance","libraryMethod","_args","extend","LocalForage","driverTypeKey","driver","driverName","driverObject","complianceError","driverMethods","driverMethodName","isRequired","configureMissingMethods","methodNotImplementedFactory","methodName","optionalDriverMethod","setDriverSupport","support","getDriverPromise","serializerPromise","drivers","supportedDrivers","setDriverToConfig","extendSelfWithDriver","initDriver","currentDriverIndex","driverPromiseLoop","oldDriverSetDone","libraryMethodsAndProperties","localforage_js","bind","isUndefined","isArrayBuffer","isFormData","isArrayBufferView","isString","isNumber","prototype","isDate","isFile","isBlob","isStream","isURLSearchParams","trim","isStandardBrowserEnv","forEach","merge","stripBOM","content","utils","encode","buildURL","url","params","paramsSerializer","serializedParams","hashmarkIndex","InterceptorManager","InterceptorManager_1","normalizeHeaderName","headers","normalizedName","enhanceError","config","request","createError","message","settle","validateStatus","cookies","expires","path","domain","secure","cookie","match","isAbsoluteURL","combineURLs","baseURL","relativeURL","buildFullPath","requestedURL","ignoreDuplicateOf","parseHeaders","parsed","line","isURLSameOrigin","msie","urlParsingNode","originURL","resolveURL","href","requestURL","Cancel","Cancel_1","defaults","xhr","requestData","requestHeaders","responseType","onCanceled","done","username","password","fullPath","onloadend","responseHeaders","responseData","timeoutErrorMessage","transitional","xsrfValue","cancel","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","getDefaultAdapter","adapter","stringifySafely","rawValue","parser","encoder","silentJSONParsing","forcedJSONParsing","strictJSONParsing","status","method","defaults_1","transformData","fns","context","isCancel","throwIfCancellationRequested","dispatchRequest","mergeConfig","config1","config2","getMergedValue","mergeDeepProperties","valueFromConfig2","defaultToConfig2","mergeDirectKeys","mergeMap","configValue","VERSION","validators","thing","deprecatedWarnings","validator","version","formatMessage","opt","desc","opts","assertOptions","schema","allowUnknown","Axios","instanceConfig","requestInterceptorChain","synchronousRequestInterceptors","interceptor","responseInterceptorChain","newConfig","Axios_1","CancelToken","executor","resolvePromise","token","onfulfilled","_resolve","CancelToken_1","spread","isAxiosError","createInstance","axios","promises","axiosModule","Cloudlog","mongoUrl","info","level","now","postData","that","color","upload","levelToNum","cloudlogjs","logger","jp","zhCn","fr","zhTw","language","language2","languages","i18nTranslationResources","defaultLanguage","playSpeed","playSpeed2","textSize","textSize2","textFont","textFont2","voiceOption","voiceOption2","fullScreenOption","fullScreenOption2","initialOptionSet","userDataSlice","series","isExist","isRegistedInUserData","setUserData","resetUserData","setOptionData","setGlobalVar","setScriptManagedGlobalVar","setSlPage","unlockCgInUserData","unlockBgmInUserData","resetOptionSet","resetAllData","userDataReducer","SYSTEM_CONFIG","PERFORM_CONFIG","BacklogManager","sceneManager","__publicField","effects","currentStageState","webgalStore","stageStateToBacklog","ele","argelement","backlogElement","initSceneData","SceneManager","AnimationManager","animation","initPerform","fileType","fileType2","assetSetter","fileName","assetType","returnFilePath","assetsPrefetcher","assetList","asset","WebGAL","newLink","head","argsParser","argsRaw","returnArrayList","rawArgsList","equalSignIndex","argName","argValue","configLineParser","inputLine","command","newSentenceRaw","getCommandResult","getOptionsResult","optionsRaw","configParser","configText","commandParser","commandRaw","ADD_NEXT_ARG_LIST","SCRIPT_CONFIG_MAP","returnCommand","getCommandType","addNextArg","commandToParse","thisCommandType","contentParser","contentRaw","getChooseContent","chooseList","chooseKeyList","chooseValueList","parsedChooseList","ret","assetsScanner","returnAssetsList","subSceneScanner","subSceneList","scriptParser","sentenceRaw","subScene","sentenceAssets","parsedCommand","getArgsResult","commonjsGlobal","freeGlobal$1","root$4","root$3","Symbol$2","Symbol$1","objectProto$4","hasOwnProperty$3","nativeObjectToString$1","symToStringTag$1","getRawTag$1","objectProto$3","objectToString$1","baseGetTag$1","isObject$2","isObject$1","isFunction$1","root$2","coreJsData$1","isMasked$1","funcProto$1","funcToString$1","toSource$1","objectProto$2","hasOwnProperty$2","baseIsNative$1","getValue$1","getNative$3","getNative$2","nativeCreate$4","nativeCreate$3","hashClear$1","hashDelete$1","nativeCreate$2","HASH_UNDEFINED$2","objectProto$1","hasOwnProperty$1","hashGet$1","nativeCreate$1","hashHas$1","HASH_UNDEFINED$1","hashSet$1","Hash$1","listCacheClear$1","eq$1","assocIndexOf$4","assocIndexOf$3","listCacheDelete$1","assocIndexOf$2","listCacheGet$1","assocIndexOf$1","listCacheHas$1","listCacheSet$1","ListCache$1","getNative$1","root$1","Map$2","Map$1","mapCacheClear$1","isKeyable$1","getMapData$4","getMapData$3","mapCacheDelete$1","getMapData$2","mapCacheGet$1","getMapData$1","mapCacheHas$1","mapCacheSet$1","MapCache$1","setCacheAdd$1","_setCacheAdd","setCacheHas$1","_setCacheHas","setCacheAdd","setCacheHas","SetCache$1","_SetCache","baseFindIndex$1","fromIndex","fromRight","_baseFindIndex","baseIsNaN$1","_baseIsNaN","strictIndexOf$1","_strictIndexOf","baseFindIndex","baseIsNaN","strictIndexOf","baseIndexOf$1","_baseIndexOf","baseIndexOf","arrayIncludes$1","_arrayIncludes","arrayIncludesWith$1","comparator","_arrayIncludesWith","cacheHas$1","cache","_cacheHas","Set$1","noop$1","noop_1","setToArray$2","set","_setToArray","noop","setToArray$1","INFINITY","createSet$1","_createSet","SetCache","arrayIncludes","arrayIncludesWith","cacheHas","createSet","setToArray","baseUniq$1","isCommon","seen","outer","computed","seenIndex","_baseUniq","baseUniq","uniqWith","uniqWith_1","sceneParser","rawScene","sceneName","sceneUrl","rawSentenceListWithoutEmpty","assetsList","sentenceList","sentence","returnSentence","scss2cssinjsParser","scssString","classNameStyles","others","parseCSS","css","specialRules","matches","classRegex","specialRegex","SceneParser","SCRIPT_CONFIG_INPUT","previousValue","curr","getSentenceArgByKey","sentnece","argk","bgm","enter","volume","playBgm","kindOf","kindOfTest","isEmptyObject","isFileList","product","inherits","constructor","superConstructor","descriptors","toFlatObject","sourceObj","destObj","filter","propFilter","merged","endsWith","searchString","position","toArray","TypedArray","forEachEntry","pair","matchAll","regExp","isHTMLForm","_hasOwnProperty","AxiosError","customProps","axiosError","AxiosError_1","browser","FormData","envFormData","isVisitable","removeBrackets","renderKey","dots","isFlatArray","predicates","isSpecCompliant","toFormData","formData","option","metaTokens","visitor","defaultVisitor","indexes","_Blob","useBlob","convertValue","el","exposedHelpers","build","toFormData_1","charMap","AxiosURLSearchParams","_encode","AxiosURLSearchParams_1","serializerParams","URLSearchParams_1","FormData_1","platform","toURLEncodedForm","helpers","parsePropPath","arrayToObject","formDataToJSON","buildPath","isNumericKey","isLast","formDataToJSON_1","CanceledError","CanceledError_1","parseProtocol","transitionalDefaults","withXSRFToken","protocol","contentType","hasJSONContentType","isObjectPayload","_FormData","JSONRequested","configOrUrl","generateHTTPMethod","isForm","sceneFetcher","scenePrefetcher","sceneList","callScene","subSceneListUniq","nextSentence","callSceneScript","sceneNameArray","generateTransformAnimationObj","applyFrame","duration","animationObj","targetEffect","effect","effectWithDuration","generateUniversalSoftInAnimationObj","targetKey","setStartState","setEndState","tickerFunc","delta","sprite","baseDuration","increasement","generateUniversalSoftOffAnimationObj","targetContainer","decreasement","baseTransform","__rest","warning","invariant","clamp","min","max","safeMin","minDuration","maxDuration","minDamping","maxDamping","findSpring","bounce","velocity","mass","envelope","derivative","dampingRatio","undampedFreq","exponentialDecay","calcAngularFreq","initialGuess","approximateRoot","stiffness","rootIterations","durationKeys","physicsKeys","isSpringType","getSpringOptions","springOptions","derived","spring","restSpeed","restDelta","damping","isResolvedFromDuration","resolveSpring","zero","resolveVelocity","createSpring","initialVelocity","initialDelta","undampedAngularFreq","angularFreq","dampedAngularFreq","freqForT","current","currentVelocity","isBelowVelocityThreshold","isBelowDisplacementThreshold","_t","progress","toFromDifference","mix","sanitize","floatRegex","colorRegex","singleColorRegex","number","alpha","createUnitType","unit","percent","isColorString","testProp","splitColor","aName","bName","cName","hsla","hue","saturation","lightness","alpha$1","clampRgbUnit","rgbUnit","rgba","red","green","blue","parseHex","hex","colorToken","numberToken","test","analyse","numColors","colors","numbers","parse","createTransformer","tokenised","numValues","output","convertNumbersToZero","getAnimatableNone","complex","hueToRgb","hslaToRgba","mixLinearColor","fromExpo","toExpo","colorTypes","getColorType","mixColor","fromColorType","toColorType","fromColor","toColor","blended","isNum","combineFunctions","pipe","transformers","getMixer","origin","mixComplex","mixArray","blendValue","fromThis","mixObject","numNumbers","numRGB","numHSL","template","originStats","targetStats","mixNumber","detectMixerFactory","createMixers","ease","customMixer","mixers","mixerFactory","numMixers","mixer","easingFunction","fastInterpolate","slowInterpolate","input","inputLength","lastInputIndex","mixerIndex","foundMixerIndex","progressInRange","interpolate","isClamp","interpolator","mirrorEasing","easing","createExpoIn","power","createBackIn","createAnticipate","backEasing","DEFAULT_OVERSHOOT_STRENGTH","easeIn","easeInOut","defaultEasing","defaultOffset","_value","convertOffsetToTimes","keyframes","times","createInterpolator","decay","timeConstant","modifyTarget","amplitude","ideal","detectAnimationFromOptions","defaultTimestep","getCurrentTime","onNextFrame","createRenderStep","runNextFrame","toRun","toRunNextFrame","numToRun","isProcessing","flushNextFrame","toKeepAlive","keepAlive","addToCurrentFrame","frameData","maxElapsed","useDefaultElapsed","frame","stepsOrder","steps","acc","sync","process","startLoop","cancelSync","processStep","stepId","processFrame","timestamp","sync$1","loopElapsed","elapsed","delay","reverseElapsed","isForwardPlayback","hasRepeatDelayElapsed","framesync","update","passTimestamp","animate","autoplay","repeatMax","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate","driverControls","repeatCount","computedDuration","latest","isComplete","interpolateFromNumber","animator","repeat","complete","play","arraySome","_arraySome","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","arrValue","othValue","compared","othIndex","_equalArrays","mapToArray","_mapToArray","equalByTag","convert","_equalByTag","equalObjects","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","_equalObjects","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","_baseIsEqualDeep","baseIsEqual","_baseIsEqual","baseIsMatch","matchData","noCustomizer","srcValue","_baseIsMatch","isStrictComparable","_isStrictComparable","getMatchData","_getMatchData","matchesStrictComparable","_matchesStrictComparable","baseMatches","_baseMatches","isSymbol","isSymbol_1","reIsDeepProp","reIsPlainProp","isKey","_isKey","FUNC_ERROR_TEXT","memoize","memoized","memoize_1","MAX_MEMOIZE_SIZE","memoizeCapped","_memoizeCapped","rePropName","reEscapeChar","stringToPath","string","quote","subString","_stringToPath","arrayMap","_arrayMap","symbolToString","baseToString","_baseToString","toString_1","castPath","_castPath","toKey","_toKey","baseGet","_baseGet","get","defaultValue","get_1","baseHasIn","_baseHasIn","hasPath","hasFunc","_hasPath","hasIn","hasIn_1","baseMatchesProperty","_baseMatchesProperty","identity","identity_1","baseProperty","_baseProperty","basePropertyDeep","_basePropertyDeep","property_1","baseIteratee","_baseIteratee","negate","negate_1","baseSet","nested","_baseSet","basePickBy","paths","_basePickBy","pickBy","pickBy_1","omitBy","omitBy_1","isUndefined_1","generateTimelineObj","timeline","segment","currentDelay","segmentDuration","scale","segmentValues","container","animateInstance","updateValue","scaleX","scaleY","sliceDuration","endState","getEndStateEffect","getStartStateEffect","getEndFilterEffect","endSegment","rotation","blur","rest","getAnimationObject","animationName","ani","mappedEffects","targetSetEffect","newEffect","getAnimateDuration","getEnterExitAnimation","isBg","animarionName","changeBg","transformString","newAnimation","applyDefaultTransform","changeFigure","pos","isFreeFigure","mouthOpen","mouthClose","mouthHalfOpen","eyesOpen","eyesClose","animationFlag","filteredFigureAssociatedAnimation","newFigureAssociatedAnimationItem","isRemoveEffects","figWithKey","deleteKey","deleteKey2","setAnimationNames","durationFromArg","enterAnim","exitAnim","freeFigureItem","positionMap","dispatchMap","changeScene","changeSceneScript","jmp","labelName","currentLine","page_flip_1","switch_1","mouse_enter","dialog_se","click_se","useSyncExternalStoreShim_production_min","shimModule","withSelector_production_min","withSelectorModule","defaultNoopBatch","batch","setBatch","newBatch","getBatch","ContextKey","gT","getContext","_gT$ContextKey","React.createContext","contextMap","realContext","ReactReduxContext","createReduxContextHook","useContext","useReduxContext","notInitialized","useSyncExternalStoreWithSelector","initializeUseSelector","refEquality","createSelectorHook","useDefaultReduxContext","selector","equalityFnOrOptions","equalityFn","stabilityCheck","noopCheck","subscription","getServerState","globalStabilityCheck","globalNoopCheck","useRef","wrappedSelector","useCallback","selectedState","useDebugValue","useSelector","_objectWithoutPropertiesLoose","excluded","sourceKeys","reactIs_production_min","reactIsModule","reactIs","FORWARD_REF_STATICS","MEMO_STATICS","TYPE_STATICS","createListenerCollection","first","last","nullListeners","createSubscription","parentSub","subscriptionsAmount","selfSubscribed","addNestedSub","trySubscribe","cleanupListener","removed","tryUnsubscribe","notifyNestedSubs","handleChangeWrapper","trySubscribeSelf","tryUnsubscribeSelf","canUseDOM","useIsomorphicLayoutEffect","React.useLayoutEffect","React.useEffect","Provider","children","serverState","contextValue","React.useMemo","Context","React.createElement","createStoreHook","useStore","createDispatchHook","useDefaultStore","useDispatch","useSoundEffect","useSEByWebgalStore","escapeMap","useEscape","_res","WebgalParser","useValue","setValue","useState","sheetForTag","createStyleElement","StyleSheet","before","_proto","nodes","rule","sheet","MS","MOZ","WEBKIT","COMMENT","RULESET","DECLARATION","IMPORT","KEYFRAMES","LAYER","abs","assign","hash","charat","replace","replacement","indexof","search","substr","begin","end","strlen","sizeof","append","combine","column","character","characters","node","parent","copy","char","prev","peek","caret","alloc","dealloc","delimit","delimiter","whitespace","escaping","count","commenter","identifier","compile","rules","rulesets","pseudo","points","declarations","atrule","previous","variable","scanning","ampersand","reference","comment","declaration","ruleset","post","stringify","collection","rulesheet","identifierWithPointTracking","toRules","getRules","fixedElements","compat","isImplicitRule","parentRules","removeLabel","prefix","prefixer","defaultStylisPlugins","createCache","ssrStyles","dataEmotionAttribute","stylisPlugins","inserted","nodesToHydrate","attrib","_insert","omnipresentPlugins","currentSheet","finalizingPlugins","serializer","stylis","styles","serialized","shouldCache","murmur2","unitlessKeys","hyphenateRegex","animationRegex","isCustomProperty","isProcessableValue","processStyleName","styleName","processStyleValue","p1","p2","unitless","handleInterpolation","mergedProps","registered","interpolation","createStringFromObject","previousCursor","cached","interpolated","labelPattern","serializeStyles","stringMode","strings","identifierName","hashString","isBrowser","getRegisteredStyles","registeredStyles","classNames","rawClassName","className","registerStyles","isStringTag","insertStyles","insertWithoutScoping","createEmotion","_len2","_key2","injectGlobal","_len3","_key3","cx","_len4","_key4","classnames","ids","cls","toAdd","_createEmotion","useApplyStyle","styleObject","replaced","applyStyle","classNameLable","fallbackClassName","cijClassName","updateStyleFile","scssStr","useEffect","useRigisterStyleUpdate","handler","ChooseOption","text","jump","script","conditonPart","mainPartNodes","showConditionPart","enableConditionPart","choose","chooseOptions","ReactDOM","jsx","Choose","font","playSeEnter","playSeClick","runtimeBuildList","chooseListFull","whenChecker","enable","onClick","filmMode","getUserInput","varKey","titleFromArgs","title","buttonTextFromArgs","buttonText","chooseElements","jsxs","userInput","intro","performName","fontSize","backgroundColor","animationClass","chosenAnimationClass","delayTime","isHold","parsedValue","introContainerStyle","introArray","isBlocking","setBlockingStateTimeout","timeout","toNextIntroElement","introContainer","showIntro","label","miniAvatar","performs","getName","getKey","registerPerform","call","__vitePreload","pixi","pixiPerformName","res","tickerKey","playEffect","performInitName","isLoop","isOver","volumeArg","seElement","userDataState","mainVol","seVol","perform","playVideo","vocalVol","bgmVol","getRandomPerformName","blockingNext","blockingNextFlag","VocalControl","endPerform","skipVideo","bgmElement","vocalElement","vocalVol2","bgmVol2","setAnimation","animationDuration","stopFunction","generateTestblurAnimationObj","currentAddOplityDelta","webgalAnimations","setComplexAnimation","animationFunction","setFilter","setTempAnimation","animationString","setTextbox","setTransform","setTransition","unlockBgm","localforage","unlockCg","resetStage","resetBacklog","resetSceneAndVar","initSceneDataCopy","currentVars","saveDataSlice","saveActions","savesReducer","dumpToStorageFast","setVisibility","jumpLabel","pixiInit","e2","audioContextWrapper","updateThresholds","audioLevel","performBlinkAnimation","isBlinking","blink","nextBlinkTime","getAudioLevel","analyser","dataArray","sum","performMouthAnimation","OPEN_THRESHOLD","HALF_OPEN_THRESHOLD","currentMouthValue","lerpSpeed","animationItem","targetValue","mouthValue","mouthState","Matcher","subject","playVocal","freeFigure","figureAssociatedAnimation","tid","foundFigure","audioContext","vocalControl","animationEndTime","useTextDelay","useTextAnimationDuration","useFontFamily","fontFamily","getFont","getTextSize","IMSSTextbox","textArray","textDelay","currentConcatDialogPrev","currentDialogKey","isText","boolean","showName","textDuration","isUseStroke","textboxOpacity","settleText","allTextIndex","textElementList","textLine","style","style_alltext","dataElem","prevLength","styleClassName","styleAllText","Fragment","SCREEN_CONSTANTS","userAgent","isFirefox","TextBox","isShowStroke","setIsShowStroke","handleResize","targetHeight","targetWidth","zoomH","zoomW","zoomH2","zoomW2","stageState","textSizeState","lineLimit","compileSentence","Textbox","isCJK","ignoreLineLimit","parseString","ln","chars","splitChars","enhancedNode","words","word","cjkFlag","isPunctuation","regex","enhance","parsedEnhanced","ruby","parseEnhancedString","rubyKvPair","enhanced","say","dialogKey","dialogToShow","isConcat","isNotend","speaker","vocal","sentenceDelay","endDelay","window","lowercase","manualLowercase","jqLite","getPrototypeOf","ngMinErr","minErr","isWindow","isPrimitive","isBlankObject","setHashKey","isDefined","isScope","TYPED_ARRAY_REGEXP","destination","stackSource","stackDest","copyRecurse","copyElement","needsRecurse","copyType","copied","toJsonReplacer","allowAutoBootstrap","document","src","link","scriptProtocol","docLoadProtocol","createMap","serializeObject","toDebugString","ErrorConstructor","SKIP_INDEXES","templateArgs","paramPrefix","shiftedIndex","$parseMinErr","getStringValue","OPERATORS","operator","ESCAPE","Lexer","ch2","ch3","op1","op2","op3","num","cp","cp1","cp2","start","colStr","peekCh","rawString","rep","AST","lexer","left","isAssignable","alternate","consequent","primary","baseExpression","elements","msg","e1","e3","e4","ifDefined","plusFn","isStateless","$filter","filterName","findConstantAndWatchExpressions","ast","allConstants","argsToWatch","isStatelessFilter","expr","getInputs","lastExpression","candidate","assignableAST","isLiteral","isConstant","ASTCompiler","astBuilder","assignable","toWatch","watch","fnKey","intoId","fnString","section","nameId","recursionFn","create","skipWatchIdCheck","right","inAssignment","member","argument","own","expr1","expr2","SAFE_IDENTIFIER","UNSAFE_CHARACTERS","skip","init","ASTInterpreter","inputs","expressions","scope","locals","lastValue","exp","rhs","lhs","base","watchId","Parser","filters","localFilters","lexerOptions","parserOptions","compile_1","setVar","setGlobal","targetReducerFunction","valExp","valExp2","_r","getValueFromStateElseKey","pre","getValueFromState","stage","userData","_Merge","propertyKey","valueFromState","showVars","allVar","ScriptConfig","scriptType","scriptFunction","scriptRegistry","defineScripts","record","scriptString","applyStyleSegments","applyStyleSegment","splitSegment","classNameToBeChange","classNameChangeTo","SCRIPT_TAG_MAP","SCRIPT_CONFIG","parsedScene","runScript","resolovedPerform","restoreScene","strIf","whenValue","scriptExecutor","sceneToRestore","currentScript","interpolationOneItem","retContent","contentExp","contentVarValue","runThis","isHasWhenArg","isNext","isSaveBacklog","allState","isBlockingNext","allSettled","newStageState","isGoNext","PerformController","syncPerformState","performToAdd","force","isBlockingAuto","Gameplay","autoInterval","fastInterval","autoTimeout","mitt","Events","formEvent","eventBus","eventName","WebgalCore","setStorage","debounce","localforage.setItem","getStorage","localforage.getItem","newUserData","checkUserDataProperty","wait","getStorageAsync","MenuPanelTag","MenuPanelTag2","GUISlice","component","visibility","setMenuPanelTag","setGuiAsset","setLogoImage","GUIReducer","emptyBgmTimeout","lastSrc","audioElement","setEbg","ebg","stopAllPerform","restorePerform","jumpFromBacklog","refetchScene","backlogFile","loadGame","loadFile","loadGameFromStageData","stageData","newBacklog","dumpSavesToStorage","startIndex","endIndex","save","getSavesFromStorage","dumpFastSaveToStorage","getFastSaveFromStorage","saveGame","saveData","generateCurrentStageData","isSavePreviewImage","saveBacklog","urlToSave","canvas","canvas2","initKey","fastSaveGame","newSaveData","hasFastSaveRecord","loadFastSaveGame","startGame","continueGame","_objectWithoutProperties","objectWithoutPropertiesLoose","sourceSymbolKeys","voidElements","warn","_console","alreadyWarned","warnOnce","loadedClb","i18n","initialized","loadNamespaces","ns","loadLanguages","lng","oldI18nextHasLoadedNamespace","fallbackLng","lastLng","loadNotPending","loadState","hasLoadedNamespace","isNewerI18next","i18nInstance","matchHtmlEntity","htmlEntities","unescapeHtmlEntity","unescape","enumerableOnly","sym","defaultOptions","setDefaults","getDefaults","setI18n","getI18n","_excluded","_excluded2","hasChildren","checkLength","getChildren","hasValidReactChildren","child","isValidElement","getAsArray","mergeProps","newTarget","nodesToString","i18nOptions","stringNode","childrenArray","keepArray","childIndex","childPropsCount","shouldKeepChild","childChildren","format","clone","renderNodes","targetString","combinedTOpts","shouldUnescape","emptyChildrenButNeedsHandling","getData","childs","HTML","renderInner","rootReactNode","mappedChildren","mapAST","pushTranslatedJSX","inner","mem","isVoid","cloneElement","reactNode","astNode","reactNodes","astNodes","translationContent","tmp","isElement","isValidTranslationWithChildren","isEmptyTransWithHTML","isKnownComponent","_inner","_inner2","createElement","_inner3","_inner4","wrapTextNodes","_content","Trans","i18nKey","_ref$tOptions","tOptions","components","i18nFromProps","tFromProps","additionalProps","reactI18nextOptions","namespaces","hashTransKey","interpolationOverride","translation","useAsParent","_defineProperties","descriptor","_createClass","protoProps","staticProps","initReactI18next","I18nContext","createContext","ReportNamespaces","i18nFromContext","defaultNSFromContext","TransWithoutContext","_arrayWithHoles","_iterableToArrayLimit","_arrayLikeToArray","arr2","_unsupportedIterableToArray","minLen","arrayLikeToArray","_nonIterableRest","_slicedToArray","arrayWithHoles","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","usePrevious","ignore","ref","useTranslation","notReadyT","optsOrDefaultValue","retNotReady","useSuspense","ready","getT","_useState","_useState2","setT","joinedNS","previousJoinedNS","isMounted","bindI18n","bindI18nStore","boundReset","isInitial","useTrans","trans","useGenSyncRef","Store","Ref","useMounted","useUnMounted","useUpdated","setButton","autoIcon","stopAuto","switchAuto","autoPlay","autoNextSentence","autoPlayDelay","stopFast","isFast","startFast","stopAll","switchFast","now_1","reWhitespace","trimmedEndIndex","_trimmedEndIndex","reTrimStart","baseTrim","_baseTrim","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","isBinary","toNumber_1","nativeMax","nativeMin","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","flush","debounced","isInvoking","debounce_1","throttle","throttle_1","keyboard","useHotkey","useMouseRightClickHotKey","useMouseWheel","useSkip","usePanic","useFastSaveBeforeUnloadPage","useSpaceAndEnter","useToggleFullScreen","GUIStore","setComponentVisibility","useSetComponentVisibility","isGameActive","useGameActive","isInBackLog","useIsInBackLog","isOpenedDialog","useIsOpenedDialog","validMenuPanelTag","useValidMenuPanelTag","isShowExtra","useIsOpenedExtra","handleContextMenu","ev","wheelTimeout","isPanicOverlayOpen","useIsPanicOverlayOpen","prevDownWheelTimeRef","handleMouseWheel","direction","ctrlKey","dom","flag","hasScrollToBottom","curTime","panicButtonList","isPanicButton","isTitleShown","handlePressPanicButton","isCtrlKey","handleCtrlKeydown","handleCtrlKeyup","handleWindowBlur","validMenuGameStart","useValidMenuGameStart","handleWindowUnload","lockRef","isSpaceOrEnter","handleKeydown","handleKeyup","scrollTop","clientHeight","scrollHeight","fullScreen","handleKeyDown","useConfigData","_map","configData","titleUrl","logoUrlList","bgmUrl","Title","GUIState","background","showBackground","Logo","logoImage","isEnterGame","currentLogoIndex","currentTimeOutId","nextImg","currentLogoUrl","infoFetcher","gameConfigRaw","gameConfig","keyItem","syncFastTimeout","syncWithOrigine","sentenceId","expermental","pastScene","lastSameSentence","findLastSameSentence","lastRecoverySentenceId","recId","findLastAvailableBacklog","isCanRec","currentSceneName","syncFast","oldScene","newScene","oldSentenceStr","newSentenceStr","targetSentence","lastAvailable","recSentenceId","recSceneName","bindExtraFunc","DebugCommand","DebugCommand2","webSocketFunc","loc","port","defaultPort","wsUrl","socket","sendStageSyncMessage","finallyConstructor","remaining","AggregateError","errors","any","rejectionReasons","setTimeoutFunc","doResolve","handle","deferred","finale","Handler","prom","promiseFinally","Polyfill","ONE_FRAME_TIME","startTime_1","lastTime","vendors","currentTime","ENV","RENDERER_TYPE","BUFFER_BITS","BLEND_MODES","DRAW_MODES","FORMATS","TARGETS","TYPES","SAMPLER_TYPES","SCALE_MODES","WRAP_MODES","MIPMAP_MODES","ALPHA_MODES","CLEAR_MODES","GC_MODES","PRECISION","MASK_TYPES","COLOR_MASK_BITS","MSAA_QUALITY","BUFFER_TYPE","BrowserAdapter","width","height","appleIphone","appleIpod","appleTablet","appleUniversal","androidPhone","androidTablet","amazonPhone","amazonTablet","windowsPhone","windowsTablet","otherBlackBerry","otherBlackBerry10","otherOpera","otherChrome","otherFirefox","isAppleTabletOnIos13","navigator","createMatch","isMobile$1","param","nav","isMobile","canUploadSameBuffer","maxRecommendedTextures","allowMax","majorVersion","settings","has","EE","once","addListener","emitter","event","evt","clearEvent","EventEmitter","names","events","a1","a2","a3","a4","a5","earcutModule","earcut","holeIndices","dim","hasHoles","outerLen","outerNode","linkedList","triangles","minX","minY","maxX","maxY","invSize","eliminateHoles","earcutLinked","clockwise","signedArea","insertNode","equals","removeNode","filterPoints","again","area","ear","pass","indexCurve","stop","isEarHashed","isEar","cureLocalIntersections","splitEarcut","ax","bx","ay","by","cy","x0","y0","x1","y1","pointInTriangle","minZ","zOrder","maxZ","intersects","locallyInside","isValidDiagonal","splitPolygon","list","getLeftmost","compareX","eliminateHole","hole","bridge","findHoleBridge","bridgeReverse","hx","hy","qx","mx","my","tanMin","tan","sectorContainsSector","sortLinked","tail","numMerges","pSize","qSize","inSize","leftmost","px","py","intersectsPolygon","middleInside","q1","q2","o1","sign","o2","o3","o4","onSegment","inside","Node","b2","bp","polygonArea","trianglesArea","holeIndex","punycode","maxInt","tMin","tMax","skew","damp","initialBias","initialN","regexPunycode","regexNonASCII","regexSeparators","baseMinusTMin","floor","stringFromCharCode","mapDomain","labels","encoded","ucs2decode","counter","ucs2encode","basicToDigit","codePoint","digitToBasic","digit","adapt","numPoints","firstTime","decode","bias","basic","oldi","baseMinusT","handledCPCount","basicLength","currentValue","handledCPCountPlusOne","qMinusT","toUnicode","toASCII","esErrors","_eval","range","syntax","uri","shams","symObj","symVal","syms","origSymbol","hasSymbolSham","hasSymbols","$Object","hasProto","ERROR_MESSAGE","toStr","funcType","concatty","slicy","arrLike","joiny","joiner","implementation","bound","binder","boundLength","boundArgs","Empty","functionBind","$hasOwn","hasown","undefined","$Error","$EvalError","$RangeError","$ReferenceError","$SyntaxError","$TypeError","$URIError","$Function","getEvalledConstructor","expressionSyntax","$gOPD","throwTypeError","ThrowTypeError","getProto","needsEval","INTRINSICS","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","$replace","$strSlice","$exec","getBaseIntrinsic","allowMissing","intrinsicName","alias","getIntrinsic","intrinsicBaseName","intrinsic","intrinsicRealName","skipFurtherCaching","part","GetIntrinsic","$defineProperty","esDefineProperty","gopd","defineDataProperty","nonEnumerable","nonWritable","nonConfigurable","loose","hasPropertyDescriptors","hasPropertyDescriptors_1","define","hasDescriptors","gOPD","$floor","setFunctionLength","functionLengthIsConfigurable","functionLengthIsWritable","$apply","$call","$reflectApply","$max","originalFunction","applyBind","callBind","$indexOf","callBound","__viteBrowserExternal","hasMap","mapSizeDescriptor","mapSize","mapForEach","hasSet","setSizeDescriptor","setSize","setForEach","hasWeakMap","weakMapHas","hasWeakSet","weakSetHas","hasWeakRef","weakRefDeref","booleanValueOf","functionToString","$match","$slice","$toUpperCase","$toLowerCase","$test","$join","$arrSlice","bigIntValueOf","gOPS","symToString","hasShammedSymbols","toStringTag","isEnumerable","gPO","addNumericSeparator","sepRegex","int","intStr","dec","utilInspect","inspectCustom","inspectSymbol","objectInspect","inspect_","depth","customInspect","numericSeparator","inspectString","bigIntStr","maxDepth","indent","getIndent","indexOf","inspect","noIndent","newOpts","isRegExp","nameOf","arrObjKeys","symString","markBoxed","attrs","wrapQuotes","xs","singleLineValues","indentedJoin","isError","mapParts","collectionOf","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isBigInt","ys","protoTag","constructorTag","defaultStyle","quoteChar","trailer","lowbyte","joinedEntries","baseIndent","lineJoiner","symMap","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","listGet","objects","listSet","listHas","sideChannel","$wm","$m","$o","percentTwenties","Format","formats","hexTable","compactQueue","compacted","mergeTarget","targetItem","decoder","charset","strWithoutPlus","defaultEncoder","kind","$0","compact","refs","maybeMap","mapped","getSideChannel","arrayPrefixGenerators","push","pushToArray","valueOrArray","toISO","defaultFormat","date","isNonNullishPrimitive","sentinel","generateArrayPrefix","commaRoundTrip","allowEmptyArrays","strictNullHandling","skipNulls","encodeDotInKeys","sort","allowDots","serializeDate","formatter","encodeValuesOnly","tmpSc","findFlag","keyValue","objKeys","encodedPrefix","adjustedPrefix","encodedKey","valueSideChannel","normalizeStringifyOptions","arrayFormat","stringify_1","joined","interpretNumericEntities","numberStr","parseArrayValue","isoSentinel","charsetSentinel","parseValues","cleanStr","limit","skipIndex","bracketEqualsPos","encodedVal","existing","parseObject","valuesParsed","leaf","cleanRoot","decodedRoot","parseKeys","givenKey","brackets","normalizeParseOptions","duplicates","tempObj","newObj","lib","Url","protocolPattern","portPattern","simplePathPattern","delims","unwise","autoEscape","nonHostChars","hostEndingChars","hostnameMaxLen","hostnamePartPattern","hostnamePartStart","unsafeProtocol","hostlessProtocol","slashedProtocol","querystring","urlParse","parseQueryString","slashesDenoteHost","queryIndex","splitter","uSplit","slashRegex","simplePath","lowerProto","slashes","hostEnd","hec","auth","atSign","ipv6Hostname","hostparts","newpart","validParts","notHost","bit","esc","qm","urlFormat","pathname","host","query","urlResolve","relative","rel","tkeys","tkey","rkeys","rkey","relPath","isSourceAbs","isRelAbs","mustEndAbs","removeAllDots","srcPath","psychotic","authInHost","hasTrailingSlash","up","isAbsolute","assertPath","removeUrlParams","escapeRegExp","replaceAll","find","normalizeStringPosix","allowAboveRoot","lastSegmentLength","lastSlash","lastSlashIndex","isHttp","isWindows","customBaseUrl","customRootUrl","baseUrl","rootUrl","absolutePath","trailingSeparator","arguments$1","segments","prevArg","hasRoot","matchedSlash","origpath","ext","extIdx","firstNonSlashEnd","startDot","startPart","preDotState","saidHello","skipHello","sayHello","supported","isWebGLSupported","contextOptions","gl","success","loseContext","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","goldenrod","gold","gray","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavenderblush","lavender","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","cssColorNames","hex2rgb","hex2string","hexString","string2hex","rgb2hex","rgb","mapPremultipliedBlendModes","pm","npm","premultiplyBlendMode","correctBlendMode","blendMode","premultiplied","premultiplyRgba","premultiply","premultiplyTint","tint","premultiplyTintToRgba","createIndicesForQuads","outBuffer","totalIndices","getBufferType","interleaveTypedArrays","arrays","sizes","outSize","stride","views","littleOffset","indexStart","nextPow2","isPow2","log2","shift","removeItems","startIdx","removeCount","nextUid","warnings","deprecation","ignoreDepth","ProgramCache","TextureCache","BaseTextureCache","destroyTextureCache","clearTextureCache","CanvasRenderTarget","resolution","desiredWidth","desiredHeight","trimCanvas","imageData","pixels","DATA_URI","decomposeDataUri","dataUri","dataUriMatch","tempAnchor","determineCrossOrigin","url$1","parsedUrl","samePort","getResolutionOfUrl","PI_2","RAD_TO_DEG","DEG_TO_RAD","SHAPES","Point","tempPoints","Rectangle","rectangle","x0_1","x1_1","y0_1","y1_1","lt","rt","nx","ny","n00","n10","n01","n11","m00","m10","m01","m11","paddingX","paddingY","x2","y2","eps","Circle","radius","r2","dx","dy","Ellipse","halfWidth","halfHeight","normx","normy","Polygon","flat","polygon","intersect","pointsDesc","currentPoint","RoundedRectangle","radius2","ObservablePoint","Matrix","ty","transpose","newPos","angle","cos","sin","c1","tx1","matrix","b1","d1","pivotX","pivotY","skewX","skewY","pivot","ux","uy","vx","vy","rotationCayley","rotationMatrices","signum","row","_ux","_uy","_vx","_vy","mat","groupD8","ind","rotationSecond","rotationFirst","Transform","parentTransform","pt","wt","Bounds","rect","point","vertices","vertexData","beginOffset","endOffset","padX","padY","rawX","rawY","bounds","mask","_minX","_minY","_maxX","_maxY","DisplayObject","propertyName","skipUpdate","transformRef","parentRef","worldBounds","worldBoundsID","_options","TemporaryDisplayObject","myParent","cacheParent","maskObject","sortChildren","Container","_length","child2","index1","index2","currentIndex","beginIndex","sortRequired","skipChildrenUpdate","renderer","sourceFrame","childCullable","_renderer","destroyChildren","oldChildren","__assign","ExtensionType","normalizeExtension","metadata","extensions","onAdd","onRemove","addHandlers","removeHandlers","extension","Runner","a0","a6","a7","items","UPDATE_PRIORITY","TickerListener","priority","deltaTime","redirect","hard","Ticker","elapsedMS","fps","minFPS","minFPMS","maxFPS","shared","system","TickerPlugin","ticker","oldTicker","INSTALLED","autoDetectResource","ResourcePlugin","Resource","baseTexture","_baseTexture","_glTexture","_source","_extension","BufferResource","glTexture","defaultBufferOptions","BaseTexture","resource","alphaMode","mipmap","anisotropicLevel","scaleMode","wrapMode","resourceOptions","dirty","realWidth","realHeight","oldResolution","strict","isFrame","cacheId","baseTextureFromCache","AbstractMultiResource","partTexture","resources","ArrayResource","urls","texture","itemDirtyIds","BaseImageResource","sourceAny","crossorigin","CanvasResource","OffscreenCanvas","CubeResource","autoLoad","linkBaseTexture","side","ImageResource","imageElement","createBitmap","completed","createImageBitmap","cors","bitmap","glTextures","otherTex","SVGResource","sourceBase64","tempImage","svgWidth","svgHeight","svgString","sizeMatch","VideoResource","videoElement","firstSrc","sourceElement","mime","baseSrc","_deltaTime","valid","ImageBitmapResource","_resources","DepthResource","Framebuffer","BaseRenderTexture","TextureUvs","baseFrame","rotate","tw","w2","h2","cX","cY","DEFAULT_UVS","removeAllHandlers","tex","Texture","orig","anchor","destroyBase","clonedFrame","clonedOrig","clonedTexture","imageUrl","textureFromCache","xNotFit","yNotFit","relationship","errorX","errorY","RenderTexture","baseRenderTexture","resizeBaseTexture","RenderTexturePool","textureOptions","multisample","minWidth","minHeight","renderTexture","filterTexture","destroyTextures","textures","Attribute","normalized","UID$4","_static","map$1","byteSizeMap$1","UID$3","Geometry","buffers","attributes","bufferIndex","interleavedBuffer","attribute","geometry","geometries","geometryOut","offsets","offset2","bufferIndexToCount","indexBufferData","Quad","QuadUv","targetTextureFrame","destinationFrame","UID$2","UniformGroup","uniforms","isStatic","isUbo","_ubo","FilterState","tempMatrix$2","FilterSystem","filterStack","renderTextureSystem","padding","autoFit","legacy","sourceFrameProjected","globalUniforms","inputSize","inputPixel","inputClamp","filterArea","lastState","flip","flop","clearMode","stateSystem","autoClear","outputMatrix","mappedMatrix","worldTransform","swap","bindingSourceFrame","bindingDestinationFrame","ObjectRenderer","_object","BatchSystem","objectRenderer","maxTextures","boundTextures","texArray","batchId","CONTEXT_UID_COUNTER","ContextSystem","common","view","isWebGl2","hasuint32","GLFramebuffer","framebuffer","tempRectangle","FramebufferSystem","nativeDrawBuffersExtension_1","nativeDepthTextureExtension","activeTextures","mipLevel","fbo","mipWidth","mipHeight","colorTextures","parentTexture","writeDepthTexture","depthTexture","samples","msaaSamples","sourcePixels","destPixels","CONTEXT_UID","colorTexture","sameSize","contextLost","stencil","byteSizeMap","GeometrySystem","nativeVaoExtension_1","vao","instanceExt_1","shader","vaos","incRefCount","bufferSystem","program","geometryAttributes","shaderAttributes","attribs","signature","vaoObjectHash","tempStride","tempStart","attribSize","vaoId","lastBuffer","glBuffer","location","instanceCount","byteSize","glType","MaskData","maskAbove","compileShader","logPrettyShaderError","shaderSrc","shaderLog","splitShader","dedupe","lineNumbers","logArgs","fragmentSourceToLog","logProgramError","vertexShader","fragmentShader","booleanArray","unknownContext","getTestContext","maxFragmentPrecision","getMaxFragmentPrecision","shaderFragment","setPrecision","requestedPrecision","maxSupportedPrecision","precision","GLSL_TO_SIZE","GL_TABLE","GL_TO_GLSL_TYPES","mapType","typeNames","uniformParsers","uniform","GLSL_TO_SINGLE_SETTERS_CACHED","GLSL_TO_ARRAY_SETTERS","generateUniformsSync","group","uniformData","funcFragments","templateType","fragTemplate","generateIfTestSrc","maxIfs","checkMaxIfStatementsInShader","fragmentSrc","unsafeEval","unsafeEvalSupported","defaultFragment$2","defaultVertex$3","UID$1","nameCache","Program","vertexSrc","Shader","BLEND$1","OFFSET$1","CULLING$1","DEPTH_TEST$1","WINDING$1","DEPTH_MASK$1","State","defaultFragment$1","defaultVertex$2","Filter","filterManager","_currentState","vertex","fragment","tempMat","TextureMatrix","clampMargin","uvs","forceUpdate","texBase","margin","SpriteMaskFilter","maskSprite","MaskSystem","maskStack","maskDataOrTarget","maskData","maskCurrent","alphaMaskFilter","stashFilterArea","currColorMask","nextColorMask","AbstractMaskSystem","curStackLen","newStackLen","tempMatrix$1","rectPool","ScissorSystem","prevData","StencilSystem","prevMaskCount","colorMask","ProjectionSystem","_destinationFrame","_resolution","_matrix","tempRect","tempRect2","RenderTextureSystem","viewportFrame","clearColor","clearMask","uboUpdate","_ud","_uv","_syncData","UBO_TO_SINGLE_SETTERS","GLSL_TO_STD40_SIZE","createUBOElements","uboElements","chunkSize","uboElement","lineUpValue","getUBOData","usedUniformDatas","generateUniformBufferSync","uniformParser","size_1","rowSize","elementSize","remainder","IGLUniformData","GLProgram","getAttributeData","totalAttributes","attribData","getUniformData","totalUniforms","generateProgram","glVertShader","glFragShader","webGLProgram","glProgram","UID","defaultSyncData","ShaderSystem","dontSync","syncData","syncFunc","uniformBlockIndex","uboData","preFix","mapWebGLBlendModesToPixi","BLEND","OFFSET","CULLING","DEPTH_TEST","WINDING","DEPTH_MASK","StateSystem","diff","TextureGCSystem","tm","managedTextures","wasRemoved","displayObject","mapTypeAndFormatToInternalFormat","_j","_k","_l","_m","_o","_p","_q","_s","_u","_v","_w","_x","table","GLTexture","TextureSystem","emptyTexture2D","hasIntegerTextures","skipRemove","anisotropicExt","_systems","tempMatrix","AbstractRenderer","staticMap","desiredScreenWidth","desiredScreenHeight","screenWidth","screenHeight","region","manualRegion","removeView","thisAny","GLBuffer","BufferSystem","drawType","Renderer","ClassRef","skipUpdateTransform","pluginName","ctor","extensions$1","autoDetectRenderer","$defaultVertex","$defaultFilterVertex","defaultVertex$1","defaultFilterVertex","System","BatchDrawCall","BatchTextureArray","ViewableBuffer","sizeOrBuffer","AbstractBatchRenderer","_drawCallPool","_textureArrayPool","MAX_SPRITES","MAX_TA","MAX_TEXTURES","textureArrays","touch","TICK","countTexArrays","finish","_attributeBuffer","_indexBuffer","vertexSize","drawCalls","dcIndex","aIndex","iIndex","drawCall","spriteBlendMode","textureSystem","packedGeometries","attributeBuffer","indexBuffer","dcCount","curTexArray","blend","roundedP2","roundedSizeIndex","roundedSize","uint32View","float32View","packedVertices","indicies","textureId","argb","BatchShaderGenerator","sampleValues","BatchGeometry","defaultVertex","defaultFragment","BatchPluginFactory","geometryClass","BatchPlugin","BatchRenderer","_loop_1","systems","_loop_2","accessibleTarget","KEY_CODE_TAB","DIV_TOUCH_SIZE","DIV_TOUCH_POS_X","DIV_TOUCH_POS_Y","DIV_TOUCH_ZINDEX","DIV_HOOK_SIZE","DIV_HOOK_POS_X","DIV_HOOK_POS_Y","DIV_HOOK_ZINDEX","AccessibilityManager","div","hookDiv","top","viewWidth","viewHeight","sx","sy","hitArea","interactionManager","eventData","InteractionData","globalPos","buttons","InteractionEvent","InteractionTrackingData","pointerId","yn","flags","TreeSearch","interactionEvent","hitTest","interactive","hit","interactiveParent","hitTestChildren","childHit","interactiveTarget","MOUSE_POINTER_ID","hitTestEvent","InteractionManager","useSystemTicker","globalPoint","interactionData","applyStyles","eventString","resolutionMultiplier","delayedEvents","delayedLen","displayObject_1","originalEvent","cancelable","eventLen","isRightButton","cancelled","eventAppend","trackingData","isTouch","isMouse","isMouseTap","isDown","pointerEvent","normalizedEvents","tempEvent","TEMP_RECT","BYTES_PER_PIXEL","Extract","quality","image","flipY","canvasBuffer","canvasData","target_1","generated","resolvedTexture","SignalBinding","_addSignalBinding","Signal","exists","parseUri","_t0","t1","t2","useXdr","STATUS_NONE","STATUS_OK","STATUS_EMPTY","STATUS_IE_BUG_EMPTY","STATUS_TYPE_OK","_noop$1","setExtMap","extname","reqType","LoaderResource","loadType","xhrType","mimeTypes","xdr","statusType","domparser","e$1","slashIndex","queryStart","hashStart","STATUS_FLAGS","TYPE","LOAD_TYPE","XHR_RESPONSE_TYPE","_noop","onlyOnce","callFn","AsyncQueueItem","AsyncQueue","worker","concurrency","insertAtFront","deferNext","MAX_PROGRESS","rgxExtractUrlHash","Loader","plugin","use","incompleteChildren","fullChunk","eachChunk","numTasks","chunk","dequeue","AppLoaderPlugin","TextureLoader","_keyStr","encodeBinary","inx","bytebuffer","encodedCharIndexes","jnx","paddingBytes","parsing","Url_1","src_1","ParsingLoader","_a$2","INTERNAL_FORMATS","INTERNAL_FORMAT_TO_BYTES_PER_PIXEL","__awaiter","_arguments","adopt","BlobResource","_data","CompressedTextureResource","_texture","levelID","levelWidth","levelHeight","levelBuffer","levels","blockWidth","blockHeight","imageWidth","imageHeight","alignedLevelWidth","alignedLevelHeight","levelSize","CompressedTextureLoader","loader","textureURL","fallbackURL","url_1","loadOptions","resourcePath","resourceName","extensionName","registerCompressedTextures","cacheID","_a$1","_b$1","DDS_MAGIC_SIZE","DDS_HEADER_SIZE","DDS_HEADER_PF_SIZE","DDS_HEADER_DX10_SIZE","DDS_MAGIC","DDS_FIELDS","DDS_PF_FIELDS","DDS_DX10_FIELDS","DXGI_FORMAT","D3D10_RESOURCE_DIMENSION","PF_FLAGS","DDPF_ALPHA","DDPF_FOURCC","DDPF_RGB","DDPF_YUV","DDPF_LUMINANCE","FOURCC_DXT1","FOURCC_DXT3","FOURCC_DXT5","FOURCC_DX10","DDS_RESOURCE_MISC_TEXTURECUBE","FOURCC_TO_FORMAT","DXGI_TO_FORMAT","parseDDS","magicWord","header","mipmapCount","pixelFormat","formatFlags","fourCC","internalFormat_1","dataOffset_1","texData","dx10Offset","dx10Header","dxgiFormat","resourceDimension","miscFlag","arraySize","internalFormat_2","imageBuffers","dataOffset","pixelSize","imageSize","imageOffset","FILE_IDENTIFIER","ENDIANNESS","KTX_FIELDS","FILE_HEADER_SIZE","TYPES_TO_BYTES_PER_COMPONENT","FORMATS_TO_COMPONENTS","TYPES_TO_BYTES_PER_PIXEL","parseKTX","loadKeyValueData","validate","littleEndian","glFormat","glInternalFormat","pixelWidth","pixelHeight","pixelDepth","numberOfArrayElements","numberOfFaces","numberOfMipmapLevels","bytesOfKeyValueData","alignedWidth","alignedHeight","imagePixels","imagePixelByteSize","kvData","parseKvData","imageByteSize","mipByteSize","alignedMipWidth","alignedMipHeight","mipmapLevel","elementOffset","arrayElement","mips","levelBuffers","convertToInt","convertFormatToInteger","bytesIntoKeyValueData","keyAndValueByteSize","keyAndValueByteOffset","valuePadding","keyNulByte","DDSLoader","KTXLoader","compressed","uncompressed","kvData_1","textures_1","ParticleContainer","maxSize","batchSize","autoResize","maxBatchSize","smallestChildIndex","ParticleBuffer","dynamicPropertyFlags","dynamicOffset","dynBuffer","staticOffset","statBuffer","amount","ParticleRenderer","totalChildren","updateStatic","bid","w0","w1","h0","h1","spritePosition","spriteRotation","textureUvs","LINE_JOIN","LINE_CAP","GRAPHICS_CURVES","defaultSegments","FillStyle","fixOrientation","i1","i2","i3","i4","buildPoly","graphicsData","graphicsGeometry","holes","verts","indices","holeArray","vertPos","buildCircle","rx","ry","circle","ellipse","roundedRect","j1","j2","j3","j4","center","buildRectangle","rectData","getPt","n1","n2","perc","quadraticBezierCurve","fromX","fromY","cpX","cpY","toX","toY","buildRoundedRectangle","Graphics","rrectData","vecPos","square","innerWeight","outerWeight","ix","iy","ox","oy","exx","eyy","eix","eiy","eox","eoy","round","ey","cx2p0x","cy2p0y","angle0","angle1","startAngle","angleDiff","absAngleDiff","segCount","angleInc","buildNonNativeLine","shape","firstPoint","lastPoint","closedShape","closedPath","midPointX","midPointY","indexCount","widthSquared","miterLimitSquared","perpx","perpy","perp1x","perp1y","dist","ratio","dx0","dy0","dx1","dy1","dot","cross","c2","pdist","imx","imy","omx","omy","smallerInsideSegmentSq","insideWeight","smallerInsideDiagonalSq","insideMiterOk","eps2","buildNativeLine","buildLine","ArcUtils","mm","tt","k1","k2","qy","endAngle","_startX","_startY","_anticlockwise","sweep","theta","theta2","cTheta","sTheta","segMinus","real","BezierUtils","cpX2","cpY2","t3","nt","nt2","nt3","prevX","prevY","dt","dt2","dt3","QuadraticUtils","a32","BatchPart","attribStart","endAttrib","FILL_COMMANDS","BATCH_POOL","DRAW_CALL_POOL","GraphicsData","fillStyle","lineStyle","tmpPoint","GraphicsGeometry","batchPart","lastShape","hitHole","i_1","currentStyle","nextTexture","index_1","attribIndex","need32","styleA","styleB","fill","batches","textureIds","currentGroup","textureCount","currentTexture","native","drawMode","glPoints","f32","u32","uvsStart","offsetX","offsetY","LineStyle","temp","DEFAULT_SHADERS","alignment","visible","radius_1","anticlockwise","startX","startY","xDiff","yDiff","closeStroke","poly","gI","worldAlpha","groupTextureCount","tintRGB","batchTint","wtID","currentPath","graphicsUtils","tempPoint","Sprite","destroyTexture","destroyBaseTexture","TEXT_GRADIENT","genericFontFamilies","TextStyle","deepCopyProperties","clonedProperties","align","breakWords","dropShadow","dropShadowAlpha","dropShadowAngle","dropShadowBlur","dropShadowColor","outputColor","getColor","dropShadowDistance","fillGradientType","fillGradientStops","areArraysEqual","fontStyle","fontVariant","fontWeight","letterSpacing","lineHeight","lineJoin","miterLimit","stroke","strokeThickness","textBaseline","whiteSpace","wordWrap","wordWrapWidth","fontSizeString","fontFamilies","getSingleColor","array1","array2","propertyObj","contextSettings","TextMetrics","lines","lineWidths","maxLineWidth","fontProperties","outputText","lineWidth","collapseSpaces","collapseNewlines","canPrependSpaces","tokens","currIsBreakingSpace","lastIsBreakingSpace","tokenWidth","nextChar","lastChar","characterWidth","isLastToken","newLine","spacing","_nextChar","_token","_char","_index","_breakWords","metricsString","baseline","imagedata","idx","defaultDestroyOptions","Text","ownCanvas","respectDirty","measured","linePositionX","linePositionY","passesCount","isShadowPass","dsOffsetText","dsOffsetShadow","linePositionYShift","isStroke","supportLetterSpacing","currentPosition","stringArray","previousWidth","currentWidth","currentChar","textStr","trimmed","metrics","gradient","dropShadowCorrection","lengthPlus1","textHeight","lastLineBottom","thisLineTop","thisLineGradientStart","thisLineBottom","nextLineTop","thisLineGradientEnd","gradStopLineHeight","lineStop","globalStop","totalIterations","currentIteration","CountLimiter","maxItemsPerFrame","findMultipleBaseTextures","findBaseTexture","findTexture","drawText","_helper","calculateTextStyle","findText","findTextStyle","BasePrepare","uploaded","completes","addHook","uploadHook","uploadBaseTextures","uploadGraphics","findGraphics","Prepare","TimeLimiter","maxMilliseconds","Spritesheet","resolutionFilename","initialFrameIndex","frameIndex","maxFrames","sourceSize","animations","animName","frameName","SpritesheetLoader","imageResourceName","multiPacks","itemName","itemUrl","multiPacks_1","spritesheet","TilingSprite","fragmentSimpleSrc","gl1VertexSrc","gl1FragmentSrc","gl2VertexSrc","gl2FragmentSrc","TilingSpriteRenderer","ts","quad","anchorX","anchorY","baseTex","uv","isSimple","MeshBatchUvs","uvBuffer","uvMatrix","tempPolygon","Mesh","verticesBuffer","vertexDirtyId","geomUvs","ind0","ind1","ind2","MeshMaterial","uSampler","MeshGeometry","uvsBuffer","BitmapFontData","TextFormat","txt","rawData","attributeList","itemData","split","strValue","floatValue","page","kerning","XMLFormat","xml","distanceField","XMLStringFormat","xmlTxt","autoDetectFormat","generateFillStyle","lastIterationStop","clampedStop","drawGlyph","splitTextToCharacters","resolveCharacters","startCode","endCode","j_1","extractCharCode","BitmapFont","ownsTextures","pageTextures","file","page_1","xoffset","yoffset","xadvance","second","fontData","textStyle","textureWidth","textureHeight","charsList","positionX","positionY","maxCharHeight","textureGlyphWidth","total","msdfFrag","msdfVert","pageMeshDataDefaultPageMeshData","pageMeshDataMSDFPageMeshData","charRenderDataPool","BitmapText","maxWidth","fontName","lineSpaces","charsInput","pageMeshDataPool","prevCharCode","lastLineWidth","lastBreakPos","lastBreakWidth","spacesRemoved","maxLineHeight","spaceCount","charCode","charData","charRenderData","lineAlignOffsets","alignOffset","lenChars","pagesMeshData","newPagesMeshData","activePagesMeshData","baseTextureUid","pageMeshData","material","meshBlendMode","mesh","_textureCache","total_1","xPos","yPos","pageMesh","textureFrame","vertexCount","anchorOffsetX","anchorOffsetY","i_2","vertexBuffer","textureBuffer","distanceFieldRange","distanceFieldType","worldScale","fontScale","BitmapFontLoader","pageFile","bitmapResource","resUrl","dir","AlphaFilter","vertTemplate","generateBlurVertSource","kernelSize","halfLength","vertSource","blurLoop","GAUSSIAN_VALUES","generateBlurFragSource","kernel","fragSource","BlurFilterPass","horizontal","strength","vertSrc","fragSrc","renderTarget","BlurFilter","xStrength","yStrength","ColorMatrixFilter","multiply","newMatrix","cosR","sinR","sqrt","sqrW","a00","a01","a02","a10","a11","a12","a20","a21","a22","desaturation","toned","lightColor","darkColor","lR","lG","lB","dR","dG","dB","intensity","DisplacementFilter","maskMatrix","lenX","lenY","FXAAFilter","NoiseFilter","noise","seed","_tempMatrix","CacheData","cacheAlpha","cachedRenderTexture","cachedSourceFrame","cachedDestinationFrame","cachedProjectionTransform","textureCacheId","cachedSprite","cachedRenderTarget","deep","ResizePlugin","clientWidth","Application","stageOptions","plugins","PlaneGeometry","segWidth","segHeight","segmentsX","segmentsY","sizeX","sizeY","totalSub","xpos","ypos","value2","value3","value4","RopeGeometry","textureScale","distance","nextPoint","perpX","perpY","perpLength","SimpleRope","ropeGeometry","meshMaterial","SimplePlane","verticesX","verticesY","planeGeometry","SimpleMesh","DEFAULT_BORDER_SIZE","NineSlicePlane","leftWidth","topHeight","rightWidth","bottomHeight","scaleW","scaleH","_uvw","_uvh","AnimatedSprite","autoUpdate","frameNumber","previousFrame","lag","currentFrame","frames","images","getRandomValues","rnds8","rng","byteToHex","unsafeStringify","randomUUID","v4","rnds","OldFilmFilter","DotFilter","ReflectionFilter","GlitchFilter","averageWidth","rand","ctx","radians","RGBSplitFilter","perlin","GodrayFilter","AdjustmentFilter","fragmentClamp","KawaseBlurFilter","uvX","uvY","kernels","ExtractBrightnessFilter","threshold","fragment$1","AdvancedBloomFilter","brightTarget","bloomTarget","AsciiFilter","BevelFilter","BloomFilter","blurX","blurY","BulgePinchFilter","ColorMapFilter","colorMap","nearest","ColorOverlayFilter","ColorReplaceFilter","originalColor","newColor","epsilon","ConvolutionFilter","CrossHatchFilter","CRTFilter","DropShadowFilter","shadowOnly","EmbossFilter","GlowFilter","outerStrength","innerStrength","knockout","MotionBlurFilter","MultiColorReplaceFilter","replacements","maxColors","originals","targets","colorCount","targetColor","OutlineFilter","thickness","PixelateFilter","RadialBlurFilter","ShockwaveFilter","SimpleLightmapFilter","TiltShiftAxisFilter","gradientBlur","TiltShiftXFilter","TiltShiftYFilter","TiltShiftFilter","TwistFilter","ZoomBlurFilter","maxKernelSize","FILTER_NAME","getOrCreateShockwaveFilterImpl","createMode","shockwaveFilterFromMap","shockwaveFilter","getShockwaveFilter","setShockwaveFilter","INIT_RAD","RadiusAlphaFilter","PIXI.Filter","PIXI.Point","getOrCreateRadiusAlphaFilterImpl","getRadiusAlphaFilter","setRadiusAlphaFilter","WebGALPixiContainer","PIXI.Container","PIXI.filters","originalX","originalY","blurFilterFromMap","blurFilter","oldFilm","dotFilm","reflectionFilm","glitchFilm","rgbFilm","godrayFilm","AttachmentType","BinaryInput","optimizePositive","byteCount","MixBlend","MixDirection","PositionMode","RotateMode","TransformMode","filterFromString","TextureFilter","TextureWrap","TextureRegion","RegionFields","TextureAtlas","atlasText","textureLoader","pages","TextureAtlasPage","TextureAtlasRegion","stripExtension","TextureAtlasReader","pageFields","regionFields","rotateValue","iterateParser","field","atlasRegion","entryValues","swapWH","colon","lastMatch","comma","fround_polyfill","fround","IntSet","contains","StringSet","oldSize","Color","MathUtils","degrees","Interpolation","Pow","PowOut","Utils","sourceStart","dest","destStart","numElements","toIndex","Pool","instantiator","Vector2","SkeletonBoundsBase","skeleton","updateAabb","boundingBoxes","polygons","polygonPool","slots","slotCount","slot","attachment","boundingBox","prevIndex","vertexY","vertexX","width12","height12","det1","x3","y3","x4","y4","det2","width34","height34","det3","tempRgb","SpineSprite","SpineMesh","SpineBase","spineData","slotContainer","spriteName","delayLimit","globalClr","light","dark","spriteColor","attColor","transform_1","meshId","r0","g0","b0","drawOrder","clippingAttachment","clippingContainer","timeDelta","defName","strip","clip","graphics","geom","slotIndex","slotName","attachmentName","currentAttachment","nameSuffix","outGroup","list_d","list_n","name_1","name_2","name_3","isJson","AbstractSpineParser","isJsonSpineModel","isBinarySpineModel","dataToParse","metadataSkeletonScale","metadataAtlas","metadataAtlasSuffix","atlasPath","queryStringPos","atlasOptions","imageOptions","namePrefix","staticImageLoader","imageLoaderAdapter","createSkeletonWithRawAtlas","spineAtlas","atlasResource","cachedResource","Attachment","VertexAttachment","worldVertices","deformArray","bones","v_1","skeletonBones","wx","wy","weight","deform","BoundingBoxAttachment","ClippingAttachment","MeshAttachment","parentMesh","PathAttachment","PointAttachment","bone","Slot","RegionAttachment","regionScaleX","regionScaleY","localX","localY","localX2","localY2","localXCos","localXSin","localYCos","localYSin","localX2Cos","localX2Sin","localY2Cos","localY2Sin","vertexOffset","JitterEffect","jitterX","jitterY","SwirlEffect","radAngle","Animation","timelines","loop","low","high","TimelineType","CurveTimeline","frameCount","cx1","cy1","cx2","cy2","tmpx","tmpy","dddfx","dddfy","ddfx","ddfy","dfx","dfy","curves","RotateTimeline","r_1","r_2","prevRotation","frameTime","TranslateTimeline","ScaleTimeline","ShearTimeline","ColorTimeline","setup","TwoColorTimeline","g2","setupLight","setupDark","AttachmentTimeline","zeros","DeformTimeline","firedEvents","slotAttachment","frameVertices","vertexAttachment","deform_1","setupVertices","lastVertices","vertexAttachment_1","i_3","i_4","i_5","i_6","i_7","prevVertices","nextVertices","i_8","i_9","i_10","vertexAttachment_2","i_11","i_12","i_13","i_14","i_15","EventTimeline","DrawOrderTimeline","drawOrderToSetupIndex","IkConstraintTimeline","softness","bendDirection","compress","stretch","constraint","TransformConstraintTimeline","rotateMix","translateMix","scaleMix","shearMix","translate","shear","PathConstraintPositionTimeline","PathConstraintSpacingTimeline","PathConstraintMixTimeline","AnimationState","EventQueue","TrackEntry","tracks","currentDelta","nextTime","finished","applied","n_1","animationLast","animationTime","timelineCount","timelineMode","firstFrame","timelinesRotation","timeline_1","timelineBlend","setupState","attachments","alphaHold","alphaMix","timelineHoldMix","holdMix","rotateTimeline","r1","lastTotal","lastDiff","animationStart","animationEnd","trackLastWrapped","event_1","event_2","oldDrainDisabled","trackIndex","interrupt","mixDuration","timelinesCount","timelineDipMix","propertyIDs","animState","EventType","event_3","AnimationStateAdapter","AnimationStateData","skeletonData","fromName","toName","AtlasAttachmentLoader","atlas","skin","Bone","shearX","shearY","rotationY","prx","pid","det","world","invDet","local","worldRotation","localRotation","BoneData","ConstraintData","order","skinRequired","Event","EventData","IkConstraint","targetX","targetY","rotationIK","bendDir","psx","psy","csx","pmat","os1","os2","s2","cwx","cwy","pp","l1","l2","minAngle","minDist","maxAngle","maxDist","os","IkConstraintData","PathConstraintData","SpacingMode","PathConstraint","spacingMode","lengthSpacing","rotateMode","tangents","boneCount","spacesCount","spaces","lengths","setupLength","length_1","positions","boneX","boneY","offsetRotation","tip","length_2","length_3","percentPosition","percentSpacing","closed","verticesLength","curveCount","prevCurve","pathLength_1","curve","space","length_4","pathLength","curveLength","length_5","length_6","ttt","uu","uuu","ut","ut3","uut3","utt3","TransformConstraint","targetMat","degRadReflect","offsetShearY","modified","Skeleton","boneData","parent_1","slotData","ikConstraintData","transformConstraintData","pathConstraintData","updateCache","skinBones","ikConstraints","transformConstraints","pathConstraints","ikCount","transformCount","pathCount","constraintCount","constrained","slotBone","pathBones","boneIndex","updateCacheReset","boneName","skinName","newSkin","constraintName","ikConstraint","SkeletonData","skins","eventDataName","pathConstraintName","SlotData","TransformConstraintData","SkinEntry","Skin","contained","dictionary","slotAttachments","oldSkin","skinAttachment","SkeletonBinary","attachmentLoader","binary","nonessential","defaultSkin","linkedMesh","parent_2","typeIndex","box","hullLength","edges","parent_3","inheritDeform","LinkedMesh$1","closed_1","constantSpeed","endSlotIndex","Vertices","weights","bonesArray","tempColor1","tempColor2","timelineType","timelineScale","iii","nnn","weighted","deformLength","vn","drawOrderCount","offsetCount","unchanged","originalIndex","unchangedIndex","eventCount","LinkedMesh","SkeletonBounds","SkeletonJson","json","skeletonMap","boneMap","parentName","slotMap","constraintMap","targetName","skinMap","entryName","eventMap","animationMap","scaledVertices","timelineName","timelineMap","valueMap","deformName","deformMap","verticesValue","drawOrderNode","drawOrderMap","offsetMap","Spine","sourceAttachment","attachmentName_1","attachmentName_2","verticesArray","vertices_1","AnimationStateAdapter2","Sequence","basePath","SequenceMode","SequenceModeValues","Property","Timeline","propertyIds","bezierCount","newCurves","bezier","time1","value1","time2","dddx","dddy","ddx","ddy","valueOffset","x_1","y_1","x_2","y_2","CurveTimeline1","propertyId","curveType","CurveTimeline2","propertyId1","propertyId2","TranslateXTimeline","TranslateYTimeline","ScaleXTimeline","ScaleYTimeline","ShearXTimeline","ShearYTimeline","RGBATimeline","RGBTimeline","AlphaTimeline","RGBA2Timeline","RGB2Timeline","x_3","x_4","x_5","y_3","ikConstraintIndex","transformConstraintIndex","mixRotate","mixX","mixY","mixScaleX","mixScaleY","mixShearY","pathConstraintIndex","SequenceTimeline","modeAndIndex","applyTime","applyEvents","shortestRotation","SUBSEQUENT","SETUP","FIRST","HOLD_SUBSEQUENT","HOLD_FIRST","CURRENT","HOLD_MIX","sequence","regions","skelX","skelY","multiplier_1","multiplier","length_7","rootBone","updatable","lowHash","highHash","verShort","name_4","name_5","inheritTimelines","ATTACHMENT_DEFORM","frameLast","SLOT_ATTACHMENT","SLOT_RGBA","CURVE_STEPPED","CURVE_BEZIER","setBezier","SLOT_RGB","SLOT_RGBA2","nr","nr2","ng2","nb2","SLOT_RGB2","SLOT_ALPHA","BONE_ROTATE","readTimeline1$1","BONE_TRANSLATE","readTimeline2$1","BONE_TRANSLATEX","BONE_TRANSLATEY","BONE_SCALE","BONE_SCALEX","BONE_SCALEY","BONE_SHEAR","BONE_SHEARX","BONE_SHEARY","mix2","softness2","mixRotate2","mixX2","mixY2","mixScaleX2","mixScaleY2","mixShearY2","PATH_POSITION","PATH_SPACING","PATH_MIX","ATTACHMENT_SEQUENCE","nvalue1","nvalue2","frames_1","keyMap","nextMap","readCurve","readTimeline1","color2","newColor2","frames_2","readTimeline2","constraintIndex","frames_3","outMap","outMap2","innerMapName","attachmentsName","attachmentsMap","slotMapName","attachmentMapName","attachmentMap","timelineMapName","lastDelay","name1","name2","SPINE_VERSION","detectSpineVersion","ver3","verNum","UniBinaryParser","ver","spine38.SkeletonBinary","spine38.AtlasAttachmentLoader","spine41.SkeletonBinary","spine41.AtlasAttachmentLoader","UniJsonParser","spine37.SkeletonJson","spine37.AtlasAttachmentLoader","spine38.SkeletonJson","spine41.SkeletonJson","SpineParser","parserCast","spine","spine37","spine38","spine41","PIXI","PixiStage","PIXI.Loader","app","PIXI.Application","pixiContainer","appRoot","isIOS","reload","animationObject","uuid","currentEffects","targetPixiContainer","targetPresetAnimations","thisTickerFunc","webgalFilters","targetTransform","targetAnimation","presetPosition","currentFigure","mouthTextureUrls","blinkState","blinkTextureUrls","thisBgContainer","bgUuid","originalWidth","originalHeight","targetScale","bgSprite","PIXI.Sprite","spineId","spineResource","bgSpine","thisFigureContainer","figureUuid","figureSprite","figureSpine","transY","figureRecordTarget","model","category_name","animation_index","priority_number","internalModel","mapToZeroOne","paramY","objUuid","indexFig","indexBg","PIXI.utils.clearTextureCache","figureTargetIndex","front","getScreenFps","nextFrame","targetCount","beginDate","log","diffDate","__INFO","initializeScript","loadStyle","getUserAnimation","userAnimation","DEFAULT_ICON_CONFIGS","guid","IconConverter","icon","theme","IconContext","IconWrapper","rtl","render","strokeWidth","strokeLinecap","strokeLinejoin","spin","ICON_CONFIGS","useMemo","svgProps","React","AlignTextLeftOne","CloseSmall","DoubleDown","DoubleRight","DoubleUp","FolderOpen","GoEnd","GoStart","HamburgerButton","Home","Left","Lock","Logout","MusicList","PlayOne","PreviewCloseOne","PreviewOpen","ReplayMusic","Return","Save$1","SettingTwo","SquareSmall","Unlock","VolumeNotice","MenuIconMap","returnIcon","Save","MenuPanelButton","playSePageChange","buttonClassName","backToTitle","GlobalDialog","isGlobalDialogShow","showGlogalDialog","handleLeft","hideGlobalDialog","handleRight","renderElement","showControls","hideControls","switchControls","MenuPanel","playSeDialogOpen","SaveTagOn","LoadTagOn","OptionTagOn","SaveTagColor","LoadTagColor","OptionTagColor","SaveIconColor","LoadIconColor","OptionIconColor","savesDataState","classNameOfElement","tCommon","showSaves","animationIndex","saveElementContent","saveElement","Load","saveDataState","NormalOption","NormalButton","buttonList","playSeSwitch","getLanguageName","lang","useLanguage","userDataRef","_lang","isSyncStorage","languageName","About","userSavesState","setLanguage","exportSaves","saves","blobUrl","importSavesEventHandler","evR","saveAsObj","importSaves","inputElement","showAbout","setShowAbout","toggleAbout","TextPreview","previewBackground","previewText","previewTextArray","textboxProps","OptionSlider","Display","Sound","Options","currentOptionPage","getClassName","Menu","currentTag","AudioContainer","stageStore","titleBgm","isShowTitle","bgmEnter","uiSoundEffects","uiSeVol","fadeTimer","setFadeTimer","bgmFadeIn","maxVol","volumeStep","fade","timer","uiSeAudioElement","FullScreenPerform","stageWidth","stageHeight","TextBoxFilm","useSetBg","bgName","thisBgKey","currentBg","removeBg","addBg","bgObject","oldBgKey","useSetFigure","figNameLeft","figName","figNameRight","live2dMotion","live2dExpression","thisFigKey","softInAniKey","currentFigCenter","removeFig","addFigure","currentFigLeft","currentFigRight","fig","currentFigThisKey","currentFigures","existFigure","existKey","figObj","enterTikerKey","oldFigKey","figKey","leaveKey","addLive2dFigure","setStageObjectEffects","setStageEffects","stageObjects","stageObj","convertTransform","MainStage","IntroContainer","inTextBox","checkMousePosition","isTextboxHidden","timeoutEventHandle","updateControlsVisibility","Stage","BottomControlPanel","isFr","setMenuPanel","menuPanel","fastSlPreview","Backlog","iconSize","indexHide","setIndexHide","isDisableScroll","setIsDisableScroll","timeRef","backlogList","backlogs","backlogItem","showTextArray2","showTextElementList","mergeStringsAndKeepObjects","singleBacklogView","backlog_audio_element","userDataStore","currentString","currentItem","ExtraBgm","currentBgmSrc","extraState","initName","isShowBgmList","foundCurrentBgmName","foundCurrentBgmIndex","bgmPlayerHeight","bgmListLen","currentPlayingBgmName","setBgmByIndex","showBgmList","bgmControl","ExtraCgElement","showFull","ExtraCg","pageNumber","currentPage","showCgList","deg","Random","showNav","Extra","showExtra","BottomControlPanelFilm","showPanel","getPixiSscreenshot","DevPanel","isShowDevPanel","isOpenDevPanel","isShow","devMainArea","Translation","isShowSelectLanguage","setIsShowSelectLanguage","setLang","langId","PanicYoozle","panicTitle","originalTitle","PanicOverlay","showOverlay","setShowOverlay","useFullScreen","App","_assertThisInitialized","_setPrototypeOf","_inherits","subClass","superClass","setPrototypeOf","_possibleConstructorReturn","assertThisInitialized","_getPrototypeOf","_iterableToArray","iter","_toArray","iterableToArray","ownKeys$6","_objectSpread$6","consoleLogger","Logger","concreteLogger","bool","lvl","debugOnly","moduleName","baseLogger","cloned","_cloned","defer","rej","makeString","getLastOfPath","cleanKey","canNotTraverseDeeper","setPath","_getLastOfPath","pushPath","concat","_getLastOfPath2","getPath","_getLastOfPath3","getPathWithDefaults","defaultData","deepExtend","overwrite","regexEscape","_entityMap","isIE10","looksLikeObjectPath","nsSeparator","keySeparator","possibleChars","matched","deepFind","joinedPath","ownKeys$5","_objectSpread$5","_createSuper$3","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct$3","Super","NewTarget","ResourceStore","_EventEmitter","ignoreJSONStructure","pack","postProcessor","processors","translator","processor","ownKeys$4","_objectSpread$4","_createSuper$2","_isNativeReflectConstruct$2","checkedLoadedFor","Translator","services","wouldCheckForNsInKey","seemsNaturalLanguage","lastKey","_this2","returnDetails","_this$extractFromKey","namespace","appendNamespaceToCIMode","resUsedKey","resExactUsedKey","resType","noObject","joinArrays","handleAsObjectInI18nFormat","handleAsObject","resTypeIsArray","newKeyToUse","deepKey","usedDefault","usedKey","needsPluralHandling","hasDefaultValue","defaultValueSuffix","missingKeyNoValueFallbackToKey","resForMissing","updateMissing","lngs","fallbackLngs","send","specificDefaultValue","defaultForMissing","suffix","_this3","skipOnVariables","nestBef","nestAft","postProcess","postProcessorNames","_this4","found","exactUsedKey","usedLng","usedNS","extracted","needsZeroSuffixLookup","needsContextHandling","codes","finalKeys","pluralSuffix","zeroSuffix","contextKey","possibleKey","capitalize","LanguageUtil","specialCases","cleanedLng","lngOnly","supportedLng","fallbacks","fallbackCode","fallbackCodes","addCode","sets","_rulesPluralsTypes","deprecatedJsonVersions","suffixesOrder","createRules","PluralResolver","languageUtils","pluralCategory1","pluralCategory2","pluralCategory","returnSuffix","ownKeys$3","_objectSpread$3","deepFindWithDefaults","Interpolator","iOpts","regexpStr","regexpUnescapeStr","nestingRegexpStr","replaces","regexSafe","handleFormat","missingInterpolationHandler","todos","todo","matchedVar","safeValue","clonedOptions","handleHasOptions","inheritedOptions","sep","optionsString","matchedSingleQuotes","matchedDoubleQuotes","formatters","doReduce","elem","ownKeys$2","_objectSpread$2","parseFormatStr","formatStr","formatName","formatOptions","optStr","_opt$split","_opt$split2","createCachedFormatter","Formatter","_format","_parseFormatStr","formatted","valOptions","ownKeys$1","_objectSpread$1","_createSuper$1","_isNativeReflectConstruct$1","removePending","Connector","backend","toLoad","toLoadLanguages","toLoadNamespaces","hasAllNamespaces","loaded","loadedKeys","fcName","tried","_this5","fallbackValue","isUpdate","clb","transformOptions","_createSuper","_isNativeReflectConstruct","bindMemberFunctions","inst","mems","I18n","defOpts","createClassOnDemand","ClassOrObject","lu","storeApi","_this2$store","storeApiChained","_this2$store2","load","usedCallback","lngInLngs","setLngProps","setLng","fixedT","resultKey","_this$translator","_this$translator2","_this6","preResult","_this7","preloaded","newLngs","rtlLngs","_this8","mergedOptions","membersToCopy"],"sources":["../../../../node_modules/object-assign/index.js","../../../../node_modules/react/cjs/react.production.min.js","../../../../node_modules/react/index.js","../../../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../../node_modules/react/jsx-runtime.js","../../../../node_modules/scheduler/cjs/scheduler.production.min.js","../../../../node_modules/scheduler/index.js","../../../../node_modules/react-dom/cjs/react-dom.production.min.js","../../../../node_modules/react-dom/index.js","../../../../node_modules/immer/dist/immer.esm.mjs","../../../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../../../node_modules/redux/es/redux.js","../../../../node_modules/redux-thunk/es/index.js","../../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js","../../../../node_modules/lodash/_listCacheClear.js","../../../../node_modules/lodash/eq.js","../../../../node_modules/lodash/_assocIndexOf.js","../../../../node_modules/lodash/_listCacheDelete.js","../../../../node_modules/lodash/_listCacheGet.js","../../../../node_modules/lodash/_listCacheHas.js","../../../../node_modules/lodash/_listCacheSet.js","../../../../node_modules/lodash/_ListCache.js","../../../../node_modules/lodash/_stackClear.js","../../../../node_modules/lodash/_stackDelete.js","../../../../node_modules/lodash/_stackGet.js","../../../../node_modules/lodash/_stackHas.js","../../../../node_modules/lodash/_freeGlobal.js","../../../../node_modules/lodash/_root.js","../../../../node_modules/lodash/_Symbol.js","../../../../node_modules/lodash/_getRawTag.js","../../../../node_modules/lodash/_objectToString.js","../../../../node_modules/lodash/_baseGetTag.js","../../../../node_modules/lodash/isObject.js","../../../../node_modules/lodash/isFunction.js","../../../../node_modules/lodash/_coreJsData.js","../../../../node_modules/lodash/_isMasked.js","../../../../node_modules/lodash/_toSource.js","../../../../node_modules/lodash/_baseIsNative.js","../../../../node_modules/lodash/_getValue.js","../../../../node_modules/lodash/_getNative.js","../../../../node_modules/lodash/_Map.js","../../../../node_modules/lodash/_nativeCreate.js","../../../../node_modules/lodash/_hashClear.js","../../../../node_modules/lodash/_hashDelete.js","../../../../node_modules/lodash/_hashGet.js","../../../../node_modules/lodash/_hashHas.js","../../../../node_modules/lodash/_hashSet.js","../../../../node_modules/lodash/_Hash.js","../../../../node_modules/lodash/_mapCacheClear.js","../../../../node_modules/lodash/_isKeyable.js","../../../../node_modules/lodash/_getMapData.js","../../../../node_modules/lodash/_mapCacheDelete.js","../../../../node_modules/lodash/_mapCacheGet.js","../../../../node_modules/lodash/_mapCacheHas.js","../../../../node_modules/lodash/_mapCacheSet.js","../../../../node_modules/lodash/_MapCache.js","../../../../node_modules/lodash/_stackSet.js","../../../../node_modules/lodash/_Stack.js","../../../../node_modules/lodash/_arrayEach.js","../../../../node_modules/lodash/_defineProperty.js","../../../../node_modules/lodash/_baseAssignValue.js","../../../../node_modules/lodash/_assignValue.js","../../../../node_modules/lodash/_copyObject.js","../../../../node_modules/lodash/_baseTimes.js","../../../../node_modules/lodash/isObjectLike.js","../../../../node_modules/lodash/_baseIsArguments.js","../../../../node_modules/lodash/isArguments.js","../../../../node_modules/lodash/isArray.js","../../../../node_modules/lodash/stubFalse.js","../../../../node_modules/lodash/isBuffer.js","../../../../node_modules/lodash/_isIndex.js","../../../../node_modules/lodash/isLength.js","../../../../node_modules/lodash/_baseIsTypedArray.js","../../../../node_modules/lodash/_baseUnary.js","../../../../node_modules/lodash/_nodeUtil.js","../../../../node_modules/lodash/isTypedArray.js","../../../../node_modules/lodash/_arrayLikeKeys.js","../../../../node_modules/lodash/_isPrototype.js","../../../../node_modules/lodash/_overArg.js","../../../../node_modules/lodash/_nativeKeys.js","../../../../node_modules/lodash/_baseKeys.js","../../../../node_modules/lodash/isArrayLike.js","../../../../node_modules/lodash/keys.js","../../../../node_modules/lodash/_baseAssign.js","../../../../node_modules/lodash/_nativeKeysIn.js","../../../../node_modules/lodash/_baseKeysIn.js","../../../../node_modules/lodash/keysIn.js","../../../../node_modules/lodash/_baseAssignIn.js","../../../../node_modules/lodash/_cloneBuffer.js","../../../../node_modules/lodash/_copyArray.js","../../../../node_modules/lodash/_arrayFilter.js","../../../../node_modules/lodash/stubArray.js","../../../../node_modules/lodash/_getSymbols.js","../../../../node_modules/lodash/_copySymbols.js","../../../../node_modules/lodash/_arrayPush.js","../../../../node_modules/lodash/_getPrototype.js","../../../../node_modules/lodash/_getSymbolsIn.js","../../../../node_modules/lodash/_copySymbolsIn.js","../../../../node_modules/lodash/_baseGetAllKeys.js","../../../../node_modules/lodash/_getAllKeys.js","../../../../node_modules/lodash/_getAllKeysIn.js","../../../../node_modules/lodash/_DataView.js","../../../../node_modules/lodash/_Promise.js","../../../../node_modules/lodash/_Set.js","../../../../node_modules/lodash/_WeakMap.js","../../../../node_modules/lodash/_getTag.js","../../../../node_modules/lodash/_initCloneArray.js","../../../../node_modules/lodash/_Uint8Array.js","../../../../node_modules/lodash/_cloneArrayBuffer.js","../../../../node_modules/lodash/_cloneDataView.js","../../../../node_modules/lodash/_cloneRegExp.js","../../../../node_modules/lodash/_cloneSymbol.js","../../../../node_modules/lodash/_cloneTypedArray.js","../../../../node_modules/lodash/_initCloneByTag.js","../../../../node_modules/lodash/_baseCreate.js","../../../../node_modules/lodash/_initCloneObject.js","../../../../node_modules/lodash/_baseIsMap.js","../../../../node_modules/lodash/isMap.js","../../../../node_modules/lodash/_baseIsSet.js","../../../../node_modules/lodash/isSet.js","../../../../node_modules/lodash/_baseClone.js","../../../../node_modules/lodash/cloneDeep.js","../../src/Core/controller/scene/sceneInterface.ts","../../src/store/stageReducer.ts","../../../../node_modules/localforage/dist/localforage.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/bind.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/utils.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/buildURL.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/InterceptorManager.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/normalizeHeaderName.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/enhanceError.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/createError.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/settle.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/cookies.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/isAbsoluteURL.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/combineURLs.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/buildFullPath.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/parseHeaders.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/isURLSameOrigin.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/cancel/Cancel.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/adapters/xhr.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/defaults.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/transformData.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/cancel/isCancel.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/dispatchRequest.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/mergeConfig.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/env/data.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/validator.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/core/Axios.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/cancel/CancelToken.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/spread.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/helpers/isAxiosError.js","../../../../node_modules/cloudlogjs/node_modules/axios/lib/axios.js","../../../../node_modules/cloudlogjs/node_modules/axios/index.js","../../../../node_modules/cloudlogjs/index.js","../../src/Core/util/logger.ts","../../src/translations/en.ts","../../src/translations/jp.ts","../../src/translations/zh-cn.ts","../../src/translations/fr.ts","../../src/translations/de.ts","../../src/translations/zh-tw.ts","../../src/config/language.ts","../../src/store/userDataInterface.ts","../../src/store/userDataReducer.ts","../../src/config/index.ts","../../src/Core/Modules/backlog.ts","../../src/Core/Modules/scene.ts","../../src/Core/Modules/animations.ts","../../src/Core/Modules/perform/performInterface.ts","../../src/Core/util/gameAssetsAccess/assetSetter.ts","../../src/Core/util/prefetcher/assetsPrefetcher.ts","../../../parser/build/es/index.js","../../src/Core/util/getSentenceArg.ts","../../src/Core/gameScripts/bgm.ts","../../../../node_modules/axios/lib/helpers/bind.js","../../../../node_modules/axios/lib/utils.js","../../../../node_modules/axios/lib/core/AxiosError.js","../../../../node_modules/form-data/lib/browser.js","../../../../node_modules/axios/lib/env/classes/FormData.js","../../../../node_modules/axios/lib/helpers/toFormData.js","../../../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../../../node_modules/axios/lib/helpers/buildURL.js","../../../../node_modules/axios/lib/core/InterceptorManager.js","../../../../node_modules/axios/lib/helpers/normalizeHeaderName.js","../../../../node_modules/axios/lib/defaults/transitional.js","../../../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../../../node_modules/axios/lib/platform/browser/classes/FormData.js","../../../../node_modules/axios/lib/platform/browser/index.js","../../../../node_modules/axios/lib/platform/index.js","../../../../node_modules/axios/lib/helpers/toURLEncodedForm.js","../../../../node_modules/axios/lib/helpers/formDataToJSON.js","../../../../node_modules/axios/lib/core/settle.js","../../../../node_modules/axios/lib/helpers/cookies.js","../../../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../../../node_modules/axios/lib/helpers/combineURLs.js","../../../../node_modules/axios/lib/core/buildFullPath.js","../../../../node_modules/axios/lib/helpers/parseHeaders.js","../../../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../../../node_modules/axios/lib/cancel/CanceledError.js","../../../../node_modules/axios/lib/helpers/parseProtocol.js","../../../../node_modules/axios/lib/adapters/xhr.js","../../../../node_modules/axios/lib/defaults/index.js","../../../../node_modules/axios/lib/core/transformData.js","../../../../node_modules/axios/lib/cancel/isCancel.js","../../../../node_modules/axios/lib/core/dispatchRequest.js","../../../../node_modules/axios/lib/core/mergeConfig.js","../../../../node_modules/axios/lib/env/data.js","../../../../node_modules/axios/lib/helpers/validator.js","../../../../node_modules/axios/lib/core/Axios.js","../../../../node_modules/axios/lib/cancel/CancelToken.js","../../../../node_modules/axios/lib/helpers/spread.js","../../../../node_modules/axios/lib/helpers/isAxiosError.js","../../../../node_modules/axios/lib/axios.js","../../../../node_modules/axios/index.js","../../src/Core/controller/scene/sceneFetcher.ts","../../../../node_modules/lodash/_setCacheAdd.js","../../../../node_modules/lodash/_setCacheHas.js","../../../../node_modules/lodash/_SetCache.js","../../../../node_modules/lodash/_baseFindIndex.js","../../../../node_modules/lodash/_baseIsNaN.js","../../../../node_modules/lodash/_strictIndexOf.js","../../../../node_modules/lodash/_baseIndexOf.js","../../../../node_modules/lodash/_arrayIncludes.js","../../../../node_modules/lodash/_arrayIncludesWith.js","../../../../node_modules/lodash/_cacheHas.js","../../../../node_modules/lodash/noop.js","../../../../node_modules/lodash/_setToArray.js","../../../../node_modules/lodash/_createSet.js","../../../../node_modules/lodash/_baseUniq.js","../../../../node_modules/lodash/uniqWith.js","../../src/Core/util/prefetcher/scenePrefetcher.ts","../../src/Core/controller/scene/callScene.ts","../../src/Core/gameScripts/callSceneScript.ts","../../src/Core/controller/stage/pixi/animations/generateTransformAnimationObj.ts","../../src/Core/controller/stage/pixi/animations/universalSoftIn.ts","../../src/Core/controller/stage/pixi/animations/universalSoftOff.ts","../../src/store/stageInterface.ts","../../../../node_modules/popmotion/node_modules/tslib/tslib.es6.js","../../../../node_modules/hey-listen/dist/hey-listen.es.js","../../../../node_modules/popmotion/dist/es/utils/clamp.mjs","../../../../node_modules/popmotion/dist/es/animations/utils/find-spring.mjs","../../../../node_modules/popmotion/dist/es/animations/generators/spring.mjs","../../../../node_modules/popmotion/dist/es/utils/progress.mjs","../../../../node_modules/popmotion/dist/es/utils/mix.mjs","../../../../node_modules/style-value-types/dist/es/utils.mjs","../../../../node_modules/style-value-types/dist/es/numbers/index.mjs","../../../../node_modules/style-value-types/dist/es/numbers/units.mjs","../../../../node_modules/style-value-types/dist/es/color/utils.mjs","../../../../node_modules/style-value-types/dist/es/color/hsla.mjs","../../../../node_modules/style-value-types/dist/es/color/rgba.mjs","../../../../node_modules/style-value-types/dist/es/color/hex.mjs","../../../../node_modules/style-value-types/dist/es/color/index.mjs","../../../../node_modules/style-value-types/dist/es/complex/index.mjs","../../../../node_modules/popmotion/dist/es/utils/hsla-to-rgba.mjs","../../../../node_modules/popmotion/dist/es/utils/mix-color.mjs","../../../../node_modules/popmotion/dist/es/utils/inc.mjs","../../../../node_modules/popmotion/dist/es/utils/pipe.mjs","../../../../node_modules/popmotion/dist/es/utils/mix-complex.mjs","../../../../node_modules/popmotion/dist/es/utils/interpolate.mjs","../../../../node_modules/popmotion/dist/es/easing/utils.mjs","../../../../node_modules/popmotion/dist/es/easing/index.mjs","../../../../node_modules/popmotion/dist/es/animations/generators/keyframes.mjs","../../../../node_modules/popmotion/dist/es/animations/generators/decay.mjs","../../../../node_modules/popmotion/dist/es/animations/utils/detect-animation-from-options.mjs","../../../../node_modules/framesync/dist/es/on-next-frame.mjs","../../../../node_modules/framesync/dist/es/create-render-step.mjs","../../../../node_modules/framesync/dist/es/index.mjs","../../../../node_modules/popmotion/dist/es/animations/utils/elapsed.mjs","../../../../node_modules/popmotion/dist/es/animations/index.mjs","../../../../node_modules/lodash/_arraySome.js","../../../../node_modules/lodash/_equalArrays.js","../../../../node_modules/lodash/_mapToArray.js","../../../../node_modules/lodash/_equalByTag.js","../../../../node_modules/lodash/_equalObjects.js","../../../../node_modules/lodash/_baseIsEqualDeep.js","../../../../node_modules/lodash/_baseIsEqual.js","../../../../node_modules/lodash/_baseIsMatch.js","../../../../node_modules/lodash/_isStrictComparable.js","../../../../node_modules/lodash/_getMatchData.js","../../../../node_modules/lodash/_matchesStrictComparable.js","../../../../node_modules/lodash/_baseMatches.js","../../../../node_modules/lodash/isSymbol.js","../../../../node_modules/lodash/_isKey.js","../../../../node_modules/lodash/memoize.js","../../../../node_modules/lodash/_memoizeCapped.js","../../../../node_modules/lodash/_stringToPath.js","../../../../node_modules/lodash/_arrayMap.js","../../../../node_modules/lodash/_baseToString.js","../../../../node_modules/lodash/toString.js","../../../../node_modules/lodash/_castPath.js","../../../../node_modules/lodash/_toKey.js","../../../../node_modules/lodash/_baseGet.js","../../../../node_modules/lodash/get.js","../../../../node_modules/lodash/_baseHasIn.js","../../../../node_modules/lodash/_hasPath.js","../../../../node_modules/lodash/hasIn.js","../../../../node_modules/lodash/_baseMatchesProperty.js","../../../../node_modules/lodash/identity.js","../../../../node_modules/lodash/_baseProperty.js","../../../../node_modules/lodash/_basePropertyDeep.js","../../../../node_modules/lodash/property.js","../../../../node_modules/lodash/_baseIteratee.js","../../../../node_modules/lodash/negate.js","../../../../node_modules/lodash/_baseSet.js","../../../../node_modules/lodash/_basePickBy.js","../../../../node_modules/lodash/pickBy.js","../../../../node_modules/lodash/omitBy.js","../../../../node_modules/lodash/isUndefined.js","../../src/Core/controller/stage/pixi/animations/timeline.ts","../../src/Core/Modules/animationFunctions.ts","../../src/Core/gameScripts/changeBg/index.ts","../../src/Core/gameScripts/changeFigure.ts","../../src/Core/controller/scene/changeScene.ts","../../src/Core/gameScripts/changeSceneScript.ts","../../src/Core/gameScripts/label/jmp.ts","../../src/assets/se/page-flip-1.mp3","../../src/assets/se/switch-1.mp3","../../src/assets/se/mouse-enter.mp3","../../src/assets/se/dialog.mp3","../../src/assets/se/click.mp3","../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../../../node_modules/use-sync-external-store/shim/index.js","../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js","../../../../node_modules/use-sync-external-store/shim/with-selector.js","../../../../node_modules/react-redux/es/utils/batch.js","../../../../node_modules/react-redux/es/components/Context.js","../../../../node_modules/react-redux/es/hooks/useReduxContext.js","../../../../node_modules/react-redux/es/utils/useSyncExternalStore.js","../../../../node_modules/react-redux/es/hooks/useSelector.js","../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../../node_modules/react-is/cjs/react-is.production.min.js","../../../../node_modules/react-is/index.js","../../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../../../node_modules/react-redux/node_modules/react-is/cjs/react-is.production.min.js","../../../../node_modules/react-redux/es/utils/Subscription.js","../../../../node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","../../../../node_modules/react-redux/es/components/Provider.js","../../../../node_modules/react-redux/es/hooks/useStore.js","../../../../node_modules/react-redux/es/hooks/useDispatch.js","../../../../node_modules/react-redux/es/index.js","../../src/hooks/useSoundEffect.ts","../../src/hooks/useEscape.ts","../../src/Core/controller/customUI/scss2cssinjsParser.ts","../../src/hooks/useValue.ts","../../../../node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","../../../../node_modules/stylis/src/Enum.js","../../../../node_modules/stylis/src/Utility.js","../../../../node_modules/stylis/src/Tokenizer.js","../../../../node_modules/stylis/src/Parser.js","../../../../node_modules/stylis/src/Serializer.js","../../../../node_modules/stylis/src/Middleware.js","../../../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../../../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../../../node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","../../../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../../../../node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js","../../../../node_modules/@emotion/css/dist/emotion-css.esm.js","../../src/hooks/useApplyStyle.ts","../../src/Core/gameScripts/choose/index.tsx","../../src/Core/gameScripts/comment.ts","../../src/Core/gameScripts/filmMode.ts","../../src/Core/gameScripts/getUserInput/index.tsx","../../src/Core/gameScripts/intro.tsx","../../src/Core/gameScripts/label/index.ts","../../src/Core/gameScripts/miniAvatar.ts","../../src/Core/util/pixiPerformManager/pixiPerformManager.ts","../../src/Core/gameScripts/pixi/index.ts","../../src/Core/gameScripts/playEffect.ts","../../src/Core/gameScripts/playVideo.tsx","../../src/Core/gameScripts/setAnimation.ts","../../src/Core/controller/stage/pixi/animations/testblur.ts","../../src/Core/controller/stage/pixi/animations/index.ts","../../src/Core/gameScripts/setComplexAnimation.ts","../../src/Core/gameScripts/setFilter.ts","../../src/Core/gameScripts/setTempAnimation.ts","../../src/Core/gameScripts/setTextbox.ts","../../src/Core/gameScripts/setTransform.ts","../../src/Core/gameScripts/setTransition.ts","../../src/Core/gameScripts/unlockBgm.ts","../../src/Core/gameScripts/unlockCg.ts","../../src/Core/controller/stage/resetStage.ts","../../src/store/savesReducer.ts","../../src/Core/gameScripts/end.ts","../../src/Core/gameScripts/jumpLabel.ts","../../src/Core/gameScripts/pixi/pixiInit.ts","../../src/Core/gameScripts/vocal/vocalAnimation.ts","../../src/Core/util/match.ts","../../src/Core/gameScripts/vocal/index.ts","../../src/hooks/useTextOptions.ts","../../src/hooks/useFontFamily.ts","../../src/UI/getTextSize.ts","../../src/Stage/TextBox/IMSSTextbox.tsx","../../src/Core/util/constants.ts","../../src/Stage/TextBox/TextBox.tsx","../../src/Core/gameScripts/say.ts","../../../../node_modules/angular-expressions/lib/parse.js","../../../../node_modules/angular-expressions/lib/main.js","../../src/Core/gameScripts/setVar.ts","../../src/Core/gameScripts/showVars.ts","../../src/Core/parser/utils.ts","../../src/Core/gameScripts/applyStyle.ts","../../src/Core/parser/sceneParser.ts","../../src/Core/controller/gamePlay/runScript.ts","../../src/Core/controller/scene/restoreScene.ts","../../src/Core/controller/gamePlay/strIf.ts","../../src/Core/controller/gamePlay/scriptExecutor.ts","../../src/Core/controller/gamePlay/nextSentence.ts","../../src/Core/Modules/perform/performController.ts","../../src/Core/Modules/gamePlay.ts","../../../../node_modules/mitt/dist/mitt.mjs","../../src/Core/Modules/events.ts","../../src/Core/webgalCore.ts","../../src/Core/WebGAL.ts","../../src/Core/controller/storage/storageController.ts","../../src/store/guiInterface.ts","../../src/store/GUIReducer.ts","../../src/store/store.ts","../../src/Core/controller/stage/playBgm.ts","../../src/Core/gameScripts/changeBg/setEbg.ts","../../src/Core/controller/gamePlay/stopAllPerform.ts","../../src/Core/controller/storage/jumpFromBacklog.ts","../../src/Core/controller/storage/loadGame.ts","../../src/Core/controller/storage/savesController.ts","../../src/Core/controller/storage/saveGame.ts","../../src/Core/controller/storage/fastSaveLoad.ts","../../src/Core/controller/gamePlay/startContinueGame.ts","../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../../../node_modules/void-elements/index.js","../../../../node_modules/html-parse-stringify/dist/html-parse-stringify.module.js","../../../../node_modules/react-i18next/dist/es/utils.js","../../../../node_modules/react-i18next/dist/es/unescape.js","../../../../node_modules/react-i18next/dist/es/defaults.js","../../../../node_modules/react-i18next/dist/es/i18nInstance.js","../../../../node_modules/react-i18next/dist/es/TransWithoutContext.js","../../../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../../../node_modules/react-i18next/dist/es/initReactI18next.js","../../../../node_modules/react-i18next/dist/es/context.js","../../../../node_modules/react-i18next/dist/es/Trans.js","../../../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../../../node_modules/react-i18next/dist/es/useTranslation.js","../../src/hooks/useTrans.ts","../../src/hooks/useGenSyncRef.ts","../../src/hooks/useLifeCycle.ts","../../src/Core/controller/gamePlay/autoPlay.ts","../../src/Core/controller/gamePlay/fastSkip.ts","../../../../node_modules/lodash/now.js","../../../../node_modules/lodash/_trimmedEndIndex.js","../../../../node_modules/lodash/_baseTrim.js","../../../../node_modules/lodash/toNumber.js","../../../../node_modules/lodash/debounce.js","../../../../node_modules/lodash/throttle.js","../../src/hooks/useHotkey.tsx","../../src/hooks/useConfigData.ts","../../src/UI/Title/Title.tsx","../../src/UI/Logo/Logo.tsx","../../src/Core/util/coreInitialFunction/infoFetcher.ts","../../src/Core/util/syncWithEditor/syncWithOrigine.ts","../../src/Core/util/coreInitialFunction/bindExtraFunc.ts","../../src/types/debugProtocol.ts","../../src/Core/util/syncWithEditor/webSocketFunc.ts","../../../../node_modules/promise-polyfill/src/finally.js","../../../../node_modules/promise-polyfill/src/allSettled.js","../../../../node_modules/promise-polyfill/src/any.js","../../../../node_modules/promise-polyfill/src/index.js","../../../../node_modules/@pixi/polyfill/dist/esm/polyfill.mjs","../../../../node_modules/@pixi/constants/dist/esm/constants.mjs","../../../../node_modules/@pixi/settings/dist/esm/settings.mjs","../../../../node_modules/eventemitter3/index.js","../../../../node_modules/earcut/src/earcut.js","../../../../node_modules/punycode/punycode.js","../../../../node_modules/es-errors/index.js","../../../../node_modules/es-errors/eval.js","../../../../node_modules/es-errors/range.js","../../../../node_modules/es-errors/ref.js","../../../../node_modules/es-errors/syntax.js","../../../../node_modules/es-errors/type.js","../../../../node_modules/es-errors/uri.js","../../../../node_modules/has-symbols/shams.js","../../../../node_modules/has-symbols/index.js","../../../../node_modules/has-proto/index.js","../../../../node_modules/function-bind/implementation.js","../../../../node_modules/function-bind/index.js","../../../../node_modules/hasown/index.js","../../../../node_modules/get-intrinsic/index.js","../../../../node_modules/es-define-property/index.js","../../../../node_modules/gopd/index.js","../../../../node_modules/define-data-property/index.js","../../../../node_modules/has-property-descriptors/index.js","../../../../node_modules/set-function-length/index.js","../../../../node_modules/call-bind/index.js","../../../../node_modules/call-bind/callBound.js","../../__vite-browser-external","../../../../node_modules/object-inspect/index.js","../../../../node_modules/side-channel/index.js","../../../../node_modules/url/node_modules/qs/lib/formats.js","../../../../node_modules/url/node_modules/qs/lib/utils.js","../../../../node_modules/url/node_modules/qs/lib/stringify.js","../../../../node_modules/url/node_modules/qs/lib/parse.js","../../../../node_modules/url/node_modules/qs/lib/index.js","../../../../node_modules/url/url.js","../../../../node_modules/@pixi/utils/dist/esm/utils.mjs","../../../../node_modules/@pixi/math/dist/esm/math.mjs","../../../../node_modules/@pixi/display/dist/esm/display.mjs","../../../../node_modules/@pixi/extensions/dist/esm/extensions.mjs","../../../../node_modules/@pixi/runner/dist/esm/runner.mjs","../../../../node_modules/@pixi/ticker/dist/esm/ticker.mjs","../../../../node_modules/@pixi/core/dist/esm/core.mjs","../../../../node_modules/@pixi/accessibility/dist/esm/accessibility.mjs","../../../../node_modules/@pixi/interaction/dist/esm/interaction.mjs","../../../../node_modules/@pixi/extract/dist/esm/extract.mjs","../../../../node_modules/@pixi/loaders/dist/esm/loaders.mjs","../../../../node_modules/@pixi/compressed-textures/dist/esm/compressed-textures.mjs","../../../../node_modules/@pixi/particle-container/dist/esm/particle-container.mjs","../../../../node_modules/@pixi/graphics/dist/esm/graphics.mjs","../../../../node_modules/@pixi/sprite/dist/esm/sprite.mjs","../../../../node_modules/@pixi/text/dist/esm/text.mjs","../../../../node_modules/@pixi/prepare/dist/esm/prepare.mjs","../../../../node_modules/@pixi/spritesheet/dist/esm/spritesheet.mjs","../../../../node_modules/@pixi/sprite-tiling/dist/esm/sprite-tiling.mjs","../../../../node_modules/@pixi/mesh/dist/esm/mesh.mjs","../../../../node_modules/@pixi/text-bitmap/dist/esm/text-bitmap.mjs","../../../../node_modules/@pixi/filter-alpha/dist/esm/filter-alpha.mjs","../../../../node_modules/@pixi/filter-blur/dist/esm/filter-blur.mjs","../../../../node_modules/@pixi/filter-color-matrix/dist/esm/filter-color-matrix.mjs","../../../../node_modules/@pixi/filter-displacement/dist/esm/filter-displacement.mjs","../../../../node_modules/@pixi/filter-fxaa/dist/esm/filter-fxaa.mjs","../../../../node_modules/@pixi/filter-noise/dist/esm/filter-noise.mjs","../../../../node_modules/@pixi/mixin-cache-as-bitmap/dist/esm/mixin-cache-as-bitmap.mjs","../../../../node_modules/@pixi/mixin-get-child-by-name/dist/esm/mixin-get-child-by-name.mjs","../../../../node_modules/@pixi/mixin-get-global-position/dist/esm/mixin-get-global-position.mjs","../../../../node_modules/@pixi/app/dist/esm/app.mjs","../../../../node_modules/@pixi/mesh-extras/dist/esm/mesh-extras.mjs","../../../../node_modules/@pixi/sprite-animated/dist/esm/sprite-animated.mjs","../../../../node_modules/pixi.js/dist/esm/pixi.mjs","../../../../node_modules/uuid/dist/esm-browser/rng.js","../../../../node_modules/uuid/dist/esm-browser/stringify.js","../../../../node_modules/uuid/dist/esm-browser/native.js","../../../../node_modules/uuid/dist/esm-browser/v4.js","../../../../node_modules/@pixi/filter-old-film/dist/filter-old-film.esm.mjs","../../../../node_modules/@pixi/filter-dot/dist/filter-dot.esm.mjs","../../../../node_modules/@pixi/filter-reflection/dist/filter-reflection.esm.mjs","../../../../node_modules/@pixi/filter-glitch/dist/filter-glitch.esm.mjs","../../../../node_modules/@pixi/filter-rgb-split/dist/filter-rgb-split.esm.mjs","../../../../node_modules/@pixi/filter-godray/dist/filter-godray.esm.mjs","../../../../node_modules/@pixi/filter-adjustment/dist/filter-adjustment.esm.mjs","../../../../node_modules/@pixi/filter-kawase-blur/dist/filter-kawase-blur.esm.mjs","../../../../node_modules/@pixi/filter-advanced-bloom/dist/filter-advanced-bloom.esm.mjs","../../../../node_modules/@pixi/filter-ascii/dist/filter-ascii.esm.mjs","../../../../node_modules/@pixi/filter-bevel/dist/filter-bevel.esm.mjs","../../../../node_modules/@pixi/filter-bloom/dist/filter-bloom.esm.mjs","../../../../node_modules/@pixi/filter-bulge-pinch/dist/filter-bulge-pinch.esm.mjs","../../../../node_modules/@pixi/filter-color-map/dist/filter-color-map.esm.mjs","../../../../node_modules/@pixi/filter-color-overlay/dist/filter-color-overlay.esm.mjs","../../../../node_modules/@pixi/filter-color-replace/dist/filter-color-replace.esm.mjs","../../../../node_modules/@pixi/filter-convolution/dist/filter-convolution.esm.mjs","../../../../node_modules/@pixi/filter-cross-hatch/dist/filter-cross-hatch.esm.mjs","../../../../node_modules/@pixi/filter-crt/dist/filter-crt.esm.mjs","../../../../node_modules/@pixi/filter-drop-shadow/dist/filter-drop-shadow.esm.mjs","../../../../node_modules/@pixi/filter-emboss/dist/filter-emboss.esm.mjs","../../../../node_modules/@pixi/filter-glow/dist/filter-glow.esm.mjs","../../../../node_modules/@pixi/filter-motion-blur/dist/filter-motion-blur.esm.mjs","../../../../node_modules/@pixi/filter-multi-color-replace/dist/filter-multi-color-replace.esm.mjs","../../../../node_modules/@pixi/filter-outline/dist/filter-outline.esm.mjs","../../../../node_modules/@pixi/filter-pixelate/dist/filter-pixelate.esm.mjs","../../../../node_modules/@pixi/filter-radial-blur/dist/filter-radial-blur.esm.mjs","../../../../node_modules/@pixi/filter-shockwave/dist/filter-shockwave.esm.mjs","../../../../node_modules/@pixi/filter-simple-lightmap/dist/filter-simple-lightmap.esm.mjs","../../../../node_modules/@pixi/filter-tilt-shift/dist/filter-tilt-shift.esm.mjs","../../../../node_modules/@pixi/filter-twist/dist/filter-twist.esm.mjs","../../../../node_modules/@pixi/filter-zoom-blur/dist/filter-zoom-blur.esm.mjs","../../src/Core/controller/stage/pixi/filters/ShockwaveFilter.ts","../../src/Core/controller/stage/pixi/shaders/RadiusAlphaFilter.ts","../../src/Core/controller/stage/pixi/WebGALPixiContainer.ts","../../../../node_modules/@pixi-spine/base/lib/base.es.js","../../../../node_modules/@pixi-spine/loader-base/lib/loader-base.es.js","../../../../node_modules/@pixi-spine/runtime-3.8/lib/runtime-3.8.es.js","../../../../node_modules/@pixi-spine/runtime-3.7/lib/runtime-3.7.es.js","../../../../node_modules/@pixi-spine/runtime-4.1/lib/runtime-4.1.es.js","../../../../node_modules/@pixi-spine/loader-uni/lib/loader-uni.es.js","../../../../node_modules/pixi-spine/lib/all.es.js","../../src/Core/controller/stage/pixi/PixiController.ts","../../src/config/info.ts","../../src/Core/initializeScript.ts","../../../../node_modules/@icon-park/react/es/runtime/index.js","../../../../node_modules/@icon-park/react/es/icons/AlignTextLeftOne.js","../../../../node_modules/@icon-park/react/es/icons/CloseSmall.js","../../../../node_modules/@icon-park/react/es/icons/DoubleDown.js","../../../../node_modules/@icon-park/react/es/icons/DoubleRight.js","../../../../node_modules/@icon-park/react/es/icons/DoubleUp.js","../../../../node_modules/@icon-park/react/es/icons/FolderOpen.js","../../../../node_modules/@icon-park/react/es/icons/GoEnd.js","../../../../node_modules/@icon-park/react/es/icons/GoStart.js","../../../../node_modules/@icon-park/react/es/icons/HamburgerButton.js","../../../../node_modules/@icon-park/react/es/icons/Home.js","../../../../node_modules/@icon-park/react/es/icons/Left.js","../../../../node_modules/@icon-park/react/es/icons/Lock.js","../../../../node_modules/@icon-park/react/es/icons/Logout.js","../../../../node_modules/@icon-park/react/es/icons/MusicList.js","../../../../node_modules/@icon-park/react/es/icons/PlayOne.js","../../../../node_modules/@icon-park/react/es/icons/PreviewCloseOne.js","../../../../node_modules/@icon-park/react/es/icons/PreviewOpen.js","../../../../node_modules/@icon-park/react/es/icons/ReplayMusic.js","../../../../node_modules/@icon-park/react/es/icons/Return.js","../../../../node_modules/@icon-park/react/es/icons/Save.js","../../../../node_modules/@icon-park/react/es/icons/SettingTwo.js","../../../../node_modules/@icon-park/react/es/icons/SquareSmall.js","../../../../node_modules/@icon-park/react/es/icons/Unlock.js","../../../../node_modules/@icon-park/react/es/icons/VolumeNotice.js","../../src/UI/Menu/MenuPanel/MenuIconMap.tsx","../../src/UI/Menu/MenuPanel/MenuPanelButton.tsx","../../src/Core/controller/gamePlay/backToTitle.ts","../../src/UI/GlobalDialog/GlobalDialog.tsx","../../src/UI/Menu/MenuPanel/MenuPanel.tsx","../../src/UI/Menu/SaveAndLoad/Save/Save.tsx","../../src/UI/Menu/SaveAndLoad/Load/Load.tsx","../../src/UI/Menu/Options/NormalOption.tsx","../../src/UI/Menu/Options/NormalButton.tsx","../../src/hooks/useLanguage.ts","../../src/UI/Menu/Options/System/About.tsx","../../src/UI/Menu/Options/System/System.tsx","../../src/UI/Menu/Options/TextPreview/TextPreview.tsx","../../src/UI/Menu/Options/OptionSlider.tsx","../../src/UI/Menu/Options/Display/Display.tsx","../../src/UI/Menu/Options/Sound/Sound.tsx","../../src/UI/Menu/Options/Options.tsx","../../src/UI/Menu/Menu.tsx","../../src/Stage/AudioContainer/AudioContainer.tsx","../../src/Stage/FullScreenPerform/FullScreenPerform.tsx","../../src/Stage/TextBox/TextBoxFilm.tsx","../../src/Stage/MainStage/useSetBg.ts","../../src/Stage/MainStage/useSetFigure.ts","../../src/Stage/MainStage/useSetEffects.ts","../../src/Stage/MainStage/MainStage.tsx","../../src/Stage/introContainer/IntroContainer.tsx","../../src/Stage/Stage.tsx","../../src/UI/BottomControlPanel/BottomControlPanel.tsx","../../src/UI/Backlog/Backlog.tsx","../../src/UI/Extra/ExtraBgm.tsx","../../src/UI/Extra/ExtraCgElement.tsx","../../src/UI/Extra/ExtraCg.tsx","../../src/UI/Extra/Extra.tsx","../../src/UI/BottomControlPanel/BottomControlPanelFilm.tsx","../../src/UI/DevPanel/devFunctions/getPixiSscreenshot.ts","../../src/UI/DevPanel/DevPanel.tsx","../../src/UI/Translation/Translation.tsx","../../src/UI/PanicOverlay/PanicYoozle/PanicYoozle.tsx","../../src/UI/PanicOverlay/PanicOverlay.tsx","../../src/hooks/useFullScreen.ts","../../src/App.tsx","../../../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/inherits.js","../../../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/toArray.js","../../../../node_modules/i18next/dist/esm/i18next.js","../../src/main.tsx"],"sourcesContent":["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/** @license React v17.0.2\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=require(\"object-assign\"),n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;\nif(\"function\"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w(\"react.element\");p=w(\"react.portal\");exports.Fragment=w(\"react.fragment\");exports.StrictMode=w(\"react.strict_mode\");exports.Profiler=w(\"react.profiler\");q=w(\"react.provider\");r=w(\"react.context\");t=w(\"react.forward_ref\");exports.Suspense=w(\"react.suspense\");u=w(\"react.memo\");v=w(\"react.lazy\")}var x=\"function\"===typeof Symbol&&Symbol.iterator;\nfunction y(a){if(null===a||\"object\"!==typeof a)return null;a=x&&a[x]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}function z(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;c<arguments.length;c++)b+=\"&args[]=\"+encodeURIComponent(arguments[c]);return\"Minified React error #\"+a+\"; visit \"+b+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}\nvar A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,\"setState\")};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};\nfunction D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A}var F=E.prototype=new D;F.constructor=E;l(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};\nfunction J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return{$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}\nfunction K(a,b){return{$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\\/+/g;function N(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(\"\"+a.key):b.toString(36)}\nfunction O(a,b,c,e,d){var k=typeof a;if(\"undefined\"===k||\"boolean\"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case \"string\":case \"number\":h=!0;break;case \"object\":switch(a.$$typeof){case n:case p:h=!0}}if(h)return h=a,d=d(h),a=\"\"===e?\".\"+N(h,0):e,Array.isArray(d)?(c=\"\",null!=a&&(c=a.replace(M,\"$&/\")+\"/\"),O(d,b,c,\"\",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?\"\":(\"\"+d.key).replace(M,\"$&/\")+\"/\")+a)),b.push(d)),1;h=0;e=\"\"===e?\".\":e+\":\";if(Array.isArray(a))for(var g=\n0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d)}else if(f=y(a),\"function\"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if(\"object\"===k)throw b=\"\"+a,Error(z(31,\"[object Object]\"===b?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,\"\",\"\",function(a){return b.call(c,a,d++)});return e}\nfunction Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)})}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:l};\nexports.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments)},c)},count:function(a){var b=0;P(a,function(){b++});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};exports.Component=C;exports.PureComponent=E;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;\nexports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=l({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=\"\"+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g}return{$$typeof:n,type:a.type,\nkey:d,ref:k,props:e,_owner:h}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=J;exports.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};exports.forwardRef=function(a){return{$$typeof:t,render:a}};exports.isValidElement=L;\nexports.lazy=function(a){return{$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};exports.memo=function(a,b){return{$$typeof:u,type:a,compare:void 0===b?null:b}};exports.useCallback=function(a,b){return S().useCallback(a,b)};exports.useContext=function(a,b){return S().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return S().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};\nexports.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S().useMemo(a,b)};exports.useReducer=function(a,b,c){return S().useReducer(a,b,c)};exports.useRef=function(a){return S().useRef(a)};exports.useState=function(a){return S().useState(a)};exports.version=\"17.0.2\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n","/** @license React v17.0.2\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';require(\"object-assign\");var f=require(\"react\"),g=60103;exports.Fragment=60107;if(\"function\"===typeof Symbol&&Symbol.for){var h=Symbol.for;g=h(\"react.element\");exports.Fragment=h(\"react.fragment\")}var m=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n=Object.prototype.hasOwnProperty,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,k){var b,d={},e=null,l=null;void 0!==k&&(e=\"\"+k);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(l=a.ref);for(b in a)n.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:g,type:c,key:e,ref:l,props:d,_owner:m.current}}exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","/** @license React v0.20.2\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f,g,h,k;if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}\nif(\"undefined\"===typeof window||\"function\"!==typeof MessageChannel){var t=null,u=null,w=function(){if(null!==t)try{var a=exports.unstable_now();t(!0,a);t=null}catch(b){throw setTimeout(w,0),b;}};f=function(a){null!==t?setTimeout(f,0,a):(t=a,setTimeout(w,0))};g=function(a,b){u=setTimeout(a,b)};h=function(){clearTimeout(u)};exports.unstable_shouldYield=function(){return!1};k=exports.unstable_forceFrameRate=function(){}}else{var x=window.setTimeout,y=window.clearTimeout;if(\"undefined\"!==typeof console){var z=\nwindow.cancelAnimationFrame;\"function\"!==typeof window.requestAnimationFrame&&console.error(\"This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\");\"function\"!==typeof z&&console.error(\"This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\")}var A=!1,B=null,C=-1,D=5,E=0;exports.unstable_shouldYield=function(){return exports.unstable_now()>=\nE};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):D=0<a?Math.floor(1E3/a):5};var F=new MessageChannel,G=F.port2;F.port1.onmessage=function(){if(null!==B){var a=exports.unstable_now();E=a+D;try{B(!0,a)?G.postMessage(null):(A=!1,B=null)}catch(b){throw G.postMessage(null),b;}}else A=!1};f=function(a){B=a;A||(A=!0,G.postMessage(null))};g=function(a,b){C=\nx(function(){a(exports.unstable_now())},b)};h=function(){y(C);C=-1}}function H(a,b){var c=a.length;a.push(b);a:for(;;){var d=c-1>>>1,e=a[d];if(void 0!==e&&0<I(e,b))a[d]=b,a[c]=e,c=d;else break a}}function J(a){a=a[0];return void 0===a?null:a}\nfunction K(a){var b=a[0];if(void 0!==b){var c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length;d<e;){var m=2*(d+1)-1,n=a[m],v=m+1,r=a[v];if(void 0!==n&&0>I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;\nfunction T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M)}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else{var b=J(M);null!==b&&g(U,b.startTime-a)}}\nfunction V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if(\"function\"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?O.callback=e:O===J(L)&&K(L);T(b)}else K(L);O=J(L)}if(null!==O)var m=!0;else{var n=J(M);null!==n&&g(U,n.startTime-b);m=!1}return m}finally{O=null,P=c,Q=!1}}var W=k;exports.unstable_IdlePriority=5;\nexports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V))};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)};\nexports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P}var c=P;P=b;try{return a()}finally{P=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=P;P=a;try{return b()}finally{P=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();\"object\"===typeof c&&null!==c?(c=c.delay,c=\"number\"===typeof c&&0<c?d+c:d):c=d;switch(a){case 1:var e=-1;break;case 2:e=250;break;case 5:e=1073741823;break;case 4:e=1E4;break;default:e=5E3}e=c+e;a={id:N++,callback:b,priorityLevel:a,startTime:c,expirationTime:e,sortIndex:-1};c>d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a};\nexports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/** @license React v17.0.2\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),m=require(\"object-assign\"),r=require(\"scheduler\");function y(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;c<arguments.length;c++)b+=\"&args[]=\"+encodeURIComponent(arguments[c]);return\"Minified React error #\"+a+\"; visit \"+b+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}if(!aa)throw Error(y(227));var ba=new Set,ca={};function da(a,b){ea(a,b);ea(a+\"Capture\",b)}\nfunction ea(a,b){ca[a]=b;for(a=0;a<b.length;a++)ba.add(b[a])}\nvar fa=!(\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement),ha=/^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,ia=Object.prototype.hasOwnProperty,\nja={},ka={};function la(a){if(ia.call(ka,a))return!0;if(ia.call(ja,a))return!1;if(ha.test(a))return ka[a]=!0;ja[a]=!0;return!1}function ma(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case \"function\":case \"symbol\":return!0;case \"boolean\":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return\"data-\"!==a&&\"aria-\"!==a;default:return!1}}\nfunction na(a,b,c,d){if(null===b||\"undefined\"===typeof b||ma(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function B(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var D={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1,!1)});var oa=/[\\-:]([a-z])/g;function pa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(oa,\npa);D[b]=new B(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1,!1)});\nD.xlinkHref=new B(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction qa(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||\"o\"!==b[0]&&\"O\"!==b[0]||\"n\"!==b[1]&&\"N\"!==b[1]?!1:!0;f||(na(b,c,e,d)&&(c=null),d||null===e?la(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,\"\"+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:\"\":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?\"\":\"\"+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}\nvar ra=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sa=60103,ta=60106,ua=60107,wa=60108,xa=60114,ya=60109,za=60110,Aa=60112,Ba=60113,Ca=60120,Da=60115,Ea=60116,Fa=60121,Ga=60128,Ha=60129,Ia=60130,Ja=60131;\nif(\"function\"===typeof Symbol&&Symbol.for){var E=Symbol.for;sa=E(\"react.element\");ta=E(\"react.portal\");ua=E(\"react.fragment\");wa=E(\"react.strict_mode\");xa=E(\"react.profiler\");ya=E(\"react.provider\");za=E(\"react.context\");Aa=E(\"react.forward_ref\");Ba=E(\"react.suspense\");Ca=E(\"react.suspense_list\");Da=E(\"react.memo\");Ea=E(\"react.lazy\");Fa=E(\"react.block\");E(\"react.scope\");Ga=E(\"react.opaque.id\");Ha=E(\"react.debug_trace_mode\");Ia=E(\"react.offscreen\");Ja=E(\"react.legacy_hidden\")}\nvar Ka=\"function\"===typeof Symbol&&Symbol.iterator;function La(a){if(null===a||\"object\"!==typeof a)return null;a=Ka&&a[Ka]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}var Ma;function Na(a){if(void 0===Ma)try{throw Error();}catch(c){var b=c.stack.trim().match(/\\n( *(at )?)/);Ma=b&&b[1]||\"\"}return\"\\n\"+Ma+a}var Oa=!1;\nfunction Pa(a,b){if(!a||Oa)return\"\";Oa=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error();},Object.defineProperty(b.prototype,\"props\",{set:function(){throw Error();}}),\"object\"===typeof Reflect&&Reflect.construct){try{Reflect.construct(b,[])}catch(k){var d=k}Reflect.construct(a,[],b)}else{try{b.call()}catch(k){d=k}a.call(b.prototype)}else{try{throw Error();}catch(k){d=k}a()}}catch(k){if(k&&d&&\"string\"===typeof k.stack){for(var e=k.stack.split(\"\\n\"),\nf=d.stack.split(\"\\n\"),g=e.length-1,h=f.length-1;1<=g&&0<=h&&e[g]!==f[h];)h--;for(;1<=g&&0<=h;g--,h--)if(e[g]!==f[h]){if(1!==g||1!==h){do if(g--,h--,0>h||e[g]!==f[h])return\"\\n\"+e[g].replace(\" at new \",\" at \");while(1<=g&&0<=h)}break}}}finally{Oa=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Na(a):\"\"}\nfunction Qa(a){switch(a.tag){case 5:return Na(a.type);case 16:return Na(\"Lazy\");case 13:return Na(\"Suspense\");case 19:return Na(\"SuspenseList\");case 0:case 2:case 15:return a=Pa(a.type,!1),a;case 11:return a=Pa(a.type.render,!1),a;case 22:return a=Pa(a.type._render,!1),a;case 1:return a=Pa(a.type,!0),a;default:return\"\"}}\nfunction Ra(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ua:return\"Fragment\";case ta:return\"Portal\";case xa:return\"Profiler\";case wa:return\"StrictMode\";case Ba:return\"Suspense\";case Ca:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case za:return(a.displayName||\"Context\")+\".Consumer\";case ya:return(a._context.displayName||\"Context\")+\".Provider\";case Aa:var b=a.render;b=b.displayName||b.name||\"\";\nreturn a.displayName||(\"\"!==b?\"ForwardRef(\"+b+\")\":\"ForwardRef\");case Da:return Ra(a.type);case Fa:return Ra(a._render);case Ea:b=a._payload;a=a._init;try{return Ra(a(b))}catch(c){}}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"object\":case \"string\":case \"undefined\":return a;default:return\"\"}}function Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return m({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function $a(a,b){b=b.checked;null!=b&&qa(a,\"checked\",b,!1)}\nfunction ab(a,b){$a(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?bb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&bb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction cb(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction bb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}function db(a){var b=\"\";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function eb(a,b){a=m({children:void 0},b);if(b=db(b.children))a.children=b;return a}\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b[\"$\"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty(\"$\"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=\"\"+Sa(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}\nfunction gb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(y(91));return m({},b,{value:void 0,defaultValue:void 0,children:\"\"+a._wrapperState.initialValue})}function hb(a,b){var c=b.value;if(null==c){c=b.children;b=b.defaultValue;if(null!=c){if(null!=b)throw Error(y(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(y(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:Sa(c)}}\nfunction ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var kb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction lb(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function mb(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?lb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar nb,ob=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==kb.svg||\"innerHTML\"in a)a.innerHTML=b;else{nb=nb||document.createElement(\"div\");nb.innerHTML=\"<svg>\"+b.valueOf().toString()+\"</svg>\";for(b=nb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction pb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar qb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(qb).forEach(function(a){rb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qb[b]=qb[a]})});function sb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||qb.hasOwnProperty(a)&&qb[a]?(\"\"+b).trim():b+\"px\"}\nfunction tb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=sb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var ub=m({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction vb(a,b){if(b){if(ub[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(y(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(y(60));if(!(\"object\"===typeof b.dangerouslySetInnerHTML&&\"__html\"in b.dangerouslySetInnerHTML))throw Error(y(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(y(62));}}\nfunction wb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(y(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a<b.length;a++)Bb(b[a])}}function Gb(a,b){return a(b)}function Hb(a,b,c,d,e){return a(b,c,d,e)}function Ib(){}var Jb=Gb,Kb=!1,Lb=!1;function Mb(){if(null!==zb||null!==Ab)Ib(),Fb()}\nfunction Nb(a,b,c){if(Lb)return a(b,c);Lb=!0;try{return Jb(a,b,c)}finally{Lb=!1,Mb()}}\nfunction Ob(a,b){var c=a.stateNode;if(null===c)return null;var d=Db(c);if(null===d)return null;c=d[b];a:switch(b){case \"onClick\":case \"onClickCapture\":case \"onDoubleClick\":case \"onDoubleClickCapture\":case \"onMouseDown\":case \"onMouseDownCapture\":case \"onMouseMove\":case \"onMouseMoveCapture\":case \"onMouseUp\":case \"onMouseUpCapture\":case \"onMouseEnter\":(d=!d.disabled)||(a=a.type,d=!(\"button\"===a||\"input\"===a||\"select\"===a||\"textarea\"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&\"function\"!==\ntypeof c)throw Error(y(231,b,typeof c));return c}var Pb=!1;if(fa)try{var Qb={};Object.defineProperty(Qb,\"passive\",{get:function(){Pb=!0}});window.addEventListener(\"test\",Qb,Qb);window.removeEventListener(\"test\",Qb,Qb)}catch(a){Pb=!1}function Rb(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(n){this.onError(n)}}var Sb=!1,Tb=null,Ub=!1,Vb=null,Wb={onError:function(a){Sb=!0;Tb=a}};function Xb(a,b,c,d,e,f,g,h,k){Sb=!1;Tb=null;Rb.apply(Wb,arguments)}\nfunction Yb(a,b,c,d,e,f,g,h,k){Xb.apply(this,arguments);if(Sb){if(Sb){var l=Tb;Sb=!1;Tb=null}else throw Error(y(198));Ub||(Ub=!0,Vb=l)}}function Zb(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.flags&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function $b(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function ac(a){if(Zb(a)!==a)throw Error(y(188));}\nfunction bc(a){var b=a.alternate;if(!b){b=Zb(a);if(null===b)throw Error(y(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return ac(e),a;if(f===d)return ac(e),b;f=f.sibling}throw Error(y(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===\nc){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(y(189));}}if(c.alternate!==d)throw Error(y(190));}if(3!==c.tag)throw Error(y(188));return c.stateNode.current===c?a:b}function cc(a){a=bc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}\nfunction dc(a,b){for(var c=a.alternate;null!==b;){if(b===a||b===c)return!0;b=b.return}return!1}var ec,fc,gc,hc,ic=!1,jc=[],kc=null,lc=null,mc=null,nc=new Map,oc=new Map,pc=[],qc=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit\".split(\" \");\nfunction rc(a,b,c,d,e){return{blockedOn:a,domEventName:b,eventSystemFlags:c|16,nativeEvent:e,targetContainers:[d]}}function sc(a,b){switch(a){case \"focusin\":case \"focusout\":kc=null;break;case \"dragenter\":case \"dragleave\":lc=null;break;case \"mouseover\":case \"mouseout\":mc=null;break;case \"pointerover\":case \"pointerout\":nc.delete(b.pointerId);break;case \"gotpointercapture\":case \"lostpointercapture\":oc.delete(b.pointerId)}}\nfunction tc(a,b,c,d,e,f){if(null===a||a.nativeEvent!==f)return a=rc(b,c,d,e,f),null!==b&&(b=Cb(b),null!==b&&fc(b)),a;a.eventSystemFlags|=d;b=a.targetContainers;null!==e&&-1===b.indexOf(e)&&b.push(e);return a}\nfunction uc(a,b,c,d,e){switch(b){case \"focusin\":return kc=tc(kc,a,b,c,d,e),!0;case \"dragenter\":return lc=tc(lc,a,b,c,d,e),!0;case \"mouseover\":return mc=tc(mc,a,b,c,d,e),!0;case \"pointerover\":var f=e.pointerId;nc.set(f,tc(nc.get(f)||null,a,b,c,d,e));return!0;case \"gotpointercapture\":return f=e.pointerId,oc.set(f,tc(oc.get(f)||null,a,b,c,d,e)),!0}return!1}\nfunction vc(a){var b=wc(a.target);if(null!==b){var c=Zb(b);if(null!==c)if(b=c.tag,13===b){if(b=$b(c),null!==b){a.blockedOn=b;hc(a.lanePriority,function(){r.unstable_runWithPriority(a.priority,function(){gc(c)})});return}}else if(3===b&&c.stateNode.hydrate){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}\nfunction xc(a){if(null!==a.blockedOn)return!1;for(var b=a.targetContainers;0<b.length;){var c=yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null!==c)return b=Cb(c),null!==b&&fc(b),a.blockedOn=c,!1;b.shift()}return!0}function zc(a,b,c){xc(a)&&c.delete(b)}\nfunction Ac(){for(ic=!1;0<jc.length;){var a=jc[0];if(null!==a.blockedOn){a=Cb(a.blockedOn);null!==a&&ec(a);break}for(var b=a.targetContainers;0<b.length;){var c=yc(a.domEventName,a.eventSystemFlags,b[0],a.nativeEvent);if(null!==c){a.blockedOn=c;break}b.shift()}null===a.blockedOn&&jc.shift()}null!==kc&&xc(kc)&&(kc=null);null!==lc&&xc(lc)&&(lc=null);null!==mc&&xc(mc)&&(mc=null);nc.forEach(zc);oc.forEach(zc)}\nfunction Bc(a,b){a.blockedOn===b&&(a.blockedOn=null,ic||(ic=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ac)))}\nfunction Cc(a){function b(b){return Bc(b,a)}if(0<jc.length){Bc(jc[0],a);for(var c=1;c<jc.length;c++){var d=jc[c];d.blockedOn===a&&(d.blockedOn=null)}}null!==kc&&Bc(kc,a);null!==lc&&Bc(lc,a);null!==mc&&Bc(mc,a);nc.forEach(b);oc.forEach(b);for(c=0;c<pc.length;c++)d=pc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<pc.length&&(c=pc[0],null===c.blockedOn);)vc(c),null===c.blockedOn&&pc.shift()}\nfunction Dc(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c[\"Webkit\"+a]=\"webkit\"+b;c[\"Moz\"+a]=\"moz\"+b;return c}var Ec={animationend:Dc(\"Animation\",\"AnimationEnd\"),animationiteration:Dc(\"Animation\",\"AnimationIteration\"),animationstart:Dc(\"Animation\",\"AnimationStart\"),transitionend:Dc(\"Transition\",\"TransitionEnd\")},Fc={},Gc={};\nfa&&(Gc=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete Ec.animationend.animation,delete Ec.animationiteration.animation,delete Ec.animationstart.animation),\"TransitionEvent\"in window||delete Ec.transitionend.transition);function Hc(a){if(Fc[a])return Fc[a];if(!Ec[a])return a;var b=Ec[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Gc)return Fc[a]=b[c];return a}\nvar Ic=Hc(\"animationend\"),Jc=Hc(\"animationiteration\"),Kc=Hc(\"animationstart\"),Lc=Hc(\"transitionend\"),Mc=new Map,Nc=new Map,Oc=[\"abort\",\"abort\",Ic,\"animationEnd\",Jc,\"animationIteration\",Kc,\"animationStart\",\"canplay\",\"canPlay\",\"canplaythrough\",\"canPlayThrough\",\"durationchange\",\"durationChange\",\"emptied\",\"emptied\",\"encrypted\",\"encrypted\",\"ended\",\"ended\",\"error\",\"error\",\"gotpointercapture\",\"gotPointerCapture\",\"load\",\"load\",\"loadeddata\",\"loadedData\",\"loadedmetadata\",\"loadedMetadata\",\"loadstart\",\"loadStart\",\n\"lostpointercapture\",\"lostPointerCapture\",\"playing\",\"playing\",\"progress\",\"progress\",\"seeking\",\"seeking\",\"stalled\",\"stalled\",\"suspend\",\"suspend\",\"timeupdate\",\"timeUpdate\",Lc,\"transitionEnd\",\"waiting\",\"waiting\"];function Pc(a,b){for(var c=0;c<a.length;c+=2){var d=a[c],e=a[c+1];e=\"on\"+(e[0].toUpperCase()+e.slice(1));Nc.set(d,b);Mc.set(d,e);da(e,[d])}}var Qc=r.unstable_now;Qc();var F=8;\nfunction Rc(a){if(0!==(1&a))return F=15,1;if(0!==(2&a))return F=14,2;if(0!==(4&a))return F=13,4;var b=24&a;if(0!==b)return F=12,b;if(0!==(a&32))return F=11,32;b=192&a;if(0!==b)return F=10,b;if(0!==(a&256))return F=9,256;b=3584&a;if(0!==b)return F=8,b;if(0!==(a&4096))return F=7,4096;b=4186112&a;if(0!==b)return F=6,b;b=62914560&a;if(0!==b)return F=5,b;if(a&67108864)return F=4,67108864;if(0!==(a&134217728))return F=3,134217728;b=805306368&a;if(0!==b)return F=2,b;if(0!==(1073741824&a))return F=1,1073741824;\nF=8;return a}function Sc(a){switch(a){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function Tc(a){switch(a){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(y(358,a));}}\nfunction Uc(a,b){var c=a.pendingLanes;if(0===c)return F=0;var d=0,e=0,f=a.expiredLanes,g=a.suspendedLanes,h=a.pingedLanes;if(0!==f)d=f,e=F=15;else if(f=c&134217727,0!==f){var k=f&~g;0!==k?(d=Rc(k),e=F):(h&=f,0!==h&&(d=Rc(h),e=F))}else f=c&~g,0!==f?(d=Rc(f),e=F):0!==h&&(d=Rc(h),e=F);if(0===d)return 0;d=31-Vc(d);d=c&((0>d?0:1<<d)<<1)-1;if(0!==b&&b!==d&&0===(b&g)){Rc(b);if(e<=F)return b;F=e}b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0<b;)c=31-Vc(b),e=1<<c,d|=a[c],b&=~e;return d}\nfunction Wc(a){a=a.pendingLanes&-1073741825;return 0!==a?a:a&1073741824?1073741824:0}function Xc(a,b){switch(a){case 15:return 1;case 14:return 2;case 12:return a=Yc(24&~b),0===a?Xc(10,b):a;case 10:return a=Yc(192&~b),0===a?Xc(8,b):a;case 8:return a=Yc(3584&~b),0===a&&(a=Yc(4186112&~b),0===a&&(a=512)),a;case 2:return b=Yc(805306368&~b),0===b&&(b=268435456),b}throw Error(y(358,a));}function Yc(a){return a&-a}function Zc(a){for(var b=[],c=0;31>c;c++)b.push(a);return b}\nfunction $c(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Vc(b);a[b]=c}var Vc=Math.clz32?Math.clz32:ad,bd=Math.log,cd=Math.LN2;function ad(a){return 0===a?32:31-(bd(a)/cd|0)|0}var dd=r.unstable_UserBlockingPriority,ed=r.unstable_runWithPriority,fd=!0;function gd(a,b,c,d){Kb||Ib();var e=hd,f=Kb;Kb=!0;try{Hb(e,a,b,c,d)}finally{(Kb=f)||Mb()}}function id(a,b,c,d){ed(dd,hd.bind(null,a,b,c,d))}\nfunction hd(a,b,c,d){if(fd){var e;if((e=0===(b&4))&&0<jc.length&&-1<qc.indexOf(a))a=rc(null,a,b,c,d),jc.push(a);else{var f=yc(a,b,c,d);if(null===f)e&&sc(a,d);else{if(e){if(-1<qc.indexOf(a)){a=rc(f,a,b,c,d);jc.push(a);return}if(uc(f,a,b,c,d))return;sc(a,d)}jd(a,b,d,null,c)}}}}\nfunction yc(a,b,c,d){var e=xb(d);e=wc(e);if(null!==e){var f=Zb(e);if(null===f)e=null;else{var g=f.tag;if(13===g){e=$b(f);if(null!==e)return e;e=null}else if(3===g){if(f.stateNode.hydrate)return 3===f.tag?f.stateNode.containerInfo:null;e=null}else f!==e&&(e=null)}}jd(a,b,d,e,c);return null}var kd=null,ld=null,md=null;\nfunction nd(){if(md)return md;var a,b=ld,c=b.length,d,e=\"value\"in kd?kd.value:kd.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return md=e.slice(a,1<d?1-d:void 0)}function od(a){var b=a.keyCode;\"charCode\"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}function pd(){return!0}function qd(){return!1}\nfunction rd(a){function b(b,d,e,f,g){this._reactName=b;this._targetInst=e;this.type=d;this.nativeEvent=f;this.target=g;this.currentTarget=null;for(var c in a)a.hasOwnProperty(c)&&(b=a[c],this[c]=b?b(f):f[c]);this.isDefaultPrevented=(null!=f.defaultPrevented?f.defaultPrevented:!1===f.returnValue)?pd:qd;this.isPropagationStopped=qd;return this}m(b.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():\"unknown\"!==typeof a.returnValue&&\n(a.returnValue=!1),this.isDefaultPrevented=pd)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():\"unknown\"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=pd)},persist:function(){},isPersistent:pd});return b}\nvar sd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},td=rd(sd),ud=m({},sd,{view:0,detail:0}),vd=rd(ud),wd,xd,yd,Ad=m({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zd,button:0,buttons:0,relatedTarget:function(a){return void 0===a.relatedTarget?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){if(\"movementX\"in\na)return a.movementX;a!==yd&&(yd&&\"mousemove\"===a.type?(wd=a.screenX-yd.screenX,xd=a.screenY-yd.screenY):xd=wd=0,yd=a);return wd},movementY:function(a){return\"movementY\"in a?a.movementY:xd}}),Bd=rd(Ad),Cd=m({},Ad,{dataTransfer:0}),Dd=rd(Cd),Ed=m({},ud,{relatedTarget:0}),Fd=rd(Ed),Gd=m({},sd,{animationName:0,elapsedTime:0,pseudoElement:0}),Hd=rd(Gd),Id=m({},sd,{clipboardData:function(a){return\"clipboardData\"in a?a.clipboardData:window.clipboardData}}),Jd=rd(Id),Kd=m({},sd,{data:0}),Ld=rd(Kd),Md={Esc:\"Escape\",\nSpacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},Nd={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",\n119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},Od={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function Pd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=Od[a])?!!b[a]:!1}function zd(){return Pd}\nvar Qd=m({},ud,{key:function(a){if(a.key){var b=Md[a.key]||a.key;if(\"Unidentified\"!==b)return b}return\"keypress\"===a.type?(a=od(a),13===a?\"Enter\":String.fromCharCode(a)):\"keydown\"===a.type||\"keyup\"===a.type?Nd[a.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zd,charCode:function(a){return\"keypress\"===a.type?od(a):0},keyCode:function(a){return\"keydown\"===a.type||\"keyup\"===a.type?a.keyCode:0},which:function(a){return\"keypress\"===\na.type?od(a):\"keydown\"===a.type||\"keyup\"===a.type?a.keyCode:0}}),Rd=rd(Qd),Sd=m({},Ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Td=rd(Sd),Ud=m({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zd}),Vd=rd(Ud),Wd=m({},sd,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xd=rd(Wd),Yd=m({},Ad,{deltaX:function(a){return\"deltaX\"in a?a.deltaX:\"wheelDeltaX\"in a?-a.wheelDeltaX:0},\ndeltaY:function(a){return\"deltaY\"in a?a.deltaY:\"wheelDeltaY\"in a?-a.wheelDeltaY:\"wheelDelta\"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Zd=rd(Yd),$d=[9,13,27,32],ae=fa&&\"CompositionEvent\"in window,be=null;fa&&\"documentMode\"in document&&(be=document.documentMode);var ce=fa&&\"TextEvent\"in window&&!be,de=fa&&(!ae||be&&8<be&&11>=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case \"compositionend\":return de&&\"ko\"!==b.locale?null:b.data;default:return null}}\nvar le={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return\"input\"===b?!!le[a.type]:\"textarea\"===b?!0:!1}function ne(a,b,c,d){Eb(d);b=oe(b,\"onChange\");0<b.length&&(c=new td(\"onChange\",\"change\",null,c,d),a.push({event:c,listeners:b}))}var pe=null,qe=null;function re(a){se(a,0)}function te(a){var b=ue(a);if(Wa(b))return a}\nfunction ve(a,b){if(\"change\"===a)return b}var we=!1;if(fa){var xe;if(fa){var ye=\"oninput\"in document;if(!ye){var ze=document.createElement(\"div\");ze.setAttribute(\"oninput\",\"return;\");ye=\"function\"===typeof ze.oninput}xe=ye}else xe=!1;we=xe&&(!document.documentMode||9<document.documentMode)}function Ae(){pe&&(pe.detachEvent(\"onpropertychange\",Be),qe=pe=null)}function Be(a){if(\"value\"===a.propertyName&&te(qe)){var b=[];ne(b,qe,a,xb(a));a=re;if(Kb)a(b);else{Kb=!0;try{Gb(a,b)}finally{Kb=!1,Mb()}}}}\nfunction Ce(a,b,c){\"focusin\"===a?(Ae(),pe=b,qe=c,pe.attachEvent(\"onpropertychange\",Be)):\"focusout\"===a&&Ae()}function De(a){if(\"selectionchange\"===a||\"keyup\"===a||\"keydown\"===a)return te(qe)}function Ee(a,b){if(\"click\"===a)return te(b)}function Fe(a,b){if(\"input\"===a||\"change\"===a)return te(b)}function Ge(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var He=\"function\"===typeof Object.is?Object.is:Ge,Ie=Object.prototype.hasOwnProperty;\nfunction Je(a,b){if(He(a,b))return!0;if(\"object\"!==typeof a||null===a||\"object\"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!Ie.call(b,c[d])||!He(a[c[d]],b[c[d]]))return!1;return!0}function Ke(a){for(;a&&a.firstChild;)a=a.firstChild;return a}\nfunction Le(a,b){var c=Ke(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Ke(c)}}function Me(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Me(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Ne(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Oe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nvar Pe=fa&&\"documentMode\"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Oe(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Je(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0<d.length&&(b=new td(\"onSelect\",\"select\",null,b,c),a.push({event:b,listeners:d}),b.target=Qe)))}\nPc(\"cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange\".split(\" \"),\n0);Pc(\"drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel\".split(\" \"),1);Pc(Oc,2);for(var Ve=\"change selectionchange textInput compositionstart compositionend compositionupdate\".split(\" \"),We=0;We<Ve.length;We++)Nc.set(Ve[We],0);ea(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]);\nea(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]);ea(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]);ea(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]);da(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \"));da(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \"));da(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]);da(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \"));\nda(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \"));da(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var Xe=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),Ye=new Set(\"cancel close invalid load scroll toggle\".split(\" \").concat(Xe));\nfunction Ze(a,b,c){var d=a.type||\"unknown-event\";a.currentTarget=c;Yb(d,b,void 0,a);a.currentTarget=null}\nfunction se(a,b){b=0!==(b&4);for(var c=0;c<a.length;c++){var d=a[c],e=d.event;d=d.listeners;a:{var f=void 0;if(b)for(var g=d.length-1;0<=g;g--){var h=d[g],k=h.instance,l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;Ze(e,h,l);f=k}else for(g=0;g<d.length;g++){h=d[g];k=h.instance;l=h.currentTarget;h=h.listener;if(k!==f&&e.isPropagationStopped())break a;Ze(e,h,l);f=k}}}if(Ub)throw a=Vb,Ub=!1,Vb=null,a;}\nfunction G(a,b){var c=$e(b),d=a+\"__bubble\";c.has(d)||(af(b,a,2,!1),c.add(d))}var bf=\"_reactListening\"+Math.random().toString(36).slice(2);function cf(a){a[bf]||(a[bf]=!0,ba.forEach(function(b){Ye.has(b)||df(b,!1,a,null);df(b,!0,a,null)}))}\nfunction df(a,b,c,d){var e=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,f=c;\"selectionchange\"===a&&9!==c.nodeType&&(f=c.ownerDocument);if(null!==d&&!b&&Ye.has(a)){if(\"scroll\"!==a)return;e|=2;f=d}var g=$e(f),h=a+\"__\"+(b?\"capture\":\"bubble\");g.has(h)||(b&&(e|=4),af(f,a,e,b),g.add(h))}\nfunction af(a,b,c,d){var e=Nc.get(b);switch(void 0===e?2:e){case 0:e=gd;break;case 1:e=id;break;default:e=hd}c=e.bind(null,b,c,a);e=void 0;!Pb||\"touchstart\"!==b&&\"touchmove\"!==b&&\"wheel\"!==b||(e=!0);d?void 0!==e?a.addEventListener(b,c,{capture:!0,passive:e}):a.addEventListener(b,c,!0):void 0!==e?a.addEventListener(b,c,{passive:e}):a.addEventListener(b,c,!1)}\nfunction jd(a,b,c,d,e){var f=d;if(0===(b&1)&&0===(b&2)&&null!==d)a:for(;;){if(null===d)return;var g=d.tag;if(3===g||4===g){var h=d.stateNode.containerInfo;if(h===e||8===h.nodeType&&h.parentNode===e)break;if(4===g)for(g=d.return;null!==g;){var k=g.tag;if(3===k||4===k)if(k=g.stateNode.containerInfo,k===e||8===k.nodeType&&k.parentNode===e)return;g=g.return}for(;null!==h;){g=wc(h);if(null===g)return;k=g.tag;if(5===k||6===k){d=f=g;continue a}h=h.parentNode}}d=d.return}Nb(function(){var d=f,e=xb(c),g=[];\na:{var h=Mc.get(a);if(void 0!==h){var k=td,x=a;switch(a){case \"keypress\":if(0===od(c))break a;case \"keydown\":case \"keyup\":k=Rd;break;case \"focusin\":x=\"focus\";k=Fd;break;case \"focusout\":x=\"blur\";k=Fd;break;case \"beforeblur\":case \"afterblur\":k=Fd;break;case \"click\":if(2===c.button)break a;case \"auxclick\":case \"dblclick\":case \"mousedown\":case \"mousemove\":case \"mouseup\":case \"mouseout\":case \"mouseover\":case \"contextmenu\":k=Bd;break;case \"drag\":case \"dragend\":case \"dragenter\":case \"dragexit\":case \"dragleave\":case \"dragover\":case \"dragstart\":case \"drop\":k=\nDd;break;case \"touchcancel\":case \"touchend\":case \"touchmove\":case \"touchstart\":k=Vd;break;case Ic:case Jc:case Kc:k=Hd;break;case Lc:k=Xd;break;case \"scroll\":k=vd;break;case \"wheel\":k=Zd;break;case \"copy\":case \"cut\":case \"paste\":k=Jd;break;case \"gotpointercapture\":case \"lostpointercapture\":case \"pointercancel\":case \"pointerdown\":case \"pointermove\":case \"pointerout\":case \"pointerover\":case \"pointerup\":k=Td}var w=0!==(b&4),z=!w&&\"scroll\"===a,u=w?null!==h?h+\"Capture\":null:h;w=[];for(var t=d,q;null!==\nt;){q=t;var v=q.stateNode;5===q.tag&&null!==v&&(q=v,null!==u&&(v=Ob(t,u),null!=v&&w.push(ef(t,v,q))));if(z)break;t=t.return}0<w.length&&(h=new k(h,x,null,c,e),g.push({event:h,listeners:w}))}}if(0===(b&7)){a:{h=\"mouseover\"===a||\"pointerover\"===a;k=\"mouseout\"===a||\"pointerout\"===a;if(h&&0===(b&16)&&(x=c.relatedTarget||c.fromElement)&&(wc(x)||x[ff]))break a;if(k||h){h=e.window===e?e:(h=e.ownerDocument)?h.defaultView||h.parentWindow:window;if(k){if(x=c.relatedTarget||c.toElement,k=d,x=x?wc(x):null,null!==\nx&&(z=Zb(x),x!==z||5!==x.tag&&6!==x.tag))x=null}else k=null,x=d;if(k!==x){w=Bd;v=\"onMouseLeave\";u=\"onMouseEnter\";t=\"mouse\";if(\"pointerout\"===a||\"pointerover\"===a)w=Td,v=\"onPointerLeave\",u=\"onPointerEnter\",t=\"pointer\";z=null==k?h:ue(k);q=null==x?h:ue(x);h=new w(v,t+\"leave\",k,c,e);h.target=z;h.relatedTarget=q;v=null;wc(e)===d&&(w=new w(u,t+\"enter\",x,c,e),w.target=q,w.relatedTarget=z,v=w);z=v;if(k&&x)b:{w=k;u=x;t=0;for(q=w;q;q=gf(q))t++;q=0;for(v=u;v;v=gf(v))q++;for(;0<t-q;)w=gf(w),t--;for(;0<q-t;)u=\ngf(u),q--;for(;t--;){if(w===u||null!==u&&w===u.alternate)break b;w=gf(w);u=gf(u)}w=null}else w=null;null!==k&&hf(g,h,k,w,!1);null!==x&&null!==z&&hf(g,z,x,w,!0)}}}a:{h=d?ue(d):window;k=h.nodeName&&h.nodeName.toLowerCase();if(\"select\"===k||\"input\"===k&&\"file\"===h.type)var J=ve;else if(me(h))if(we)J=Fe;else{J=De;var K=Ce}else(k=h.nodeName)&&\"input\"===k.toLowerCase()&&(\"checkbox\"===h.type||\"radio\"===h.type)&&(J=Ee);if(J&&(J=J(a,d))){ne(g,J,c,e);break a}K&&K(a,h,d);\"focusout\"===a&&(K=h._wrapperState)&&\nK.controlled&&\"number\"===h.type&&bb(h,\"number\",h.value)}K=d?ue(d):window;switch(a){case \"focusin\":if(me(K)||\"true\"===K.contentEditable)Qe=K,Re=d,Se=null;break;case \"focusout\":Se=Re=Qe=null;break;case \"mousedown\":Te=!0;break;case \"contextmenu\":case \"mouseup\":case \"dragend\":Te=!1;Ue(g,c,e);break;case \"selectionchange\":if(Pe)break;case \"keydown\":case \"keyup\":Ue(g,c,e)}var Q;if(ae)b:{switch(a){case \"compositionstart\":var L=\"onCompositionStart\";break b;case \"compositionend\":L=\"onCompositionEnd\";break b;\ncase \"compositionupdate\":L=\"onCompositionUpdate\";break b}L=void 0}else ie?ge(a,c)&&(L=\"onCompositionEnd\"):\"keydown\"===a&&229===c.keyCode&&(L=\"onCompositionStart\");L&&(de&&\"ko\"!==c.locale&&(ie||\"onCompositionStart\"!==L?\"onCompositionEnd\"===L&&ie&&(Q=nd()):(kd=e,ld=\"value\"in kd?kd.value:kd.textContent,ie=!0)),K=oe(d,L),0<K.length&&(L=new Ld(L,a,null,c,e),g.push({event:L,listeners:K}),Q?L.data=Q:(Q=he(c),null!==Q&&(L.data=Q))));if(Q=ce?je(a,c):ke(a,c))d=oe(d,\"onBeforeInput\"),0<d.length&&(e=new Ld(\"onBeforeInput\",\n\"beforeinput\",null,c,e),g.push({event:e,listeners:d}),e.data=Q)}se(g,b)})}function ef(a,b,c){return{instance:a,listener:b,currentTarget:c}}function oe(a,b){for(var c=b+\"Capture\",d=[];null!==a;){var e=a,f=e.stateNode;5===e.tag&&null!==f&&(e=f,f=Ob(a,c),null!=f&&d.unshift(ef(a,f,e)),f=Ob(a,b),null!=f&&d.push(ef(a,f,e)));a=a.return}return d}function gf(a){if(null===a)return null;do a=a.return;while(a&&5!==a.tag);return a?a:null}\nfunction hf(a,b,c,d,e){for(var f=b._reactName,g=[];null!==c&&c!==d;){var h=c,k=h.alternate,l=h.stateNode;if(null!==k&&k===d)break;5===h.tag&&null!==l&&(h=l,e?(k=Ob(c,f),null!=k&&g.unshift(ef(c,k,h))):e||(k=Ob(c,f),null!=k&&g.push(ef(c,k,h))));c=c.return}0!==g.length&&a.push({event:b,listeners:g})}function jf(){}var kf=null,lf=null;function mf(a,b){switch(a){case \"button\":case \"input\":case \"select\":case \"textarea\":return!!b.autoFocus}return!1}\nfunction nf(a,b){return\"textarea\"===a||\"option\"===a||\"noscript\"===a||\"string\"===typeof b.children||\"number\"===typeof b.children||\"object\"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var of=\"function\"===typeof setTimeout?setTimeout:void 0,pf=\"function\"===typeof clearTimeout?clearTimeout:void 0;function qf(a){1===a.nodeType?a.textContent=\"\":9===a.nodeType&&(a=a.body,null!=a&&(a.textContent=\"\"))}\nfunction rf(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}function sf(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(\"$\"===c||\"$!\"===c||\"$?\"===c){if(0===b)return a;b--}else\"/$\"===c&&b++}a=a.previousSibling}return null}var tf=0;function uf(a){return{$$typeof:Ga,toString:a,valueOf:a}}var vf=Math.random().toString(36).slice(2),wf=\"__reactFiber$\"+vf,xf=\"__reactProps$\"+vf,ff=\"__reactContainer$\"+vf,yf=\"__reactEvents$\"+vf;\nfunction wc(a){var b=a[wf];if(b)return b;for(var c=a.parentNode;c;){if(b=c[ff]||c[wf]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=sf(a);null!==a;){if(c=a[wf])return c;a=sf(a)}return b}a=c;c=a.parentNode}return null}function Cb(a){a=a[wf]||a[ff];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function ue(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(y(33));}function Db(a){return a[xf]||null}\nfunction $e(a){var b=a[yf];void 0===b&&(b=a[yf]=new Set);return b}var zf=[],Af=-1;function Bf(a){return{current:a}}function H(a){0>Af||(a.current=zf[Af],zf[Af]=null,Af--)}function I(a,b){Af++;zf[Af]=a.current;a.current=b}var Cf={},M=Bf(Cf),N=Bf(!1),Df=Cf;\nfunction Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ff(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Gf(){H(N);H(M)}function Hf(a,b,c){if(M.current!==Cf)throw Error(y(168));I(M,b);I(N,c)}\nfunction If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(y(108,Ra(b)||\"Unknown\",e));return m({},c,d)}function Jf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Cf;Df=M.current;I(M,a);I(N,N.current);return!0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(y(169));c?(a=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=a,H(N),H(M),I(M,a)):H(N);I(N,c)}\nvar Lf=null,Mf=null,Nf=r.unstable_runWithPriority,Of=r.unstable_scheduleCallback,Pf=r.unstable_cancelCallback,Qf=r.unstable_shouldYield,Rf=r.unstable_requestPaint,Sf=r.unstable_now,Tf=r.unstable_getCurrentPriorityLevel,Uf=r.unstable_ImmediatePriority,Vf=r.unstable_UserBlockingPriority,Wf=r.unstable_NormalPriority,Xf=r.unstable_LowPriority,Yf=r.unstable_IdlePriority,Zf={},$f=void 0!==Rf?Rf:function(){},ag=null,bg=null,cg=!1,dg=Sf(),O=1E4>dg?Sf:function(){return Sf()-dg};\nfunction eg(){switch(Tf()){case Uf:return 99;case Vf:return 98;case Wf:return 97;case Xf:return 96;case Yf:return 95;default:throw Error(y(332));}}function fg(a){switch(a){case 99:return Uf;case 98:return Vf;case 97:return Wf;case 96:return Xf;case 95:return Yf;default:throw Error(y(332));}}function gg(a,b){a=fg(a);return Nf(a,b)}function hg(a,b,c){a=fg(a);return Of(a,b,c)}function ig(){if(null!==bg){var a=bg;bg=null;Pf(a)}jg()}\nfunction jg(){if(!cg&&null!==ag){cg=!0;var a=0;try{var b=ag;gg(99,function(){for(;a<b.length;a++){var c=b[a];do c=c(!0);while(null!==c)}});ag=null}catch(c){throw null!==ag&&(ag=ag.slice(a+1)),Of(Uf,ig),c;}finally{cg=!1}}}var kg=ra.ReactCurrentBatchConfig;function lg(a,b){if(a&&a.defaultProps){b=m({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}var mg=Bf(null),ng=null,og=null,pg=null;function qg(){pg=og=ng=null}\nfunction rg(a){var b=mg.current;H(mg);a.type._context._currentValue=b}function sg(a,b){for(;null!==a;){var c=a.alternate;if((a.childLanes&b)===b)if(null===c||(c.childLanes&b)===b)break;else c.childLanes|=b;else a.childLanes|=b,null!==c&&(c.childLanes|=b);a=a.return}}function tg(a,b){ng=a;pg=og=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(ug=!0),a.firstContext=null)}\nfunction vg(a,b){if(pg!==a&&!1!==b&&0!==b){if(\"number\"!==typeof b||1073741823===b)pg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===og){if(null===ng)throw Error(y(308));og=b;ng.dependencies={lanes:0,firstContext:b,responders:null}}else og=og.next=b}return a._currentValue}var wg=!1;function xg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}\nfunction yg(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function zg(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}function Ag(a,b){a=a.updateQueue;if(null!==a){a=a.shared;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}}\nfunction Bg(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b}\nfunction Cg(a,b,c,d){var e=a.updateQueue;wg=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var n=a.alternate;if(null!==n){n=n.updateQueue;var A=n.lastBaseUpdate;A!==g&&(null===A?n.firstBaseUpdate=l:A.next=l,n.lastBaseUpdate=k)}}if(null!==f){A=e.baseState;g=0;n=l=k=null;do{h=f.lane;var p=f.eventTime;if((d&h)===h){null!==n&&(n=n.next={eventTime:p,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,\nnext:null});a:{var C=a,x=f;h=b;p=c;switch(x.tag){case 1:C=x.payload;if(\"function\"===typeof C){A=C.call(p,A,h);break a}A=C;break a;case 3:C.flags=C.flags&-4097|64;case 0:C=x.payload;h=\"function\"===typeof C?C.call(p,A,h):C;if(null===h||void 0===h)break a;A=m({},A,h);break a;case 2:wg=!0}}null!==f.callback&&(a.flags|=32,h=e.effects,null===h?e.effects=[f]:h.push(f))}else p={eventTime:p,lane:h,tag:f.tag,payload:f.payload,callback:f.callback,next:null},null===n?(l=n=p,k=A):n=n.next=p,g|=h;f=f.next;if(null===\nf)if(h=e.shared.pending,null===h)break;else f=h.next,h.next=null,e.lastBaseUpdate=h,e.shared.pending=null}while(1);null===n&&(k=A);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=n;Dg|=g;a.lanes=g;a.memoizedState=A}}function Eg(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;b<a.length;b++){var d=a[b],e=d.callback;if(null!==e){d.callback=null;d=c;if(\"function\"!==typeof e)throw Error(y(191,e));e.call(d)}}}var Fg=(new aa.Component).refs;\nfunction Gg(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:m({},b,c);a.memoizedState=c;0===a.lanes&&(a.updateQueue.baseState=c)}\nvar Kg={isMounted:function(a){return(a=a._reactInternals)?Zb(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternals;var d=Hg(),e=Ig(a),f=zg(d,e);f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ag(a,f);Jg(a,e,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternals;var d=Hg(),e=Ig(a),f=zg(d,e);f.tag=1;f.payload=b;void 0!==c&&null!==c&&(f.callback=c);Ag(a,f);Jg(a,e,d)},enqueueForceUpdate:function(a,b){a=a._reactInternals;var c=Hg(),d=Ig(a),e=zg(c,d);e.tag=2;void 0!==b&&null!==b&&(e.callback=\nb);Ag(a,e);Jg(a,d,c)}};function Lg(a,b,c,d,e,f,g){a=a.stateNode;return\"function\"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!Je(c,d)||!Je(e,f):!0}\nfunction Mg(a,b,c){var d=!1,e=Cf;var f=b.contextType;\"object\"===typeof f&&null!==f?f=vg(f):(e=Ff(b)?Df:M.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Ef(a,e):Cf);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Kg;a.stateNode=b;b._reactInternals=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}\nfunction Ng(a,b,c,d){a=b.state;\"function\"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);\"function\"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Kg.enqueueReplaceState(b,b.state,null)}\nfunction Og(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=Fg;xg(a);var f=b.contextType;\"object\"===typeof f&&null!==f?e.context=vg(f):(f=Ff(b)?Df:M.current,e.context=Ef(a,f));Cg(a,c,e,d);e.state=a.memoizedState;f=b.getDerivedStateFromProps;\"function\"===typeof f&&(Gg(a,b,f,c),e.state=a.memoizedState);\"function\"===typeof b.getDerivedStateFromProps||\"function\"===typeof e.getSnapshotBeforeUpdate||\"function\"!==typeof e.UNSAFE_componentWillMount&&\"function\"!==typeof e.componentWillMount||\n(b=e.state,\"function\"===typeof e.componentWillMount&&e.componentWillMount(),\"function\"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Kg.enqueueReplaceState(e,e.state,null),Cg(a,c,e,d),e.state=a.memoizedState);\"function\"===typeof e.componentDidMount&&(a.flags|=4)}var Pg=Array.isArray;\nfunction Qg(a,b,c){a=c.ref;if(null!==a&&\"function\"!==typeof a&&\"object\"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(y(309));var d=c.stateNode}if(!d)throw Error(y(147,a));var e=\"\"+a;if(null!==b&&null!==b.ref&&\"function\"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===Fg&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}if(\"string\"!==typeof a)throw Error(y(284));if(!c._owner)throw Error(y(290,a));}return a}\nfunction Rg(a,b){if(\"textarea\"!==a.type)throw Error(y(31,\"[object Object]\"===Object.prototype.toString.call(b)?\"object with keys {\"+Object.keys(b).join(\", \")+\"}\":b));}\nfunction Sg(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.flags=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b){a=Tg(a,b);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.flags=2,\nc):d;b.flags=2;return c}function g(b){a&&null===b.alternate&&(b.flags=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=Ug(c,a.mode,d),b.return=a,b;b=e(b,c);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props),d.ref=Qg(a,b,c),d.return=a,d;d=Vg(c.type,c.key,c.props,null,a.mode,d);d.ref=Qg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==c.implementation)return b=\nWg(c,a.mode,d),b.return=a,b;b=e(b,c.children||[]);b.return=a;return b}function n(a,b,c,d,f){if(null===b||7!==b.tag)return b=Xg(c,a.mode,d,f),b.return=a,b;b=e(b,c);b.return=a;return b}function A(a,b,c){if(\"string\"===typeof b||\"number\"===typeof b)return b=Ug(\"\"+b,a.mode,c),b.return=a,b;if(\"object\"===typeof b&&null!==b){switch(b.$$typeof){case sa:return c=Vg(b.type,b.key,b.props,null,a.mode,c),c.ref=Qg(a,null,b),c.return=a,c;case ta:return b=Wg(b,a.mode,c),b.return=a,b}if(Pg(b)||La(b))return b=Xg(b,\na.mode,c,null),b.return=a,b;Rg(a,b)}return null}function p(a,b,c,d){var e=null!==b?b.key:null;if(\"string\"===typeof c||\"number\"===typeof c)return null!==e?null:h(a,b,\"\"+c,d);if(\"object\"===typeof c&&null!==c){switch(c.$$typeof){case sa:return c.key===e?c.type===ua?n(a,b,c.props.children,d,e):k(a,b,c,d):null;case ta:return c.key===e?l(a,b,c,d):null}if(Pg(c)||La(c))return null!==e?null:n(a,b,c,d,null);Rg(a,c)}return null}function C(a,b,c,d,e){if(\"string\"===typeof d||\"number\"===typeof d)return a=a.get(c)||\nnull,h(b,a,\"\"+d,e);if(\"object\"===typeof d&&null!==d){switch(d.$$typeof){case sa:return a=a.get(null===d.key?c:d.key)||null,d.type===ua?n(b,a,d.props.children,e,d.key):k(b,a,d,e);case ta:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(Pg(d)||La(d))return a=a.get(c)||null,n(b,a,d,e,null);Rg(b,d)}return null}function x(e,g,h,k){for(var l=null,t=null,u=g,z=g=0,q=null;null!==u&&z<h.length;z++){u.index>z?(q=u,u=null):q=u.sibling;var n=p(e,u,h[z],k);if(null===n){null===u&&(u=q);break}a&&u&&null===\nn.alternate&&b(e,u);g=f(n,g,z);null===t?l=n:t.sibling=n;t=n;u=q}if(z===h.length)return c(e,u),l;if(null===u){for(;z<h.length;z++)u=A(e,h[z],k),null!==u&&(g=f(u,g,z),null===t?l=u:t.sibling=u,t=u);return l}for(u=d(e,u);z<h.length;z++)q=C(u,e,z,h[z],k),null!==q&&(a&&null!==q.alternate&&u.delete(null===q.key?z:q.key),g=f(q,g,z),null===t?l=q:t.sibling=q,t=q);a&&u.forEach(function(a){return b(e,a)});return l}function w(e,g,h,k){var l=La(h);if(\"function\"!==typeof l)throw Error(y(150));h=l.call(h);if(null==\nh)throw Error(y(151));for(var t=l=null,u=g,z=g=0,q=null,n=h.next();null!==u&&!n.done;z++,n=h.next()){u.index>z?(q=u,u=null):q=u.sibling;var w=p(e,u,n.value,k);if(null===w){null===u&&(u=q);break}a&&u&&null===w.alternate&&b(e,u);g=f(w,g,z);null===t?l=w:t.sibling=w;t=w;u=q}if(n.done)return c(e,u),l;if(null===u){for(;!n.done;z++,n=h.next())n=A(e,n.value,k),null!==n&&(g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);return l}for(u=d(e,u);!n.done;z++,n=h.next())n=C(u,e,z,n.value,k),null!==n&&(a&&null!==n.alternate&&\nu.delete(null===n.key?z:n.key),g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ua&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case sa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ua){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,k.sibling);\nd=e(k,f.props);d.ref=Qg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ua?(d=Xg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Vg(f.type,f.key,f.props,null,a.mode,h),h.ref=Qg(a,d,f),h.return=a,a=h)}return g(a);case ta:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=\nWg(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ug(f,a.mode,h),d.return=a,a=d),g(a);if(Pg(f))return x(a,d,f,h);if(La(f))return w(a,d,f,h);l&&Rg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,Ra(a.type)||\"Component\"));}return c(a,d)}}var Yg=Sg(!0),Zg=Sg(!1),$g={},ah=Bf($g),bh=Bf($g),ch=Bf($g);\nfunction dh(a){if(a===$g)throw Error(y(174));return a}function eh(a,b){I(ch,b);I(bh,a);I(ah,$g);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:mb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=mb(b,a)}H(ah);I(ah,b)}function fh(){H(ah);H(bh);H(ch)}function gh(a){dh(ch.current);var b=dh(ah.current);var c=mb(b,a.type);b!==c&&(I(bh,a),I(ah,c))}function hh(a){bh.current===a&&(H(ah),H(bh))}var P=Bf(0);\nfunction ih(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var jh=null,kh=null,lh=!1;\nfunction mh(a,b){var c=nh(5,null,null,0);c.elementType=\"DELETED\";c.type=\"DELETED\";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function oh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\"\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}\nfunction ph(a){if(lh){var b=kh;if(b){var c=b;if(!oh(a,b)){b=rf(c.nextSibling);if(!b||!oh(a,b)){a.flags=a.flags&-1025|2;lh=!1;jh=a;return}mh(jh,c)}jh=a;kh=rf(b.firstChild)}else a.flags=a.flags&-1025|2,lh=!1,jh=a}}function qh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;jh=a}\nfunction rh(a){if(a!==jh)return!1;if(!lh)return qh(a),lh=!0,!1;var b=a.type;if(5!==a.tag||\"head\"!==b&&\"body\"!==b&&!nf(b,a.memoizedProps))for(b=kh;b;)mh(a,b),b=rf(b.nextSibling);qh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(y(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(\"/$\"===c){if(0===b){kh=rf(a.nextSibling);break a}b--}else\"$\"!==c&&\"$!\"!==c&&\"$?\"!==c||b++}a=a.nextSibling}kh=null}}else kh=jh?rf(a.stateNode.nextSibling):null;return!0}\nfunction sh(){kh=jh=null;lh=!1}var th=[];function uh(){for(var a=0;a<th.length;a++)th[a]._workInProgressVersionPrimary=null;th.length=0}var vh=ra.ReactCurrentDispatcher,wh=ra.ReactCurrentBatchConfig,xh=0,R=null,S=null,T=null,yh=!1,zh=!1;function Ah(){throw Error(y(321));}function Bh(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!He(a[c],b[c]))return!1;return!0}\nfunction Ch(a,b,c,d,e,f){xh=f;R=b;b.memoizedState=null;b.updateQueue=null;b.lanes=0;vh.current=null===a||null===a.memoizedState?Dh:Eh;a=c(d,e);if(zh){f=0;do{zh=!1;if(!(25>f))throw Error(y(301));f+=1;T=S=null;b.updateQueue=null;vh.current=Fh;a=c(d,e)}while(zh)}vh.current=Gh;b=null!==S&&null!==S.next;xh=0;T=S=R=null;yh=!1;if(b)throw Error(y(300));return a}function Hh(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===T?R.memoizedState=T=a:T=T.next=a;return T}\nfunction Ih(){if(null===S){var a=R.alternate;a=null!==a?a.memoizedState:null}else a=S.next;var b=null===T?R.memoizedState:T.next;if(null!==b)T=b,S=a;else{if(null===a)throw Error(y(310));S=a;a={memoizedState:S.memoizedState,baseState:S.baseState,baseQueue:S.baseQueue,queue:S.queue,next:null};null===T?R.memoizedState=T=a:T=T.next=a}return T}function Jh(a,b){return\"function\"===typeof b?b(a):b}\nfunction Kh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=S,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.lane;if((xh&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else{var n={lane:l,action:k.action,eagerReducer:k.eagerReducer,\neagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;R.lanes|=l;Dg|=l}k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;He(d,b.memoizedState)||(ug=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction Lh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction Mh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes,a=(xh&a)===a)b._workInProgressVersionPrimary=d,th.push(b);if(a)return c(b._source);th.push(b);throw Error(y(350));}\nfunction Nh(a,b,c,d){var e=U;if(null===e)throw Error(y(349));var f=b._getVersion,g=f(b._source),h=vh.current,k=h.useState(function(){return Mh(e,b,c)}),l=k[1],n=k[0];k=T;var A=a.memoizedState,p=A.refs,C=p.getSnapshot,x=A.source;A=A.subscribe;var w=R;a.memoizedState={refs:p,source:b,subscribe:d};h.useEffect(function(){p.getSnapshot=c;p.setSnapshot=l;var a=f(b._source);if(!He(g,a)){a=c(b._source);He(n,a)||(l(a),a=Ig(w),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d=\ne.entanglements,h=a;0<h;){var k=31-Vc(h),v=1<<k;d[k]|=a;h&=~v}}},[c,b,d]);h.useEffect(function(){return d(b._source,function(){var a=p.getSnapshot,c=p.setSnapshot;try{c(a(b._source));var d=Ig(w);e.mutableReadLanes|=d&e.pendingLanes}catch(q){c(function(){throw q;})}})},[b,d]);He(C,c)&&He(x,b)&&He(A,d)||(a={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:n},a.dispatch=l=Oh.bind(null,R,a),k.queue=a,k.baseQueue=null,n=Mh(e,b,c),k.memoizedState=k.baseState=n);return n}\nfunction Ph(a,b,c){var d=Ih();return Nh(d,a,b,c)}function Qh(a){var b=Hh();\"function\"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={pending:null,dispatch:null,lastRenderedReducer:Jh,lastRenderedState:a};a=a.dispatch=Oh.bind(null,R,a);return[b.memoizedState,a]}\nfunction Rh(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};b=R.updateQueue;null===b?(b={lastEffect:null},R.updateQueue=b,b.lastEffect=a.next=a):(c=b.lastEffect,null===c?b.lastEffect=a.next=a:(d=c.next,c.next=a,a.next=d,b.lastEffect=a));return a}function Sh(a){var b=Hh();a={current:a};return b.memoizedState=a}function Th(){return Ih().memoizedState}function Uh(a,b,c,d){var e=Hh();R.flags|=a;e.memoizedState=Rh(1|b,c,void 0,void 0===d?null:d)}\nfunction Vh(a,b,c,d){var e=Ih();d=void 0===d?null:d;var f=void 0;if(null!==S){var g=S.memoizedState;f=g.destroy;if(null!==d&&Bh(d,g.deps)){Rh(b,c,f,d);return}}R.flags|=a;e.memoizedState=Rh(1|b,c,f,d)}function Wh(a,b){return Uh(516,4,a,b)}function Xh(a,b){return Vh(516,4,a,b)}function Yh(a,b){return Vh(4,2,a,b)}function Zh(a,b){if(\"function\"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}\nfunction $h(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Vh(4,2,Zh.bind(null,b,a),c)}function ai(){}function bi(a,b){var c=Ih();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Bh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}function ci(a,b){var c=Ih();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Bh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a}\nfunction di(a,b){var c=eg();gg(98>c?98:c,function(){a(!0)});gg(97<c?97:c,function(){var c=wh.transition;wh.transition=1;try{a(!1),b()}finally{wh.transition=c}})}\nfunction Oh(a,b,c){var d=Hg(),e=Ig(a),f={lane:e,action:c,eagerReducer:null,eagerState:null,next:null},g=b.pending;null===g?f.next=f:(f.next=g.next,g.next=f);b.pending=f;g=a.alternate;if(a===R||null!==g&&g===R)zh=yh=!0;else{if(0===a.lanes&&(null===g||0===g.lanes)&&(g=b.lastRenderedReducer,null!==g))try{var h=b.lastRenderedState,k=g(h,c);f.eagerReducer=g;f.eagerState=k;if(He(k,h))return}catch(l){}finally{}Jg(a,e,d)}}\nvar Gh={readContext:vg,useCallback:Ah,useContext:Ah,useEffect:Ah,useImperativeHandle:Ah,useLayoutEffect:Ah,useMemo:Ah,useReducer:Ah,useRef:Ah,useState:Ah,useDebugValue:Ah,useDeferredValue:Ah,useTransition:Ah,useMutableSource:Ah,useOpaqueIdentifier:Ah,unstable_isNewReconciler:!1},Dh={readContext:vg,useCallback:function(a,b){Hh().memoizedState=[a,void 0===b?null:b];return a},useContext:vg,useEffect:Wh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Uh(4,2,Zh.bind(null,\nb,a),c)},useLayoutEffect:function(a,b){return Uh(4,2,a,b)},useMemo:function(a,b){var c=Hh();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Hh();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={pending:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Oh.bind(null,R,a);return[d.memoizedState,a]},useRef:Sh,useState:Qh,useDebugValue:ai,useDeferredValue:function(a){var b=Qh(a),c=b[0],d=b[1];Wh(function(){var b=wh.transition;\nwh.transition=1;try{d(a)}finally{wh.transition=b}},[a]);return c},useTransition:function(){var a=Qh(!1),b=a[0];a=di.bind(null,a[1]);Sh(a);return[a,b]},useMutableSource:function(a,b,c){var d=Hh();d.memoizedState={refs:{getSnapshot:b,setSnapshot:null},source:a,subscribe:c};return Nh(d,a,b,c)},useOpaqueIdentifier:function(){if(lh){var a=!1,b=uf(function(){a||(a=!0,c(\"r:\"+(tf++).toString(36)));throw Error(y(355));}),c=Qh(b)[1];0===(R.mode&2)&&(R.flags|=516,Rh(5,function(){c(\"r:\"+(tf++).toString(36))},\nvoid 0,null));return b}b=\"r:\"+(tf++).toString(36);Qh(b);return b},unstable_isNewReconciler:!1},Eh={readContext:vg,useCallback:bi,useContext:vg,useEffect:Xh,useImperativeHandle:$h,useLayoutEffect:Yh,useMemo:ci,useReducer:Kh,useRef:Th,useState:function(){return Kh(Jh)},useDebugValue:ai,useDeferredValue:function(a){var b=Kh(Jh),c=b[0],d=b[1];Xh(function(){var b=wh.transition;wh.transition=1;try{d(a)}finally{wh.transition=b}},[a]);return c},useTransition:function(){var a=Kh(Jh)[0];return[Th().current,\na]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Kh(Jh)[0]},unstable_isNewReconciler:!1},Fh={readContext:vg,useCallback:bi,useContext:vg,useEffect:Xh,useImperativeHandle:$h,useLayoutEffect:Yh,useMemo:ci,useReducer:Lh,useRef:Th,useState:function(){return Lh(Jh)},useDebugValue:ai,useDeferredValue:function(a){var b=Lh(Jh),c=b[0],d=b[1];Xh(function(){var b=wh.transition;wh.transition=1;try{d(a)}finally{wh.transition=b}},[a]);return c},useTransition:function(){var a=Lh(Jh)[0];return[Th().current,\na]},useMutableSource:Ph,useOpaqueIdentifier:function(){return Lh(Jh)[0]},unstable_isNewReconciler:!1},ei=ra.ReactCurrentOwner,ug=!1;function fi(a,b,c,d){b.child=null===a?Zg(b,null,c,d):Yg(b,a.child,c,d)}function gi(a,b,c,d,e){c=c.render;var f=b.ref;tg(b,e);d=Ch(a,b,c,d,f,e);if(null!==a&&!ug)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,hi(a,b,e);b.flags|=1;fi(a,b,d,e);return b.child}\nfunction ii(a,b,c,d,e,f){if(null===a){var g=c.type;if(\"function\"===typeof g&&!ji(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,ki(a,b,g,d,e,f);a=Vg(c.type,null,d,b,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(0===(e&f)&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:Je,c(e,d)&&a.ref===b.ref))return hi(a,b,f);b.flags|=1;a=Tg(g,d);a.ref=b.ref;a.return=b;return b.child=a}\nfunction ki(a,b,c,d,e,f){if(null!==a&&Je(a.memoizedProps,d)&&a.ref===b.ref)if(ug=!1,0!==(f&e))0!==(a.flags&16384)&&(ug=!0);else return b.lanes=a.lanes,hi(a,b,f);return li(a,b,c,d,f)}\nfunction mi(a,b,c){var d=b.pendingProps,e=d.children,f=null!==a?a.memoizedState:null;if(\"hidden\"===d.mode||\"unstable-defer-without-hiding\"===d.mode)if(0===(b.mode&4))b.memoizedState={baseLanes:0},ni(b,c);else if(0!==(c&1073741824))b.memoizedState={baseLanes:0},ni(b,null!==f?f.baseLanes:c);else return a=null!==f?f.baseLanes|c:c,b.lanes=b.childLanes=1073741824,b.memoizedState={baseLanes:a},ni(b,a),null;else null!==f?(d=f.baseLanes|c,b.memoizedState=null):d=c,ni(b,d);fi(a,b,e,c);return b.child}\nfunction oi(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.flags|=128}function li(a,b,c,d,e){var f=Ff(c)?Df:M.current;f=Ef(b,f);tg(b,e);c=Ch(a,b,c,d,f,e);if(null!==a&&!ug)return b.updateQueue=a.updateQueue,b.flags&=-517,a.lanes&=~e,hi(a,b,e);b.flags|=1;fi(a,b,c,e);return b.child}\nfunction pi(a,b,c,d,e){if(Ff(c)){var f=!0;Jf(b)}else f=!1;tg(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),Mg(b,c,d),Og(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;\"object\"===typeof l&&null!==l?l=vg(l):(l=Ff(c)?Df:M.current,l=Ef(b,l));var n=c.getDerivedStateFromProps,A=\"function\"===typeof n||\"function\"===typeof g.getSnapshotBeforeUpdate;A||\"function\"!==typeof g.UNSAFE_componentWillReceiveProps&&\n\"function\"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Ng(b,g,d,l);wg=!1;var p=b.memoizedState;g.state=p;Cg(b,d,g,e);k=b.memoizedState;h!==d||p!==k||N.current||wg?(\"function\"===typeof n&&(Gg(b,c,n,d),k=b.memoizedState),(h=wg||Lg(b,c,h,d,p,k,l))?(A||\"function\"!==typeof g.UNSAFE_componentWillMount&&\"function\"!==typeof g.componentWillMount||(\"function\"===typeof g.componentWillMount&&g.componentWillMount(),\"function\"===typeof g.UNSAFE_componentWillMount&&g.UNSAFE_componentWillMount()),\"function\"===\ntypeof g.componentDidMount&&(b.flags|=4)):(\"function\"===typeof g.componentDidMount&&(b.flags|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):(\"function\"===typeof g.componentDidMount&&(b.flags|=4),d=!1)}else{g=b.stateNode;yg(a,b);h=b.memoizedProps;l=b.type===b.elementType?h:lg(b.type,h);g.props=l;A=b.pendingProps;p=g.context;k=c.contextType;\"object\"===typeof k&&null!==k?k=vg(k):(k=Ff(c)?Df:M.current,k=Ef(b,k));var C=c.getDerivedStateFromProps;(n=\"function\"===typeof C||\n\"function\"===typeof g.getSnapshotBeforeUpdate)||\"function\"!==typeof g.UNSAFE_componentWillReceiveProps&&\"function\"!==typeof g.componentWillReceiveProps||(h!==A||p!==k)&&Ng(b,g,d,k);wg=!1;p=b.memoizedState;g.state=p;Cg(b,d,g,e);var x=b.memoizedState;h!==A||p!==x||N.current||wg?(\"function\"===typeof C&&(Gg(b,c,C,d),x=b.memoizedState),(l=wg||Lg(b,c,l,d,p,x,k))?(n||\"function\"!==typeof g.UNSAFE_componentWillUpdate&&\"function\"!==typeof g.componentWillUpdate||(\"function\"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,\nx,k),\"function\"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,x,k)),\"function\"===typeof g.componentDidUpdate&&(b.flags|=4),\"function\"===typeof g.getSnapshotBeforeUpdate&&(b.flags|=256)):(\"function\"!==typeof g.componentDidUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=4),\"function\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=256),b.memoizedProps=d,b.memoizedState=x),g.props=d,g.state=x,g.context=k,d=l):(\"function\"!==typeof g.componentDidUpdate||\nh===a.memoizedProps&&p===a.memoizedState||(b.flags|=4),\"function\"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&p===a.memoizedState||(b.flags|=256),d=!1)}return qi(a,b,c,d,f,e)}\nfunction qi(a,b,c,d,e,f){oi(a,b);var g=0!==(b.flags&64);if(!d&&!g)return e&&Kf(b,c,!1),hi(a,b,f);d=b.stateNode;ei.current=b;var h=g&&\"function\"!==typeof c.getDerivedStateFromError?null:d.render();b.flags|=1;null!==a&&g?(b.child=Yg(b,a.child,null,f),b.child=Yg(b,null,h,f)):fi(a,b,h,f);b.memoizedState=d.state;e&&Kf(b,c,!0);return b.child}function ri(a){var b=a.stateNode;b.pendingContext?Hf(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Hf(a,b.context,!1);eh(a,b.containerInfo)}\nvar si={dehydrated:null,retryLane:0};\nfunction ti(a,b,c){var d=b.pendingProps,e=P.current,f=!1,g;(g=0!==(b.flags&64))||(g=null!==a&&null===a.memoizedState?!1:0!==(e&2));g?(f=!0,b.flags&=-65):null!==a&&null===a.memoizedState||void 0===d.fallback||!0===d.unstable_avoidThisFallback||(e|=1);I(P,e&1);if(null===a){void 0!==d.fallback&&ph(b);a=d.children;e=d.fallback;if(f)return a=ui(b,a,e,c),b.child.memoizedState={baseLanes:c},b.memoizedState=si,a;if(\"number\"===typeof d.unstable_expectedLoadTime)return a=ui(b,a,e,c),b.child.memoizedState={baseLanes:c},\nb.memoizedState=si,b.lanes=33554432,a;c=vi({mode:\"visible\",children:a},b.mode,c,null);c.return=b;return b.child=c}if(null!==a.memoizedState){if(f)return d=wi(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=si,d;c=xi(a,b,d.children,c);b.memoizedState=null;return c}if(f)return d=wi(a,b,d.children,d.fallback,c),f=b.child,e=a.child.memoizedState,f.memoizedState=null===e?{baseLanes:c}:\n{baseLanes:e.baseLanes|c},f.childLanes=a.childLanes&~c,b.memoizedState=si,d;c=xi(a,b,d.children,c);b.memoizedState=null;return c}function ui(a,b,c,d){var e=a.mode,f=a.child;b={mode:\"hidden\",children:b};0===(e&2)&&null!==f?(f.childLanes=0,f.pendingProps=b):f=vi(b,e,0,null);c=Xg(c,e,d,null);f.return=a;c.return=a;f.sibling=c;a.child=f;return c}\nfunction xi(a,b,c,d){var e=a.child;a=e.sibling;c=Tg(e,{mode:\"visible\",children:c});0===(b.mode&2)&&(c.lanes=d);c.return=b;c.sibling=null;null!==a&&(a.nextEffect=null,a.flags=8,b.firstEffect=b.lastEffect=a);return b.child=c}\nfunction wi(a,b,c,d,e){var f=b.mode,g=a.child;a=g.sibling;var h={mode:\"hidden\",children:c};0===(f&2)&&b.child!==g?(c=b.child,c.childLanes=0,c.pendingProps=h,g=c.lastEffect,null!==g?(b.firstEffect=c.firstEffect,b.lastEffect=g,g.nextEffect=null):b.firstEffect=b.lastEffect=null):c=Tg(g,h);null!==a?d=Tg(a,d):(d=Xg(d,f,e,null),d.flags|=2);d.return=b;c.return=b;c.sibling=d;b.child=c;return d}function yi(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);sg(a.return,b)}\nfunction zi(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:e,lastEffect:f}:(g.isBackwards=b,g.rendering=null,g.renderingStartTime=0,g.last=d,g.tail=c,g.tailMode=e,g.lastEffect=f)}\nfunction Ai(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;fi(a,b,d.children,c);d=P.current;if(0!==(d&2))d=d&1|2,b.flags|=64;else{if(null!==a&&0!==(a.flags&64))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&yi(a,c);else if(19===a.tag)yi(a,c);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}I(P,d);if(0===(b.mode&2))b.memoizedState=\nnull;else switch(e){case \"forwards\":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===ih(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);zi(b,!1,e,c,f,b.lastEffect);break;case \"backwards\":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===ih(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}zi(b,!0,c,null,f,b.lastEffect);break;case \"together\":zi(b,!1,null,null,void 0,b.lastEffect);break;default:b.memoizedState=null}return b.child}\nfunction hi(a,b,c){null!==a&&(b.dependencies=a.dependencies);Dg|=b.lanes;if(0!==(c&b.childLanes)){if(null!==a&&b.child!==a.child)throw Error(y(153));if(null!==b.child){a=b.child;c=Tg(a,a.pendingProps);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=Tg(a,a.pendingProps),c.return=b;c.sibling=null}return b.child}return null}var Bi,Ci,Di,Ei;\nBi=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Ci=function(){};\nDi=function(a,b,c,d){var e=a.memoizedProps;if(e!==d){a=b.stateNode;dh(ah.current);var f=null;switch(c){case \"input\":e=Ya(a,e);d=Ya(a,d);f=[];break;case \"option\":e=eb(a,e);d=eb(a,d);f=[];break;case \"select\":e=m({},e,{value:void 0});d=m({},d,{value:void 0});f=[];break;case \"textarea\":e=gb(a,e);d=gb(a,d);f=[];break;default:\"function\"!==typeof e.onClick&&\"function\"===typeof d.onClick&&(a.onclick=jf)}vb(c,d);var g;c=null;for(l in e)if(!d.hasOwnProperty(l)&&e.hasOwnProperty(l)&&null!=e[l])if(\"style\"===\nl){var h=e[l];for(g in h)h.hasOwnProperty(g)&&(c||(c={}),c[g]=\"\")}else\"dangerouslySetInnerHTML\"!==l&&\"children\"!==l&&\"suppressContentEditableWarning\"!==l&&\"suppressHydrationWarning\"!==l&&\"autoFocus\"!==l&&(ca.hasOwnProperty(l)?f||(f=[]):(f=f||[]).push(l,null));for(l in d){var k=d[l];h=null!=e?e[l]:void 0;if(d.hasOwnProperty(l)&&k!==h&&(null!=k||null!=h))if(\"style\"===l)if(h){for(g in h)!h.hasOwnProperty(g)||k&&k.hasOwnProperty(g)||(c||(c={}),c[g]=\"\");for(g in k)k.hasOwnProperty(g)&&h[g]!==k[g]&&(c||\n(c={}),c[g]=k[g])}else c||(f||(f=[]),f.push(l,c)),c=k;else\"dangerouslySetInnerHTML\"===l?(k=k?k.__html:void 0,h=h?h.__html:void 0,null!=k&&h!==k&&(f=f||[]).push(l,k)):\"children\"===l?\"string\"!==typeof k&&\"number\"!==typeof k||(f=f||[]).push(l,\"\"+k):\"suppressContentEditableWarning\"!==l&&\"suppressHydrationWarning\"!==l&&(ca.hasOwnProperty(l)?(null!=k&&\"onScroll\"===l&&G(\"scroll\",a),f||h===k||(f=[])):\"object\"===typeof k&&null!==k&&k.$$typeof===Ga?k.toString():(f=f||[]).push(l,k))}c&&(f=f||[]).push(\"style\",\nc);var l=f;if(b.updateQueue=l)b.flags|=4}};Ei=function(a,b,c,d){c!==d&&(b.flags|=4)};function Fi(a,b){if(!lh)switch(a.tailMode){case \"hidden\":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case \"collapsed\":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}\nfunction Gi(a,b,c){var d=b.pendingProps;switch(b.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Ff(b.type)&&Gf(),null;case 3:fh();H(N);H(M);uh();d=b.stateNode;d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)rh(b)?b.flags|=4:d.hydrate||(b.flags|=256);Ci(b);return null;case 5:hh(b);var e=dh(ch.current);c=b.type;if(null!==a&&null!=b.stateNode)Di(a,b,c,d,e),a.ref!==b.ref&&(b.flags|=128);else{if(!d){if(null===\nb.stateNode)throw Error(y(166));return null}a=dh(ah.current);if(rh(b)){d=b.stateNode;c=b.type;var f=b.memoizedProps;d[wf]=b;d[xf]=f;switch(c){case \"dialog\":G(\"cancel\",d);G(\"close\",d);break;case \"iframe\":case \"object\":case \"embed\":G(\"load\",d);break;case \"video\":case \"audio\":for(a=0;a<Xe.length;a++)G(Xe[a],d);break;case \"source\":G(\"error\",d);break;case \"img\":case \"image\":case \"link\":G(\"error\",d);G(\"load\",d);break;case \"details\":G(\"toggle\",d);break;case \"input\":Za(d,f);G(\"invalid\",d);break;case \"select\":d._wrapperState=\n{wasMultiple:!!f.multiple};G(\"invalid\",d);break;case \"textarea\":hb(d,f),G(\"invalid\",d)}vb(c,f);a=null;for(var g in f)f.hasOwnProperty(g)&&(e=f[g],\"children\"===g?\"string\"===typeof e?d.textContent!==e&&(a=[\"children\",e]):\"number\"===typeof e&&d.textContent!==\"\"+e&&(a=[\"children\",\"\"+e]):ca.hasOwnProperty(g)&&null!=e&&\"onScroll\"===g&&G(\"scroll\",d));switch(c){case \"input\":Va(d);cb(d,f,!0);break;case \"textarea\":Va(d);jb(d);break;case \"select\":case \"option\":break;default:\"function\"===typeof f.onClick&&(d.onclick=\njf)}d=a;b.updateQueue=d;null!==d&&(b.flags|=4)}else{g=9===e.nodeType?e:e.ownerDocument;a===kb.html&&(a=lb(c));a===kb.html?\"script\"===c?(a=g.createElement(\"div\"),a.innerHTML=\"<script>\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[wf]=b;a[xf]=d;Bi(a,b,!1,!1);b.stateNode=a;g=wb(c,d);switch(c){case \"dialog\":G(\"cancel\",a);G(\"close\",a);\ne=d;break;case \"iframe\":case \"object\":case \"embed\":G(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;e<Xe.length;e++)G(Xe[e],a);e=d;break;case \"source\":G(\"error\",a);e=d;break;case \"img\":case \"image\":case \"link\":G(\"error\",a);G(\"load\",a);e=d;break;case \"details\":G(\"toggle\",a);e=d;break;case \"input\":Za(a,d);e=Ya(a,d);G(\"invalid\",a);break;case \"option\":e=eb(a,d);break;case \"select\":a._wrapperState={wasMultiple:!!d.multiple};e=m({},d,{value:void 0});G(\"invalid\",a);break;case \"textarea\":hb(a,d);e=\ngb(a,d);G(\"invalid\",a);break;default:e=d}vb(c,e);var h=e;for(f in h)if(h.hasOwnProperty(f)){var k=h[f];\"style\"===f?tb(a,k):\"dangerouslySetInnerHTML\"===f?(k=k?k.__html:void 0,null!=k&&ob(a,k)):\"children\"===f?\"string\"===typeof k?(\"textarea\"!==c||\"\"!==k)&&pb(a,k):\"number\"===typeof k&&pb(a,\"\"+k):\"suppressContentEditableWarning\"!==f&&\"suppressHydrationWarning\"!==f&&\"autoFocus\"!==f&&(ca.hasOwnProperty(f)?null!=k&&\"onScroll\"===f&&G(\"scroll\",a):null!=k&&qa(a,f,k,g))}switch(c){case \"input\":Va(a);cb(a,d,!1);\nbreak;case \"textarea\":Va(a);jb(a);break;case \"option\":null!=d.value&&a.setAttribute(\"value\",\"\"+Sa(d.value));break;case \"select\":a.multiple=!!d.multiple;f=d.value;null!=f?fb(a,!!d.multiple,f,!1):null!=d.defaultValue&&fb(a,!!d.multiple,d.defaultValue,!0);break;default:\"function\"===typeof e.onClick&&(a.onclick=jf)}mf(c,d)&&(b.flags|=4)}null!==b.ref&&(b.flags|=128)}return null;case 6:if(a&&null!=b.stateNode)Ei(a,b,a.memoizedProps,d);else{if(\"string\"!==typeof d&&null===b.stateNode)throw Error(y(166));\nc=dh(ch.current);dh(ah.current);rh(b)?(d=b.stateNode,c=b.memoizedProps,d[wf]=b,d.nodeValue!==c&&(b.flags|=4)):(d=(9===c.nodeType?c:c.ownerDocument).createTextNode(d),d[wf]=b,b.stateNode=d)}return null;case 13:H(P);d=b.memoizedState;if(0!==(b.flags&64))return b.lanes=c,b;d=null!==d;c=!1;null===a?void 0!==b.memoizedProps.fallback&&rh(b):c=null!==a.memoizedState;if(d&&!c&&0!==(b.mode&2))if(null===a&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!==(P.current&1))0===V&&(V=3);else{if(0===V||3===V)V=\n4;null===U||0===(Dg&134217727)&&0===(Hi&134217727)||Ii(U,W)}if(d||c)b.flags|=4;return null;case 4:return fh(),Ci(b),null===a&&cf(b.stateNode.containerInfo),null;case 10:return rg(b),null;case 17:return Ff(b.type)&&Gf(),null;case 19:H(P);d=b.memoizedState;if(null===d)return null;f=0!==(b.flags&64);g=d.rendering;if(null===g)if(f)Fi(d,!1);else{if(0!==V||null!==a&&0!==(a.flags&64))for(a=b.child;null!==a;){g=ih(a);if(null!==g){b.flags|=64;Fi(d,!1);f=g.updateQueue;null!==f&&(b.updateQueue=f,b.flags|=4);\nnull===d.lastEffect&&(b.firstEffect=null);b.lastEffect=d.lastEffect;d=c;for(c=b.child;null!==c;)f=c,a=d,f.flags&=2,f.nextEffect=null,f.firstEffect=null,f.lastEffect=null,g=f.alternate,null===g?(f.childLanes=0,f.lanes=a,f.child=null,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=g.childLanes,f.lanes=g.lanes,f.child=g.child,f.memoizedProps=g.memoizedProps,f.memoizedState=g.memoizedState,f.updateQueue=g.updateQueue,f.type=g.type,a=g.dependencies,\nf.dependencies=null===a?null:{lanes:a.lanes,firstContext:a.firstContext}),c=c.sibling;I(P,P.current&1|2);return b.child}a=a.sibling}null!==d.tail&&O()>Ji&&(b.flags|=64,f=!0,Fi(d,!1),b.lanes=33554432)}else{if(!f)if(a=ih(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Fi(d,!0),null===d.tail&&\"hidden\"===d.tailMode&&!g.alternate&&!lh)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*O()-d.renderingStartTime>Ji&&1073741824!==c&&(b.flags|=\n64,f=!0,Fi(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g)}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=O(),c.sibling=null,b=P.current,I(P,f?b&1|2:b&1),c):null;case 23:case 24:return Ki(),null!==a&&null!==a.memoizedState!==(null!==b.memoizedState)&&\"unstable-defer-without-hiding\"!==d.mode&&(b.flags|=4),null}throw Error(y(156,b.tag));}\nfunction Li(a){switch(a.tag){case 1:Ff(a.type)&&Gf();var b=a.flags;return b&4096?(a.flags=b&-4097|64,a):null;case 3:fh();H(N);H(M);uh();b=a.flags;if(0!==(b&64))throw Error(y(285));a.flags=b&-4097|64;return a;case 5:return hh(a),null;case 13:return H(P),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return H(P),null;case 4:return fh(),null;case 10:return rg(a),null;case 23:case 24:return Ki(),null;default:return null}}\nfunction Mi(a,b){try{var c=\"\",d=b;do c+=Qa(d),d=d.return;while(d);var e=c}catch(f){e=\"\\nError generating stack: \"+f.message+\"\\n\"+f.stack}return{value:a,source:b,stack:e}}function Ni(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}var Oi=\"function\"===typeof WeakMap?WeakMap:Map;function Pi(a,b,c){c=zg(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Qi||(Qi=!0,Ri=d);Ni(a,b)};return c}\nfunction Si(a,b,c){c=zg(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if(\"function\"===typeof d){var e=b.value;c.payload=function(){Ni(a,b);return d(e)}}var f=a.stateNode;null!==f&&\"function\"===typeof f.componentDidCatch&&(c.callback=function(){\"function\"!==typeof d&&(null===Ti?Ti=new Set([this]):Ti.add(this),Ni(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:\"\"})});return c}var Ui=\"function\"===typeof WeakSet?WeakSet:Set;\nfunction Vi(a){var b=a.ref;if(null!==b)if(\"function\"===typeof b)try{b(null)}catch(c){Wi(a,c)}else b.current=null}function Xi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:lg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}return;case 3:b.flags&256&&qf(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(y(163));}\nfunction Yi(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{if(3===(a.tag&3)){var d=a.create;a.destroy=d()}a=a.next}while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Zi(c,a),$i(c,a));a=d}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:lg(c.type,b.memoizedProps),a.componentDidUpdate(d,\nb.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&Eg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}Eg(c,b,a)}return;case 5:a=c.stateNode;null===b&&c.flags&4&&mf(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Cc(c))));\nreturn;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(y(163));}\nfunction aj(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d=d.style,\"function\"===typeof d.setProperty?d.setProperty(\"display\",\"none\",\"important\"):d.display=\"none\";else{d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty(\"display\")?e.display:null;d.style.display=sb(\"display\",e)}}else if(6===c.tag)c.stateNode.nodeValue=b?\"\":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===\na)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}}\nfunction bj(a,b){if(Mf&&\"function\"===typeof Mf.onCommitFiberUnmount)try{Mf.onCommitFiberUnmount(Lf,b)}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Zi(b,c);else{d=b;try{e()}catch(f){Wi(d,f)}}c=c.next}while(c!==a)}break;case 1:Vi(b);a=b.stateNode;if(\"function\"===typeof a.componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount()}catch(f){Wi(b,\nf)}break;case 5:Vi(b);break;case 4:cj(a,b)}}function dj(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null}function ej(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction fj(a){a:{for(var b=a.return;null!==b;){if(ej(b))break a;b=b.return}throw Error(y(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(y(161));}c.flags&16&&(pb(b,\"\"),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||ej(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null===\nc.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.flags&2)){c=c.stateNode;break a}}d?gj(a,c,b):hj(a,c,b)}\nfunction gj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=jf));else if(4!==d&&(a=a.child,null!==a))for(gj(a,b,c),a=a.sibling;null!==a;)gj(a,b,c),a=a.sibling}\nfunction hj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(hj(a,b,c),a=a.sibling;null!==a;)hj(a,b,c),a=a.sibling}\nfunction cj(a,b){for(var c=b,d=!1,e,f;;){if(!d){d=c.return;a:for(;;){if(null===d)throw Error(y(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return}d=!0}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(bj(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else{if(k===h)break a;for(;null===k.sibling;){if(null===k.return||k.return===h)break a;k=k.return}k.sibling.return=k.return;k=k.sibling}f?(g=e,h=c.stateNode,\n8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode)}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(bj(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1)}c.sibling.return=c.return;c=c.sibling}}\nfunction ij(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[xf]=d;\"input\"===a&&\"radio\"===d.type&&null!=d.name&&$a(c,d);wb(a,e);b=wb(a,d);for(e=0;e<f.length;e+=\n2){var g=f[e],h=f[e+1];\"style\"===g?tb(c,h):\"dangerouslySetInnerHTML\"===g?ob(c,h):\"children\"===g?pb(c,h):qa(c,g,h,b)}switch(a){case \"input\":ab(c,d);break;case \"textarea\":ib(c,d);break;case \"select\":a=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,f=d.value,null!=f?fb(c,!!d.multiple,f,!1):a!==!!d.multiple&&(null!=d.defaultValue?fb(c,!!d.multiple,d.defaultValue,!0):fb(c,!!d.multiple,d.multiple?[]:\"\",!1))}}}return;case 6:if(null===b.stateNode)throw Error(y(162));b.stateNode.nodeValue=\nb.memoizedProps;return;case 3:c=b.stateNode;c.hydrate&&(c.hydrate=!1,Cc(c.containerInfo));return;case 12:return;case 13:null!==b.memoizedState&&(jj=O(),aj(b.child,!0));kj(b);return;case 19:kj(b);return;case 17:return;case 23:case 24:aj(b,null!==b.memoizedState);return}throw Error(y(163));}function kj(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Ui);b.forEach(function(b){var d=lj.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction mj(a,b){return null!==a&&(a=a.memoizedState,null===a||null!==a.dehydrated)?(b=b.memoizedState,null!==b&&null===b.dehydrated):!1}var nj=Math.ceil,oj=ra.ReactCurrentDispatcher,pj=ra.ReactCurrentOwner,X=0,U=null,Y=null,W=0,qj=0,rj=Bf(0),V=0,sj=null,tj=0,Dg=0,Hi=0,uj=0,vj=null,jj=0,Ji=Infinity;function wj(){Ji=O()+500}var Z=null,Qi=!1,Ri=null,Ti=null,xj=!1,yj=null,zj=90,Aj=[],Bj=[],Cj=null,Dj=0,Ej=null,Fj=-1,Gj=0,Hj=0,Ij=null,Jj=!1;function Hg(){return 0!==(X&48)?O():-1!==Fj?Fj:Fj=O()}\nfunction Ig(a){a=a.mode;if(0===(a&2))return 1;if(0===(a&4))return 99===eg()?1:2;0===Gj&&(Gj=tj);if(0!==kg.transition){0!==Hj&&(Hj=null!==vj?vj.pendingLanes:0);a=Gj;var b=4186112&~Hj;b&=-b;0===b&&(a=4186112&~a,b=a&-a,0===b&&(b=8192));return b}a=eg();0!==(X&4)&&98===a?a=Xc(12,Gj):(a=Sc(a),a=Xc(a,Gj));return a}\nfunction Jg(a,b,c){if(50<Dj)throw Dj=0,Ej=null,Error(y(185));a=Kj(a,b);if(null===a)return null;$c(a,b,c);a===U&&(Hi|=b,4===V&&Ii(a,W));var d=eg();1===b?0!==(X&8)&&0===(X&48)?Lj(a):(Mj(a,c),0===X&&(wj(),ig())):(0===(X&4)||98!==d&&99!==d||(null===Cj?Cj=new Set([a]):Cj.add(a)),Mj(a,c));vj=a}function Kj(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}\nfunction Mj(a,b){for(var c=a.callbackNode,d=a.suspendedLanes,e=a.pingedLanes,f=a.expirationTimes,g=a.pendingLanes;0<g;){var h=31-Vc(g),k=1<<h,l=f[h];if(-1===l){if(0===(k&d)||0!==(k&e)){l=b;Rc(k);var n=F;f[h]=10<=n?l+250:6<=n?l+5E3:-1}}else l<=b&&(a.expiredLanes|=k);g&=~k}d=Uc(a,a===U?W:0);b=F;if(0===d)null!==c&&(c!==Zf&&Pf(c),a.callbackNode=null,a.callbackPriority=0);else{if(null!==c){if(a.callbackPriority===b)return;c!==Zf&&Pf(c)}15===b?(c=Lj.bind(null,a),null===ag?(ag=[c],bg=Of(Uf,jg)):ag.push(c),\nc=Zf):14===b?c=hg(99,Lj.bind(null,a)):(c=Tc(b),c=hg(c,Nj.bind(null,a)));a.callbackPriority=b;a.callbackNode=c}}\nfunction Nj(a){Fj=-1;Hj=Gj=0;if(0!==(X&48))throw Error(y(327));var b=a.callbackNode;if(Oj()&&a.callbackNode!==b)return null;var c=Uc(a,a===U?W:0);if(0===c)return null;var d=c;var e=X;X|=16;var f=Pj();if(U!==a||W!==d)wj(),Qj(a,d);do try{Rj();break}catch(h){Sj(a,h)}while(1);qg();oj.current=f;X=e;null!==Y?d=0:(U=null,W=0,d=V);if(0!==(tj&Hi))Qj(a,0);else if(0!==d){2===d&&(X|=64,a.hydrate&&(a.hydrate=!1,qf(a.containerInfo)),c=Wc(a),0!==c&&(d=Tj(a,c)));if(1===d)throw b=sj,Qj(a,0),Ii(a,c),Mj(a,O()),b;a.finishedWork=\na.current.alternate;a.finishedLanes=c;switch(d){case 0:case 1:throw Error(y(345));case 2:Uj(a);break;case 3:Ii(a,c);if((c&62914560)===c&&(d=jj+500-O(),10<d)){if(0!==Uc(a,0))break;e=a.suspendedLanes;if((e&c)!==c){Hg();a.pingedLanes|=a.suspendedLanes&e;break}a.timeoutHandle=of(Uj.bind(null,a),d);break}Uj(a);break;case 4:Ii(a,c);if((c&4186112)===c)break;d=a.eventTimes;for(e=-1;0<c;){var g=31-Vc(c);f=1<<g;g=d[g];g>e&&(e=g);c&=~f}c=e;c=O()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>\nc?4320:1960*nj(c/1960))-c;if(10<c){a.timeoutHandle=of(Uj.bind(null,a),c);break}Uj(a);break;case 5:Uj(a);break;default:throw Error(y(329));}}Mj(a,O());return a.callbackNode===b?Nj.bind(null,a):null}function Ii(a,b){b&=~uj;b&=~Hi;a.suspendedLanes|=b;a.pingedLanes&=~b;for(a=a.expirationTimes;0<b;){var c=31-Vc(b),d=1<<c;a[c]=-1;b&=~d}}\nfunction Lj(a){if(0!==(X&48))throw Error(y(327));Oj();if(a===U&&0!==(a.expiredLanes&W)){var b=W;var c=Tj(a,b);0!==(tj&Hi)&&(b=Uc(a,b),c=Tj(a,b))}else b=Uc(a,0),c=Tj(a,b);0!==a.tag&&2===c&&(X|=64,a.hydrate&&(a.hydrate=!1,qf(a.containerInfo)),b=Wc(a),0!==b&&(c=Tj(a,b)));if(1===c)throw c=sj,Qj(a,0),Ii(a,b),Mj(a,O()),c;a.finishedWork=a.current.alternate;a.finishedLanes=b;Uj(a);Mj(a,O());return null}\nfunction Vj(){if(null!==Cj){var a=Cj;Cj=null;a.forEach(function(a){a.expiredLanes|=24&a.pendingLanes;Mj(a,O())})}ig()}function Wj(a,b){var c=X;X|=1;try{return a(b)}finally{X=c,0===X&&(wj(),ig())}}function Xj(a,b){var c=X;X&=-2;X|=8;try{return a(b)}finally{X=c,0===X&&(wj(),ig())}}function ni(a,b){I(rj,qj);qj|=b;tj|=b}function Ki(){qj=rj.current;H(rj)}\nfunction Qj(a,b){a.finishedWork=null;a.finishedLanes=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,pf(c));if(null!==Y)for(c=Y.return;null!==c;){var d=c;switch(d.tag){case 1:d=d.type.childContextTypes;null!==d&&void 0!==d&&Gf();break;case 3:fh();H(N);H(M);uh();break;case 5:hh(d);break;case 4:fh();break;case 13:H(P);break;case 19:H(P);break;case 10:rg(d);break;case 23:case 24:Ki()}c=c.return}U=a;Y=Tg(a.current,null);W=qj=tj=b;V=0;sj=null;uj=Hi=Dg=0}\nfunction Sj(a,b){do{var c=Y;try{qg();vh.current=Gh;if(yh){for(var d=R.memoizedState;null!==d;){var e=d.queue;null!==e&&(e.pending=null);d=d.next}yh=!1}xh=0;T=S=R=null;zh=!1;pj.current=null;if(null===c||null===c.return){V=1;sj=b;Y=null;break}a:{var f=a,g=c.return,h=c,k=b;b=W;h.flags|=2048;h.firstEffect=h.lastEffect=null;if(null!==k&&\"object\"===typeof k&&\"function\"===typeof k.then){var l=k;if(0===(h.mode&2)){var n=h.alternate;n?(h.updateQueue=n.updateQueue,h.memoizedState=n.memoizedState,h.lanes=n.lanes):\n(h.updateQueue=null,h.memoizedState=null)}var A=0!==(P.current&1),p=g;do{var C;if(C=13===p.tag){var x=p.memoizedState;if(null!==x)C=null!==x.dehydrated?!0:!1;else{var w=p.memoizedProps;C=void 0===w.fallback?!1:!0!==w.unstable_avoidThisFallback?!0:A?!1:!0}}if(C){var z=p.updateQueue;if(null===z){var u=new Set;u.add(l);p.updateQueue=u}else z.add(l);if(0===(p.mode&2)){p.flags|=64;h.flags|=16384;h.flags&=-2981;if(1===h.tag)if(null===h.alternate)h.tag=17;else{var t=zg(-1,1);t.tag=2;Ag(h,t)}h.lanes|=1;break a}k=\nvoid 0;h=b;var q=f.pingCache;null===q?(q=f.pingCache=new Oi,k=new Set,q.set(l,k)):(k=q.get(l),void 0===k&&(k=new Set,q.set(l,k)));if(!k.has(h)){k.add(h);var v=Yj.bind(null,f,l,h);l.then(v,v)}p.flags|=4096;p.lanes=b;break a}p=p.return}while(null!==p);k=Error((Ra(h.type)||\"A React component\")+\" suspended while rendering, but no fallback UI was specified.\\n\\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.\")}5!==V&&(V=2);k=Mi(k,h);p=\ng;do{switch(p.tag){case 3:f=k;p.flags|=4096;b&=-b;p.lanes|=b;var J=Pi(p,f,b);Bg(p,J);break a;case 1:f=k;var K=p.type,Q=p.stateNode;if(0===(p.flags&64)&&(\"function\"===typeof K.getDerivedStateFromError||null!==Q&&\"function\"===typeof Q.componentDidCatch&&(null===Ti||!Ti.has(Q)))){p.flags|=4096;b&=-b;p.lanes|=b;var L=Si(p,f,b);Bg(p,L);break a}}p=p.return}while(null!==p)}Zj(c)}catch(va){b=va;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}\nfunction Pj(){var a=oj.current;oj.current=Gh;return null===a?Gh:a}function Tj(a,b){var c=X;X|=16;var d=Pj();U===a&&W===b||Qj(a,b);do try{ak();break}catch(e){Sj(a,e)}while(1);qg();X=c;oj.current=d;if(null!==Y)throw Error(y(261));U=null;W=0;return V}function ak(){for(;null!==Y;)bk(Y)}function Rj(){for(;null!==Y&&!Qf();)bk(Y)}function bk(a){var b=ck(a.alternate,a,qj);a.memoizedProps=a.pendingProps;null===b?Zj(a):Y=b;pj.current=null}\nfunction Zj(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=Gi(c,b,qj);if(null!==c){Y=c;return}c=b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(qj&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1<b.flags&&(null!==\na.lastEffect?a.lastEffect.nextEffect=b:a.firstEffect=b,a.lastEffect=b))}else{c=Li(b);if(null!==c){c.flags&=2047;Y=c;return}null!==a&&(a.firstEffect=a.lastEffect=null,a.flags|=2048)}b=b.sibling;if(null!==b){Y=b;return}Y=b=a}while(null!==b);0===V&&(V=5)}function Uj(a){var b=eg();gg(99,dk.bind(null,a,b));return null}\nfunction dk(a,b){do Oj();while(null!==yj);if(0!==(X&48))throw Error(y(327));var c=a.finishedWork;if(null===c)return null;a.finishedWork=null;a.finishedLanes=0;if(c===a.current)throw Error(y(177));a.callbackNode=null;var d=c.lanes|c.childLanes,e=d,f=a.pendingLanes&~e;a.pendingLanes=e;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=e;a.mutableReadLanes&=e;a.entangledLanes&=e;e=a.entanglements;for(var g=a.eventTimes,h=a.expirationTimes;0<f;){var k=31-Vc(f),l=1<<k;e[k]=0;g[k]=-1;h[k]=-1;f&=~l}null!==\nCj&&0===(d&24)&&Cj.has(a)&&Cj.delete(a);a===U&&(Y=U=null,W=0);1<c.flags?null!==c.lastEffect?(c.lastEffect.nextEffect=c,d=c.firstEffect):d=c:d=c.firstEffect;if(null!==d){e=X;X|=32;pj.current=null;kf=fd;g=Ne();if(Oe(g)){if(\"selectionStart\"in g)h={start:g.selectionStart,end:g.selectionEnd};else a:if(h=(h=g.ownerDocument)&&h.defaultView||window,(l=h.getSelection&&h.getSelection())&&0!==l.rangeCount){h=l.anchorNode;f=l.anchorOffset;k=l.focusNode;l=l.focusOffset;try{h.nodeType,k.nodeType}catch(va){h=null;\nbreak a}var n=0,A=-1,p=-1,C=0,x=0,w=g,z=null;b:for(;;){for(var u;;){w!==h||0!==f&&3!==w.nodeType||(A=n+f);w!==k||0!==l&&3!==w.nodeType||(p=n+l);3===w.nodeType&&(n+=w.nodeValue.length);if(null===(u=w.firstChild))break;z=w;w=u}for(;;){if(w===g)break b;z===h&&++C===f&&(A=n);z===k&&++x===l&&(p=n);if(null!==(u=w.nextSibling))break;w=z;z=w.parentNode}w=u}h=-1===A||-1===p?null:{start:A,end:p}}else h=null;h=h||{start:0,end:0}}else h=null;lf={focusedElem:g,selectionRange:h};fd=!1;Ij=null;Jj=!1;Z=d;do try{ek()}catch(va){if(null===\nZ)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect}while(null!==Z);Ij=null;Z=d;do try{for(g=a;null!==Z;){var t=Z.flags;t&16&&pb(Z.stateNode,\"\");if(t&128){var q=Z.alternate;if(null!==q){var v=q.ref;null!==v&&(\"function\"===typeof v?v(null):v.current=null)}}switch(t&1038){case 2:fj(Z);Z.flags&=-3;break;case 6:fj(Z);Z.flags&=-3;ij(Z.alternate,Z);break;case 1024:Z.flags&=-1025;break;case 1028:Z.flags&=-1025;ij(Z.alternate,Z);break;case 4:ij(Z.alternate,Z);break;case 8:h=Z;cj(g,h);var J=h.alternate;dj(h);null!==\nJ&&dj(J)}Z=Z.nextEffect}}catch(va){if(null===Z)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect}while(null!==Z);v=lf;q=Ne();t=v.focusedElem;g=v.selectionRange;if(q!==t&&t&&t.ownerDocument&&Me(t.ownerDocument.documentElement,t)){null!==g&&Oe(t)&&(q=g.start,v=g.end,void 0===v&&(v=q),\"selectionStart\"in t?(t.selectionStart=q,t.selectionEnd=Math.min(v,t.value.length)):(v=(q=t.ownerDocument||document)&&q.defaultView||window,v.getSelection&&(v=v.getSelection(),h=t.textContent.length,J=Math.min(g.start,h),g=void 0===\ng.end?J:Math.min(g.end,h),!v.extend&&J>g&&(h=g,g=J,J=h),h=Le(t,J),f=Le(t,g),h&&f&&(1!==v.rangeCount||v.anchorNode!==h.node||v.anchorOffset!==h.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),v.removeAllRanges(),J>g?(v.addRange(q),v.extend(f.node,f.offset)):(q.setEnd(f.node,f.offset),v.addRange(q))))));q=[];for(v=t;v=v.parentNode;)1===v.nodeType&&q.push({element:v,left:v.scrollLeft,top:v.scrollTop});\"function\"===typeof t.focus&&t.focus();for(t=\n0;t<q.length;t++)v=q[t],v.element.scrollLeft=v.left,v.element.scrollTop=v.top}fd=!!kf;lf=kf=null;a.current=c;Z=d;do try{for(t=a;null!==Z;){var K=Z.flags;K&36&&Yi(t,Z.alternate,Z);if(K&128){q=void 0;var Q=Z.ref;if(null!==Q){var L=Z.stateNode;switch(Z.tag){case 5:q=L;break;default:q=L}\"function\"===typeof Q?Q(q):Q.current=q}}Z=Z.nextEffect}}catch(va){if(null===Z)throw Error(y(330));Wi(Z,va);Z=Z.nextEffect}while(null!==Z);Z=null;$f();X=e}else a.current=c;if(xj)xj=!1,yj=a,zj=b;else for(Z=d;null!==Z;)b=\nZ.nextEffect,Z.nextEffect=null,Z.flags&8&&(K=Z,K.sibling=null,K.stateNode=null),Z=b;d=a.pendingLanes;0===d&&(Ti=null);1===d?a===Ej?Dj++:(Dj=0,Ej=a):Dj=0;c=c.stateNode;if(Mf&&\"function\"===typeof Mf.onCommitFiberRoot)try{Mf.onCommitFiberRoot(Lf,c,void 0,64===(c.current.flags&64))}catch(va){}Mj(a,O());if(Qi)throw Qi=!1,a=Ri,Ri=null,a;if(0!==(X&8))return null;ig();return null}\nfunction ek(){for(;null!==Z;){var a=Z.alternate;Jj||null===Ij||(0!==(Z.flags&8)?dc(Z,Ij)&&(Jj=!0):13===Z.tag&&mj(a,Z)&&dc(Z,Ij)&&(Jj=!0));var b=Z.flags;0!==(b&256)&&Xi(a,Z);0===(b&512)||xj||(xj=!0,hg(97,function(){Oj();return null}));Z=Z.nextEffect}}function Oj(){if(90!==zj){var a=97<zj?97:zj;zj=90;return gg(a,fk)}return!1}function $i(a,b){Aj.push(b,a);xj||(xj=!0,hg(97,function(){Oj();return null}))}function Zi(a,b){Bj.push(b,a);xj||(xj=!0,hg(97,function(){Oj();return null}))}\nfunction fk(){if(null===yj)return!1;var a=yj;yj=null;if(0!==(X&48))throw Error(y(331));var b=X;X|=32;var c=Bj;Bj=[];for(var d=0;d<c.length;d+=2){var e=c[d],f=c[d+1],g=e.destroy;e.destroy=void 0;if(\"function\"===typeof g)try{g()}catch(k){if(null===f)throw Error(y(330));Wi(f,k)}}c=Aj;Aj=[];for(d=0;d<c.length;d+=2){e=c[d];f=c[d+1];try{var h=e.create;e.destroy=h()}catch(k){if(null===f)throw Error(y(330));Wi(f,k)}}for(h=a.current.firstEffect;null!==h;)a=h.nextEffect,h.nextEffect=null,h.flags&8&&(h.sibling=\nnull,h.stateNode=null),h=a;X=b;ig();return!0}function gk(a,b,c){b=Mi(c,b);b=Pi(a,b,1);Ag(a,b);b=Hg();a=Kj(a,1);null!==a&&($c(a,1,b),Mj(a,b))}\nfunction Wi(a,b){if(3===a.tag)gk(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){gk(c,a,b);break}else if(1===c.tag){var d=c.stateNode;if(\"function\"===typeof c.type.getDerivedStateFromError||\"function\"===typeof d.componentDidCatch&&(null===Ti||!Ti.has(d))){a=Mi(b,a);var e=Si(c,a,1);Ag(c,e);e=Hg();c=Kj(c,1);if(null!==c)$c(c,1,e),Mj(c,e);else if(\"function\"===typeof d.componentDidCatch&&(null===Ti||!Ti.has(d)))try{d.componentDidCatch(b,a)}catch(f){}break}}c=c.return}}\nfunction Yj(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);b=Hg();a.pingedLanes|=a.suspendedLanes&c;U===a&&(W&c)===c&&(4===V||3===V&&(W&62914560)===W&&500>O()-jj?Qj(a,0):uj|=c);Mj(a,b)}function lj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===eg()?1:2:(0===Gj&&(Gj=tj),b=Yc(62914560&~Gj),0===b&&(b=4194304)));c=Hg();a=Kj(a,b);null!==a&&($c(a,b,c),Mj(a,c))}var ck;\nck=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||N.current)ug=!0;else if(0!==(c&d))ug=0!==(a.flags&16384)?!0:!1;else{ug=!1;switch(b.tag){case 3:ri(b);sh();break;case 5:gh(b);break;case 1:Ff(b.type)&&Jf(b);break;case 4:eh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;var e=b.type._context;I(mg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return ti(a,b,c);I(P,P.current&1);b=hi(a,b,c);return null!==\nb?b.sibling:null}I(P,P.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Ai(a,b,c);b.flags|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);I(P,P.current);if(d)break;else return null;case 23:case 24:return b.lanes=0,mi(a,b,c)}return hi(a,b,c)}else ug=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=Ef(b,M.current);tg(b,c);e=Ch(null,b,d,a,e,c);b.flags|=1;if(\"object\"===\ntypeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(Ff(d)){var f=!0;Jf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;xg(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Gg(b,d,g,a);e.updater=Kg;b.stateNode=e;e._reactInternals=b;Og(b,d,a,c);b=qi(null,b,d,!0,f,c)}else b.tag=0,fi(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);\na=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=hk(e);a=lg(e,a);switch(f){case 0:b=li(null,b,e,a,c);break a;case 1:b=pi(null,b,e,a,c);break a;case 11:b=gi(null,b,e,a,c);break a;case 14:b=ii(null,b,e,lg(e.type,a),d,c);break a}throw Error(y(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),li(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),pi(a,b,d,e,c);case 3:ri(b);d=b.updateQueue;if(null===a||null===d)throw Error(y(282));\nd=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;yg(a,b);Cg(b,d,null,c);d=b.memoizedState.element;if(d===e)sh(),b=hi(a,b,c);else{e=b.stateNode;if(f=e.hydrate)kh=rf(b.stateNode.containerInfo.firstChild),jh=b,f=lh=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!=a)for(e=0;e<a.length;e+=2)f=a[e],f._workInProgressVersionPrimary=a[e+1],th.push(f);c=Zg(b,null,d,c);for(b.child=c;c;)c.flags=c.flags&-3|1024,c=c.sibling}else fi(a,b,d,c),sh();b=b.child}return b;case 5:return gh(b),null===a&&\nph(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,nf(d,e)?g=null:null!==f&&nf(d,f)&&(b.flags|=16),oi(a,b),fi(a,b,g,c),b.child;case 6:return null===a&&ph(b),null;case 13:return ti(a,b,c);case 4:return eh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Yg(b,null,d,c):fi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),gi(a,b,d,e,c);case 7:return fi(a,b,b.pendingProps,c),b.child;case 8:return fi(a,b,b.pendingProps.children,\nc),b.child;case 12:return fi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;g=b.memoizedProps;f=e.value;var h=b.type._context;I(mg,h._currentValue);h._currentValue=f;if(null!==g)if(h=g.value,f=He(h,f)?0:(\"function\"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0,0===f){if(g.children===e.children&&!N.current){b=hi(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==k){g=h.child;for(var l=\nk.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=zg(-1,c&-c),l.tag=2,Ag(h,l));h.lanes|=c;l=h.alternate;null!==l&&(l.lanes|=c);sg(h.return,c);k.lanes|=c;break}l=l.next}}else g=10===h.tag?h.type===b.type?null:h.child:h.child;if(null!==g)g.return=h;else for(g=h;null!==g;){if(g===b){g=null;break}h=g.sibling;if(null!==h){h.return=g.return;g=h;break}g=g.return}h=g}fi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,tg(b,c),e=vg(e,\nf.unstable_observedBits),d=d(e),b.flags|=1,fi(a,b,d,c),b.child;case 14:return e=b.type,f=lg(e,b.pendingProps),f=lg(e.type,f),ii(a,b,e,f,d,c);case 15:return ki(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2),b.tag=1,Ff(d)?(a=!0,Jf(b)):a=!1,tg(b,c),Mg(b,d,e),Og(b,d,e,c),qi(null,b,d,!0,a,c);case 19:return Ai(a,b,c);case 23:return mi(a,b,c);case 24:return mi(a,b,c)}throw Error(y(156,b.tag));\n};function ik(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.flags=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childLanes=this.lanes=0;this.alternate=null}function nh(a,b,c,d){return new ik(a,b,c,d)}function ji(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction hk(a){if(\"function\"===typeof a)return ji(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Aa)return 11;if(a===Da)return 14}return 2}\nfunction Tg(a,b){var c=a.alternate;null===c?(c=nh(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Vg(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)ji(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ua:return Xg(c.children,e,f,b);case Ha:g=8;e|=16;break;case wa:g=8;e|=1;break;case xa:return a=nh(12,c,b,e|8),a.elementType=xa,a.type=xa,a.lanes=f,a;case Ba:return a=nh(13,c,b,e),a.type=Ba,a.elementType=Ba,a.lanes=f,a;case Ca:return a=nh(19,c,b,e),a.elementType=Ca,a.lanes=f,a;case Ia:return vi(c,e,f,b);case Ja:return a=nh(24,c,b,e),a.elementType=Ja,a.lanes=f,a;default:if(\"object\"===\ntypeof a&&null!==a)switch(a.$$typeof){case ya:g=10;break a;case za:g=9;break a;case Aa:g=11;break a;case Da:g=14;break a;case Ea:g=16;d=null;break a;case Fa:g=22;break a}throw Error(y(130,null==a?a:typeof a,\"\"));}b=nh(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Xg(a,b,c,d){a=nh(7,a,d,b);a.lanes=c;return a}function vi(a,b,c,d){a=nh(23,a,d,b);a.elementType=Ia;a.lanes=c;return a}function Ug(a,b,c){a=nh(6,a,null,b);a.lanes=c;return a}\nfunction Wg(a,b,c){b=nh(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction jk(a,b,c){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.pendingContext=this.context=null;this.hydrate=c;this.callbackNode=null;this.callbackPriority=0;this.eventTimes=Zc(0);this.expirationTimes=Zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=Zc(0);this.mutableSourceEagerHydrationData=null}\nfunction kk(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:ta,key:null==d?null:\"\"+d,children:a,containerInfo:b,implementation:c}}\nfunction lk(a,b,c,d){var e=b.current,f=Hg(),g=Ig(e);a:if(c){c=c._reactInternals;b:{if(Zb(c)!==c||1!==c.tag)throw Error(y(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(Ff(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(y(171));}if(1===c.tag){var k=c.type;if(Ff(k)){c=If(c,k,h);break a}}c=h}else c=Cf;null===b.context?b.context=c:b.pendingContext=c;b=zg(f,g);b.payload={element:a};d=void 0===d?null:d;null!==\nd&&(b.callback=d);Ag(e,b);Jg(e,g,f);return g}function mk(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function nk(a,b){a=a.memoizedState;if(null!==a&&null!==a.dehydrated){var c=a.retryLane;a.retryLane=0!==c&&c<b?c:b}}function ok(a,b){nk(a,b);(a=a.alternate)&&nk(a,b)}function pk(){return null}\nfunction qk(a,b,c){var d=null!=c&&null!=c.hydrationOptions&&c.hydrationOptions.mutableSources||null;c=new jk(a,b,null!=c&&!0===c.hydrate);b=nh(3,null,null,2===b?7:1===b?3:0);c.current=b;b.stateNode=c;xg(b);a[ff]=c.current;cf(8===a.nodeType?a.parentNode:a);if(d)for(a=0;a<d.length;a++){b=d[a];var e=b._getVersion;e=e(b._source);null==c.mutableSourceEagerHydrationData?c.mutableSourceEagerHydrationData=[b,e]:c.mutableSourceEagerHydrationData.push(b,e)}this._internalRoot=c}\nqk.prototype.render=function(a){lk(a,this._internalRoot,null,null)};qk.prototype.unmount=function(){var a=this._internalRoot,b=a.containerInfo;lk(null,a,null,function(){b[ff]=null})};function rk(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||\" react-mount-point-unstable \"!==a.nodeValue))}\nfunction sk(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute(\"data-reactroot\")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new qk(a,0,b?{hydrate:!0}:void 0)}\nfunction tk(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if(\"function\"===typeof e){var h=e;e=function(){var a=mk(g);h.call(a)}}lk(b,g,a,e)}else{f=c._reactRootContainer=sk(c,d);g=f._internalRoot;if(\"function\"===typeof e){var k=e;e=function(){var a=mk(g);k.call(a)}}Xj(function(){lk(b,g,a,e)})}return mk(g)}ec=function(a){if(13===a.tag){var b=Hg();Jg(a,4,b);ok(a,4)}};fc=function(a){if(13===a.tag){var b=Hg();Jg(a,67108864,b);ok(a,67108864)}};\ngc=function(a){if(13===a.tag){var b=Hg(),c=Ig(a);Jg(a,c,b);ok(a,c)}};hc=function(a,b){return b()};\nyb=function(a,b,c){switch(b){case \"input\":ab(a,c);b=c.name;if(\"radio\"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll(\"input[name=\"+JSON.stringify(\"\"+b)+'][type=\"radio\"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=Db(d);if(!e)throw Error(y(90));Wa(d);ab(d,e)}}}break;case \"textarea\":ib(a,c);break;case \"select\":b=c.value,null!=b&&fb(a,!!c.multiple,b,!1)}};Gb=Wj;\nHb=function(a,b,c,d,e){var f=X;X|=4;try{return gg(98,a.bind(null,b,c,d,e))}finally{X=f,0===X&&(wj(),ig())}};Ib=function(){0===(X&49)&&(Vj(),Oj())};Jb=function(a,b){var c=X;X|=2;try{return a(b)}finally{X=c,0===X&&(wj(),ig())}};function uk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!rk(b))throw Error(y(200));return kk(a,b,null,c)}var vk={Events:[Cb,ue,Db,Eb,Fb,Oj,{current:!1}]},wk={findFiberByHostInstance:wc,bundleType:0,version:\"17.0.2\",rendererPackageName:\"react-dom\"};\nvar xk={bundleType:wk.bundleType,version:wk.version,rendererPackageName:wk.rendererPackageName,rendererConfig:wk.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ra.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=cc(a);return null===a?null:a.stateNode},findFiberByHostInstance:wk.findFiberByHostInstance||\npk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(\"undefined\"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var yk=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yk.isDisabled&&yk.supportsFiber)try{Lf=yk.inject(xk),Mf=yk}catch(a){}}exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vk;exports.createPortal=uk;\nexports.findDOMNode=function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternals;if(void 0===b){if(\"function\"===typeof a.render)throw Error(y(188));throw Error(y(268,Object.keys(a)));}a=cc(b);a=null===a?null:a.stateNode;return a};exports.flushSync=function(a,b){var c=X;if(0!==(c&48))return a(b);X|=1;try{if(a)return gg(99,a.bind(null,b))}finally{X=c,ig()}};exports.hydrate=function(a,b,c){if(!rk(b))throw Error(y(200));return tk(null,a,b,!0,c)};\nexports.render=function(a,b,c){if(!rk(b))throw Error(y(200));return tk(null,a,b,!1,c)};exports.unmountComponentAtNode=function(a){if(!rk(a))throw Error(y(40));return a._reactRootContainer?(Xj(function(){tk(null,null,a,!1,function(){a._reactRootContainer=null;a[ff]=null})}),!0):!1};exports.unstable_batchedUpdates=Wj;exports.unstable_createPortal=function(a,b){return uk(a,b,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)};\nexports.unstable_renderSubtreeIntoContainer=function(a,b,c,d){if(!rk(c))throw Error(y(200));if(null==a||void 0===a._reactInternals)throw Error(y(38));return tk(a,b,c,!1,d)};exports.version=\"17.0.2\";\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.min.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n","function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if(\"production\"!==process.env.NODE_ENV){var i=Y[n],o=i?\"function\"==typeof i?i.apply(null,t):i:\"unknown error nr: \"+n;throw Error(\"[Immer] \"+o)}throw Error(\"[Immer] minified error nr: \"+n+(t.length?\" \"+t.map((function(n){return\"'\"+n+\"'\"})).join(\",\"):\"\")+\". Find the full error at: https://bit.ly/3cXEKWf\")}function r(n){return!!n&&!!n[Q]}function t(n){var r;return!!n&&(function(n){if(!n||\"object\"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,\"constructor\")&&r.constructor;return t===Object||\"function\"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&\"symbol\"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||\"object\"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return\"production\"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b(\"Patches\"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b(\"ES5\").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b(\"Patches\").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b(\"Patches\").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if(\"production\"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b(\"MapSet\").F(r,t):v(r)?b(\"MapSet\").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b(\"ES5\").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b(\"ES5\").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return\"production\"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];\"production\"!==process.env.NODE_ENV&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m(\"ES5\",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,\"\"+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&\"object\"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c=\"add\";m(\"Patches\",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];\"string\"!=typeof p&&\"number\"!=typeof p&&(p=\"\"+p),0!==v&&1!==v||\"__proto__\"!==p&&\"constructor\"!==p||n(24),\"function\"==typeof f&&\"prototype\"===p&&n(24),\"object\"!=typeof(f=a(f,p))&&n(15,i.join(\"/\"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case\"replace\":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return\"-\"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case\"remove\":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?\"replace\":c:\"remove\";if(v!==p||\"replace\"!==l){var d=r.concat(n);t.push(\"remove\"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:\"remove\",path:d}:\"remove\"===l?{op:c,path:d,value:f(v)}:{op:\"replace\",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:\"replace\",path:p,value:f(u[v])}),e.push({op:\"replace\",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:\"replace\",path:r.concat([\"length\"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:\"remove\",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:\"remove\",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:\"replace\",path:[],value:r===H?void 0:r}),e.push({op:\"replace\",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,\"size\",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,\"size\",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m(\"MapSet\",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W=\"undefined\"!=typeof Symbol&&\"symbol\"==typeof Symbol(\"x\"),X=\"undefined\"!=typeof Map,q=\"undefined\"!=typeof Set,B=\"undefined\"!=typeof Proxy&&void 0!==Proxy.revocable&&\"undefined\"!=typeof Reflect,H=W?Symbol.for(\"immer-nothing\"):((G={})[\"immer-nothing\"]=!0,G),L=W?Symbol.for(\"immer-draftable\"):\"__$immer_draftable\",Q=W?Symbol.for(\"immer-state\"):\"__$immer_state\",V=\"undefined\"!=typeof Symbol&&Symbol.iterator||\"@@iterator\",Y={0:\"Illegal state\",1:\"Immer drafts cannot have computed properties\",2:\"This object has been frozen and should not be mutated\",3:function(n){return\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \"+n},4:\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",5:\"Immer forbids circular references\",6:\"The first or second argument to `produce` must be a function\",7:\"The third argument to `produce` must be a function or undefined\",8:\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",9:\"First argument to `finishDraft` must be a draft returned by `createDraft`\",10:\"The given draft is already finalized\",11:\"Object.defineProperty() cannot be used on an Immer draft\",12:\"Object.setPrototypeOf() cannot be used on an Immer draft\",13:\"Immer only supports deleting array indices\",14:\"Immer only supports setting array indices and the 'length' property\",15:function(n){return\"Cannot apply patch, path doesn't resolve: \"+n},16:'Sets cannot have \"replace\" patches.',17:function(n){return\"Unsupported patch operation: \"+n},18:function(n){return\"The plugin for '\"+n+\"' has not been loaded into Immer. To enable the plugin, import and call `enable\"+n+\"()` when initializing your application.\"},20:\"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available\",21:function(n){return\"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '\"+n+\"'\"},22:function(n){return\"'current' expects a draft, got: \"+n},23:function(n){return\"'original' expects a draft, got: \"+n},24:\"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"},Z=\"\"+Object.prototype.constructor,nn=\"undefined\"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?\"value\"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||\"length\"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return\"production\"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return\"production\"!==process.env.NODE_ENV&&\"length\"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if(\"function\"==typeof r&&\"function\"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if(\"function\"!=typeof i&&n(6),void 0!==o&&\"function\"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return\"undefined\"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||\"object\"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b(\"Patches\").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if(\"function\"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return\"undefined\"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},\"boolean\"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),\"boolean\"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];\"production\"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&\"replace\"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b(\"Patches\").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);export default fn;export{un as Immer,pn as applyPatches,K as castDraft,$ as castImmutable,ln as createDraft,R as current,J as enableAllPlugins,F as enableES5,C as enableMapSet,T as enablePatches,dn as finishDraft,d as freeze,L as immerable,r as isDraft,t as isDraftable,H as nothing,e as original,fn as produce,cn as produceWithPatches,sn as setAutoFreeze,vn as setUseProxies};\n//# sourceMappingURL=immer.esm.js.map\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nexport default function _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nvar legacy_createStore = createStore;\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };\n","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n};\r\nvar __defProp = Object.defineProperty;\r\nvar __defProps = Object.defineProperties;\r\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\r\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\r\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\r\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\r\nvar __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };\r\nvar __spreadValues = function (a, b) {\r\n for (var prop in b || (b = {}))\r\n if (__hasOwnProp.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n if (__getOwnPropSymbols)\r\n for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {\r\n var prop = _c[_i];\r\n if (__propIsEnum.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n }\r\n return a;\r\n};\r\nvar __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };\r\nvar __async = function (__this, __arguments, generator) {\r\n return new Promise(function (resolve, reject) {\r\n var fulfilled = function (value) {\r\n try {\r\n step(generator.next(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var rejected = function (value) {\r\n try {\r\n step(generator.throw(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };\r\n step((generator = generator.apply(__this, __arguments)).next());\r\n });\r\n};\r\n// src/index.ts\r\nimport { enableES5 } from \"immer\";\r\nexport * from \"redux\";\r\nimport { default as default2, current as current2, freeze, original, isDraft as isDraft4 } from \"immer\";\r\nimport { createSelector as createSelector2 } from \"reselect\";\r\n// src/createDraftSafeSelector.ts\r\nimport { current, isDraft } from \"immer\";\r\nimport { createSelector } from \"reselect\";\r\nvar createDraftSafeSelector = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var selector = createSelector.apply(void 0, args);\r\n var wrappedSelector = function (value) {\r\n var rest = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n rest[_i - 1] = arguments[_i];\r\n }\r\n return selector.apply(void 0, __spreadArray([isDraft(value) ? current(value) : value], rest));\r\n };\r\n return wrappedSelector;\r\n};\r\n// src/configureStore.ts\r\nimport { createStore, compose as compose2, applyMiddleware, combineReducers } from \"redux\";\r\n// src/devtoolsExtension.ts\r\nimport { compose } from \"redux\";\r\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {\r\n if (arguments.length === 0)\r\n return void 0;\r\n if (typeof arguments[0] === \"object\")\r\n return compose;\r\n return compose.apply(null, arguments);\r\n};\r\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {\r\n return function (noop2) {\r\n return noop2;\r\n };\r\n};\r\n// src/isPlainObject.ts\r\nfunction isPlainObject(value) {\r\n if (typeof value !== \"object\" || value === null)\r\n return false;\r\n var proto = Object.getPrototypeOf(value);\r\n if (proto === null)\r\n return true;\r\n var baseProto = proto;\r\n while (Object.getPrototypeOf(baseProto) !== null) {\r\n baseProto = Object.getPrototypeOf(baseProto);\r\n }\r\n return proto === baseProto;\r\n}\r\n// src/getDefaultMiddleware.ts\r\nimport thunkMiddleware from \"redux-thunk\";\r\n// src/tsHelpers.ts\r\nvar hasMatchFunction = function (v) {\r\n return v && typeof v.match === \"function\";\r\n};\r\n// src/createAction.ts\r\nfunction createAction(type, prepareAction) {\r\n function actionCreator() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (prepareAction) {\r\n var prepared = prepareAction.apply(void 0, args);\r\n if (!prepared) {\r\n throw new Error(\"prepareAction did not return an object\");\r\n }\r\n return __spreadValues(__spreadValues({\r\n type: type,\r\n payload: prepared.payload\r\n }, \"meta\" in prepared && { meta: prepared.meta }), \"error\" in prepared && { error: prepared.error });\r\n }\r\n return { type: type, payload: args[0] };\r\n }\r\n actionCreator.toString = function () { return \"\" + type; };\r\n actionCreator.type = type;\r\n actionCreator.match = function (action) { return action.type === type; };\r\n return actionCreator;\r\n}\r\nfunction isAction(action) {\r\n return isPlainObject(action) && \"type\" in action;\r\n}\r\nfunction isActionCreator(action) {\r\n return typeof action === \"function\" && \"type\" in action && hasMatchFunction(action);\r\n}\r\nfunction isFSA(action) {\r\n return isAction(action) && typeof action.type === \"string\" && Object.keys(action).every(isValidKey);\r\n}\r\nfunction isValidKey(key) {\r\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\r\n}\r\nfunction getType(actionCreator) {\r\n return \"\" + actionCreator;\r\n}\r\n// src/actionCreatorInvariantMiddleware.ts\r\nfunction getMessage(type) {\r\n var splitType = type ? (\"\" + type).split(\"/\") : [];\r\n var actionName = splitType[splitType.length - 1] || \"actionCreator\";\r\n return \"Detected an action creator with type \\\"\" + (type || \"unknown\") + \"\\\" being dispatched. \\nMake sure you're calling the action creator before dispatching, i.e. `dispatch(\" + actionName + \"())` instead of `dispatch(\" + actionName + \")`. This is necessary even if the action has no payload.\";\r\n}\r\nfunction createActionCreatorInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c;\r\n return function () { return function (next) { return function (action) {\r\n if (isActionCreator2(action)) {\r\n console.warn(getMessage(action.type));\r\n }\r\n return next(action);\r\n }; }; };\r\n}\r\n// src/utils.ts\r\nimport createNextState, { isDraftable } from \"immer\";\r\nfunction getTimeMeasureUtils(maxDelay, fnName) {\r\n var elapsed = 0;\r\n return {\r\n measureTime: function (fn) {\r\n var started = Date.now();\r\n try {\r\n return fn();\r\n }\r\n finally {\r\n var finished = Date.now();\r\n elapsed += finished - started;\r\n }\r\n },\r\n warnIfExceeded: function () {\r\n if (elapsed > maxDelay) {\r\n console.warn(fnName + \" took \" + elapsed + \"ms, which is more than the warning threshold of \" + maxDelay + \"ms. \\nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\\nIt is disabled in production builds, so you don't need to worry about that.\");\r\n }\r\n }\r\n };\r\n}\r\nvar MiddlewareArray = /** @class */ (function (_super) {\r\n __extends(MiddlewareArray, _super);\r\n function MiddlewareArray() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n Object.setPrototypeOf(_this, MiddlewareArray.prototype);\r\n return _this;\r\n }\r\n Object.defineProperty(MiddlewareArray, Symbol.species, {\r\n get: function () {\r\n return MiddlewareArray;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n MiddlewareArray.prototype.concat = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n return _super.prototype.concat.apply(this, arr);\r\n };\r\n MiddlewareArray.prototype.prepend = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();\r\n }\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();\r\n };\r\n return MiddlewareArray;\r\n}(Array));\r\nvar EnhancerArray = /** @class */ (function (_super) {\r\n __extends(EnhancerArray, _super);\r\n function EnhancerArray() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n Object.setPrototypeOf(_this, EnhancerArray.prototype);\r\n return _this;\r\n }\r\n Object.defineProperty(EnhancerArray, Symbol.species, {\r\n get: function () {\r\n return EnhancerArray;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n EnhancerArray.prototype.concat = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n return _super.prototype.concat.apply(this, arr);\r\n };\r\n EnhancerArray.prototype.prepend = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();\r\n }\r\n return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();\r\n };\r\n return EnhancerArray;\r\n}(Array));\r\nfunction freezeDraftable(val) {\r\n return isDraftable(val) ? createNextState(val, function () {\r\n }) : val;\r\n}\r\n// src/immutableStateInvariantMiddleware.ts\r\nvar isProduction = process.env.NODE_ENV === \"production\";\r\nvar prefix = \"Invariant failed\";\r\nfunction invariant(condition, message) {\r\n if (condition) {\r\n return;\r\n }\r\n if (isProduction) {\r\n throw new Error(prefix);\r\n }\r\n throw new Error(prefix + \": \" + (message || \"\"));\r\n}\r\nfunction stringify(obj, serializer, indent, decycler) {\r\n return JSON.stringify(obj, getSerialize(serializer, decycler), indent);\r\n}\r\nfunction getSerialize(serializer, decycler) {\r\n var stack = [], keys = [];\r\n if (!decycler)\r\n decycler = function (_, value) {\r\n if (stack[0] === value)\r\n return \"[Circular ~]\";\r\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\r\n };\r\n return function (key, value) {\r\n if (stack.length > 0) {\r\n var thisPos = stack.indexOf(this);\r\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\r\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\r\n if (~stack.indexOf(value))\r\n value = decycler.call(this, key, value);\r\n }\r\n else\r\n stack.push(value);\r\n return serializer == null ? value : serializer.call(this, key, value);\r\n };\r\n}\r\nfunction isImmutableDefault(value) {\r\n return typeof value !== \"object\" || value == null || Object.isFrozen(value);\r\n}\r\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\r\n var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\r\n return {\r\n detectMutations: function () {\r\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\r\n }\r\n };\r\n}\r\nfunction trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) {\r\n if (ignorePaths === void 0) { ignorePaths = []; }\r\n if (path === void 0) { path = \"\"; }\r\n if (checkedObjects === void 0) { checkedObjects = new Set(); }\r\n var tracked = { value: obj };\r\n if (!isImmutable(obj) && !checkedObjects.has(obj)) {\r\n checkedObjects.add(obj);\r\n tracked.children = {};\r\n for (var key in obj) {\r\n var childPath = path ? path + \".\" + key : key;\r\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\r\n continue;\r\n }\r\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\r\n }\r\n }\r\n return tracked;\r\n}\r\nfunction detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {\r\n if (ignoredPaths === void 0) { ignoredPaths = []; }\r\n if (sameParentRef === void 0) { sameParentRef = false; }\r\n if (path === void 0) { path = \"\"; }\r\n var prevObj = trackedProperty ? trackedProperty.value : void 0;\r\n var sameRef = prevObj === obj;\r\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\r\n return { wasMutated: true, path: path };\r\n }\r\n if (isImmutable(prevObj) || isImmutable(obj)) {\r\n return { wasMutated: false };\r\n }\r\n var keysToDetect = {};\r\n for (var key in trackedProperty.children) {\r\n keysToDetect[key] = true;\r\n }\r\n for (var key in obj) {\r\n keysToDetect[key] = true;\r\n }\r\n var hasIgnoredPaths = ignoredPaths.length > 0;\r\n var _loop_1 = function (key) {\r\n var nestedPath = path ? path + \".\" + key : key;\r\n if (hasIgnoredPaths) {\r\n var hasMatches = ignoredPaths.some(function (ignored) {\r\n if (ignored instanceof RegExp) {\r\n return ignored.test(nestedPath);\r\n }\r\n return nestedPath === ignored;\r\n });\r\n if (hasMatches) {\r\n return \"continue\";\r\n }\r\n }\r\n var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);\r\n if (result.wasMutated) {\r\n return { value: result };\r\n }\r\n };\r\n for (var key in keysToDetect) {\r\n var state_1 = _loop_1(key);\r\n if (typeof state_1 === \"object\")\r\n return state_1.value;\r\n }\r\n return { wasMutated: false };\r\n}\r\nfunction createImmutableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;\r\n ignoredPaths = ignoredPaths || ignore;\r\n var track = trackForMutations.bind(null, isImmutable, ignoredPaths);\r\n return function (_c) {\r\n var getState = _c.getState;\r\n var state = getState();\r\n var tracker = track(state);\r\n var result;\r\n return function (next) { return function (action) {\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n invariant(!result.wasMutated, \"A state mutation was detected between dispatches, in the path '\" + (result.path || \"\") + \"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n var dispatchedAction = next(action);\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n result.wasMutated && invariant(!result.wasMutated, \"A state mutation was detected inside a dispatch, in the path: \" + (result.path || \"\") + \". Take a look at the reducer(s) handling the action \" + stringify(action) + \". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n measureUtils.warnIfExceeded();\r\n return dispatchedAction;\r\n }; };\r\n };\r\n}\r\n// src/serializableStateInvariantMiddleware.ts\r\nfunction isPlain(val) {\r\n var type = typeof val;\r\n return val == null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\r\n}\r\nfunction findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {\r\n if (path === void 0) { path = \"\"; }\r\n if (isSerializable === void 0) { isSerializable = isPlain; }\r\n if (ignoredPaths === void 0) { ignoredPaths = []; }\r\n var foundNestedSerializable;\r\n if (!isSerializable(value)) {\r\n return {\r\n keyPath: path || \"<root>\",\r\n value: value\r\n };\r\n }\r\n if (typeof value !== \"object\" || value === null) {\r\n return false;\r\n }\r\n if (cache == null ? void 0 : cache.has(value))\r\n return false;\r\n var entries = getEntries != null ? getEntries(value) : Object.entries(value);\r\n var hasIgnoredPaths = ignoredPaths.length > 0;\r\n var _loop_2 = function (key, nestedValue) {\r\n var nestedPath = path ? path + \".\" + key : key;\r\n if (hasIgnoredPaths) {\r\n var hasMatches = ignoredPaths.some(function (ignored) {\r\n if (ignored instanceof RegExp) {\r\n return ignored.test(nestedPath);\r\n }\r\n return nestedPath === ignored;\r\n });\r\n if (hasMatches) {\r\n return \"continue\";\r\n }\r\n }\r\n if (!isSerializable(nestedValue)) {\r\n return { value: {\r\n keyPath: nestedPath,\r\n value: nestedValue\r\n } };\r\n }\r\n if (typeof nestedValue === \"object\") {\r\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);\r\n if (foundNestedSerializable) {\r\n return { value: foundNestedSerializable };\r\n }\r\n }\r\n };\r\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\r\n var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];\r\n var state_2 = _loop_2(key, nestedValue);\r\n if (typeof state_2 === \"object\")\r\n return state_2.value;\r\n }\r\n if (cache && isNestedFrozen(value))\r\n cache.add(value);\r\n return false;\r\n}\r\nfunction isNestedFrozen(value) {\r\n if (!Object.isFrozen(value))\r\n return false;\r\n for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {\r\n var nestedValue = _c[_i];\r\n if (typeof nestedValue !== \"object\" || nestedValue === null)\r\n continue;\r\n if (!isNestedFrozen(nestedValue))\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction createSerializableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? [\"meta.arg\", \"meta.baseQueryMeta\"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;\r\n var cache = !disableCache && WeakSet ? new WeakSet() : void 0;\r\n return function (storeAPI) { return function (next) { return function (action) {\r\n var result = next(action);\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\r\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\r\n measureUtils.measureTime(function () {\r\n var foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths, cache);\r\n if (foundActionNonSerializableValue) {\r\n var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in an action, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the logic that dispatched this action: \", action, \"\\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)\", \"\\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\");\r\n }\r\n });\r\n }\r\n if (!ignoreState) {\r\n measureUtils.measureTime(function () {\r\n var state = storeAPI.getState();\r\n var foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths, cache);\r\n if (foundStateNonSerializableValue) {\r\n var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in the state, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the reducer(s) handling this action type: \" + action.type + \".\\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)\");\r\n }\r\n });\r\n measureUtils.warnIfExceeded();\r\n }\r\n return result;\r\n }; }; };\r\n}\r\n// src/getDefaultMiddleware.ts\r\nfunction isBoolean(x) {\r\n return typeof x === \"boolean\";\r\n}\r\nfunction curryGetDefaultMiddleware() {\r\n return function curriedGetDefaultMiddleware(options) {\r\n return getDefaultMiddleware(options);\r\n };\r\n}\r\nfunction getDefaultMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f;\r\n var middlewareArray = new MiddlewareArray();\r\n if (thunk) {\r\n if (isBoolean(thunk)) {\r\n middlewareArray.push(thunkMiddleware);\r\n }\r\n else {\r\n middlewareArray.push(thunkMiddleware.withExtraArgument(thunk.extraArgument));\r\n }\r\n }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (immutableCheck) {\r\n var immutableOptions = {};\r\n if (!isBoolean(immutableCheck)) {\r\n immutableOptions = immutableCheck;\r\n }\r\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\r\n }\r\n if (serializableCheck) {\r\n var serializableOptions = {};\r\n if (!isBoolean(serializableCheck)) {\r\n serializableOptions = serializableCheck;\r\n }\r\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\r\n }\r\n if (actionCreatorCheck) {\r\n var actionCreatorOptions = {};\r\n if (!isBoolean(actionCreatorCheck)) {\r\n actionCreatorOptions = actionCreatorCheck;\r\n }\r\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\r\n }\r\n }\r\n return middlewareArray;\r\n}\r\n// src/configureStore.ts\r\nvar IS_PRODUCTION = process.env.NODE_ENV === \"production\";\r\nfunction configureStore(options) {\r\n var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();\r\n var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;\r\n var rootReducer;\r\n if (typeof reducer === \"function\") {\r\n rootReducer = reducer;\r\n }\r\n else if (isPlainObject(reducer)) {\r\n rootReducer = combineReducers(reducer);\r\n }\r\n else {\r\n throw new Error('\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');\r\n }\r\n var finalMiddleware = middleware;\r\n if (typeof finalMiddleware === \"function\") {\r\n finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);\r\n if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {\r\n throw new Error(\"when using a middleware builder function, an array of middleware must be returned\");\r\n }\r\n }\r\n if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== \"function\"; })) {\r\n throw new Error(\"each middleware provided to configureStore must be a function\");\r\n }\r\n var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);\r\n var finalCompose = compose2;\r\n if (devTools) {\r\n finalCompose = composeWithDevTools(__spreadValues({\r\n trace: !IS_PRODUCTION\r\n }, typeof devTools === \"object\" && devTools));\r\n }\r\n var defaultEnhancers = new EnhancerArray(middlewareEnhancer);\r\n var storeEnhancers = defaultEnhancers;\r\n if (Array.isArray(enhancers)) {\r\n storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);\r\n }\r\n else if (typeof enhancers === \"function\") {\r\n storeEnhancers = enhancers(defaultEnhancers);\r\n }\r\n var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);\r\n return createStore(rootReducer, preloadedState, composedEnhancer);\r\n}\r\n// src/createReducer.ts\r\nimport createNextState2, { isDraft as isDraft2, isDraftable as isDraftable2 } from \"immer\";\r\n// src/mapBuilders.ts\r\nfunction executeReducerBuilderCallback(builderCallback) {\r\n var actionsMap = {};\r\n var actionMatchers = [];\r\n var defaultCaseReducer;\r\n var builder = {\r\n addCase: function (typeOrActionCreator, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (actionMatchers.length > 0) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addMatcher`\");\r\n }\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n var type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\r\n if (!type) {\r\n throw new Error(\"`builder.addCase` cannot be called with an empty action type\");\r\n }\r\n if (type in actionsMap) {\r\n throw new Error(\"`builder.addCase` cannot be called with two reducers for the same action type\");\r\n }\r\n actionsMap[type] = reducer;\r\n return builder;\r\n },\r\n addMatcher: function (matcher, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n actionMatchers.push({ matcher: matcher, reducer: reducer });\r\n return builder;\r\n },\r\n addDefaultCase: function (reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addDefaultCase` can only be called once\");\r\n }\r\n }\r\n defaultCaseReducer = reducer;\r\n return builder;\r\n }\r\n };\r\n builderCallback(builder);\r\n return [actionsMap, actionMatchers, defaultCaseReducer];\r\n}\r\n// src/createReducer.ts\r\nfunction isStateFunction(x) {\r\n return typeof x === \"function\";\r\n}\r\nvar hasWarnedAboutObjectNotation = false;\r\nfunction createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {\r\n if (actionMatchers === void 0) { actionMatchers = []; }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (typeof mapOrBuilderCallback === \"object\") {\r\n if (!hasWarnedAboutObjectNotation) {\r\n hasWarnedAboutObjectNotation = true;\r\n console.warn(\"The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\r\n }\r\n }\r\n }\r\n var _c = typeof mapOrBuilderCallback === \"function\" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];\r\n var getInitialState;\r\n if (isStateFunction(initialState)) {\r\n getInitialState = function () { return freezeDraftable(initialState()); };\r\n }\r\n else {\r\n var frozenInitialState_1 = freezeDraftable(initialState);\r\n getInitialState = function () { return frozenInitialState_1; };\r\n }\r\n function reducer(state, action) {\r\n if (state === void 0) { state = getInitialState(); }\r\n var caseReducers = __spreadArray([\r\n actionsMap[action.type]\r\n ], finalActionMatchers.filter(function (_c) {\r\n var matcher = _c.matcher;\r\n return matcher(action);\r\n }).map(function (_c) {\r\n var reducer2 = _c.reducer;\r\n return reducer2;\r\n }));\r\n if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {\r\n caseReducers = [finalDefaultCaseReducer];\r\n }\r\n return caseReducers.reduce(function (previousState, caseReducer) {\r\n if (caseReducer) {\r\n if (isDraft2(previousState)) {\r\n var draft = previousState;\r\n var result = caseReducer(draft, action);\r\n if (result === void 0) {\r\n return previousState;\r\n }\r\n return result;\r\n }\r\n else if (!isDraftable2(previousState)) {\r\n var result = caseReducer(previousState, action);\r\n if (result === void 0) {\r\n if (previousState === null) {\r\n return previousState;\r\n }\r\n throw Error(\"A case reducer on a non-draftable value must not return undefined\");\r\n }\r\n return result;\r\n }\r\n else {\r\n return createNextState2(previousState, function (draft) {\r\n return caseReducer(draft, action);\r\n });\r\n }\r\n }\r\n return previousState;\r\n }, state);\r\n }\r\n reducer.getInitialState = getInitialState;\r\n return reducer;\r\n}\r\n// src/createSlice.ts\r\nvar hasWarnedAboutObjectNotation2 = false;\r\nfunction getType2(slice, actionKey) {\r\n return slice + \"/\" + actionKey;\r\n}\r\nfunction createSlice(options) {\r\n var name = options.name;\r\n if (!name) {\r\n throw new Error(\"`name` is a required option for createSlice\");\r\n }\r\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\r\n if (options.initialState === void 0) {\r\n console.error(\"You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`\");\r\n }\r\n }\r\n var initialState = typeof options.initialState == \"function\" ? options.initialState : freezeDraftable(options.initialState);\r\n var reducers = options.reducers || {};\r\n var reducerNames = Object.keys(reducers);\r\n var sliceCaseReducersByName = {};\r\n var sliceCaseReducersByType = {};\r\n var actionCreators = {};\r\n reducerNames.forEach(function (reducerName) {\r\n var maybeReducerWithPrepare = reducers[reducerName];\r\n var type = getType2(name, reducerName);\r\n var caseReducer;\r\n var prepareCallback;\r\n if (\"reducer\" in maybeReducerWithPrepare) {\r\n caseReducer = maybeReducerWithPrepare.reducer;\r\n prepareCallback = maybeReducerWithPrepare.prepare;\r\n }\r\n else {\r\n caseReducer = maybeReducerWithPrepare;\r\n }\r\n sliceCaseReducersByName[reducerName] = caseReducer;\r\n sliceCaseReducersByType[type] = caseReducer;\r\n actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);\r\n });\r\n function buildReducer() {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (typeof options.extraReducers === \"object\") {\r\n if (!hasWarnedAboutObjectNotation2) {\r\n hasWarnedAboutObjectNotation2 = true;\r\n console.warn(\"The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\r\n }\r\n }\r\n }\r\n var _c = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;\r\n var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);\r\n return createReducer(initialState, function (builder) {\r\n for (var key in finalCaseReducers) {\r\n builder.addCase(key, finalCaseReducers[key]);\r\n }\r\n for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {\r\n var m = actionMatchers_1[_i];\r\n builder.addMatcher(m.matcher, m.reducer);\r\n }\r\n if (defaultCaseReducer) {\r\n builder.addDefaultCase(defaultCaseReducer);\r\n }\r\n });\r\n }\r\n var _reducer;\r\n return {\r\n name: name,\r\n reducer: function (state, action) {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer(state, action);\r\n },\r\n actions: actionCreators,\r\n caseReducers: sliceCaseReducersByName,\r\n getInitialState: function () {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer.getInitialState();\r\n }\r\n };\r\n}\r\n// src/entities/entity_state.ts\r\nfunction getInitialEntityState() {\r\n return {\r\n ids: [],\r\n entities: {}\r\n };\r\n}\r\nfunction createInitialStateFactory() {\r\n function getInitialState(additionalState) {\r\n if (additionalState === void 0) { additionalState = {}; }\r\n return Object.assign(getInitialEntityState(), additionalState);\r\n }\r\n return { getInitialState: getInitialState };\r\n}\r\n// src/entities/state_selectors.ts\r\nfunction createSelectorsFactory() {\r\n function getSelectors(selectState) {\r\n var selectIds = function (state) { return state.ids; };\r\n var selectEntities = function (state) { return state.entities; };\r\n var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });\r\n var selectId = function (_, id) { return id; };\r\n var selectById = function (entities, id) { return entities[id]; };\r\n var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });\r\n if (!selectState) {\r\n return {\r\n selectIds: selectIds,\r\n selectEntities: selectEntities,\r\n selectAll: selectAll,\r\n selectTotal: selectTotal,\r\n selectById: createDraftSafeSelector(selectEntities, selectId, selectById)\r\n };\r\n }\r\n var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);\r\n return {\r\n selectIds: createDraftSafeSelector(selectState, selectIds),\r\n selectEntities: selectGlobalizedEntities,\r\n selectAll: createDraftSafeSelector(selectState, selectAll),\r\n selectTotal: createDraftSafeSelector(selectState, selectTotal),\r\n selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)\r\n };\r\n }\r\n return { getSelectors: getSelectors };\r\n}\r\n// src/entities/state_adapter.ts\r\nimport createNextState3, { isDraft as isDraft3 } from \"immer\";\r\nfunction createSingleArgumentStateOperator(mutator) {\r\n var operator = createStateOperator(function (_, state) { return mutator(state); });\r\n return function operation(state) {\r\n return operator(state, void 0);\r\n };\r\n}\r\nfunction createStateOperator(mutator) {\r\n return function operation(state, arg) {\r\n function isPayloadActionArgument(arg2) {\r\n return isFSA(arg2);\r\n }\r\n var runMutator = function (draft) {\r\n if (isPayloadActionArgument(arg)) {\r\n mutator(arg.payload, draft);\r\n }\r\n else {\r\n mutator(arg, draft);\r\n }\r\n };\r\n if (isDraft3(state)) {\r\n runMutator(state);\r\n return state;\r\n }\r\n else {\r\n return createNextState3(state, runMutator);\r\n }\r\n };\r\n}\r\n// src/entities/utils.ts\r\nfunction selectIdValue(entity, selectId) {\r\n var key = selectId(entity);\r\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\r\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\r\n }\r\n return key;\r\n}\r\nfunction ensureEntitiesArray(entities) {\r\n if (!Array.isArray(entities)) {\r\n entities = Object.values(entities);\r\n }\r\n return entities;\r\n}\r\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var added = [];\r\n var updated = [];\r\n for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {\r\n var entity = newEntities_1[_i];\r\n var id = selectIdValue(entity, selectId);\r\n if (id in state.entities) {\r\n updated.push({ id: id, changes: entity });\r\n }\r\n else {\r\n added.push(entity);\r\n }\r\n }\r\n return [added, updated];\r\n}\r\n// src/entities/unsorted_state_adapter.ts\r\nfunction createUnsortedStateAdapter(selectId) {\r\n function addOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (key in state.entities) {\r\n return;\r\n }\r\n state.ids.push(key);\r\n state.entities[key] = entity;\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {\r\n var entity = newEntities_2[_i];\r\n addOneMutably(entity, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (!(key in state.entities)) {\r\n state.ids.push(key);\r\n }\r\n state.entities[key] = entity;\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {\r\n var entity = newEntities_3[_i];\r\n setOneMutably(entity, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.ids = [];\r\n state.entities = {};\r\n addManyMutably(newEntities, state);\r\n }\r\n function removeOneMutably(key, state) {\r\n return removeManyMutably([key], state);\r\n }\r\n function removeManyMutably(keys, state) {\r\n var didMutate = false;\r\n keys.forEach(function (key) {\r\n if (key in state.entities) {\r\n delete state.entities[key];\r\n didMutate = true;\r\n }\r\n });\r\n if (didMutate) {\r\n state.ids = state.ids.filter(function (id) { return id in state.entities; });\r\n }\r\n }\r\n function removeAllMutably(state) {\r\n Object.assign(state, {\r\n ids: [],\r\n entities: {}\r\n });\r\n }\r\n function takeNewKey(keys, update, state) {\r\n var original2 = state.entities[update.id];\r\n var updated = Object.assign({}, original2, update.changes);\r\n var newKey = selectIdValue(updated, selectId);\r\n var hasNewKey = newKey !== update.id;\r\n if (hasNewKey) {\r\n keys[update.id] = newKey;\r\n delete state.entities[update.id];\r\n }\r\n state.entities[newKey] = updated;\r\n return hasNewKey;\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function updateManyMutably(updates, state) {\r\n var newKeys = {};\r\n var updatesPerEntity = {};\r\n updates.forEach(function (update) {\r\n if (update.id in state.entities) {\r\n updatesPerEntity[update.id] = {\r\n id: update.id,\r\n changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)\r\n };\r\n }\r\n });\r\n updates = Object.values(updatesPerEntity);\r\n var didMutateEntities = updates.length > 0;\r\n if (didMutateEntities) {\r\n var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;\r\n if (didMutateIds) {\r\n state.ids = Object.keys(state.entities);\r\n }\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n return {\r\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\r\n addOne: createStateOperator(addOneMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n upsertMany: createStateOperator(upsertManyMutably),\r\n removeOne: createStateOperator(removeOneMutably),\r\n removeMany: createStateOperator(removeManyMutably)\r\n };\r\n}\r\n// src/entities/sorted_state_adapter.ts\r\nfunction createSortedStateAdapter(selectId, sort) {\r\n var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;\r\n function addOneMutably(entity, state) {\r\n return addManyMutably([entity], state);\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });\r\n if (models.length !== 0) {\r\n merge(models, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n return setManyMutably([entity], state);\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n if (newEntities.length !== 0) {\r\n merge(newEntities, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.entities = {};\r\n state.ids = [];\r\n addManyMutably(newEntities, state);\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function updateManyMutably(updates, state) {\r\n var appliedUpdates = false;\r\n for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {\r\n var update = updates_1[_i];\r\n var entity = state.entities[update.id];\r\n if (!entity) {\r\n continue;\r\n }\r\n appliedUpdates = true;\r\n Object.assign(entity, update.changes);\r\n var newId = selectId(entity);\r\n if (update.id !== newId) {\r\n delete state.entities[update.id];\r\n state.entities[newId] = entity;\r\n }\r\n }\r\n if (appliedUpdates) {\r\n resortEntities(state);\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n function areArraysEqual(a, b) {\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < a.length && i < b.length; i++) {\r\n if (a[i] === b[i]) {\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function merge(models, state) {\r\n models.forEach(function (model) {\r\n state.entities[selectId(model)] = model;\r\n });\r\n resortEntities(state);\r\n }\r\n function resortEntities(state) {\r\n var allEntities = Object.values(state.entities);\r\n allEntities.sort(sort);\r\n var newSortedIds = allEntities.map(selectId);\r\n var ids = state.ids;\r\n if (!areArraysEqual(ids, newSortedIds)) {\r\n state.ids = newSortedIds;\r\n }\r\n }\r\n return {\r\n removeOne: removeOne,\r\n removeMany: removeMany,\r\n removeAll: removeAll,\r\n addOne: createStateOperator(addOneMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertMany: createStateOperator(upsertManyMutably)\r\n };\r\n}\r\n// src/entities/create_adapter.ts\r\nfunction createEntityAdapter(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = __spreadValues({\r\n sortComparer: false,\r\n selectId: function (instance) { return instance.id; }\r\n }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;\r\n var stateFactory = createInitialStateFactory();\r\n var selectorsFactory = createSelectorsFactory();\r\n var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\r\n return __spreadValues(__spreadValues(__spreadValues({\r\n selectId: selectId,\r\n sortComparer: sortComparer\r\n }, stateFactory), selectorsFactory), stateAdapter);\r\n}\r\n// src/nanoid.ts\r\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\r\nvar nanoid = function (size) {\r\n if (size === void 0) { size = 21; }\r\n var id = \"\";\r\n var i = size;\r\n while (i--) {\r\n id += urlAlphabet[Math.random() * 64 | 0];\r\n }\r\n return id;\r\n};\r\n// src/createAsyncThunk.ts\r\nvar commonProperties = [\r\n \"name\",\r\n \"message\",\r\n \"stack\",\r\n \"code\"\r\n];\r\nvar RejectWithValue = /** @class */ (function () {\r\n function RejectWithValue(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return RejectWithValue;\r\n}());\r\nvar FulfillWithMeta = /** @class */ (function () {\r\n function FulfillWithMeta(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return FulfillWithMeta;\r\n}());\r\nvar miniSerializeError = function (value) {\r\n if (typeof value === \"object\" && value !== null) {\r\n var simpleError = {};\r\n for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {\r\n var property = commonProperties_1[_i];\r\n if (typeof value[property] === \"string\") {\r\n simpleError[property] = value[property];\r\n }\r\n }\r\n return simpleError;\r\n }\r\n return { message: String(value) };\r\n};\r\nvar createAsyncThunk = (function () {\r\n function createAsyncThunk2(typePrefix, payloadCreator, options) {\r\n var fulfilled = createAction(typePrefix + \"/fulfilled\", function (payload, requestId, arg, meta) { return ({\r\n payload: payload,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"fulfilled\"\r\n })\r\n }); });\r\n var pending = createAction(typePrefix + \"/pending\", function (requestId, arg, meta) { return ({\r\n payload: void 0,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"pending\"\r\n })\r\n }); });\r\n var rejected = createAction(typePrefix + \"/rejected\", function (error, requestId, arg, payload, meta) { return ({\r\n payload: payload,\r\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n rejectedWithValue: !!payload,\r\n requestStatus: \"rejected\",\r\n aborted: (error == null ? void 0 : error.name) === \"AbortError\",\r\n condition: (error == null ? void 0 : error.name) === \"ConditionError\"\r\n })\r\n }); });\r\n var displayedWarning = false;\r\n var AC = typeof AbortController !== \"undefined\" ? AbortController : /** @class */ (function () {\r\n function class_1() {\r\n this.signal = {\r\n aborted: false,\r\n addEventListener: function () {\r\n },\r\n dispatchEvent: function () {\r\n return false;\r\n },\r\n onabort: function () {\r\n },\r\n removeEventListener: function () {\r\n },\r\n reason: void 0,\r\n throwIfAborted: function () {\r\n }\r\n };\r\n }\r\n class_1.prototype.abort = function () {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (!displayedWarning) {\r\n displayedWarning = true;\r\n console.info(\"This platform does not implement AbortController. \\nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.\");\r\n }\r\n }\r\n };\r\n return class_1;\r\n }());\r\n function actionCreator(arg) {\r\n return function (dispatch, getState, extra) {\r\n var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();\r\n var abortController = new AC();\r\n var abortReason;\r\n var started = false;\r\n function abort(reason) {\r\n abortReason = reason;\r\n abortController.abort();\r\n }\r\n var promise2 = function () {\r\n return __async(this, null, function () {\r\n var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 4, , 5]);\r\n conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });\r\n if (!isThenable(conditionResult)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, conditionResult];\r\n case 1:\r\n conditionResult = _c.sent();\r\n _c.label = 2;\r\n case 2:\r\n if (conditionResult === false || abortController.signal.aborted) {\r\n throw {\r\n name: \"ConditionError\",\r\n message: \"Aborted due to condition callback returning false.\"\r\n };\r\n }\r\n started = true;\r\n abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener(\"abort\", function () { return reject({\r\n name: \"AbortError\",\r\n message: abortReason || \"Aborted\"\r\n }); }); });\r\n dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));\r\n return [4 /*yield*/, Promise.race([\r\n abortedPromise,\r\n Promise.resolve(payloadCreator(arg, {\r\n dispatch: dispatch,\r\n getState: getState,\r\n extra: extra,\r\n requestId: requestId,\r\n signal: abortController.signal,\r\n abort: abort,\r\n rejectWithValue: function (value, meta) {\r\n return new RejectWithValue(value, meta);\r\n },\r\n fulfillWithValue: function (value, meta) {\r\n return new FulfillWithMeta(value, meta);\r\n }\r\n })).then(function (result) {\r\n if (result instanceof RejectWithValue) {\r\n throw result;\r\n }\r\n if (result instanceof FulfillWithMeta) {\r\n return fulfilled(result.payload, requestId, arg, result.meta);\r\n }\r\n return fulfilled(result, requestId, arg);\r\n })\r\n ])];\r\n case 3:\r\n finalAction = _c.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n err_1 = _c.sent();\r\n finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);\r\n return [3 /*break*/, 5];\r\n case 5:\r\n skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\r\n if (!skipDispatch) {\r\n dispatch(finalAction);\r\n }\r\n return [2 /*return*/, finalAction];\r\n }\r\n });\r\n });\r\n }();\r\n return Object.assign(promise2, {\r\n abort: abort,\r\n requestId: requestId,\r\n arg: arg,\r\n unwrap: function () {\r\n return promise2.then(unwrapResult);\r\n }\r\n });\r\n };\r\n }\r\n return Object.assign(actionCreator, {\r\n pending: pending,\r\n rejected: rejected,\r\n fulfilled: fulfilled,\r\n typePrefix: typePrefix\r\n });\r\n }\r\n createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };\r\n return createAsyncThunk2;\r\n})();\r\nfunction unwrapResult(action) {\r\n if (action.meta && action.meta.rejectedWithValue) {\r\n throw action.payload;\r\n }\r\n if (action.error) {\r\n throw action.error;\r\n }\r\n return action.payload;\r\n}\r\nfunction isThenable(value) {\r\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\r\n}\r\n// src/matchers.ts\r\nvar matches = function (matcher, action) {\r\n if (hasMatchFunction(matcher)) {\r\n return matcher.match(action);\r\n }\r\n else {\r\n return matcher(action);\r\n }\r\n};\r\nfunction isAnyOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.some(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction isAllOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.every(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction hasExpectedRequestMetadata(action, validStatus) {\r\n if (!action || !action.meta)\r\n return false;\r\n var hasValidRequestId = typeof action.meta.requestId === \"string\";\r\n var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\r\n return hasValidRequestId && hasValidRequestStatus;\r\n}\r\nfunction isAsyncThunkArray(a) {\r\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\r\n}\r\nfunction isPending() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isPending()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejected() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejected()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejectedWithValue() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n var hasFlag = function (action) {\r\n return action && action.meta && action.meta.rejectedWithValue;\r\n };\r\n if (asyncThunks.length === 0) {\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejectedWithValue()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isFulfilled() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"fulfilled\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isFulfilled()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isAsyncThunkAction() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isAsyncThunkAction()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = [];\r\n for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {\r\n var asyncThunk = asyncThunks_1[_i];\r\n matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);\r\n }\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\n// src/listenerMiddleware/utils.ts\r\nvar assertFunction = function (func, expected) {\r\n if (typeof func !== \"function\") {\r\n throw new TypeError(expected + \" is not a function\");\r\n }\r\n};\r\nvar noop = function () {\r\n};\r\nvar catchRejection = function (promise2, onError) {\r\n if (onError === void 0) { onError = noop; }\r\n promise2.catch(onError);\r\n return promise2;\r\n};\r\nvar addAbortSignalListener = function (abortSignal, callback) {\r\n abortSignal.addEventListener(\"abort\", callback, { once: true });\r\n return function () { return abortSignal.removeEventListener(\"abort\", callback); };\r\n};\r\nvar abortControllerWithReason = function (abortController, reason) {\r\n var signal = abortController.signal;\r\n if (signal.aborted) {\r\n return;\r\n }\r\n if (!(\"reason\" in signal)) {\r\n Object.defineProperty(signal, \"reason\", {\r\n enumerable: true,\r\n value: reason,\r\n configurable: true,\r\n writable: true\r\n });\r\n }\r\n ;\r\n abortController.abort(reason);\r\n};\r\n// src/listenerMiddleware/exceptions.ts\r\nvar task = \"task\";\r\nvar listener = \"listener\";\r\nvar completed = \"completed\";\r\nvar cancelled = \"cancelled\";\r\nvar taskCancelled = \"task-\" + cancelled;\r\nvar taskCompleted = \"task-\" + completed;\r\nvar listenerCancelled = listener + \"-\" + cancelled;\r\nvar listenerCompleted = listener + \"-\" + completed;\r\nvar TaskAbortError = /** @class */ (function () {\r\n function TaskAbortError(code) {\r\n this.code = code;\r\n this.name = \"TaskAbortError\";\r\n this.message = task + \" \" + cancelled + \" (reason: \" + code + \")\";\r\n }\r\n return TaskAbortError;\r\n}());\r\n// src/listenerMiddleware/task.ts\r\nvar validateActive = function (signal) {\r\n if (signal.aborted) {\r\n throw new TaskAbortError(signal.reason);\r\n }\r\n};\r\nfunction raceWithSignal(signal, promise2) {\r\n var cleanup = noop;\r\n return new Promise(function (resolve, reject) {\r\n var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };\r\n if (signal.aborted) {\r\n notifyRejection();\r\n return;\r\n }\r\n cleanup = addAbortSignalListener(signal, notifyRejection);\r\n promise2.finally(function () { return cleanup(); }).then(resolve, reject);\r\n }).finally(function () {\r\n cleanup = noop;\r\n });\r\n}\r\nvar runTask = function (task2, cleanUp) { return __async(void 0, null, function () {\r\n var value, error_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 3, 4, 5]);\r\n return [4 /*yield*/, Promise.resolve()];\r\n case 1:\r\n _c.sent();\r\n return [4 /*yield*/, task2()];\r\n case 2:\r\n value = _c.sent();\r\n return [2 /*return*/, {\r\n status: \"ok\",\r\n value: value\r\n }];\r\n case 3:\r\n error_1 = _c.sent();\r\n return [2 /*return*/, {\r\n status: error_1 instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\r\n error: error_1\r\n }];\r\n case 4:\r\n cleanUp == null ? void 0 : cleanUp();\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n}); };\r\nvar createPause = function (signal) {\r\n return function (promise2) {\r\n return catchRejection(raceWithSignal(signal, promise2).then(function (output) {\r\n validateActive(signal);\r\n return output;\r\n }));\r\n };\r\n};\r\nvar createDelay = function (signal) {\r\n var pause = createPause(signal);\r\n return function (timeoutMs) {\r\n return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));\r\n };\r\n};\r\n// src/listenerMiddleware/index.ts\r\nvar assign = Object.assign;\r\nvar INTERNAL_NIL_TOKEN = {};\r\nvar alm = \"listenerMiddleware\";\r\nvar createFork = function (parentAbortSignal, parentBlockingPromises) {\r\n var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };\r\n return function (taskExecutor, opts) {\r\n assertFunction(taskExecutor, \"taskExecutor\");\r\n var childAbortController = new AbortController();\r\n linkControllers(childAbortController);\r\n var result = runTask(function () { return __async(void 0, null, function () {\r\n var result2;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(parentAbortSignal);\r\n validateActive(childAbortController.signal);\r\n return [4 /*yield*/, taskExecutor({\r\n pause: createPause(childAbortController.signal),\r\n delay: createDelay(childAbortController.signal),\r\n signal: childAbortController.signal\r\n })];\r\n case 1:\r\n result2 = _c.sent();\r\n validateActive(childAbortController.signal);\r\n return [2 /*return*/, result2];\r\n }\r\n });\r\n }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });\r\n if (opts == null ? void 0 : opts.autoJoin) {\r\n parentBlockingPromises.push(result);\r\n }\r\n return {\r\n result: createPause(parentAbortSignal)(result),\r\n cancel: function () {\r\n abortControllerWithReason(childAbortController, taskCancelled);\r\n }\r\n };\r\n };\r\n};\r\nvar createTakePattern = function (startListening, signal) {\r\n var take = function (predicate, timeout) { return __async(void 0, null, function () {\r\n var unsubscribe, tuplePromise, promises, output;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(signal);\r\n unsubscribe = function () {\r\n };\r\n tuplePromise = new Promise(function (resolve, reject) {\r\n var stopListening = startListening({\r\n predicate: predicate,\r\n effect: function (action, listenerApi) {\r\n listenerApi.unsubscribe();\r\n resolve([\r\n action,\r\n listenerApi.getState(),\r\n listenerApi.getOriginalState()\r\n ]);\r\n }\r\n });\r\n unsubscribe = function () {\r\n stopListening();\r\n reject();\r\n };\r\n });\r\n promises = [\r\n tuplePromise\r\n ];\r\n if (timeout != null) {\r\n promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));\r\n }\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, , 3, 4]);\r\n return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];\r\n case 2:\r\n output = _c.sent();\r\n validateActive(signal);\r\n return [2 /*return*/, output];\r\n case 3:\r\n unsubscribe();\r\n return [7 /*endfinally*/];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };\r\n};\r\nvar getListenerEntryPropsFrom = function (options) {\r\n var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;\r\n if (type) {\r\n predicate = createAction(type).match;\r\n }\r\n else if (actionCreator) {\r\n type = actionCreator.type;\r\n predicate = actionCreator.match;\r\n }\r\n else if (matcher) {\r\n predicate = matcher;\r\n }\r\n else if (predicate) {\r\n }\r\n else {\r\n throw new Error(\"Creating or removing a listener requires one of the known fields for matching an action\");\r\n }\r\n assertFunction(effect, \"options.listener\");\r\n return { predicate: predicate, type: type, effect: effect };\r\n};\r\nvar createListenerEntry = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;\r\n var id = nanoid();\r\n var entry = {\r\n id: id,\r\n effect: effect,\r\n type: type,\r\n predicate: predicate,\r\n pending: new Set(),\r\n unsubscribe: function () {\r\n throw new Error(\"Unsubscribe not initialized\");\r\n }\r\n };\r\n return entry;\r\n};\r\nvar cancelActiveListeners = function (entry) {\r\n entry.pending.forEach(function (controller) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n });\r\n};\r\nvar createClearListenerMiddleware = function (listenerMap) {\r\n return function () {\r\n listenerMap.forEach(cancelActiveListeners);\r\n listenerMap.clear();\r\n };\r\n};\r\nvar safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {\r\n try {\r\n errorHandler(errorToNotify, errorInfo);\r\n }\r\n catch (errorHandlerError) {\r\n setTimeout(function () {\r\n throw errorHandlerError;\r\n }, 0);\r\n }\r\n};\r\nvar addListener = createAction(alm + \"/add\");\r\nvar clearAllListeners = createAction(alm + \"/removeAll\");\r\nvar removeListener = createAction(alm + \"/remove\");\r\nvar defaultErrorHandler = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n console.error.apply(console, __spreadArray([alm + \"/error\"], args));\r\n};\r\nfunction createListenerMiddleware(middlewareOptions) {\r\n var _this = this;\r\n if (middlewareOptions === void 0) { middlewareOptions = {}; }\r\n var listenerMap = new Map();\r\n var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;\r\n assertFunction(onError, \"onError\");\r\n var insertEntry = function (entry) {\r\n entry.unsubscribe = function () { return listenerMap.delete(entry.id); };\r\n listenerMap.set(entry.id, entry);\r\n return function (cancelOptions) {\r\n entry.unsubscribe();\r\n if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n };\r\n };\r\n var findListenerEntry = function (comparator) {\r\n for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {\r\n var entry = _c[_i];\r\n if (comparator(entry)) {\r\n return entry;\r\n }\r\n }\r\n return void 0;\r\n };\r\n var startListening = function (options) {\r\n var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });\r\n if (!entry) {\r\n entry = createListenerEntry(options);\r\n }\r\n return insertEntry(entry);\r\n };\r\n var stopListening = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;\r\n var entry = findListenerEntry(function (entry2) {\r\n var matchPredicateOrType = typeof type === \"string\" ? entry2.type === type : entry2.predicate === predicate;\r\n return matchPredicateOrType && entry2.effect === effect;\r\n });\r\n if (entry) {\r\n entry.unsubscribe();\r\n if (options.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n }\r\n return !!entry;\r\n };\r\n var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {\r\n var internalTaskController, take, autoJoinPromises, listenerError_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n internalTaskController = new AbortController();\r\n take = createTakePattern(startListening, internalTaskController.signal);\r\n autoJoinPromises = [];\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, 3, 4, 6]);\r\n entry.pending.add(internalTaskController);\r\n return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {\r\n getOriginalState: getOriginalState,\r\n condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },\r\n take: take,\r\n delay: createDelay(internalTaskController.signal),\r\n pause: createPause(internalTaskController.signal),\r\n extra: extra,\r\n signal: internalTaskController.signal,\r\n fork: createFork(internalTaskController.signal, autoJoinPromises),\r\n unsubscribe: entry.unsubscribe,\r\n subscribe: function () {\r\n listenerMap.set(entry.id, entry);\r\n },\r\n cancelActiveListeners: function () {\r\n entry.pending.forEach(function (controller, _, set) {\r\n if (controller !== internalTaskController) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n set.delete(controller);\r\n }\r\n });\r\n }\r\n })))];\r\n case 2:\r\n _c.sent();\r\n return [3 /*break*/, 6];\r\n case 3:\r\n listenerError_1 = _c.sent();\r\n if (!(listenerError_1 instanceof TaskAbortError)) {\r\n safelyNotifyError(onError, listenerError_1, {\r\n raisedBy: \"effect\"\r\n });\r\n }\r\n return [3 /*break*/, 6];\r\n case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)];\r\n case 5:\r\n _c.sent();\r\n abortControllerWithReason(internalTaskController, listenerCompleted);\r\n entry.pending.delete(internalTaskController);\r\n return [7 /*endfinally*/];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\r\n var middleware = function (api) { return function (next) { return function (action) {\r\n if (!isAction(action)) {\r\n return next(action);\r\n }\r\n if (addListener.match(action)) {\r\n return startListening(action.payload);\r\n }\r\n if (clearAllListeners.match(action)) {\r\n clearListenerMiddleware();\r\n return;\r\n }\r\n if (removeListener.match(action)) {\r\n return stopListening(action.payload);\r\n }\r\n var originalState = api.getState();\r\n var getOriginalState = function () {\r\n if (originalState === INTERNAL_NIL_TOKEN) {\r\n throw new Error(alm + \": getOriginalState can only be called synchronously\");\r\n }\r\n return originalState;\r\n };\r\n var result;\r\n try {\r\n result = next(action);\r\n if (listenerMap.size > 0) {\r\n var currentState = api.getState();\r\n var listenerEntries = Array.from(listenerMap.values());\r\n for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {\r\n var entry = listenerEntries_1[_i];\r\n var runListener = false;\r\n try {\r\n runListener = entry.predicate(action, currentState, originalState);\r\n }\r\n catch (predicateError) {\r\n runListener = false;\r\n safelyNotifyError(onError, predicateError, {\r\n raisedBy: \"predicate\"\r\n });\r\n }\r\n if (!runListener) {\r\n continue;\r\n }\r\n notifyListener(entry, action, api, getOriginalState);\r\n }\r\n }\r\n }\r\n finally {\r\n originalState = INTERNAL_NIL_TOKEN;\r\n }\r\n return result;\r\n }; }; };\r\n return {\r\n middleware: middleware,\r\n startListening: startListening,\r\n stopListening: stopListening,\r\n clearListeners: clearListenerMiddleware\r\n };\r\n}\r\n// src/autoBatchEnhancer.ts\r\nvar SHOULD_AUTOBATCH = \"RTK_autoBatch\";\r\nvar prepareAutoBatched = function () { return function (payload) {\r\n var _c;\r\n return ({\r\n payload: payload,\r\n meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)\r\n });\r\n}; };\r\nvar promise;\r\nvar queueMicrotaskShim = typeof queueMicrotask === \"function\" ? queueMicrotask.bind(typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {\r\n throw err;\r\n}, 0); }); };\r\nvar createQueueWithTimer = function (timeout) {\r\n return function (notify) {\r\n setTimeout(notify, timeout);\r\n };\r\n};\r\nvar rAF = typeof window !== \"undefined\" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);\r\nvar autoBatchEnhancer = function (options) {\r\n if (options === void 0) { options = { type: \"raf\" }; }\r\n return function (next) { return function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var store = next.apply(void 0, args);\r\n var notifying = true;\r\n var shouldNotifyAtEndOfTick = false;\r\n var notificationQueued = false;\r\n var listeners = new Set();\r\n var queueCallback = options.type === \"tick\" ? queueMicrotaskShim : options.type === \"raf\" ? rAF : options.type === \"callback\" ? options.queueNotification : createQueueWithTimer(options.timeout);\r\n var notifyListeners = function () {\r\n notificationQueued = false;\r\n if (shouldNotifyAtEndOfTick) {\r\n shouldNotifyAtEndOfTick = false;\r\n listeners.forEach(function (l) { return l(); });\r\n }\r\n };\r\n return Object.assign({}, store, {\r\n subscribe: function (listener2) {\r\n var wrappedListener = function () { return notifying && listener2(); };\r\n var unsubscribe = store.subscribe(wrappedListener);\r\n listeners.add(listener2);\r\n return function () {\r\n unsubscribe();\r\n listeners.delete(listener2);\r\n };\r\n },\r\n dispatch: function (action) {\r\n var _a;\r\n try {\r\n notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);\r\n shouldNotifyAtEndOfTick = !notifying;\r\n if (shouldNotifyAtEndOfTick) {\r\n if (!notificationQueued) {\r\n notificationQueued = true;\r\n queueCallback(notifyListeners);\r\n }\r\n }\r\n return store.dispatch(action);\r\n }\r\n finally {\r\n notifying = true;\r\n }\r\n }\r\n });\r\n }; };\r\n};\r\n// src/index.ts\r\nenableES5();\r\nexport { EnhancerArray, MiddlewareArray, SHOULD_AUTOBATCH, TaskAbortError, addListener, autoBatchEnhancer, clearAllListeners, configureStore, createAction, createActionCreatorInvariantMiddleware, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAction, isActionCreator, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFSA as isFluxStandardAction, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, prepareAutoBatched, removeListener, unwrapResult };\r\n//# sourceMappingURL=redux-toolkit.esm.js.map","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","/**\n * 语句类型\n */\nimport { fileType } from '@/Core/util/gameAssetsAccess/assetSetter';\nimport { ISceneEntry } from '@/Core/Modules/scene';\n\nexport enum commandType {\n say, // 对话\n changeBg, // 更改背景\n changeFigure, // 更改立绘\n bgm, // 更改背景音乐\n video, // 播放视频\n pixi, // pixi演出\n pixiInit, // pixi初始化\n intro, // 黑屏文字演示\n miniAvatar, // 小头像\n changeScene, // 切换场景\n choose, // 分支选择\n end, // 结束游戏\n setComplexAnimation, // 动画演出\n setFilter, // 设置效果\n label, // 标签\n jumpLabel, // 跳转标签\n chooseLabel, // 选择标签\n setVar, // 设置变量\n if, // 条件跳转\n callScene, // 调用场景\n showVars,\n unlockCg,\n unlockBgm,\n filmMode,\n setTextbox,\n setAnimation,\n playEffect,\n setTempAnimation,\n comment,\n setTransform,\n setTransition,\n getUserInput,\n applyStyle,\n}\n\n/**\n * 单个参数接口\n * @interface arg\n */\nexport interface arg {\n key: string; // 参数键\n value: string | boolean | number; // 参数值\n}\n\n/**\n * 资源接口\n * @interface IAsset\n */\nexport interface IAsset {\n name: string; // 资源名称\n type: fileType; // 资源类型\n url: string; // 资源url\n lineNumber: number; // 触发资源语句的行号\n}\n\n/**\n * 单条语句接口\n * @interface ISentence\n */\nexport interface ISentence {\n command: commandType; // 语句类型\n commandRaw: string; // 命令的原始内容,方便调试\n content: string; // 语句内容\n args: Array<arg>; // 参数列表\n sentenceAssets: Array<IAsset>; // 语句携带的资源列表\n subScene: Array<string>; // 语句包含子场景列表\n}\n\n/**\n * 场景接口\n * @interface IScene\n */\nexport interface IScene {\n sceneName: string; // 场景名称\n sceneUrl: string; // 场景url\n sentenceList: Array<ISentence>; // 语句列表\n assetsList: Array<IAsset>; // 资源列表\n subSceneList: Array<string>; // 子场景的url列表\n}\n\n/**\n * 当前的场景数据\n * @interface ISceneData\n */\nexport interface ISceneData {\n currentSentenceId: number; // 当前语句ID\n sceneStack: Array<ISceneEntry>; // 场景栈\n currentScene: IScene; // 当前场景数据\n}\n\n/**\n * 处理后的命令接口\n * @interface parsedCommand\n */\nexport interface parsedCommand {\n type: commandType;\n additionalArgs: Array<arg>;\n}\n","/**\n * 所有会被Save和Backlog记录下的信息,构成当前的舞台状态(也包括游戏运行时变量)\n * 舞台状态是演出结束后的“终态”,在读档时不发生演出,只是将舞台状态替换为读取的状态。\n */\n\nimport {\n IEffect,\n IFreeFigure,\n ILive2DExpression,\n ILive2DMotion,\n IRunPerform,\n ISetGameVar,\n ISetStagePayload,\n IStageState,\n} from '@/store/stageInterface';\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { commandType } from '@/Core/controller/scene/sceneInterface';\n\n// 初始化舞台数据\n\nexport const initState: IStageState = {\n oldBgName: '',\n bgName: '', // 背景文件地址(相对或绝对)\n figName: '', // 立绘_中 文件地址(相对或绝对)\n figNameLeft: '', // 立绘_左 文件地址(相对或绝对)\n figNameRight: '', // 立绘_右 文件地址(相对或绝对)\n freeFigure: [],\n figureAssociatedAnimation: [],\n showText: '', // 文字\n showTextSize: -1,\n showName: '', // 人物名\n command: '', // 语句指令\n choose: [], // 选项列表,现在不用,先预留\n vocal: '', // 语音 文件地址(相对或绝对)\n playVocal: '', // 语音,真实的播放音频\n vocalVolume: 100, // 语音 音量调整(0 - 100)\n bgm: {\n // 背景音乐\n src: '', // 背景音乐 文件地址(相对或绝对)\n enter: 0, // 背景音乐 淡入或淡出的毫秒数\n volume: 100, // 背景音乐 音量调整(0 - 100)\n },\n uiSe: '', // 用户界面音效 文件地址(相对或绝对)\n miniAvatar: '', // 小头像 文件地址(相对或绝对)\n GameVar: {}, // 游戏内变量\n effects: [], // 应用的效果\n bgFilter: '', // 现在不用,先预留\n bgTransform: '', // 现在不用,先预留\n PerformList: [], // 要启动的演出列表\n currentDialogKey: 'initial',\n live2dMotion: [],\n live2dExpression: [],\n // currentPerformDelay: 0\n currentConcatDialogPrev: '',\n enableFilm: '',\n isDisableTextbox: false,\n replacedUIlable: {},\n};\n\n/**\n * 创建舞台的状态管理\n */\nconst stageSlice = createSlice({\n name: 'stage',\n initialState: cloneDeep(initState),\n reducers: {\n /**\n * 替换舞台状态\n * @param state 当前状态\n * @param action 替换的状态\n */\n resetStageState: (state, action: PayloadAction<IStageState>) => {\n Object.assign(state, action.payload);\n },\n /**\n * 设置舞台状态\n * @param state 当前状态\n * @param action 要替换的键值对\n */\n setStage: (state, action: PayloadAction<ISetStagePayload>) => {\n // @ts-ignore\n state[action.payload.key] = action.payload.value;\n },\n /**\n * 修改舞台状态变量\n * @param state 当前状态\n * @param action 要改变或添加的变量\n */\n setStageVar: (state, action: PayloadAction<ISetGameVar>) => {\n state.GameVar[action.payload.key] = action.payload.value;\n },\n updateEffect: (state, action: PayloadAction<IEffect>) => {\n const { target, transform } = action.payload;\n // 尝试找到待修改的 Effect\n const effectIndex = state.effects.findIndex((e) => e.target === target);\n if (effectIndex >= 0) {\n // Update the existing effect\n state.effects[effectIndex].transform = transform;\n } else {\n // Add a new effect\n state.effects.push({\n target,\n transform,\n });\n }\n },\n removeEffectByTargetId: (state, action: PayloadAction<string>) => {\n const index = state.effects.findIndex((e) => e.target === action.payload);\n if (index >= 0) {\n state.effects.splice(index, 1);\n }\n },\n addPerform: (state, action: PayloadAction<IRunPerform>) => {\n state.PerformList.push(action.payload);\n },\n removePerformByName: (state, action: PayloadAction<string>) => {\n for (let i = 0; i < state.PerformList.length; i++) {\n const performItem: IRunPerform = state.PerformList[i];\n if (performItem.id === action.payload) {\n state.PerformList.splice(i, 1);\n i--;\n }\n }\n },\n removeAllPixiPerforms: (state, action: PayloadAction<undefined>) => {\n for (let i = 0; i < state.PerformList.length; i++) {\n const performItem: IRunPerform = state.PerformList[i];\n if (performItem.script.command === commandType.pixi) {\n state.PerformList.splice(i, 1);\n i--;\n }\n }\n },\n setFreeFigureByKey: (state, action: PayloadAction<IFreeFigure>) => {\n const currentFreeFigures = state.freeFigure;\n const newFigure = action.payload;\n const index = currentFreeFigures.findIndex((figure) => figure.key === newFigure.key);\n if (index >= 0) {\n if (newFigure.name === '') {\n // 删掉立绘和相关的动画\n currentFreeFigures.splice(index, 1);\n const figureAssociatedAnimationIndex = state.figureAssociatedAnimation.findIndex(\n (a) => a.targetId === newFigure.key,\n );\n state.figureAssociatedAnimation.splice(figureAssociatedAnimationIndex, 1);\n } else {\n currentFreeFigures[index].basePosition = newFigure.basePosition;\n currentFreeFigures[index].name = newFigure.name;\n }\n } else {\n // 新加\n if (newFigure.name !== '') currentFreeFigures.push(newFigure);\n }\n },\n setLive2dMotion: (state, action: PayloadAction<ILive2DMotion>) => {\n const { target, motion } = action.payload;\n\n const index = state.live2dMotion.findIndex((e) => e.target === target);\n\n if (index < 0) {\n // Add a new motion\n state.live2dMotion.push({ target, motion });\n } else {\n // Update the existing motion\n state.live2dMotion[index].motion = motion;\n }\n },\n setLive2dExpression: (state, action: PayloadAction<ILive2DExpression>) => {\n const { target, expression } = action.payload;\n\n const index = state.live2dExpression.findIndex((e) => e.target === target);\n\n if (index < 0) {\n // Add a new expression\n state.live2dExpression.push({ target, expression });\n } else {\n // Update the existing expression\n state.live2dExpression[index].expression = expression;\n }\n },\n replaceUIlable: (state, action: PayloadAction<[string, string]>) => {\n state.replacedUIlable[action.payload[0]] = action.payload[1];\n },\n },\n});\n\nexport const { resetStageState, setStage, setStageVar } = stageSlice.actions;\nexport const stageActions = stageSlice.actions;\nexport default stageSlice.reducer;\n\n// /**\n// * 创建舞台的状态管理\n// * @return {IStageState} 舞台状态\n// * @return {function} 改变舞台状态\n// */\n// export function stageStateStore():StageStore {\n// const [stageState, setStageState] = useState(_.cloneDeep(initState));\n//\n// /**\n// * 设置舞台状态,以后会改\n// * @param key\n// * @param value\n// */\n// const setStage = <K extends keyof IStageState>(key: K, value: any) => {\n//\n// setStageState(state => {\n// state[key] = value;\n// return {...state};\n// });\n//\n// };\n//\n// const getStageState = () => {\n// return stageState;\n// };\n//\n// const restoreStage = (newState: IStageState) => {\n// setStageState((state) => ({ ...state, ...newState }));\n// };\n//\n// return {\n// stageState,\n// setStage,\n// getStageState,\n// restoreStage,\n// };\n// }\n","/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n try {\n if (typeof indexedDB !== 'undefined') {\n return indexedDB;\n }\n if (typeof webkitIndexedDB !== 'undefined') {\n return webkitIndexedDB;\n }\n if (typeof mozIndexedDB !== 'undefined') {\n return mozIndexedDB;\n }\n if (typeof OIndexedDB !== 'undefined') {\n return OIndexedDB;\n }\n if (typeof msIndexedDB !== 'undefined') {\n return msIndexedDB;\n }\n } catch (e) {\n return;\n }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n try {\n // Initialize IndexedDB; fall back to vendor-prefixed versions\n // if needed.\n if (!idb || !idb.open) {\n return false;\n }\n // We mimic PouchDB here;\n //\n // We test for openDatabase because IE Mobile identifies itself\n // as Safari. Oh the lulz...\n var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n // Safari <10.1 does not meet our requirements for IDB support\n // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n // Safari 10.1 shipped with fetch, we can use that to detect it.\n // Note: this creates issues with `window.fetch` polyfills and\n // overrides; see:\n // https://github.com/localForage/localForage/issues/856\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n // See: https://github.com/mozilla/localForage/issues/128\n // See: https://github.com/mozilla/localForage/issues/272\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== 'TypeError') {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n // In the \"nopromises\" build this will just throw if you don't have\n // a global promise object, but it would throw anyway later.\n _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n if (typeof callback === 'function') {\n promise.then(callback);\n }\n\n if (typeof errorCallback === 'function') {\n promise[\"catch\"](errorCallback);\n }\n}\n\nfunction normalizeKey(key) {\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n return key;\n}\n\nfunction getCallback() {\n if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n return arguments[arguments.length - 1];\n }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n return new Promise$1(function (resolve) {\n var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n var blob = createBlob(['']);\n txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n\n txn.oncomplete = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction _checkBlobSupport(idb) {\n if (typeof supportsBlobs === 'boolean') {\n return Promise$1.resolve(supportsBlobs);\n }\n return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n supportsBlobs = value;\n return supportsBlobs;\n });\n}\n\nfunction _deferReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Create a deferred object representing the current database operation.\n var deferredOperation = {};\n\n deferredOperation.promise = new Promise$1(function (resolve, reject) {\n deferredOperation.resolve = resolve;\n deferredOperation.reject = reject;\n });\n\n // Enqueue the deferred operation.\n dbContext.deferredOperations.push(deferredOperation);\n\n // Chain its promise to the database readiness.\n if (!dbContext.dbReady) {\n dbContext.dbReady = deferredOperation.promise;\n } else {\n dbContext.dbReady = dbContext.dbReady.then(function () {\n return deferredOperation.promise;\n });\n }\n}\n\nfunction _advanceReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Resolve its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.resolve();\n return deferredOperation.promise;\n }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Reject its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.reject(err);\n return deferredOperation.promise;\n }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n return new Promise$1(function (resolve, reject) {\n dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n if (dbInfo.db) {\n if (upgradeNeeded) {\n _deferReadiness(dbInfo);\n dbInfo.db.close();\n } else {\n return resolve(dbInfo.db);\n }\n }\n\n var dbArgs = [dbInfo.name];\n\n if (upgradeNeeded) {\n dbArgs.push(dbInfo.version);\n }\n\n var openreq = idb.open.apply(idb, dbArgs);\n\n if (upgradeNeeded) {\n openreq.onupgradeneeded = function (e) {\n var db = openreq.result;\n try {\n db.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // Added when support for blob shims was added\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n } catch (ex) {\n if (ex.name === 'ConstraintError') {\n console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n } else {\n throw ex;\n }\n }\n };\n }\n\n openreq.onerror = function (e) {\n e.preventDefault();\n reject(openreq.error);\n };\n\n openreq.onsuccess = function () {\n var db = openreq.result;\n db.onversionchange = function (e) {\n // Triggered when the database is modified (e.g. adding an objectStore) or\n // deleted (even when initiated by other sessions in different tabs).\n // Closing the connection here prevents those operations from being blocked.\n // If the database is accessed again later by this instance, the connection\n // will be reopened or the database recreated as needed.\n e.target.close();\n };\n resolve(db);\n _advanceReadiness(dbInfo);\n };\n });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n if (!dbInfo.db) {\n return true;\n }\n\n var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n var isDowngrade = dbInfo.version < dbInfo.db.version;\n var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n if (isDowngrade) {\n // If the version is not the default one\n // then warn for impossible downgrade.\n if (dbInfo.version !== defaultVersion) {\n console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n }\n // Align the versions to prevent errors.\n dbInfo.version = dbInfo.db.version;\n }\n\n if (isUpgrade || isNewStore) {\n // If the store is new then increment the version (if needed).\n // This will trigger an \"upgradeneeded\" event which is required\n // for creating a store.\n if (isNewStore) {\n var incVersion = dbInfo.db.version + 1;\n if (incVersion > dbInfo.version) {\n dbInfo.version = incVersion;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n return new Promise$1(function (resolve, reject) {\n var reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = function (e) {\n var base64 = btoa(e.target.result || '');\n resolve({\n __local_forage_encoded_blob: true,\n data: base64,\n type: blob.type\n });\n };\n reader.readAsBinaryString(blob);\n });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self._dbInfo.name];\n\n if (dbContext && dbContext.dbReady) {\n return dbContext.dbReady;\n }\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n _deferReadiness(dbInfo);\n\n var dbContext = dbContexts[dbInfo.name];\n var forages = dbContext.forages;\n\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n if (forage._dbInfo.db) {\n forage._dbInfo.db.close();\n forage._dbInfo.db = null;\n }\n }\n dbInfo.db = null;\n\n return _getOriginalConnection(dbInfo).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n // store the latest db reference\n // in case the db was upgraded\n dbInfo.db = dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n })[\"catch\"](function (err) {\n _rejectReadiness(dbInfo, err);\n throw err;\n });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n if (retries === undefined) {\n retries = 1;\n }\n\n try {\n var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n callback(null, tx);\n } catch (err) {\n if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n return Promise$1.resolve().then(function () {\n if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n // increase the db version, to create the new ObjectStore\n if (dbInfo.db) {\n dbInfo.version = dbInfo.db.version + 1;\n }\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n }).then(function () {\n return _tryReconnect(dbInfo).then(function () {\n createTransaction(dbInfo, mode, callback, retries - 1);\n });\n })[\"catch\"](callback);\n }\n\n callback(err);\n }\n}\n\nfunction createDbContext() {\n return {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = createDbContext();\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}\n\nfunction getItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.get(key);\n\n req.onsuccess = function () {\n var value = req.result;\n if (value === undefined) {\n value = null;\n }\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n resolve(value);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openCursor();\n var iterationNumber = 1;\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (cursor) {\n var value = cursor.value;\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n var result = iterator(value, cursor.key, iterationNumber++);\n\n // when the iterator callback returns any\n // (non-`undefined`) value, then we stop\n // the iteration immediately\n if (result !== void 0) {\n resolve(result);\n } else {\n cursor[\"continue\"]();\n }\n } else {\n resolve();\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n\n return promise;\n}\n\nfunction setItem(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n var dbInfo;\n self.ready().then(function () {\n dbInfo = self._dbInfo;\n if (toString.call(value) === '[object Blob]') {\n return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n if (blobSupport) {\n return value;\n }\n return _encodeBlob(value);\n });\n }\n return value;\n }).then(function (value) {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n\n // The reason we don't _save_ null is because IE 10 does\n // not support saving the `null` type in IndexedDB. How\n // ironic, given the bug below!\n // See: https://github.com/mozilla/localForage/issues/161\n if (value === null) {\n value = undefined;\n }\n\n var req = store.put(value, key);\n\n transaction.oncomplete = function () {\n // Cast to undefined so the value passed to\n // callback/promise is the same as what one would get out\n // of `getItem()` later. This leads to some weirdness\n // (setItem('foo', undefined) will return `null`), but\n // it's not my fault localStorage is our baseline and that\n // it's weird.\n if (value === undefined) {\n value = null;\n }\n\n resolve(value);\n };\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction removeItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n // We use a Grunt task to make this safe for IE and some\n // versions of Android (including those used by Cordova).\n // Normally IE won't like `.delete()` and will insist on\n // using `['delete']()`, but we have a build step that\n // fixes this for us now.\n var req = store[\"delete\"](key);\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onerror = function () {\n reject(req.error);\n };\n\n // The request will be also be aborted if we've exceeded our storage\n // space.\n transaction.onabort = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction clear(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.clear();\n\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction length(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.count();\n\n req.onsuccess = function () {\n resolve(req.result);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction key(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n if (n < 0) {\n resolve(null);\n\n return;\n }\n\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var advanced = false;\n var req = store.openKeyCursor();\n\n req.onsuccess = function () {\n var cursor = req.result;\n if (!cursor) {\n // this means there weren't enough keys\n resolve(null);\n\n return;\n }\n\n if (n === 0) {\n // We have the first key, return it if that's what they\n // wanted.\n resolve(cursor.key);\n } else {\n if (!advanced) {\n // Otherwise, ask the cursor to skip ahead n\n // records.\n advanced = true;\n cursor.advance(n);\n } else {\n // When we get here, we've got the nth key.\n resolve(cursor.key);\n }\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openKeyCursor();\n var keys = [];\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (!cursor) {\n resolve(keys);\n return;\n }\n\n keys.push(cursor.key);\n cursor[\"continue\"]();\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n return db;\n });\n\n if (!options.storeName) {\n promise = dbPromise.then(function (db) {\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n }\n\n var dropDBPromise = new Promise$1(function (resolve, reject) {\n var req = idb.deleteDatabase(options.name);\n\n req.onerror = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n reject(req.error);\n };\n\n req.onblocked = function () {\n // Closing all open connections in onversionchange handler should prevent this situation, but if\n // we do get here, it just means the request remains pending - eventually it will succeed or error\n console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n };\n\n req.onsuccess = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n resolve(db);\n };\n });\n\n return dropDBPromise.then(function (db) {\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n var _forage = forages[i];\n _advanceReadiness(_forage._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n } else {\n promise = dbPromise.then(function (db) {\n if (!db.objectStoreNames.contains(options.storeName)) {\n return;\n }\n\n var newVersion = db.version + 1;\n\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n forage._dbInfo.version = newVersion;\n }\n\n var dropObjectPromise = new Promise$1(function (resolve, reject) {\n var req = idb.open(options.name, newVersion);\n\n req.onerror = function (err) {\n var db = req.result;\n db.close();\n reject(err);\n };\n\n req.onupgradeneeded = function () {\n var db = req.result;\n db.deleteObjectStore(options.storeName);\n };\n\n req.onsuccess = function () {\n var db = req.result;\n db.close();\n resolve(db);\n };\n });\n\n return dropObjectPromise.then(function (db) {\n dbContext.db = db;\n for (var j = 0; j < forages.length; j++) {\n var _forage2 = forages[j];\n _forage2._dbInfo.db = db;\n _advanceReadiness(_forage2._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n }\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar asyncStorage = {\n _driver: 'asyncStorage',\n _initStorage: _initStorage,\n _support: isIndexedDBValid(),\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys,\n dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n // Fill the string into a ArrayBuffer.\n var bufferLength = serializedString.length * 0.75;\n var len = serializedString.length;\n var i;\n var p = 0;\n var encoded1, encoded2, encoded3, encoded4;\n\n if (serializedString[serializedString.length - 1] === '=') {\n bufferLength--;\n if (serializedString[serializedString.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n var buffer = new ArrayBuffer(bufferLength);\n var bytes = new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n /*jslint bitwise: true */\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n var valueType = '';\n if (value) {\n valueType = toString$1.call(value);\n }\n\n // Cannot use `value instanceof ArrayBuffer` or such here, as these\n // checks fail when running the tests using casper.js...\n //\n // TODO: See why those tests fail and use a better solution.\n if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n // Convert binary arrays to a string and prefix the string with\n // a special marker.\n var buffer;\n var marker = SERIALIZED_MARKER;\n\n if (value instanceof ArrayBuffer) {\n buffer = value;\n marker += TYPE_ARRAYBUFFER;\n } else {\n buffer = value.buffer;\n\n if (valueType === '[object Int8Array]') {\n marker += TYPE_INT8ARRAY;\n } else if (valueType === '[object Uint8Array]') {\n marker += TYPE_UINT8ARRAY;\n } else if (valueType === '[object Uint8ClampedArray]') {\n marker += TYPE_UINT8CLAMPEDARRAY;\n } else if (valueType === '[object Int16Array]') {\n marker += TYPE_INT16ARRAY;\n } else if (valueType === '[object Uint16Array]') {\n marker += TYPE_UINT16ARRAY;\n } else if (valueType === '[object Int32Array]') {\n marker += TYPE_INT32ARRAY;\n } else if (valueType === '[object Uint32Array]') {\n marker += TYPE_UINT32ARRAY;\n } else if (valueType === '[object Float32Array]') {\n marker += TYPE_FLOAT32ARRAY;\n } else if (valueType === '[object Float64Array]') {\n marker += TYPE_FLOAT64ARRAY;\n } else {\n callback(new Error('Failed to get type for BinaryArray'));\n }\n }\n\n callback(marker + bufferToString(buffer));\n } else if (valueType === '[object Blob]') {\n // Conver the blob to a binaryArray and then to a string.\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n // Backwards-compatible prefix for the blob type.\n var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n };\n\n fileReader.readAsArrayBuffer(value);\n } else {\n try {\n callback(JSON.stringify(value));\n } catch (e) {\n console.error(\"Couldn't convert value into a JSON string: \", value);\n\n callback(null, e);\n }\n }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n return JSON.parse(value);\n }\n\n // The following code deals with deserializing some kind of Blob or\n // TypedArray. First we separate out the type of data we're dealing\n // with from the data itself.\n var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n var blobType;\n // Backwards-compatible blob type serialization strategy.\n // DBs created with older versions of localForage will simply not have the blob type.\n if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n blobType = matcher[1];\n serializedString = serializedString.substring(matcher[0].length);\n }\n var buffer = stringToBuffer(serializedString);\n\n // Return the right type based on the code/type set during\n // serialization.\n switch (type) {\n case TYPE_ARRAYBUFFER:\n return buffer;\n case TYPE_BLOB:\n return createBlob([buffer], { type: blobType });\n case TYPE_INT8ARRAY:\n return new Int8Array(buffer);\n case TYPE_UINT8ARRAY:\n return new Uint8Array(buffer);\n case TYPE_UINT8CLAMPEDARRAY:\n return new Uint8ClampedArray(buffer);\n case TYPE_INT16ARRAY:\n return new Int16Array(buffer);\n case TYPE_UINT16ARRAY:\n return new Uint16Array(buffer);\n case TYPE_INT32ARRAY:\n return new Int32Array(buffer);\n case TYPE_UINT32ARRAY:\n return new Uint32Array(buffer);\n case TYPE_FLOAT32ARRAY:\n return new Float32Array(buffer);\n case TYPE_FLOAT64ARRAY:\n return new Float64Array(buffer);\n default:\n throw new Error('Unkown type: ' + type);\n }\n}\n\nvar localforageSerializer = {\n serialize: serialize,\n deserialize: deserialize,\n stringToBuffer: stringToBuffer,\n bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n t.executeSql(sqlStatement, args, callback, function (t, error) {\n if (error.code === error.SYNTAX_ERR) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n if (!results.rows.length) {\n // if the table is missing (was deleted)\n // re-create it table and retry\n createDbTable(t, dbInfo, function () {\n t.executeSql(sqlStatement, args, callback, errorCallback);\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).value : null;\n\n // Check to see if this is serialized content we need to\n // unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n var rows = results.rows;\n var length = rows.length;\n\n for (var i = 0; i < length; i++) {\n var item = rows.item(i);\n var result = item.value;\n\n // Check to see if this is serialized content\n // we need to unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n result = iterator(result, item.key, i + 1);\n\n // void(0) prevents problems with redefinition\n // of `undefined`.\n if (result !== void 0) {\n resolve(result);\n return;\n }\n }\n\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n // The localStorage API doesn't return undefined values in an\n // \"expected\" way, so undefined is always cast to null in all\n // drivers. See: https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n resolve(originalValue);\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n // The transaction failed; check\n // to see if it's a quota error.\n if (sqlError.code === sqlError.QUOTA_ERR) {\n // We reject the callback outright for now, but\n // it's worth trying to re-run the transaction.\n // Even if the user accepts the prompt to use\n // more storage on Safari, this error will\n // be called.\n //\n // Try to re-run the transaction.\n if (retriesLeft > 0) {\n resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n return;\n }\n reject(sqlError);\n }\n });\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n // Ahhh, SQL makes this one soooooo easy.\n tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n var result = results.rows.item(0).c;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).key : null;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n var keys = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n keys.push(results.rows.item(i).key);\n }\n\n resolve(keys);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n return new Promise$1(function (resolve, reject) {\n db.transaction(function (t) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n var storeNames = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n storeNames.push(results.rows.item(i).name);\n }\n\n resolve({\n db: db,\n storeNames: storeNames\n });\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n}\n\nfunction dropInstance$1(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n var db;\n if (options.name === currentConfig.name) {\n // use the db reference of the current instance\n db = self._dbInfo.db;\n } else {\n db = openDatabase(options.name, '', '', 0);\n }\n\n if (!options.storeName) {\n // drop all database tables\n resolve(getAllStoreNames(db));\n } else {\n resolve({\n db: db,\n storeNames: [options.storeName]\n });\n }\n }).then(function (operationInfo) {\n return new Promise$1(function (resolve, reject) {\n operationInfo.db.transaction(function (t) {\n function dropTable(storeName) {\n return new Promise$1(function (resolve, reject) {\n t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n }\n\n var operations = [];\n for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n operations.push(dropTable(operationInfo.storeNames[i]));\n }\n\n Promise$1.all(operations).then(function () {\n resolve();\n })[\"catch\"](function (e) {\n reject(e);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar webSQLStorage = {\n _driver: 'webSQLStorage',\n _initStorage: _initStorage$1,\n _support: isWebSQLValid(),\n iterate: iterate$1,\n getItem: getItem$1,\n setItem: setItem$1,\n removeItem: removeItem$1,\n clear: clear$1,\n length: length$1,\n key: key$1,\n keys: keys$1,\n dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n try {\n return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n // in IE8 typeof localStorage.setItem === 'object'\n !!localStorage.setItem;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n var keyPrefix = options.name + '/';\n\n if (options.storeName !== defaultConfig.storeName) {\n keyPrefix += options.storeName + '/';\n }\n return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n var localStorageTestKey = '_localforage_support_test';\n\n try {\n localStorage.setItem(localStorageTestKey, true);\n localStorage.removeItem(localStorageTestKey);\n\n return false;\n } catch (e) {\n return true;\n }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var keyPrefix = self._dbInfo.keyPrefix;\n\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the key\n // is likely undefined and we'll pass it straight to the\n // callback.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n } catch (error) {\n result = null;\n }\n\n // Remove the prefix from the key, if a key is found.\n if (result) {\n result = result.substring(dbInfo.keyPrefix.length);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var length = localStorage.length;\n var keys = [];\n\n for (var i = 0; i < length; i++) {\n var itemKey = localStorage.key(i);\n if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n localStorage.removeItem(dbInfo.keyPrefix + key);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n return new Promise$1(function (resolve, reject) {\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n try {\n localStorage.setItem(dbInfo.keyPrefix + key, value);\n resolve(originalValue);\n } catch (e) {\n // localStorage capacity exceeded.\n // TODO: Make this a specific error/event.\n if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n reject(e);\n }\n reject(e);\n }\n }\n });\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n var currentConfig = this.config();\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n if (!options.storeName) {\n resolve(options.name + '/');\n } else {\n resolve(_getKeyPrefix(options, self._defaultConfig));\n }\n }).then(function (keyPrefix) {\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar localStorageWrapper = {\n _driver: 'localStorageWrapper',\n _initStorage: _initStorage$2,\n _support: isLocalStorageValid(),\n iterate: iterate$2,\n getItem: getItem$2,\n setItem: setItem$2,\n removeItem: removeItem$2,\n clear: clear$2,\n length: length$2,\n key: key$2,\n keys: keys$2,\n dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n var len = array.length;\n var i = 0;\n while (i < len) {\n if (sameValue(array[i], searchElement)) {\n return true;\n }\n i++;\n }\n\n return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n INDEXEDDB: asyncStorage,\n WEBSQL: webSQLStorage,\n LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n description: '',\n driver: DefaultDriverOrder.slice(),\n name: 'localforage',\n // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n // we can use without a prompt.\n size: 4980736,\n storeName: 'keyvaluepairs',\n version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n localForageInstance[libraryMethod] = function () {\n var _args = arguments;\n return localForageInstance.ready().then(function () {\n return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n });\n };\n}\n\nfunction extend() {\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n\n if (arg) {\n for (var _key in arg) {\n if (arg.hasOwnProperty(_key)) {\n if (isArray(arg[_key])) {\n arguments[0][_key] = arg[_key].slice();\n } else {\n arguments[0][_key] = arg[_key];\n }\n }\n }\n }\n }\n\n return arguments[0];\n}\n\nvar LocalForage = function () {\n function LocalForage(options) {\n _classCallCheck(this, LocalForage);\n\n for (var driverTypeKey in DefaultDrivers) {\n if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n var driver = DefaultDrivers[driverTypeKey];\n var driverName = driver._driver;\n this[driverTypeKey] = driverName;\n\n if (!DefinedDrivers[driverName]) {\n // we don't need to wait for the promise,\n // since the default drivers can be defined\n // in a blocking manner\n this.defineDriver(driver);\n }\n }\n }\n\n this._defaultConfig = extend({}, DefaultConfig);\n this._config = extend({}, this._defaultConfig, options);\n this._driverSet = null;\n this._initDriver = null;\n this._ready = false;\n this._dbInfo = null;\n\n this._wrapLibraryMethodsWithReady();\n this.setDriver(this._config.driver)[\"catch\"](function () {});\n }\n\n // Set any config values for localForage; can be called anytime before\n // the first API call (e.g. `getItem`, `setItem`).\n // We loop through options so we don't overwrite existing config\n // values.\n\n\n LocalForage.prototype.config = function config(options) {\n // If the options argument is an object, we use it to set values.\n // Otherwise, we return either a specified config value or all\n // config values.\n if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n // If localforage is ready and fully initialized, we can't set\n // any new configuration values. Instead, we return an error.\n if (this._ready) {\n return new Error(\"Can't call config() after localforage \" + 'has been used.');\n }\n\n for (var i in options) {\n if (i === 'storeName') {\n options[i] = options[i].replace(/\\W/g, '_');\n }\n\n if (i === 'version' && typeof options[i] !== 'number') {\n return new Error('Database version must be a number.');\n }\n\n this._config[i] = options[i];\n }\n\n // after all config options are set and\n // the driver option is used, try setting it\n if ('driver' in options && options.driver) {\n return this.setDriver(this._config.driver);\n }\n\n return true;\n } else if (typeof options === 'string') {\n return this._config[options];\n } else {\n return this._config;\n }\n };\n\n // Used to define a custom driver, shared across all instances of\n // localForage.\n\n\n LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n var promise = new Promise$1(function (resolve, reject) {\n try {\n var driverName = driverObject._driver;\n var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n // A driver name should be defined and not overlap with the\n // library-defined, default drivers.\n if (!driverObject._driver) {\n reject(complianceError);\n return;\n }\n\n var driverMethods = LibraryMethods.concat('_initStorage');\n for (var i = 0, len = driverMethods.length; i < len; i++) {\n var driverMethodName = driverMethods[i];\n\n // when the property is there,\n // it should be a method even when optional\n var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n reject(complianceError);\n return;\n }\n }\n\n var configureMissingMethods = function configureMissingMethods() {\n var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n return function () {\n var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n var promise = Promise$1.reject(error);\n executeCallback(promise, arguments[arguments.length - 1]);\n return promise;\n };\n };\n\n for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n var optionalDriverMethod = OptionalDriverMethods[_i];\n if (!driverObject[optionalDriverMethod]) {\n driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n }\n }\n };\n\n configureMissingMethods();\n\n var setDriverSupport = function setDriverSupport(support) {\n if (DefinedDrivers[driverName]) {\n console.info('Redefining LocalForage driver: ' + driverName);\n }\n DefinedDrivers[driverName] = driverObject;\n DriverSupport[driverName] = support;\n // don't use a then, so that we can define\n // drivers that have simple _support methods\n // in a blocking manner\n resolve();\n };\n\n if ('_support' in driverObject) {\n if (driverObject._support && typeof driverObject._support === 'function') {\n driverObject._support().then(setDriverSupport, reject);\n } else {\n setDriverSupport(!!driverObject._support);\n }\n } else {\n setDriverSupport(true);\n }\n } catch (e) {\n reject(e);\n }\n });\n\n executeTwoCallbacks(promise, callback, errorCallback);\n return promise;\n };\n\n LocalForage.prototype.driver = function driver() {\n return this._driver || null;\n };\n\n LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n return getDriverPromise;\n };\n\n LocalForage.prototype.getSerializer = function getSerializer(callback) {\n var serializerPromise = Promise$1.resolve(localforageSerializer);\n executeTwoCallbacks(serializerPromise, callback);\n return serializerPromise;\n };\n\n LocalForage.prototype.ready = function ready(callback) {\n var self = this;\n\n var promise = self._driverSet.then(function () {\n if (self._ready === null) {\n self._ready = self._initDriver();\n }\n\n return self._ready;\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n };\n\n LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n var self = this;\n\n if (!isArray(drivers)) {\n drivers = [drivers];\n }\n\n var supportedDrivers = this._getSupportedDrivers(drivers);\n\n function setDriverToConfig() {\n self._config.driver = self.driver();\n }\n\n function extendSelfWithDriver(driver) {\n self._extend(driver);\n setDriverToConfig();\n\n self._ready = self._initStorage(self._config);\n return self._ready;\n }\n\n function initDriver(supportedDrivers) {\n return function () {\n var currentDriverIndex = 0;\n\n function driverPromiseLoop() {\n while (currentDriverIndex < supportedDrivers.length) {\n var driverName = supportedDrivers[currentDriverIndex];\n currentDriverIndex++;\n\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n }\n\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n }\n\n return driverPromiseLoop();\n };\n }\n\n // There might be a driver initialization in progress\n // so wait for it to finish in order to avoid a possible\n // race condition to set _dbInfo\n var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n return Promise$1.resolve();\n }) : Promise$1.resolve();\n\n this._driverSet = oldDriverSetDone.then(function () {\n var driverName = supportedDrivers[0];\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(function (driver) {\n self._driver = driver._driver;\n setDriverToConfig();\n self._wrapLibraryMethodsWithReady();\n self._initDriver = initDriver(supportedDrivers);\n });\n })[\"catch\"](function () {\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n });\n\n executeTwoCallbacks(this._driverSet, callback, errorCallback);\n return this._driverSet;\n };\n\n LocalForage.prototype.supports = function supports(driverName) {\n return !!DriverSupport[driverName];\n };\n\n LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n extend(this, libraryMethodsAndProperties);\n };\n\n LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n var supportedDrivers = [];\n for (var i = 0, len = drivers.length; i < len; i++) {\n var driverName = drivers[i];\n if (this.supports(driverName)) {\n supportedDrivers.push(driverName);\n }\n }\n return supportedDrivers;\n };\n\n LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n // Add a stub for each driver API method that delays the call to the\n // corresponding driver method until localForage is ready. These stubs\n // will be replaced by the driver methods as soon as the driver is\n // loaded, so there is no performance impact.\n for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n callWhenReady(this, LibraryMethods[i]);\n }\n };\n\n LocalForage.prototype.createInstance = function createInstance(options) {\n return new LocalForage(options);\n };\n\n return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || defaults.transitional;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.24.0\"\n};","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","const axios = require(\"axios\");\n\nclass Cloudlog {\n constructor() {\n this.url = '';\n this.level = 'all';\n this.mongoUrl = 'mongodb://localhost:27017/';\n this.collection = 'main';\n this.isUpload = true;\n }\n\n init(url, mongoUrl) {\n this.url = url;\n if (mongoUrl) {\n this.mongoUrl = mongoUrl;\n }\n }\n\n setUpload(s) {\n this.isUpload = s;\n }\n\n setCollection(c) {\n this.collection = c;\n }\n\n setLevel(l) {\n this.level = l.toUpperCase();\n }\n\n upload(info, data, level, now) {\n if (typeof info !== 'string') {\n this.error('log的第一个参数不是字符串', undefined, false);\n }\n let postData = {\n log: {\n info: info,\n data: data,\n level: level,\n now: now\n },\n mongoUrl: this.mongoUrl,\n collection: this.collection\n }\n const that = this;\n if (this.url !== '' && this.isUpload) {\n axios.post(this.url + '/log', postData).then(r => {\n that.trace('Logged to cloud.', undefined, false)\n }).catch(e => {\n that.error('Logging to cloud failed!', undefined, false);\n });\n }\n }\n\n clog(info, data, level, color, now, upload) {\n const levelToNum = {\n all: 7,\n ALL: 7,\n TRACE: 6,\n DEBUG: 5,\n INFO: 4,\n WARN: 3,\n ERROR: 2,\n FATAL: 1,\n NONE: 0,\n none: 0\n }\n if (levelToNum[level] <= levelToNum[this.level]) {\n console.log('%c%s%c%s%c%s%c %s',\n 'color:white;background-color:' + color,\n '[' + level + ']',\n '',\n ' ',\n 'color:' + color,\n '[' + now.toLocaleString() + ']',\n '',\n info\n );\n if (data) {\n console.log(data);\n console.log('------------------------')\n }\n }\n if (upload === undefined) {\n this.upload(info, data, level, now);\n }\n if (upload !== undefined) {\n if (upload) {\n this.upload(info, data, level, now);\n }\n }\n\n }\n\n trace(info, data, upload) {\n const now = new Date();\n const level = 'TRACE';\n const color = '#005CAF';\n this.clog(info, data, level, color, now, upload);\n }\n\n debug(info, data, upload) {\n const now = new Date();\n const level = 'DEBUG';\n const color = '#0089A7';\n this.clog(info, data, level, color, now, upload);\n }\n\n info(info, data, upload) {\n const now = new Date();\n const level = 'INFO';\n const color = '#00896C';\n this.clog(info, data, level, color, now, upload);\n }\n\n warn(info, data, upload) {\n const now = new Date();\n const level = 'WARN';\n const color = '#DDA52D';\n this.clog(info, data, level, color, now, upload);\n }\n\n error(info, data, upload) {\n const now = new Date();\n const level = 'ERROR';\n const color = '#AB3B3A';\n this.clog(info, data, level, color, now, upload);\n }\n\n fatal(info, data, upload) {\n const now = new Date();\n const level = 'FATAL';\n const color = '#E16B8C';\n this.clog(info, data, level, color, now, upload);\n }\n}\n\nmodule.exports = Cloudlog;","import Cloudlog from 'cloudlogjs';\n\n/**\n * 日志打印工具\n */\nexport const logger = new Cloudlog();\nif (process.env.NODE_ENV === 'production') {\n logger.setLevel('INFO');\n}\n","const en = {\n // 通用\n common: {\n yes: 'OK',\n no: 'Cancel',\n },\n\n menu: {\n options: {\n title: 'OPTIONS',\n pages: {\n system: {\n title: 'System',\n options: {\n autoSpeed: {\n title: 'Autoplay Speed',\n options: {\n slow: 'Slow',\n medium: 'Medium',\n fast: 'Fast',\n },\n },\n language: {\n title: 'Language',\n },\n resetData: {\n title: 'Clear or Reset Data',\n options: {\n clearGameSave: 'Clear game saving',\n resetSettings: 'Reset settings',\n clearAll: 'Clear all data',\n },\n dialogs: {\n clearGameSave: 'Are you sure you want to clear game saving',\n resetSettings: 'Are you sure you want to reset all settings',\n clearAll: 'Are you sure you want to clear all data',\n },\n },\n gameSave: {\n title: 'Import or Export Game Saving and Options',\n options: {\n export: 'Export game saving and options',\n import: 'Import game saving and options',\n },\n dialogs: {\n import: {\n title: 'Are you sure you want to import game saving and options',\n tip: 'Import game saving',\n error: 'Parse game saving failed',\n },\n },\n },\n about: {\n title: 'About WebGAL',\n subTitle: 'WebGAL: An Open-Source Web-Based Visual Novel Engine',\n version: 'Version',\n source: 'Source Code Repository',\n contributors: 'Contributors',\n website: 'Website',\n },\n },\n },\n display: {\n title: 'Display',\n options: {\n fullScreen: {\n title: 'Full Screen',\n options: {\n on: 'ON',\n off: 'OFF',\n },\n },\n textSpeed: {\n title: 'Text Speed',\n options: {\n slow: 'Slow',\n medium: 'Medium',\n fast: 'Fast',\n },\n },\n textSize: {\n title: 'Text Size',\n options: {\n small: 'Small',\n medium: 'Medium',\n large: 'Large',\n },\n },\n textFont: {\n title: 'Text Font',\n options: {\n siYuanSimSun: 'Source Han Serif',\n SimHei: 'Sans',\n lxgw: 'LXGW WenKai',\n },\n },\n textboxOpacity: {\n title: 'Textbox Opacity',\n },\n textPreview: {\n title: 'Preview Text Showing',\n text: \"You are previewing the text's font, size and playback speed, now. You can adjust the above options according to your perception.\",\n },\n },\n },\n sound: {\n title: 'Sound',\n options: {\n volumeMain: { title: 'Main Volume' },\n vocalVolume: { title: 'Vocal Volume' },\n bgmVolume: { title: 'BGM Volume' },\n seVolume: { title: 'Sound Effects Volume' },\n uiSeVolume: { title: 'UI Sound Effects Volume' },\n },\n },\n // language: {\n // title: '语言',\n // options: {\n // },\n // },\n },\n },\n saving: {\n title: 'SAVE',\n isOverwrite: 'Are you sure you want to overwrite this save?',\n },\n loadSaving: {\n title: 'LOAD',\n },\n title: {\n title: 'TITLE',\n },\n exit: {\n title: 'BACK',\n },\n },\n\n title: {\n start: {\n title: 'START',\n subtitle: '',\n },\n continue: {\n title: 'CONTINUE',\n subtitle: '',\n },\n options: {\n title: 'OPTIONS',\n subtitle: '',\n },\n load: {\n title: 'LOAD',\n subtitle: '',\n },\n extra: {\n title: 'EXTRA',\n subtitle: '',\n },\n },\n\n gaming: {\n noSaving: 'No saving',\n buttons: {\n hide: 'Hide',\n show: 'Show',\n backlog: 'Backlog',\n replay: 'Replay',\n auto: 'Auto',\n forward: 'Forward',\n quicklySave: 'Quickly Save',\n quicklyLoad: 'Quickly Load',\n save: 'Save',\n load: 'Load',\n options: 'Options',\n title: 'Title',\n titleTips: 'Confirm return to the title screen',\n },\n },\n\n extra: {\n title: 'EXTRA',\n },\n};\n\nexport default en;\n","const jp = {\n // 通用\n common: {\n yes: 'はい',\n no: 'いいえ',\n },\n\n menu: {\n options: {\n title: 'CONFIG',\n pages: {\n system: {\n title: 'システム',\n options: {\n autoSpeed: {\n title: '自動再生速度',\n options: {\n slow: '遅く',\n medium: '標準',\n fast: '速く',\n },\n },\n language: {\n title: '言語',\n },\n resetData: {\n title: 'データの復元と削除',\n options: {\n clearGameSave: 'すべてのセーブデータを削除',\n resetSettings: '設定を元に戻す',\n clearAll: 'すべてのデータを削除',\n },\n dialogs: {\n clearGameSave: 'すべてのセーブデータを削除しますか?',\n resetSettings: '設定を元に戻しますか?',\n clearAll: 'すべてのデータを削除しますか?',\n },\n },\n gameSave: {\n title: 'セーブデータと設定のインポートとエクスポート',\n options: {\n export: 'セーブデータと設定のエクスポート',\n import: 'セーブデータと設定のインポート',\n },\n dialogs: {\n import: {\n title: 'セーブデータと設定をインポートしますか?',\n tip: 'セーブデータのインポート',\n error: 'セーブデータの読み込みに失敗しました',\n },\n },\n },\n about: {\n title: 'WebGAL について',\n subTitle: 'WebGAL: オープンソースのウェブベースビジュアルノベルエンジン',\n version: 'バージョン',\n source: 'ソースコードリポジトリ',\n contributors: '貢献者',\n website: 'ウェブサイト',\n },\n },\n },\n display: {\n title: 'ウィンドウ',\n options: {\n fullScreen: {\n title: 'フルスクリーン',\n options: {\n on: 'オン',\n off: 'オフ',\n },\n },\n textSpeed: {\n title: 'テキスト表示速度',\n options: {\n slow: '遅く',\n medium: '標準',\n fast: '速く',\n },\n },\n textSize: {\n title: 'テキストサイズ',\n options: {\n small: '小',\n medium: '中',\n large: '大',\n },\n },\n textFont: {\n title: 'フォント',\n options: {\n siYuanSimSun: '源ノ明朝(中国語)',\n SimHei: 'OPPO Sans',\n lxgw: 'LXGW WenKai',\n },\n },\n textboxOpacity: {\n title: 'テキストボックスの不透明度',\n },\n textPreview: {\n title: 'テキスト表示プレビュー',\n text: 'これはテキストボックスのフォントとサイズ、表示速度のプレビューです。上にある設定で変更できます。',\n },\n },\n },\n sound: {\n title: 'サウンド',\n options: {\n volumeMain: { title: 'メイン音量' },\n vocalVolume: { title: 'ボイス音量' },\n bgmVolume: { title: 'BGM 音量' },\n seVolume: { title: '効果音音量' },\n uiSeVolume: { title: 'UI 効果音音量' },\n voiceOption: { title: 'ボイスの中断' },\n voiceStop: { title: '中断する' },\n voiceContinue: { title: '中断しない' },\n },\n },\n // language: {\n // title: '言語',\n // options: {\n // },\n // },\n },\n },\n saving: {\n title: 'SAVE',\n isOverwrite: 'セーブデータを上書きしますか?',\n },\n loadSaving: {\n title: 'LOAD',\n },\n title: {\n title: 'HOME',\n },\n exit: {\n title: 'BACK',\n },\n },\n\n title: {\n start: {\n title: '初めから',\n subtitle: 'START',\n },\n continue: {\n title: '続きから',\n subtitle: 'CONTINUE',\n },\n options: {\n title: '設定',\n subtitle: 'CONFIG',\n },\n load: {\n title: 'ロード',\n subtitle: 'LOAD',\n },\n extra: {\n title: '鑑賞モード',\n subtitle: 'EXTRA',\n },\n },\n\n gaming: {\n noSaving: 'クイックセーブなし',\n buttons: {\n hide: 'CLOSE',\n show: 'SHOW',\n backlog: 'LOG',\n replay: 'REPLAY',\n auto: 'AUTO',\n forward: 'SKIP',\n quicklySave: 'QUICK SAVE',\n quicklyLoad: 'QUICK LOAD',\n save: 'SAVE',\n load: 'LOAD',\n options: 'CONFIG',\n title: 'HOME',\n titleTips: 'タイトル画面に戻りますか?',\n },\n },\n\n extra: {\n title: '鑑賞モード',\n },\n};\n\nexport default jp;\n","const zhCn = {\n // 通用\n common: {\n yes: '是',\n no: '否',\n },\n\n menu: {\n options: {\n title: '选项',\n pages: {\n system: {\n title: '系统',\n options: {\n autoSpeed: {\n title: '自动播放速度',\n options: {\n slow: '慢',\n medium: '中',\n fast: '快',\n },\n },\n language: {\n title: '语言',\n },\n resetData: {\n title: '清除或还原数据',\n options: {\n clearGameSave: '清除所有存档',\n resetSettings: '还原默认设置',\n clearAll: '清除所有数据',\n },\n dialogs: {\n clearGameSave: '确定要清除存档吗',\n resetSettings: '确定要还原默认设置吗',\n clearAll: '确定要清除所有数据吗',\n },\n },\n gameSave: {\n title: '导入或导出存档与选项',\n options: {\n export: '导出存档与选项',\n import: '导入存档与选项',\n },\n dialogs: {\n import: {\n title: '确定要导入存档与选项吗',\n tip: '导入存档',\n error: '存档解析失败',\n },\n },\n },\n about: {\n title: '关于 WebGAL',\n subTitle: 'WebGAL:开源的网页端视觉小说引擎',\n version: '版本号',\n source: '源代码仓库',\n contributors: '贡献者',\n website: '网站',\n },\n },\n },\n display: {\n title: '显示',\n options: {\n fullScreen: {\n title: '全屏模式',\n options: {\n on: '开启',\n off: '关闭',\n },\n },\n textSpeed: {\n title: '文字显示速度',\n options: {\n slow: '慢',\n medium: '中',\n fast: '快',\n },\n },\n textSize: {\n title: '文本大小',\n options: {\n small: '小',\n medium: '中',\n large: '大',\n },\n },\n textFont: {\n title: '文本字体',\n options: {\n siYuanSimSun: '思源宋体',\n SimHei: '黑体',\n lxgw: '霞鹜文楷',\n },\n },\n textboxOpacity: {\n title: '文本框不透明度',\n },\n textPreview: {\n title: '文本显示预览',\n text: '现在预览的是文本框字体大小和播放速度的情况,您可以根据您的观感调整上面的选项。',\n },\n },\n },\n sound: {\n title: '音频',\n options: {\n volumeMain: { title: '主音量' },\n vocalVolume: { title: '语音音量' },\n bgmVolume: { title: '背景音乐音量' },\n seVolume: { title: '音效音量' },\n uiSeVolume: { title: '用户界面音效音量' },\n voiceOption: { title: '是否中断语音' },\n voiceStop: { title: '停止语音' },\n voiceContinue: { title: '继续语音' },\n },\n },\n // language: {\n // title: '语言',\n // options: {\n // },\n // },\n },\n },\n saving: {\n title: '存档',\n isOverwrite: '是否覆盖存档?',\n },\n loadSaving: {\n title: '读档',\n },\n title: {\n title: '标题',\n options: {\n load: '',\n extra: '鉴赏模式',\n },\n },\n exit: {\n title: '返回',\n },\n },\n\n title: {\n start: {\n title: '开始游戏',\n subtitle: 'START',\n },\n continue: {\n title: '继续游戏',\n subtitle: 'CONTINUE',\n },\n options: {\n title: '游戏选项',\n subtitle: 'OPTIONS',\n },\n load: {\n title: '读取存档',\n subtitle: 'LOAD',\n },\n extra: {\n title: '鉴赏模式',\n subtitle: 'EXTRA',\n },\n },\n\n gaming: {\n noSaving: '暂无存档',\n buttons: {\n hide: '隐藏',\n show: '显示',\n backlog: '回想',\n replay: '重播',\n auto: '自动',\n forward: '快进',\n quicklySave: '快速存档',\n quicklyLoad: '快速读档',\n save: '存档',\n load: '读档',\n options: '选项',\n title: '标题',\n titleTips: '确认返回到标题界面吗',\n },\n },\n\n extra: {\n title: '鉴赏模式',\n },\n};\n\nexport default zhCn;\n","const fr = {\n // 通用\n common: {\n yes: 'OK',\n no: 'Annuler',\n },\n\n menu: {\n options: {\n title: 'OPTIONS',\n pages: {\n system: {\n title: 'Système',\n options: {\n autoSpeed: {\n title: 'Vitesse de lecture automatique',\n options: {\n slow: 'Lente',\n medium: 'Moyenne',\n fast: 'Rapide',\n },\n },\n language: {\n title: 'Langue',\n },\n resetData: {\n title: 'Effacer ou réinitialiser les données',\n options: {\n clearGameSave: 'Effacer la sauvegarde du jeu',\n resetSettings: 'Réinitialiser les paramètres',\n clearAll: 'Tout effacer',\n },\n dialogs: {\n clearGameSave: 'Êtes-vous sûr de vouloir effacer la sauvegarde du jeu',\n resetSettings: 'Êtes-vous sûr de vouloir réinitialiser tous les paramètres',\n clearAll: 'Êtes-vous sûr de vouloir tout effacer',\n },\n },\n gameSave: {\n title: 'Importer ou exporter la sauvegarde du jeu et les options',\n options: {\n export: 'Exporter la sauvegarde du jeu et les options',\n import: 'Importer la sauvegarde du jeu et les options',\n },\n dialogs: {\n import: {\n title: 'Êtes-vous sûr de vouloir importer la sauvegarde du jeu et les options',\n tip: 'Importer la sauvegarde du jeu',\n error: \"Impossible d'analyser la sauvegarde du jeu\",\n },\n },\n },\n about: {\n title: 'À propos de WebGAL',\n subTitle: 'WebGAL: Un moteur de visual novel basé sur le web en open-source',\n version: 'Version',\n source: 'Dépôt de code source',\n contributors: 'Contributeurs',\n website: 'Site web',\n },\n },\n },\n display: {\n title: 'Affichage',\n options: {\n textSpeed: {\n title: \"Vitesse d'affichage du texte\",\n options: {\n slow: 'Lente',\n medium: 'Moyenne',\n fast: 'Rapide',\n },\n },\n textSize: {\n title: 'Taille du texte',\n options: {\n small: 'Petite',\n medium: 'Moyenne',\n large: 'Grande',\n },\n },\n textFont: {\n title: 'Police du texte',\n options: {\n siYuanSimSun: 'Source Han Serif',\n SimHei: 'Sans',\n lxgw: 'LXGW WenKai',\n },\n },\n textboxOpacity: {\n title: 'Textbox Opacity',\n },\n textPreview: {\n title: \"Aperçu de l'affichage du texte\",\n text: 'Vous prévisualisez la police, la taille et la vitesse de lecture du texte, maintenant. Vous pouvez ajuster les options ci-dessus selon votre perception.',\n },\n },\n },\n sound: {\n title: 'Son',\n options: {\n volumeMain: { title: 'Volume principal' },\n vocalVolume: { title: 'Volume des voix' },\n bgmVolume: { title: 'Volume de la musique de fond' },\n seVolume: { title: 'Volume des effets sonores' },\n uiSeVolume: { title: 'Volume de l’interface utilisateur' },\n },\n },\n // language: {\n // title: 'Langue',\n // options: {\n // },\n // },\n },\n },\n saving: {\n title: 'SAUVEGARDER',\n isOverwrite: 'Êtes-vous sûr de vouloir écraser cette sauvegarde ?',\n },\n loadSaving: {\n title: 'CHARGER',\n },\n title: {\n title: 'TITRE',\n },\n exit: {\n title: 'RETOUR',\n },\n },\n\n title: {\n start: {\n title: 'COMMENCER',\n subtitle: '',\n },\n continue: {\n title: 'CONTINUER',\n subtitle: '',\n },\n options: {\n title: 'OPTIONS',\n subtitle: '',\n },\n load: {\n title: 'CHARGER',\n subtitle: '',\n },\n extra: {\n title: 'EXTRA',\n subtitle: '',\n },\n },\n\n gaming: {\n noSaving: 'Aucune sauvegarde',\n buttons: {\n hide: 'Masquer',\n show: 'Afficher',\n backlog: 'Journal',\n replay: 'Rejouer',\n auto: 'Automatique',\n forward: 'Avancer',\n quicklySave: 'Sauvegarde rapide',\n quicklyLoad: 'Chargement rapide',\n save: 'Sauvegarder',\n load: 'Charger',\n options: 'Options',\n title: 'Titre',\n titleTips: \"Confirmer le retour à l'écran titre\",\n },\n },\n\n extra: {\n title: 'EXTRA',\n },\n};\n\nexport default fr;\n","const de = {\n // 通用\n common: {\n yes: 'Ja',\n no: 'Nein',\n },\n\n menu: {\n options: {\n title: 'OPTIONEN',\n pages: {\n system: {\n title: 'System',\n options: {\n autoSpeed: {\n title: 'Auto-Geschwindigkeit',\n options: {\n slow: 'Langsam',\n medium: 'Normal',\n fast: 'Schnell',\n },\n },\n language: {\n title: 'Sprache',\n },\n resetData: {\n title: 'Daten löschen oder zurücksetzen',\n options: {\n clearGameSave: 'Alle Spielstände löschen',\n resetSettings: 'Alle Einstellungen zurücksetzen',\n clearAll: 'Alle Daten löschen',\n },\n dialogs: {\n clearGameSave: 'Sind Sie sicher, dass Sie den Spielstand löschen möchten?',\n resetSettings: 'Sind Sie sicher, dass Sie alle Einstellungen zurücksetzen möchten?',\n clearAll: 'Sind Sie sicher, dass Sie alle Daten löschen möchten?',\n },\n },\n gameSave: {\n title: 'Spielstand und Optionen importieren oder exportieren',\n options: {\n export: 'Spielstand und Optionen exportieren',\n import: 'Spielstand und Optionen importieren',\n },\n dialogs: {\n import: {\n title: 'Sind Sie sicher, dass Sie den Spielstand und die Optionen importieren möchten?',\n tip: 'Spielstand importieren',\n error: 'Ein Fehler ist beim Analysieren des Spielstands aufgetreten',\n },\n },\n },\n about: {\n title: 'Über WebGAL',\n subTitle: 'WebGAL: Eine Open-Source Web-Based Visual Novel Engine',\n version: 'Version',\n source: 'Source Code Repository',\n contributors: 'Contributors',\n website: 'Website',\n },\n },\n },\n display: {\n title: 'Darstellung',\n options: {\n textSpeed: {\n title: 'Geschwindigkeit der Textanzeige',\n options: {\n slow: 'Langsam',\n medium: 'Normal',\n fast: 'Schnell',\n },\n },\n textSize: {\n title: 'Textgröße',\n options: {\n small: 'Klein',\n medium: 'Normal',\n large: 'Groß',\n },\n },\n textFont: {\n title: 'Schriftart',\n options: {\n siYuanSimSun: 'Source Han Serif',\n SimHei: 'Sans',\n lxgw: 'LXGW WenKai',\n },\n },\n textboxOpacity: {\n title: 'Textbox Opacity',\n },\n textPreview: {\n title: 'Vorschautext wird angezeigt',\n text: 'Sie können jederzeit die Schriftart, Größe und Wiedergabegeschwindigkeit des Textes nach Ihrer Vorliebe anpassen.',\n },\n },\n },\n sound: {\n title: 'Ton',\n options: {\n volumeMain: { title: 'Hauptlautstärke' },\n vocalVolume: { title: 'Stimmlautstärke' },\n bgmVolume: { title: 'Musiklautstärke' },\n seVolume: { title: 'Soundeffektlautstärke' },\n uiSeVolume: { title: 'UI Soundeffektlautstärke' },\n },\n },\n // language: {\n // title: 'Sprache',\n // options: {\n // },\n // },\n },\n },\n saving: {\n title: 'SPEICHERN',\n isOverwrite: 'Sind Sie sicher, dass Sie diesen Spielstand überschreiben möchten?',\n },\n loadSaving: {\n title: 'LADEN',\n },\n title: {\n title: 'TITEL',\n },\n exit: {\n title: 'ZURÜCK',\n },\n },\n\n title: {\n start: {\n title: 'STARTEN',\n subtitle: '',\n },\n continue: {\n title: 'WEITERLESEN',\n subtitle: '',\n },\n options: {\n title: 'OPTIONEN',\n subtitle: '',\n },\n load: {\n title: 'LADEN',\n subtitle: '',\n },\n extra: {\n title: 'EXTRA',\n subtitle: '',\n },\n },\n\n gaming: {\n noSaving: 'Keine Speicherung',\n buttons: {\n hide: 'Verstecken',\n show: 'Anzeigen',\n backlog: 'Verlauf',\n replay: 'Wiedergabe',\n auto: 'Auto',\n forward: 'Überspringen',\n quicklySave: 'Quickly Save',\n quicklyLoad: 'Quickly Load',\n save: 'Speichern',\n load: 'Laden',\n options: 'Optionen',\n title: 'Titel',\n },\n },\n\n extra: {\n title: 'EXTRA',\n },\n};\n\nexport default de;\n","const zhTw = {\n // 通用\n common: {\n yes: '是',\n no: '否',\n },\n\n menu: {\n options: {\n title: '選項',\n pages: {\n system: {\n title: '系統',\n options: {\n autoSpeed: {\n title: '自動播放速度',\n options: {\n slow: '慢',\n medium: '中',\n fast: '快',\n },\n },\n language: {\n title: '語言',\n },\n resetData: {\n title: '清除或還原數據',\n options: {\n clearGameSave: '清除所有存檔',\n resetSettings: '還原默認設定',\n clearAll: '清除所有數據',\n },\n dialogs: {\n clearGameSave: '確定要清除存檔嗎',\n resetSettings: '確定要還原默認設定嗎',\n clearAll: '確定要清除所有數據嗎',\n },\n },\n gameSave: {\n title: '導入或導出存檔與選項',\n options: {\n export: '導出存檔與選項',\n import: '導入存檔與選項',\n },\n dialogs: {\n import: {\n title: '確定要導入存檔與選項嗎',\n tip: '導入存檔',\n error: '存檔解析失敗',\n },\n },\n },\n about: {\n title: '關於 WebGAL',\n subTitle: 'WebGAL:開源的線上視覺小說製作引擎',\n version: '版本號',\n source: '源代碼倉庫',\n contributors: '貢獻者',\n website: '網站',\n },\n },\n },\n display: {\n title: '顯示',\n options: {\n textSpeed: {\n title: '文字顯示速度',\n options: {\n slow: '慢',\n medium: '中',\n fast: '快',\n },\n },\n textSize: {\n title: '文字大小',\n options: {\n small: '小',\n medium: '中',\n large: '大',\n },\n },\n textFont: {\n title: '文字字體',\n options: {\n siYuanSimSun: '霞鹜文楷',\n SimHei: '黑體',\n },\n },\n textboxOpacity: {\n title: '文本框不透明度',\n },\n textPreview: {\n title: '文字顯示預覽',\n text: '現在預覽的是文字框字體大小和播放速度的情況,您可以根據您的觀感調整上面的選項。',\n },\n },\n },\n sound: {\n title: '音量',\n options: {\n volumeMain: { title: '主音量' },\n vocalVolume: { title: '語音音量' },\n bgmVolume: { title: '背景音樂音量' },\n seVolume: { title: '音效音量' },\n uiSeVolume: { title: '用戶界面音效音量' },\n },\n },\n // language: {\n // title: '語言',\n // options: {\n // },\n // },\n },\n },\n saving: {\n title: '存檔',\n isOverwrite: '是否要覆蓋存檔?',\n },\n loadSaving: {\n title: '讀檔',\n },\n title: {\n title: '標題',\n options: {\n load: '',\n extra: 'CG模式',\n },\n },\n exit: {\n title: '返回',\n },\n },\n\n title: {\n start: {\n title: '開始遊戲',\n subtitle: 'START',\n },\n continue: {\n title: '繼續遊戲',\n subtitle: 'CONTINUE',\n },\n options: {\n title: '遊戲選項',\n subtitle: 'OPTIONS',\n },\n load: {\n title: '讀取存檔',\n subtitle: 'LOAD',\n },\n extra: {\n title: 'CG模式',\n subtitle: 'EXTRA',\n },\n },\n\n gaming: {\n noSaving: '暫無存檔',\n buttons: {\n hide: '隱藏',\n show: '顯示',\n backlog: '回想',\n replay: '重播',\n auto: '自動',\n forward: '加速',\n quicklySave: '快速存檔',\n quicklyLoad: '快速讀檔',\n save: '存檔',\n load: '讀檔',\n options: '選項',\n title: '標題',\n titleTips: '確認返回到標題界面嗎',\n },\n },\n\n extra: {\n title: 'CG模式',\n },\n};\n\nexport default zhTw;\n","/**\n * You can config the languages display in this file.\n * If you want close someone, please add \"//\" forward that line.\n * If you want to add language, please add the language English abbreviation name into language and languages,\n * also you need to code the name of it show.\n */\n\nimport en from '@/translations/en';\nimport jp from '@/translations/jp';\nimport zhCn from '@/translations/zh-cn';\nimport fr from '@/translations/fr';\nimport de from '@/translations/de';\nimport zhTw from '@/translations/zh-tw';\n/*\n Import your translation configs here;\n example:\n import myLang from '@/translations/filename of your config file';\n*/\n\nexport enum language {\n zhCn,\n en,\n jp,\n fr,\n de,\n zhTw,\n}\n\nconst languages: Record<string, string> = {\n zhCn: '中文',\n en: 'English',\n jp: '日本語',\n fr: 'Français',\n de: 'Deutsch',\n zhTw: '繁體中文',\n};\n\nexport const i18nTranslationResources: Record<string, { translation: Record<string, any> }> = {\n en: { translation: en },\n zhCn: { translation: zhCn },\n jp: { translation: jp },\n fr: { translation: fr },\n de: { translation: de },\n zhTw: { translation: zhTw },\n};\n\nexport const defaultLanguage: language = language.zhCn;\n\nexport default languages;\n","import { IGameVar, IStageState } from './stageInterface';\nimport { language } from '@/config/language';\nimport { IBacklogItem } from '@/Core/Modules/backlog';\nimport { ISceneEntry } from '@/Core/Modules/scene';\n\n/**\n * 播放速度的枚举类型\n */\nexport enum playSpeed {\n slow, // 慢\n normal, // 中\n fast, // 快\n}\n\nexport enum textSize {\n small,\n medium,\n large,\n}\n\nexport enum textFont {\n song,\n hei,\n lxgw,\n}\n\nexport enum voiceOption {\n yes,\n no,\n}\n\nexport enum fullScreenOption {\n on,\n off,\n}\n\n/**\n * @interface IOptionData 用户设置数据接口\n */\nexport interface IOptionData {\n volumeMain: number; // 主音量\n textSpeed: playSpeed; // 文字速度\n autoSpeed: playSpeed; // 自动播放速度\n textSize: textSize;\n vocalVolume: number; // 语音音量\n bgmVolume: number; // 背景音乐音量\n seVolume: number; // 音效音量\n uiSeVolume: number; // 用户界面音效音量\n slPage: number; // 存读档界面所在页面\n textboxFont: textFont;\n textboxOpacity: number;\n language: language;\n voiceInterruption: voiceOption; // 是否中断语音\n fullScreen: fullScreenOption;\n}\n\n/**\n * 场景存档接口\n * @interface ISaveScene\n */\nexport interface ISaveScene {\n currentSentenceId: number; // 当前语句ID\n sceneStack: Array<ISceneEntry>; // 场景栈\n sceneName: string; // 场景名称\n sceneUrl: string; // 场景url\n}\n\n/**\n * @interface ISaveData 存档文件接口\n */\nexport interface ISaveData {\n nowStageState: IStageState;\n backlog: Array<IBacklogItem>; // 舞台数据\n index: number; // 存档的序号\n saveTime: string; // 保存时间\n sceneData: ISaveScene; // 场景数据\n previewImage: string;\n}\n\nexport interface IAppreciationAsset {\n name: string;\n url: string;\n series: string;\n}\n\nexport interface IAppreciation {\n bgm: Array<IAppreciationAsset>;\n cg: Array<IAppreciationAsset>;\n}\n\n/**\n * @interface IUserData 用户数据接口\n */\nexport interface IUserData {\n scriptManagedGlobalVar: string[];\n globalGameVar: IGameVar; // 不跟随存档的全局变量\n optionData: IOptionData; // 用户设置选项数据\n appreciationData: IAppreciation;\n}\n\nexport interface ISetUserDataPayload {\n key: keyof IUserData;\n value: any;\n}\n\nexport interface ISetOptionDataPayload {\n key: keyof IOptionData;\n value: any;\n}\n\nexport interface IUserDataStore {\n userDataState: IUserData;\n setUserData: <K extends keyof IUserData>(key: K, value: any) => void;\n replaceUserData: (newUserData: IUserData) => void;\n setOptionData: <K extends keyof IOptionData>(key: K, value: any) => void;\n setSlPage: (index: number) => void;\n}\n\nexport type UserDataStore = IUserDataStore;\n","/**\n * 用于存储与本地存储交换的状态信息。\n * 这些状态会在指定的生命周期与本地存储发生交换,比如打开存档界面、存档、修改设置时。\n * 在引擎初始化时会将这些状态从本地存储加载到运行时状态。\n */\nimport { language } from '@/config/language';\nimport {\n IAppreciationAsset,\n IOptionData,\n ISaveData,\n ISetOptionDataPayload,\n ISetUserDataPayload,\n IUserData,\n fullScreenOption,\n playSpeed,\n textFont,\n textSize,\n voiceOption,\n} from '@/store/userDataInterface';\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { ISetGameVar } from './stageInterface';\n\nconst initialOptionSet: IOptionData = {\n slPage: 1,\n volumeMain: 100, // 主音量\n textSpeed: playSpeed.normal, // 文字速度\n autoSpeed: playSpeed.normal, // 自动播放速度\n textSize: textSize.medium,\n vocalVolume: 100, // 语音音量\n bgmVolume: 25, // 背景音乐音量\n seVolume: 100, // 音效音量\n uiSeVolume: 50, // UI音效音量\n textboxFont: textFont.song,\n textboxOpacity: 75,\n language: language.zhCn,\n voiceInterruption: voiceOption.yes,\n fullScreen: fullScreenOption.off,\n};\n\n// 初始化用户数据\nexport const initState: IUserData = {\n optionData: initialOptionSet,\n scriptManagedGlobalVar: [],\n globalGameVar: {},\n appreciationData: {\n bgm: [],\n cg: [],\n },\n};\n\nconst userDataSlice = createSlice({\n name: 'userData',\n initialState: cloneDeep(initState),\n reducers: {\n /**\n * 设置用户数据\n * @param state\n * @param action\n */\n setUserData: (state, action: PayloadAction<ISetUserDataPayload>) => {\n const { key, value } = action.payload;\n state[key] = value;\n },\n unlockCgInUserData: (state, action: PayloadAction<IAppreciationAsset>) => {\n const { name, url, series } = action.payload;\n // 检查是否存在\n let isExist = false;\n state.appreciationData.cg.forEach((e) => {\n if (url === e.url) {\n isExist = true;\n e.url = url;\n e.series = series;\n }\n });\n if (!isExist) {\n state.appreciationData.cg.push(action.payload);\n }\n },\n unlockBgmInUserData: (state, action: PayloadAction<IAppreciationAsset>) => {\n const { name, url, series } = action.payload;\n // 检查是否存在\n let isExist = false;\n state.appreciationData.bgm.forEach((e) => {\n if (url === e.url) {\n isExist = true;\n e.url = url;\n e.series = series;\n }\n });\n if (!isExist) {\n state.appreciationData.bgm.push(action.payload);\n }\n },\n /**\n * 替换用户数据\n * @param state\n * @param action\n */\n resetUserData: (state, action: PayloadAction<IUserData>) => {\n Object.assign(state, action.payload);\n },\n /**\n * 设置选项数据\n * @param state\n * @param action\n */\n setOptionData: (state, action: PayloadAction<ISetOptionDataPayload>) => {\n const { key, value } = action.payload;\n (state.optionData as any)[key] = value;\n },\n /**\n * 修改不跟随存档的全局变量\n * @param state 当前状态\n * @param action 要改变或添加的变量\n */\n setGlobalVar: (state, action: PayloadAction<ISetGameVar>) => {\n const isRegistedInUserData = state.scriptManagedGlobalVar.findIndex((key) => key === action.payload.key) >= 0;\n if (!isRegistedInUserData) {\n state.globalGameVar[action.payload.key] = action.payload.value;\n }\n },\n setScriptManagedGlobalVar: (state, action: PayloadAction<ISetGameVar>) => {\n const isRegistedInUserData = state.scriptManagedGlobalVar.findIndex((key) => key === action.payload.key) >= 0;\n state.globalGameVar[action.payload.key] = action.payload.value;\n if (!isRegistedInUserData) {\n state.scriptManagedGlobalVar.push(action.payload.key);\n }\n },\n /**\n * 设置存档/读档页面\n * @param state\n * @param action\n */\n setSlPage: (state, action: PayloadAction<number>) => {\n state.optionData.slPage = action.payload;\n },\n resetOptionSet(state) {\n Object.assign(state.optionData, initialOptionSet);\n },\n resetAllData(state) {\n Object.assign(state, cloneDeep(initState));\n },\n },\n});\n\nexport const {\n setUserData,\n resetUserData,\n setOptionData,\n setGlobalVar,\n setScriptManagedGlobalVar,\n setSlPage,\n unlockCgInUserData,\n unlockBgmInUserData,\n resetOptionSet,\n resetAllData,\n} = userDataSlice.actions;\nexport default userDataSlice.reducer;\n\n// /**\n// * 创建用户数据的状态管理\n// * @return {IUserData} 用户数据\n// * @return {function} 改变用户数据\n// */\n// export function userDataStateStore():UserDataStore {\n// const [userDataState, setUserDataState] = useState(initState);\n//\n// // 设置用户数据\n// const setUserData = <K extends keyof IUserData>(key: K, value: any) => {\n//\n// setUserDataState(state => {\n// state[key] = value;\n// return {...state};\n// });\n//\n// };\n//\n// // 替换用户数据(多用于与本地存储交互)\n// const replaceUserData = (newUserData: IUserData) => {\n//\n// setUserDataState(state => ({...state, ...newUserData}));\n// };\n//\n// const setOptionData = <K extends keyof IOptionData>(key: K, value: any) => {\n// setUserDataState(state => {\n// state.optionData[key] = value;\n// return {...state};\n// });\n// };\n//\n// const setSlPage = (index: number) => {\n// setUserDataState(state => {\n// state.optionData.slPage = index;\n// return {...state};\n// });\n//\n// };\n//\n// return {\n// userDataState,\n// setUserData,\n// replaceUserData,\n// setOptionData,\n// setSlPage,\n// };\n// }\n","export const SYSTEM_CONFIG = {\n backlog_size: 200,\n fast_timeout: 50,\n};\nexport const PERFORM_CONFIG = {\n // 不能小于50\n textInitialDelay: 80,\n};\n","/**\n * 当前的backlog\n */\nimport { IEffect, IStageState } from '@/store/stageInterface';\nimport { webgalStore } from '@/store/store';\nimport { ISaveScene } from '@/store/userDataInterface';\nimport cloneDeep from 'lodash/cloneDeep';\n\nimport { SYSTEM_CONFIG } from '@/config';\nimport { SceneManager } from '@/Core/Modules/scene';\n\nexport interface IBacklogItem {\n currentStageState: IStageState;\n saveScene: ISaveScene;\n}\n\nexport class BacklogManager {\n public isSaveBacklogNext = false;\n private backlog: Array<IBacklogItem> = [];\n\n private readonly sceneManager: SceneManager;\n\n public constructor(sceneManager: SceneManager) {\n this.sceneManager = sceneManager;\n }\n\n public getBacklog() {\n return this.backlog;\n }\n\n public editLastBacklogItemEffect(effects: IEffect[]) {\n this.backlog[this.backlog.length - 1].currentStageState.effects = effects;\n }\n\n public makeBacklogEmpty() {\n this.backlog.splice(0, this.backlog.length); // 清空backlog\n }\n public insertBacklogItem(item: IBacklogItem) {\n this.backlog.push(item);\n }\n public saveCurrentStateToBacklog() {\n // 存一下 Backlog\n const currentStageState = webgalStore.getState().stage;\n const stageStateToBacklog = cloneDeep(currentStageState);\n stageStateToBacklog.PerformList.forEach((ele) => {\n ele.script.args.forEach((argelement) => {\n if (argelement.key === 'concat') {\n argelement.value = false;\n ele.script.content = stageStateToBacklog.showText;\n }\n });\n });\n const backlogElement: IBacklogItem = {\n currentStageState: stageStateToBacklog,\n saveScene: {\n currentSentenceId: this.sceneManager.sceneData.currentSentenceId, // 当前语句ID\n sceneStack: cloneDeep(this.sceneManager.sceneData.sceneStack), // 场景栈\n sceneName: this.sceneManager.sceneData.currentScene.sceneName, // 场景名称\n sceneUrl: this.sceneManager.sceneData.currentScene.sceneUrl, // 场景url\n },\n };\n this.getBacklog().push(backlogElement);\n\n // 清除超出长度的部分\n while (this.getBacklog().length > SYSTEM_CONFIG.backlog_size) {\n this.getBacklog().shift();\n }\n }\n}\n","import { ISceneData } from '@/Core/controller/scene/sceneInterface';\nimport cloneDeep from 'lodash/cloneDeep';\n\nexport interface ISceneEntry {\n sceneName: string; // 场景名称\n sceneUrl: string; // 场景url\n continueLine: number; // 继续原场景的行号\n}\n\n/**\n * 初始化场景数据\n */\nexport const initSceneData = {\n currentSentenceId: 0, // 当前语句ID\n sceneStack: [],\n // 初始场景,没有数据\n currentScene: {\n sceneName: '', // 场景名称\n sceneUrl: '', // 场景url\n sentenceList: [], // 语句列表\n assetsList: [], // 资源列表\n subSceneList: [], // 子场景列表\n },\n};\n\nexport class SceneManager {\n public settledScenes: Array<string> = [];\n public settledAssets: Array<string> = [];\n public sceneData: ISceneData = cloneDeep(initSceneData);\n public lockSceneWrite = false;\n\n public resetScene() {\n this.sceneData.currentSentenceId = 0;\n this.sceneData.sceneStack = [];\n this.sceneData.currentScene = cloneDeep(initSceneData.currentScene);\n }\n}\n","import { ITransform } from '@/store/stageInterface';\n\nexport interface IUserAnimation {\n name: string;\n effects: Array<ITransform & { duration: number }>;\n}\n\nexport class AnimationManager {\n public nextEnterAnimationName: Map<string, string> = new Map();\n public nextExitAnimationName: Map<string, string> = new Map();\n private animations: Array<IUserAnimation> = [];\n\n public addAnimation(animation: IUserAnimation) {\n this.animations.push(animation);\n }\n public getAnimations() {\n return this.animations;\n }\n}\n","/**\n * 描述演出的接口,主要用于控制演出,而不是执行(在演出开始时被调用演出的执行器返回)\n * @interface IPerform\n */\nexport interface IPerform {\n // 演出名称,用于在后面手动清除演出,如果没有标识,则代表不是保持演出,给予一个随机字符串\n performName: string;\n // 持续时间,单位为ms,持续时间到后自动回收演出\n duration: number;\n // 演出是不是一个保持类型的演出\n isHoldOn: boolean;\n // 卸载演出的函数\n stopFunction: () => void;\n // 演出是否阻塞游戏流程继续(一个函数,返回 boolean类型的结果,判断要不要阻塞)\n blockingNext: () => boolean;\n // 演出是否阻塞自动模式(一个函数,返回 boolean类型的结果,判断要不要阻塞)\n blockingAuto: () => boolean;\n // 自动回收使用的 Timeout\n stopTimeout: undefined | ReturnType<typeof setTimeout>;\n // 演出结束后转到下一句\n goNextWhenOver?: boolean;\n // 对于延迟触发的演出,使用 Promise\n arrangePerformPromise?: Promise<IPerform>;\n // 跳过由 nextSentence 函数引发的演出回收\n skipNextCollect?: boolean;\n}\n\n// next之后,可以被打断的演出会被打断,不能被打断的演出会继续,阻塞next的演出会阻止next被响应。\n// 被打断或执行完毕的演出会移出演出列表\n// 只有所有演出都完成,或者仅存在不阻塞auto的演出,才允许auto\n\n/**\n * 初始化的演出\n */\nexport const initPerform: IPerform = {\n performName: '',\n duration: 100,\n // isOver: false,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined,\n};\n","/**\n * @file 资源的引入可能是绝对链接,也可能是文件名,必须做必要的处理。\n */\n\n/**\n * 内置资源类型的枚举\n */\nexport enum fileType {\n background,\n bgm,\n figure,\n scene,\n tex,\n vocal,\n video,\n}\n\n/**\n * 获取资源路径\n * @param fileName 资源的名称或地址\n * @param assetType 资源类型\n * @return {string} 处理后的资源路径(绝对或相对)\n */\nexport const assetSetter = (fileName: string, assetType: fileType): string => {\n // 是绝对链接,直接返回\n if (fileName.match('http://') || fileName.match('https://')) {\n return fileName;\n } else {\n // 根据类型拼接资源的相对路径\n let returnFilePath: string;\n switch (assetType) {\n case fileType.background:\n returnFilePath = `./game/background/${fileName}`;\n break;\n case fileType.scene:\n returnFilePath = `./game/scene/${fileName}`;\n break;\n case fileType.vocal:\n returnFilePath = `./game/vocal/${fileName}`;\n break;\n case fileType.figure:\n returnFilePath = `./game/figure/${fileName}`;\n break;\n case fileType.bgm:\n returnFilePath = `./game/bgm/${fileName}`;\n break;\n case fileType.video:\n returnFilePath = `./game/video/${fileName}`;\n break;\n default:\n returnFilePath = ``;\n break;\n }\n return returnFilePath;\n }\n};\n","import { IAsset } from '@/Core/controller/scene/sceneInterface';\nimport { logger } from '../logger';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 预加载函数\n * @param assetList 场景资源列表\n */\nexport const assetsPrefetcher = (assetList: Array<IAsset>) => {\n // @ts-ignore\n // 未必要移除,加载到内存里也有用\n // if (window?.isElectron) {\n // return;\n // }\n\n for (const asset of assetList) {\n // 判断是否已经存在\n const hasPrefetch = WebGAL.sceneManager.settledAssets.includes(asset.url);\n if (hasPrefetch) {\n logger.debug(`该资源${asset.url}已在预加载列表中,无需重复加载`);\n } else {\n const newLink = document.createElement('link');\n newLink.setAttribute('rel', 'prefetch');\n newLink.setAttribute('href', asset.url);\n const head = document.getElementsByTagName('head');\n if (head.length) {\n try {\n head[0].appendChild(newLink);\n } catch (e) {\n console.log('预加载出错', e);\n }\n }\n WebGAL.sceneManager.settledAssets.push(asset.url);\n }\n }\n};\n","var commandType;\r\n(function (commandType) {\r\n commandType[commandType[\"say\"] = 0] = \"say\";\r\n commandType[commandType[\"changeBg\"] = 1] = \"changeBg\";\r\n commandType[commandType[\"changeFigure\"] = 2] = \"changeFigure\";\r\n commandType[commandType[\"bgm\"] = 3] = \"bgm\";\r\n commandType[commandType[\"video\"] = 4] = \"video\";\r\n commandType[commandType[\"pixi\"] = 5] = \"pixi\";\r\n commandType[commandType[\"pixiInit\"] = 6] = \"pixiInit\";\r\n commandType[commandType[\"intro\"] = 7] = \"intro\";\r\n commandType[commandType[\"miniAvatar\"] = 8] = \"miniAvatar\";\r\n commandType[commandType[\"changeScene\"] = 9] = \"changeScene\";\r\n commandType[commandType[\"choose\"] = 10] = \"choose\";\r\n commandType[commandType[\"end\"] = 11] = \"end\";\r\n commandType[commandType[\"setComplexAnimation\"] = 12] = \"setComplexAnimation\";\r\n commandType[commandType[\"setFilter\"] = 13] = \"setFilter\";\r\n commandType[commandType[\"label\"] = 14] = \"label\";\r\n commandType[commandType[\"jumpLabel\"] = 15] = \"jumpLabel\";\r\n commandType[commandType[\"chooseLabel\"] = 16] = \"chooseLabel\";\r\n commandType[commandType[\"setVar\"] = 17] = \"setVar\";\r\n commandType[commandType[\"if\"] = 18] = \"if\";\r\n commandType[commandType[\"callScene\"] = 19] = \"callScene\";\r\n commandType[commandType[\"showVars\"] = 20] = \"showVars\";\r\n commandType[commandType[\"unlockCg\"] = 21] = \"unlockCg\";\r\n commandType[commandType[\"unlockBgm\"] = 22] = \"unlockBgm\";\r\n commandType[commandType[\"filmMode\"] = 23] = \"filmMode\";\r\n commandType[commandType[\"setTextbox\"] = 24] = \"setTextbox\";\r\n commandType[commandType[\"setAnimation\"] = 25] = \"setAnimation\";\r\n commandType[commandType[\"playEffect\"] = 26] = \"playEffect\";\r\n commandType[commandType[\"setTempAnimation\"] = 27] = \"setTempAnimation\";\r\n commandType[commandType[\"comment\"] = 28] = \"comment\";\r\n commandType[commandType[\"setTransform\"] = 29] = \"setTransform\";\r\n commandType[commandType[\"setTransition\"] = 30] = \"setTransition\";\r\n commandType[commandType[\"getUserInput\"] = 31] = \"getUserInput\";\r\n commandType[commandType[\"applyStyle\"] = 32] = \"applyStyle\";\r\n})(commandType || (commandType = {}));\n\nconst SCRIPT_CONFIG = [\r\n { scriptString: 'intro', scriptType: commandType.intro },\r\n { scriptString: 'changeBg', scriptType: commandType.changeBg },\r\n { scriptString: 'changeFigure', scriptType: commandType.changeFigure },\r\n { scriptString: 'miniAvatar', scriptType: commandType.miniAvatar },\r\n { scriptString: 'changeScene', scriptType: commandType.changeScene },\r\n { scriptString: 'choose', scriptType: commandType.choose },\r\n { scriptString: 'end', scriptType: commandType.end },\r\n { scriptString: 'bgm', scriptType: commandType.bgm },\r\n { scriptString: 'playVideo', scriptType: commandType.video },\r\n {\r\n scriptString: 'setComplexAnimation',\r\n scriptType: commandType.setComplexAnimation,\r\n },\r\n { scriptString: 'setFilter', scriptType: commandType.setFilter },\r\n { scriptString: 'pixiInit', scriptType: commandType.pixiInit },\r\n { scriptString: 'pixiPerform', scriptType: commandType.pixi },\r\n { scriptString: 'label', scriptType: commandType.label },\r\n { scriptString: 'jumpLabel', scriptType: commandType.jumpLabel },\r\n { scriptString: 'setVar', scriptType: commandType.setVar },\r\n { scriptString: 'callScene', scriptType: commandType.callScene },\r\n { scriptString: 'showVars', scriptType: commandType.showVars },\r\n { scriptString: 'unlockCg', scriptType: commandType.unlockCg },\r\n { scriptString: 'unlockBgm', scriptType: commandType.unlockBgm },\r\n { scriptString: 'say', scriptType: commandType.say },\r\n { scriptString: 'filmMode', scriptType: commandType.filmMode },\r\n { scriptString: 'callScene', scriptType: commandType.callScene },\r\n { scriptString: 'setTextbox', scriptType: commandType.setTextbox },\r\n { scriptString: 'setAnimation', scriptType: commandType.setAnimation },\r\n { scriptString: 'playEffect', scriptType: commandType.playEffect },\r\n { scriptString: 'applyStyle', scriptType: commandType.applyStyle },\r\n];\r\nconst ADD_NEXT_ARG_LIST = [\r\n commandType.bgm,\r\n commandType.pixi,\r\n commandType.pixiInit,\r\n commandType.label,\r\n commandType.if,\r\n commandType.miniAvatar,\r\n commandType.setVar,\r\n commandType.unlockBgm,\r\n commandType.unlockCg,\r\n commandType.filmMode,\r\n commandType.playEffect,\r\n];\n\n/**\r\n * 内置资源类型的枚举\r\n */\r\nvar fileType;\r\n(function (fileType) {\r\n fileType[fileType[\"background\"] = 0] = \"background\";\r\n fileType[fileType[\"bgm\"] = 1] = \"bgm\";\r\n fileType[fileType[\"figure\"] = 2] = \"figure\";\r\n fileType[fileType[\"scene\"] = 3] = \"scene\";\r\n fileType[fileType[\"tex\"] = 4] = \"tex\";\r\n fileType[fileType[\"vocal\"] = 5] = \"vocal\";\r\n fileType[fileType[\"video\"] = 6] = \"video\";\r\n})(fileType || (fileType = {}));\n\n/**\r\n * 参数解析器\r\n * @param argsRaw 原始参数字符串\r\n * @param assetSetter\r\n * @return {Array<arg>} 解析后的参数列表\r\n */\r\nfunction argsParser(argsRaw, assetSetter) {\r\n const returnArrayList = [];\r\n // 处理参数\r\n // 不要去空格\r\n let newArgsRaw = argsRaw.replace(/ /g, ' ');\r\n // 分割参数列表\r\n let rawArgsList = newArgsRaw.split(' -');\r\n // 去除空字符串\r\n rawArgsList = rawArgsList.filter((e) => {\r\n return e !== '';\r\n });\r\n rawArgsList.forEach((e) => {\r\n const equalSignIndex = e.indexOf('=');\r\n let argName = e.slice(0, equalSignIndex);\r\n let argValue = e.slice(equalSignIndex + 1);\r\n if (equalSignIndex < 0) {\r\n argName = e;\r\n argValue = undefined;\r\n }\r\n // 判断是不是语音参数\r\n if (argName.toLowerCase().match(/.ogg|.mp3|.wav/)) {\r\n returnArrayList.push({\r\n key: 'vocal',\r\n value: assetSetter(e, fileType.vocal),\r\n });\r\n }\r\n else {\r\n // 判断是不是省略参数\r\n if (argValue === undefined) {\r\n returnArrayList.push({\r\n key: argName,\r\n value: true,\r\n });\r\n }\r\n else {\r\n // 是字符串描述的布尔值\r\n if (argValue === 'true' || argValue === 'false') {\r\n returnArrayList.push({\r\n key: argName,\r\n value: argValue === 'true',\r\n });\r\n }\r\n else {\r\n // 是数字\r\n if (!isNaN(Number(argValue))) {\r\n returnArrayList.push({\r\n key: argName,\r\n value: Number(argValue),\r\n });\r\n }\r\n else {\r\n // 是普通参数\r\n returnArrayList.push({\r\n key: argName,\r\n value: argValue,\r\n });\r\n }\r\n }\r\n }\r\n }\r\n });\r\n return returnArrayList;\r\n}\n\nfunction configLineParser(inputLine) {\r\n const options = [];\r\n let command;\r\n let newSentenceRaw = inputLine.split(';')[0];\r\n if (newSentenceRaw === '') {\r\n // 注释提前返回\r\n return {\r\n command: '',\r\n args: [],\r\n options: [],\r\n };\r\n }\r\n // 截取命令\r\n const getCommandResult = /\\s*:\\s*/.exec(newSentenceRaw);\r\n // 没有command\r\n if (getCommandResult === null) {\r\n command = '';\r\n }\r\n else {\r\n command = newSentenceRaw.substring(0, getCommandResult.index);\r\n // 划分命令区域和content区域\r\n newSentenceRaw = newSentenceRaw.substring(getCommandResult.index + 1, newSentenceRaw.length);\r\n }\r\n // 截取 Options 区域\r\n const getOptionsResult = / -/.exec(newSentenceRaw);\r\n // 获取到参数\r\n if (getOptionsResult) {\r\n const optionsRaw = newSentenceRaw.substring(getOptionsResult.index, newSentenceRaw.length);\r\n newSentenceRaw = newSentenceRaw.substring(0, getOptionsResult.index);\r\n for (const e of argsParser(optionsRaw, (name, _) => {\r\n return name;\r\n })) {\r\n options.push(e);\r\n }\r\n }\r\n return {\r\n command,\r\n args: newSentenceRaw\r\n .split('|')\r\n .map((e) => e.trim())\r\n .filter((e) => e !== ''),\r\n options,\r\n };\r\n}\r\nfunction configParser(configText) {\r\n const configLines = configText.replaceAll(`\\r`, '').split('\\n');\r\n return configLines\r\n .map((e) => configLineParser(e))\r\n .filter((e) => e.command !== '');\r\n}\n\n/**\r\n * 处理命令\r\n * @param commandRaw\r\n * @param ADD_NEXT_ARG_LIST\r\n * @param SCRIPT_CONFIG_MAP\r\n * @return {parsedCommand} 处理后的命令\r\n */\r\nconst commandParser = (commandRaw, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP) => {\r\n let returnCommand = {\r\n type: commandType.say,\r\n additionalArgs: [],\r\n };\r\n // 开始处理命令内容\r\n const type = getCommandType(commandRaw, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP);\r\n returnCommand.type = type;\r\n // 如果是对话,加上额外的参数\r\n if (type === commandType.say && commandRaw !== 'say') {\r\n returnCommand.additionalArgs.push({\r\n key: 'speaker',\r\n value: commandRaw,\r\n });\r\n }\r\n returnCommand = addNextArg(returnCommand, type, ADD_NEXT_ARG_LIST);\r\n return returnCommand;\r\n};\r\n/**\r\n * 根据command原始值判断是什么命令\r\n * @param command command原始值\r\n * @param ADD_NEXT_ARG_LIST\r\n * @param SCRIPT_CONFIG_MAP\r\n * @return {commandType} 得到的command类型\r\n */\r\nfunction getCommandType(command, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP) {\r\n return SCRIPT_CONFIG_MAP.get(command)?.scriptType ?? commandType.say;\r\n}\r\nfunction addNextArg(commandToParse, thisCommandType, ADD_NEXT_ARG_LIST) {\r\n if (ADD_NEXT_ARG_LIST.includes(thisCommandType)) {\r\n commandToParse.additionalArgs.push({\r\n key: 'next',\r\n value: true,\r\n });\r\n }\r\n return commandToParse;\r\n}\n\n/**\r\n * 解析语句内容的函数,主要作用是把文件名改为绝对地址或相对地址(根据使用情况而定)\r\n * @param contentRaw 原始语句内容\r\n * @param type 语句类型\r\n * @param assetSetter\r\n * @return {string} 解析后的语句内容\r\n */\r\nconst contentParser = (contentRaw, type, assetSetter) => {\r\n if (contentRaw === 'none' || contentRaw === '') {\r\n return '';\r\n }\r\n switch (type) {\r\n case commandType.playEffect:\r\n return assetSetter(contentRaw, fileType.vocal);\r\n case commandType.changeBg:\r\n return assetSetter(contentRaw, fileType.background);\r\n case commandType.changeFigure:\r\n return assetSetter(contentRaw, fileType.figure);\r\n case commandType.bgm:\r\n return assetSetter(contentRaw, fileType.bgm);\r\n case commandType.callScene:\r\n return assetSetter(contentRaw, fileType.scene);\r\n case commandType.changeScene:\r\n return assetSetter(contentRaw, fileType.scene);\r\n case commandType.miniAvatar:\r\n return assetSetter(contentRaw, fileType.figure);\r\n case commandType.video:\r\n return assetSetter(contentRaw, fileType.video);\r\n case commandType.choose:\r\n return getChooseContent(contentRaw, assetSetter);\r\n case commandType.unlockBgm:\r\n return assetSetter(contentRaw, fileType.bgm);\r\n case commandType.unlockCg:\r\n return assetSetter(contentRaw, fileType.background);\r\n default:\r\n return contentRaw;\r\n }\r\n};\r\nfunction getChooseContent(contentRaw, assetSetter) {\r\n const chooseList = contentRaw.split(/(?<!\\\\)\\|/);\r\n const chooseKeyList = [];\r\n const chooseValueList = [];\r\n for (const e of chooseList) {\r\n chooseKeyList.push(e.split(/(?<!\\\\):/)[0] ?? '');\r\n chooseValueList.push(e.split(/(?<!\\\\):/)[1] ?? '');\r\n }\r\n const parsedChooseList = chooseValueList.map((e) => {\r\n if (e.match(/\\./)) {\r\n return assetSetter(e, fileType.scene);\r\n }\r\n else {\r\n return e;\r\n }\r\n });\r\n let ret = '';\r\n for (let i = 0; i < chooseKeyList.length; i++) {\r\n if (i !== 0) {\r\n ret = ret + '|';\r\n }\r\n ret = ret + `${chooseKeyList[i]}:${parsedChooseList[i]}`;\r\n }\r\n return ret;\r\n}\n\n/**\r\n * 根据语句类型、语句内容、参数列表,扫描该语句可能携带的资源\r\n * @param command 语句类型\r\n * @param content 语句内容\r\n * @param args 参数列表\r\n * @return {Array<IAsset>} 语句携带的参数列表\r\n */\r\nconst assetsScanner = (command, content, args) => {\r\n const returnAssetsList = [];\r\n if (command === commandType.say) {\r\n args.forEach((e) => {\r\n if (e.key === 'vocal') {\r\n returnAssetsList.push({\r\n name: e.value,\r\n url: e.value,\r\n lineNumber: 0,\r\n type: fileType.vocal,\r\n });\r\n }\r\n });\r\n }\r\n if (content === 'none' || content === '') {\r\n return returnAssetsList;\r\n }\r\n // 处理语句携带的资源\r\n if (command === commandType.changeBg) {\r\n returnAssetsList.push({\r\n name: content,\r\n url: content,\r\n lineNumber: 0,\r\n type: fileType.background,\r\n });\r\n }\r\n if (command === commandType.changeFigure) {\r\n returnAssetsList.push({\r\n name: content,\r\n url: content,\r\n lineNumber: 0,\r\n type: fileType.figure,\r\n });\r\n }\r\n if (command === commandType.miniAvatar) {\r\n returnAssetsList.push({\r\n name: content,\r\n url: content,\r\n lineNumber: 0,\r\n type: fileType.figure,\r\n });\r\n }\r\n if (command === commandType.video) {\r\n returnAssetsList.push({\r\n name: content,\r\n url: content,\r\n lineNumber: 0,\r\n type: fileType.video,\r\n });\r\n }\r\n if (command === commandType.bgm) {\r\n returnAssetsList.push({\r\n name: content,\r\n url: content,\r\n lineNumber: 0,\r\n type: fileType.bgm,\r\n });\r\n }\r\n return returnAssetsList;\r\n};\n\n/**\r\n * 扫描子场景\r\n * @param content 语句内容\r\n * @return {Array<string>} 子场景列表\r\n */\r\nconst subSceneScanner = (command, content) => {\r\n const subSceneList = [];\r\n if (command === commandType.changeScene ||\r\n command === commandType.callScene) {\r\n subSceneList.push(content);\r\n }\r\n if (command === commandType.choose) {\r\n const chooseList = content.split('|');\r\n const chooseValue = chooseList.map((e) => e.split(':')[1] ?? '');\r\n chooseValue.forEach((e) => {\r\n if (e.match(/\\./)) {\r\n subSceneList.push(e);\r\n }\r\n });\r\n }\r\n return subSceneList;\r\n};\n\n/**\r\n * 语句解析器\r\n * @param sentenceRaw 原始语句\r\n * @param assetSetter\r\n * @param ADD_NEXT_ARG_LIST\r\n * @param SCRIPT_CONFIG_MAP\r\n */\r\nconst scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP) => {\r\n let command; // 默认为对话\r\n let content; // 语句内容\r\n let subScene; // 语句携带的子场景(可能没有)\r\n const args = []; // 语句参数列表\r\n let sentenceAssets; // 语句携带的资源列表\r\n let parsedCommand; // 解析后的命令\r\n let commandRaw;\r\n // 正式开始解析\r\n // 去分号\r\n let newSentenceRaw = sentenceRaw.split(/(?<!\\\\);/)[0];\r\n newSentenceRaw = newSentenceRaw.replaceAll('\\\\;', ';');\r\n if (newSentenceRaw === '') {\r\n // 注释提前返回\r\n return {\r\n command: commandType.comment,\r\n commandRaw: 'comment',\r\n content: sentenceRaw.split(';')[1] ?? '',\r\n args: [{ key: 'next', value: true }],\r\n sentenceAssets: [],\r\n subScene: [], // 语句携带的子场景\r\n };\r\n }\r\n // 截取命令\r\n const getCommandResult = /:/.exec(newSentenceRaw);\r\n /**\r\n * 拆分命令和语句,同时处理连续对话。\r\n */\r\n // 没有command,说明这是一条连续对话或单条语句\r\n if (getCommandResult === null) {\r\n commandRaw = newSentenceRaw;\r\n parsedCommand = commandParser(commandRaw, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP);\r\n command = parsedCommand.type;\r\n for (const e of parsedCommand.additionalArgs) {\r\n // 由于是连续对话,所以我们去除 speaker 参数。\r\n if (command === commandType.say && e.key === 'speaker') {\r\n continue;\r\n }\r\n args.push(e);\r\n }\r\n }\r\n else {\r\n commandRaw = newSentenceRaw.substring(0, getCommandResult.index);\r\n // 划分命令区域和content区域\r\n newSentenceRaw = newSentenceRaw.substring(getCommandResult.index + 1, newSentenceRaw.length);\r\n parsedCommand = commandParser(commandRaw, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP);\r\n command = parsedCommand.type;\r\n for (const e of parsedCommand.additionalArgs) {\r\n args.push(e);\r\n }\r\n }\r\n // 截取参数区域\r\n const getArgsResult = / -/.exec(newSentenceRaw);\r\n // 获取到参数\r\n if (getArgsResult) {\r\n const argsRaw = newSentenceRaw.substring(getArgsResult.index, sentenceRaw.length);\r\n newSentenceRaw = newSentenceRaw.substring(0, getArgsResult.index);\r\n for (const e of argsParser(argsRaw, assetSetter)) {\r\n args.push(e);\r\n }\r\n }\r\n content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径\r\n sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源\r\n subScene = subSceneScanner(command, content); // 扫描语句携带子场景\r\n return {\r\n command: command,\r\n commandRaw: commandRaw.trim(),\r\n content: content,\r\n args: args,\r\n sentenceAssets: sentenceAssets,\r\n subScene: subScene, // 语句携带的子场景\r\n };\r\n};\n\nvar commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n/** Detect free variable `global` from Node.js. */\n\nvar freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;\n\nvar _freeGlobal = freeGlobal$1;\n\nvar freeGlobal = _freeGlobal;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root$4 = freeGlobal || freeSelf || Function('return this')();\n\nvar _root = root$4;\n\nvar root$3 = _root;\n\n/** Built-in value references. */\nvar Symbol$2 = root$3.Symbol;\n\nvar _Symbol = Symbol$2;\n\nvar Symbol$1 = _Symbol;\n\n/** Used for built-in method references. */\nvar objectProto$4 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$3 = objectProto$4.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString$1 = objectProto$4.toString;\n\n/** Built-in value references. */\nvar symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag$1(value) {\n var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),\n tag = value[symToStringTag$1];\n\n try {\n value[symToStringTag$1] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString$1.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag$1] = tag;\n } else {\n delete value[symToStringTag$1];\n }\n }\n return result;\n}\n\nvar _getRawTag = getRawTag$1;\n\n/** Used for built-in method references. */\n\nvar objectProto$3 = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto$3.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString$1(value) {\n return nativeObjectToString.call(value);\n}\n\nvar _objectToString = objectToString$1;\n\nvar Symbol = _Symbol,\n getRawTag = _getRawTag,\n objectToString = _objectToString;\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag$1(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nvar _baseGetTag = baseGetTag$1;\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n\nfunction isObject$2(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nvar isObject_1 = isObject$2;\n\nvar baseGetTag = _baseGetTag,\n isObject$1 = isObject_1;\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction$1(value) {\n if (!isObject$1(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nvar isFunction_1 = isFunction$1;\n\nvar root$2 = _root;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData$1 = root$2['__core-js_shared__'];\n\nvar _coreJsData = coreJsData$1;\n\nvar coreJsData = _coreJsData;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked$1(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nvar _isMasked = isMasked$1;\n\n/** Used for built-in method references. */\n\nvar funcProto$1 = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString$1 = funcProto$1.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource$1(func) {\n if (func != null) {\n try {\n return funcToString$1.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nvar _toSource = toSource$1;\n\nvar isFunction = isFunction_1,\n isMasked = _isMasked,\n isObject = isObject_1,\n toSource = _toSource;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto$2 = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$2 = objectProto$2.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative$1(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nvar _baseIsNative = baseIsNative$1;\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n\nfunction getValue$1(object, key) {\n return object == null ? undefined : object[key];\n}\n\nvar _getValue = getValue$1;\n\nvar baseIsNative = _baseIsNative,\n getValue = _getValue;\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative$3(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nvar _getNative = getNative$3;\n\nvar getNative$2 = _getNative;\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate$4 = getNative$2(Object, 'create');\n\nvar _nativeCreate = nativeCreate$4;\n\nvar nativeCreate$3 = _nativeCreate;\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear$1() {\n this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};\n this.size = 0;\n}\n\nvar _hashClear = hashClear$1;\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n\nfunction hashDelete$1(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nvar _hashDelete = hashDelete$1;\n\nvar nativeCreate$2 = _nativeCreate;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED$2 = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto$1 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$1 = objectProto$1.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet$1(key) {\n var data = this.__data__;\n if (nativeCreate$2) {\n var result = data[key];\n return result === HASH_UNDEFINED$2 ? undefined : result;\n }\n return hasOwnProperty$1.call(data, key) ? data[key] : undefined;\n}\n\nvar _hashGet = hashGet$1;\n\nvar nativeCreate$1 = _nativeCreate;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas$1(key) {\n var data = this.__data__;\n return nativeCreate$1 ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nvar _hashHas = hashHas$1;\n\nvar nativeCreate = _nativeCreate;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED$1 = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet$1(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;\n return this;\n}\n\nvar _hashSet = hashSet$1;\n\nvar hashClear = _hashClear,\n hashDelete = _hashDelete,\n hashGet = _hashGet,\n hashHas = _hashHas,\n hashSet = _hashSet;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash$1(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash$1.prototype.clear = hashClear;\nHash$1.prototype['delete'] = hashDelete;\nHash$1.prototype.get = hashGet;\nHash$1.prototype.has = hashHas;\nHash$1.prototype.set = hashSet;\n\nvar _Hash = Hash$1;\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n\nfunction listCacheClear$1() {\n this.__data__ = [];\n this.size = 0;\n}\n\nvar _listCacheClear = listCacheClear$1;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n\nfunction eq$1(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nvar eq_1 = eq$1;\n\nvar eq = eq_1;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf$4(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nvar _assocIndexOf = assocIndexOf$4;\n\nvar assocIndexOf$3 = _assocIndexOf;\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete$1(key) {\n var data = this.__data__,\n index = assocIndexOf$3(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nvar _listCacheDelete = listCacheDelete$1;\n\nvar assocIndexOf$2 = _assocIndexOf;\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet$1(key) {\n var data = this.__data__,\n index = assocIndexOf$2(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nvar _listCacheGet = listCacheGet$1;\n\nvar assocIndexOf$1 = _assocIndexOf;\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas$1(key) {\n return assocIndexOf$1(this.__data__, key) > -1;\n}\n\nvar _listCacheHas = listCacheHas$1;\n\nvar assocIndexOf = _assocIndexOf;\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet$1(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nvar _listCacheSet = listCacheSet$1;\n\nvar listCacheClear = _listCacheClear,\n listCacheDelete = _listCacheDelete,\n listCacheGet = _listCacheGet,\n listCacheHas = _listCacheHas,\n listCacheSet = _listCacheSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache$1(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache$1.prototype.clear = listCacheClear;\nListCache$1.prototype['delete'] = listCacheDelete;\nListCache$1.prototype.get = listCacheGet;\nListCache$1.prototype.has = listCacheHas;\nListCache$1.prototype.set = listCacheSet;\n\nvar _ListCache = ListCache$1;\n\nvar getNative$1 = _getNative,\n root$1 = _root;\n\n/* Built-in method references that are verified to be native. */\nvar Map$2 = getNative$1(root$1, 'Map');\n\nvar _Map = Map$2;\n\nvar Hash = _Hash,\n ListCache = _ListCache,\n Map$1 = _Map;\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear$1() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n}\n\nvar _mapCacheClear = mapCacheClear$1;\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n\nfunction isKeyable$1(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nvar _isKeyable = isKeyable$1;\n\nvar isKeyable = _isKeyable;\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData$4(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nvar _getMapData = getMapData$4;\n\nvar getMapData$3 = _getMapData;\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete$1(key) {\n var result = getMapData$3(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nvar _mapCacheDelete = mapCacheDelete$1;\n\nvar getMapData$2 = _getMapData;\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet$1(key) {\n return getMapData$2(this, key).get(key);\n}\n\nvar _mapCacheGet = mapCacheGet$1;\n\nvar getMapData$1 = _getMapData;\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas$1(key) {\n return getMapData$1(this, key).has(key);\n}\n\nvar _mapCacheHas = mapCacheHas$1;\n\nvar getMapData = _getMapData;\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet$1(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nvar _mapCacheSet = mapCacheSet$1;\n\nvar mapCacheClear = _mapCacheClear,\n mapCacheDelete = _mapCacheDelete,\n mapCacheGet = _mapCacheGet,\n mapCacheHas = _mapCacheHas,\n mapCacheSet = _mapCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache$1(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache$1.prototype.clear = mapCacheClear;\nMapCache$1.prototype['delete'] = mapCacheDelete;\nMapCache$1.prototype.get = mapCacheGet;\nMapCache$1.prototype.has = mapCacheHas;\nMapCache$1.prototype.set = mapCacheSet;\n\nvar _MapCache = MapCache$1;\n\n/** Used to stand-in for `undefined` hash values. */\n\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd$1(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nvar _setCacheAdd = setCacheAdd$1;\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n\nfunction setCacheHas$1(value) {\n return this.__data__.has(value);\n}\n\nvar _setCacheHas = setCacheHas$1;\n\nvar MapCache = _MapCache,\n setCacheAdd = _setCacheAdd,\n setCacheHas = _setCacheHas;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache$1(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache$1.prototype.add = SetCache$1.prototype.push = setCacheAdd;\nSetCache$1.prototype.has = setCacheHas;\n\nvar _SetCache = SetCache$1;\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\nfunction baseFindIndex$1(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nvar _baseFindIndex = baseFindIndex$1;\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n\nfunction baseIsNaN$1(value) {\n return value !== value;\n}\n\nvar _baseIsNaN = baseIsNaN$1;\n\n/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n\nfunction strictIndexOf$1(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nvar _strictIndexOf = strictIndexOf$1;\n\nvar baseFindIndex = _baseFindIndex,\n baseIsNaN = _baseIsNaN,\n strictIndexOf = _strictIndexOf;\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf$1(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nvar _baseIndexOf = baseIndexOf$1;\n\nvar baseIndexOf = _baseIndexOf;\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes$1(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nvar _arrayIncludes = arrayIncludes$1;\n\n/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n\nfunction arrayIncludesWith$1(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nvar _arrayIncludesWith = arrayIncludesWith$1;\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n\nfunction cacheHas$1(cache, key) {\n return cache.has(key);\n}\n\nvar _cacheHas = cacheHas$1;\n\nvar getNative = _getNative,\n root = _root;\n\n/* Built-in method references that are verified to be native. */\nvar Set$1 = getNative(root, 'Set');\n\nvar _Set = Set$1;\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\n\nfunction noop$1() {\n // No operation performed.\n}\n\nvar noop_1 = noop$1;\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n\nfunction setToArray$2(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nvar _setToArray = setToArray$2;\n\nvar Set = _Set,\n noop = noop_1,\n setToArray$1 = _setToArray;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet$1 = !(Set && (1 / setToArray$1(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nvar _createSet = createSet$1;\n\nvar SetCache = _SetCache,\n arrayIncludes = _arrayIncludes,\n arrayIncludesWith = _arrayIncludesWith,\n cacheHas = _cacheHas,\n createSet = _createSet,\n setToArray = _setToArray;\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq$1(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nvar _baseUniq = baseUniq$1;\n\nvar baseUniq = _baseUniq;\n\n/**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\nfunction uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n}\n\nvar uniqWith_1 = uniqWith;\n\n/**\r\n * 场景解析器\r\n * @param rawScene 原始场景\r\n * @param sceneName 场景名称\r\n * @param sceneUrl 场景url\r\n * @param assetsPrefetcher\r\n * @param assetSetter\r\n * @param ADD_NEXT_ARG_LIST\r\n * @param SCRIPT_CONFIG_MAP\r\n * @return {IScene} 解析后的场景\r\n */\r\nconst sceneParser = (rawScene, sceneName, sceneUrl, assetsPrefetcher, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP) => {\r\n const rawSentenceList = rawScene.split('\\n'); // 原始句子列表\r\n // 去分号留到后面去做了,现在注释要单独处理\r\n const rawSentenceListWithoutEmpty = rawSentenceList;\r\n // .map((sentence) => sentence.split(\";\")[0])\r\n // .filter((sentence) => sentence.trim() !== \"\");\r\n let assetsList = []; // 场景资源列表\r\n let subSceneList = []; // 子场景列表\r\n const sentenceList = rawSentenceListWithoutEmpty.map((sentence) => {\r\n const returnSentence = scriptParser(sentence, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_MAP);\r\n // 在这里解析出语句可能携带的资源和场景,合并到 assetsList 和 subSceneList\r\n assetsList = [...assetsList, ...returnSentence.sentenceAssets];\r\n subSceneList = [...subSceneList, ...returnSentence.subScene];\r\n return returnSentence;\r\n });\r\n // 开始资源的预加载\r\n assetsList = uniqWith_1(assetsList); // 去重\r\n assetsPrefetcher(assetsList);\r\n return {\r\n sceneName: sceneName,\r\n sceneUrl: sceneUrl,\r\n sentenceList: sentenceList,\r\n assetsList: assetsList,\r\n subSceneList: subSceneList, // 子场景列表\r\n };\r\n};\n\nfunction scss2cssinjsParser(scssString) {\r\n const [classNameStyles, others] = parseCSS(scssString);\r\n return {\r\n classNameStyles,\r\n others,\r\n };\r\n}\r\n/**\r\n * GPT 4 写的,临时用,以后要重构!!!\r\n * TODO:用人类智能重构,要是用着一直没问题,也不是不可以 trust AI\r\n * @param css\r\n */\r\nfunction parseCSS(css) {\r\n const result = {};\r\n let specialRules = '';\r\n let matches;\r\n // 使用非贪婪匹配,尝试正确处理任意层次的嵌套\r\n const classRegex = /\\.([^{\\s]+)\\s*{((?:[^{}]*|{[^}]*})*)}/g;\r\n const specialRegex = /(@[^{]+{\\s*(?:[^{}]*{[^}]*}[^{}]*)+\\s*})/g;\r\n while ((matches = classRegex.exec(css)) !== null) {\r\n const key = matches[1];\r\n const value = matches[2].trim().replace(/\\s*;\\s*/g, ';\\n');\r\n result[key] = value;\r\n }\r\n while ((matches = specialRegex.exec(css)) !== null) {\r\n specialRules += matches[1].trim() + '\\n';\r\n }\r\n return [result, specialRules.trim()];\r\n}\n\nclass SceneParser {\r\n assetsPrefetcher;\r\n assetSetter;\r\n ADD_NEXT_ARG_LIST;\r\n SCRIPT_CONFIG_MAP;\r\n constructor(assetsPrefetcher, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG_INPUT) {\r\n this.assetsPrefetcher = assetsPrefetcher;\r\n this.assetSetter = assetSetter;\r\n this.ADD_NEXT_ARG_LIST = ADD_NEXT_ARG_LIST;\r\n if (Array.isArray(SCRIPT_CONFIG_INPUT)) {\r\n this.SCRIPT_CONFIG_MAP = new Map();\r\n SCRIPT_CONFIG_INPUT.forEach((config) => {\r\n this.SCRIPT_CONFIG_MAP.set(config.scriptString, config);\r\n });\r\n }\r\n else {\r\n this.SCRIPT_CONFIG_MAP = SCRIPT_CONFIG_INPUT;\r\n }\r\n }\r\n /**\r\n * 解析场景\r\n * @param rawScene 原始场景\r\n * @param sceneName 场景名称\r\n * @param sceneUrl 场景url\r\n * @return 解析后的场景\r\n */\r\n parse(rawScene, sceneName, sceneUrl) {\r\n return sceneParser(rawScene, sceneName, sceneUrl, this.assetsPrefetcher, this.assetSetter, this.ADD_NEXT_ARG_LIST, this.SCRIPT_CONFIG_MAP);\r\n }\r\n parseConfig(configText) {\r\n return configParser(configText);\r\n }\r\n stringifyConfig(config) {\r\n return config.reduce((previousValue, curr) => previousValue +\r\n `${curr.command}:${curr.args.join('|')}${curr.options.length <= 0\r\n ? ''\r\n : curr.options.reduce((p, c) => p + ' -' + c.key + '=' + c.value, '')};\\n`, '');\r\n }\r\n parseScssToWebgalStyleObj(scssString) {\r\n return scss2cssinjsParser(scssString);\r\n }\r\n}\n\nexport { ADD_NEXT_ARG_LIST, SCRIPT_CONFIG, SceneParser as default };\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\n\nexport function getSentenceArgByKey(sentnece: ISentence, argk: string): null | string | boolean | number {\n const args = sentnece.args;\n const result = args.find((arg) => arg.key === argk);\n if (result) {\n return result.value;\n } else return null;\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { playBgm } from '@/Core/controller/stage/playBgm';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { webgalStore } from '@/store/store';\nimport { unlockBgmInUserData } from '@/store/userDataReducer';\n\n/**\n * 播放一段bgm\n * @param sentence\n */\nexport const bgm = (sentence: ISentence): IPerform => {\n let url: string = sentence.content; // 获取bgm的url\n let name = '';\n let series = 'default';\n sentence.args.forEach((e) => {\n if (e.key === 'unlockname') {\n name = e.value.toString();\n }\n if (e.key === 'series') {\n series = e.value.toString();\n }\n });\n const enter = getSentenceArgByKey(sentence, 'enter'); // 获取bgm的淡入时间\n const volume = getSentenceArgByKey(sentence, 'volume'); // 获取bgm的音量比\n if (name !== '') webgalStore.dispatch(unlockBgmInUserData({ name, url, series }));\n playBgm(\n url,\n typeof enter === 'number' && enter >= 0 ? enter : 0, // 已正确设置淡入时间时,进行淡入\n typeof volume === 'number' && volume >= 0 && volume <= 100 ? volume : 100, // 已正确设置音量比时,进行音量调整\n );\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: true,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n// eslint-disable-next-line func-names\nvar kindOf = (function(cache) {\n // eslint-disable-next-line func-names\n return function(thing) {\n var str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n };\n})(Object.create(null));\n\nfunction kindOfTest(type) {\n type = type.toLowerCase();\n return function isKindOf(thing) {\n return kindOf(thing) === type;\n };\n}\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nvar isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a empty Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a empty Object, otherwise false\n */\nfunction isEmptyObject(val) {\n return val && Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nvar isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nvar isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nvar isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} thing The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(thing) {\n var pattern = '[object FormData]';\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) ||\n toString.call(thing) === pattern ||\n (isFunction(thing.toString) && thing.toString() === pattern)\n );\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n * @function\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nvar isURLSearchParams = kindOfTest('URLSearchParams');\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n var product;\n if (typeof navigator !== 'undefined' && (\n (product = navigator.product) === 'ReactNative' ||\n product === 'NativeScript' ||\n product === 'NS')\n ) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n */\n\nfunction inherits(constructor, superConstructor, props, descriptors) {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n * @returns {Object}\n */\n\nfunction toFlatObject(sourceObj, destObj, filter, propFilter) {\n var props;\n var i;\n var prop;\n var merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && Object.getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/*\n * determines whether a string ends with the characters of a specified string\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n * @returns {boolean}\n */\nfunction endsWith(str, searchString, position) {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n var lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n * @param {*} [thing]\n * @returns {?Array}\n */\nfunction toArray(thing) {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n var i = thing.length;\n if (!isNumber(i)) return null;\n var arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n// eslint-disable-next-line func-names\nvar isTypedArray = (function(TypedArray) {\n // eslint-disable-next-line func-names\n return function(thing) {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array));\n\nfunction forEachEntry(obj, fn) {\n var generator = obj && obj[Symbol.iterator];\n\n var iterator = generator.call(obj);\n\n var result;\n\n while ((result = iterator.next()) && !result.done) {\n var pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\nfunction matchAll(regExp, str) {\n var matches;\n var arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\nvar isHTMLForm = kindOfTest('HTMLFormElement');\n\nvar hasOwnProperty = (function resolver(_hasOwnProperty) {\n return function(obj, prop) {\n return _hasOwnProperty.call(obj, prop);\n };\n})(Object.prototype.hasOwnProperty);\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isEmptyObject: isEmptyObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM,\n inherits: inherits,\n toFlatObject: toFlatObject,\n kindOf: kindOf,\n kindOfTest: kindOfTest,\n endsWith: endsWith,\n toArray: toArray,\n isTypedArray: isTypedArray,\n isFileList: isFileList,\n forEachEntry: forEachEntry,\n matchAll: matchAll,\n isHTMLForm: isHTMLForm,\n hasOwnProperty: hasOwnProperty\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n response && (this.response = response);\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n }\n});\n\nvar prototype = AxiosError.prototype;\nvar descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(function(code) {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = function(error, code, config, request, response, customProps) {\n var axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nmodule.exports = AxiosError;\n","/* eslint-env browser */\nmodule.exports = typeof self == 'object' ? self.FormData : window.FormData;\n","// eslint-disable-next-line strict\nmodule.exports = require('form-data');\n","'use strict';\n\nvar utils = require('../utils');\nvar AxiosError = require('../core/AxiosError');\nvar envFormData = require('../env/classes/FormData');\n\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nvar predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\nfunction isSpecCompliant(thing) {\n return thing && utils.isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator];\n}\n\n/**\n * Convert a data object to FormData\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n * @returns {Object}\n **/\n\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (envFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n var metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n var visitor = options.visitor || defaultVisitor;\n var dots = options.dots;\n var indexes = options.indexes;\n var _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n var useBlob = _Blob && isSpecCompliant(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array<String|Number>} path\n * @this {FormData}\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n var arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n (utils.isFileList(value) || utils.endsWith(key, '[]') && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !utils.isUndefined(el) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n var stack = [];\n\n var exposedHelpers = Object.assign(predicates, {\n defaultVisitor: defaultVisitor,\n convertValue: convertValue,\n isVisitable: isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n var result = !utils.isUndefined(el) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nmodule.exports = toFormData;\n","'use strict';\n\nvar toFormData = require('./toFormData');\n\nfunction encode(str) {\n var charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'\\(\\)~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nvar prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n var _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nmodule.exports = AxiosURLSearchParams;\n","'use strict';\n\nvar utils = require('../utils');\nvar AxiosURLSearchParams = require('../helpers/AxiosURLSearchParams');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?object} options\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n var _encode = options && options.encode || encode;\n\n var serializerParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n\n if (serializerParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializerParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Clear all interceptors from the stack\n */\nInterceptorManager.prototype.clear = function clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nvar AxiosURLSearchParams = require('../../../helpers/AxiosURLSearchParams');\n\nmodule.exports = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nmodule.exports = FormData;\n","'use strict';\n\nmodule.exports = {\n isBrowser: true,\n classes: {\n URLSearchParams: require('./classes/URLSearchParams'),\n FormData: require('./classes/FormData'),\n Blob: Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","'use strict';\n\nmodule.exports = require('./node/');\n","'use strict';\n\nvar utils = require('../utils');\nvar toFormData = require('./toFormData');\nvar platform = require('../platform/');\n\nmodule.exports = function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(function(match) {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\nfunction arrayToObject(arr) {\n var obj = {};\n var keys = Object.keys(arr);\n var i;\n var len = keys.length;\n var key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n var name = path[index++];\n var isNumericKey = Number.isFinite(+name);\n var isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProperty(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n var result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n var obj = {};\n\n utils.forEachEntry(formData, function(name, value) {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nmodule.exports = formDataToJSON;\n","'use strict';\n\nvar AxiosError = require('./AxiosError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.slice(0, i)).toLowerCase();\n val = utils.trim(line.slice(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar AxiosError = require('../core/AxiosError');\nvar utils = require('../utils');\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nmodule.exports = CanceledError;\n","'use strict';\n\nmodule.exports = function parseProtocol(url) {\n var match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar transitionalDefaults = require('../defaults/transitional');\nvar AxiosError = require('../core/AxiosError');\nvar CanceledError = require('../cancel/CanceledError');\nvar parseProtocol = require('../helpers/parseProtocol');\nvar platform = require('../platform');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var withXSRFToken = config.withXSRFToken;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData) && utils.isStandardBrowserEnv()) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {\n // Add xsrf header\n var xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, req) : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n // false, 0 (zero number), and '' (empty string) are valid JSON values\n if (!requestData && requestData !== false && requestData !== 0 && requestData !== '') {\n requestData = null;\n }\n\n var protocol = parseProtocol(fullPath);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar AxiosError = require('../core/AxiosError');\nvar transitionalDefaults = require('./transitional');\nvar toFormData = require('../helpers/toFormData');\nvar toURLEncodedForm = require('../helpers/toURLEncodedForm');\nvar platform = require('../platform');\nvar formDataToJSON = require('../helpers/formDataToJSON');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n var contentType = headers && headers['Content-Type'] || '';\n var hasJSONContentType = contentType.indexOf('application/json') > -1;\n var isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n var isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n var isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') !== -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n var _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var JSONRequested = this.responseType === 'json';\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Number} status HTTP status code\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, status, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers, status);\n });\n\n return data;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar CanceledError = require('../cancel/CanceledError');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n null,\n config.transformRequest\n );\n\n normalizeHeaderName(config.headers, 'Accept');\n normalizeHeaderName(config.headers, 'Content-Type');\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n response.status,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n reason.response.status,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isEmptyObject(source)) {\n return utils.merge({}, target);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'withXSRFToken': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'beforeRedirect': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.28.0\"\n};","'use strict';\n\nvar VERSION = require('../env/data').version;\nvar AxiosError = require('../core/AxiosError');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar buildFullPath = require('./buildFullPath');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n var paramsSerializer = config.paramsSerializer;\n\n utils.isFunction(paramsSerializer) && (config.paramsSerializer = {serialize: paramsSerializer});\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n var fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url: url,\n data: data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar CanceledError = require('./CanceledError');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\nvar formDataToJSON = require('./helpers/formDataToJSON');\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = require('./cancel/CanceledError');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\naxios.toFormData = require('./helpers/toFormData');\n\n// Expose AxiosError class\naxios.AxiosError = require('../lib/core/AxiosError');\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\naxios.formToJSON = function(thing) {\n return formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n};\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","module.exports = require('./lib/axios');","import axios from 'axios';\n\n/**\n * 原始场景文件获取函数\n * @param sceneUrl 场景文件路径\n */\nexport const sceneFetcher = (sceneUrl: string) => {\n return new Promise<string>((resolve, reject) => {\n axios\n .get(sceneUrl)\n .then((response) => {\n const rawScene: string = response.data.toString();\n resolve(rawScene);\n })\n .catch((e) => {\n reject(e);\n });\n });\n};\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseUniq = require('./_baseUniq');\n\n/**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\nfunction uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n}\n\nmodule.exports = uniqWith;\n","/**\n * 场景预加载\n * @param sceneList 需要预加载的场景文件列表\n */\nimport { sceneFetcher } from '../../controller/scene/sceneFetcher';\nimport { sceneParser } from '../../parser/sceneParser';\nimport { logger } from '@/Core/util/logger';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport const scenePrefetcher = (sceneList: Array<string>): void => {\n for (const e of sceneList) {\n if (!WebGAL.sceneManager.settledScenes.includes(e)) {\n logger.info(`现在预加载场景${e}`);\n sceneFetcher(e).then((r) => {\n sceneParser(r, e, e);\n });\n } else {\n logger.warn(`场景${e}已经加载过,无需再次加载`);\n }\n }\n};\n","import { sceneFetcher } from './sceneFetcher';\nimport { sceneParser } from '../../parser/sceneParser';\nimport { logger } from '../../util/logger';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport uniqWith from 'lodash/uniqWith';\nimport { scenePrefetcher } from '@/Core/util/prefetcher/scenePrefetcher';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 调用场景\n * @param sceneUrl 场景路径\n * @param sceneName 场景名称\n */\nexport const callScene = (sceneUrl: string, sceneName: string) => {\n if (WebGAL.sceneManager.lockSceneWrite) {\n return;\n }\n WebGAL.sceneManager.lockSceneWrite = true;\n // 先将本场景压入场景栈\n WebGAL.sceneManager.sceneData.sceneStack.push({\n sceneName: WebGAL.sceneManager.sceneData.currentScene.sceneName,\n sceneUrl: WebGAL.sceneManager.sceneData.currentScene.sceneUrl,\n continueLine: WebGAL.sceneManager.sceneData.currentSentenceId,\n });\n // 场景写入到运行时\n sceneFetcher(sceneUrl)\n .then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, sceneName, sceneUrl);\n WebGAL.sceneManager.sceneData.currentSentenceId = 0;\n // 开始场景的预加载\n const subSceneList = WebGAL.sceneManager.sceneData.currentScene.subSceneList;\n WebGAL.sceneManager.settledScenes.push(sceneUrl); // 放入已加载场景列表,避免递归加载相同场景\n const subSceneListUniq = uniqWith(subSceneList); // 去重\n scenePrefetcher(subSceneListUniq);\n logger.debug('现在调用场景,调用结果:', WebGAL.sceneManager.sceneData);\n WebGAL.sceneManager.lockSceneWrite = false;\n nextSentence();\n })\n .catch((e) => {\n logger.error('场景调用错误', e);\n WebGAL.sceneManager.lockSceneWrite = false;\n });\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { callScene } from '../controller/scene/callScene';\n\n/**\n * 调用一个场景,在场景结束后回到调用这个场景的父场景。\n * @param sentence\n */\nexport const callSceneScript = (sentence: ISentence): IPerform => {\n const sceneNameArray: Array<string> = sentence.content.split('/');\n const sceneName = sceneNameArray[sceneNameArray.length - 1];\n callScene(sentence.content, sceneName);\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: true,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ITransform } from '@/store/stageInterface';\nimport { webgalStore } from '@/store/store';\n\ntype AnimationFrame = ITransform & { duration: number };\ntype AnimationObj = Array<AnimationFrame>;\n\nexport function generateTransformAnimationObj(\n target: string,\n applyFrame: AnimationFrame,\n duration: number | string | boolean | null,\n): AnimationObj {\n let animationObj;\n // 获取那个 target 的当前变换\n const transformState = webgalStore.getState().stage.effects;\n const targetEffect = transformState.find((effect) => effect.target === target);\n applyFrame.duration = 500;\n if (duration && typeof duration === 'number') {\n applyFrame.duration = duration;\n }\n animationObj = [applyFrame];\n // 找到 effect\n if (targetEffect) {\n const effectWithDuration = { ...targetEffect!.transform!, duration: 0 };\n animationObj.unshift(effectWithDuration);\n } else {\n // 应用默认effect,也就是最终的 effect 的 alpha = 0 版本\n const effectWithDuration = { ...applyFrame, alpha: 0, duration: 0 };\n animationObj.unshift(effectWithDuration);\n }\n return animationObj;\n}\n","import { WebGAL } from '@/Core/WebGAL';\n\nexport function generateUniversalSoftInAnimationObj(targetKey: string, duration: number) {\n const target = WebGAL.gameplay.pixiStage!.getStageObjByKey(targetKey);\n\n // 先设置一个通用的初态\n\n // TODO:通用初态设置\n /**\n * 在此书写为动画设置初态的操作\n */\n function setStartState() {\n if (target) {\n target.pixiContainer.alphaFilterVal = 0;\n }\n }\n\n // TODO:通用终态设置\n /**\n * 在此书写为动画设置终态的操作\n */\n function setEndState() {\n if (target) {\n target.pixiContainer.alphaFilterVal = 1;\n }\n }\n\n /**\n * 在此书写动画每一帧执行的函数\n * @param delta\n */\n function tickerFunc(delta: number) {\n if (target) {\n const sprite = target.pixiContainer;\n const baseDuration = WebGAL.gameplay.pixiStage!.frameDuration;\n const currentAddOplityDelta = (duration / baseDuration) * delta;\n const increasement = 1 / currentAddOplityDelta;\n // const decreasement = 5 / currentAddOplityDelta;\n if (sprite.alphaFilterVal < 1) {\n sprite.alpha += increasement;\n }\n }\n }\n\n return {\n setStartState,\n setEndState,\n tickerFunc,\n };\n}\n","import { WebGAL } from '@/Core/WebGAL';\n\nexport function generateUniversalSoftOffAnimationObj(targetKey: string, duration: number) {\n const target = WebGAL.gameplay.pixiStage!.getStageObjByKey(targetKey);\n\n // 先设置一个通用的初态\n\n /**\n * 在此书写为动画设置初态的操作\n */\n function setStartState() {}\n\n /**\n * 在此书写为动画设置终态的操作\n */\n function setEndState() {\n if (target) target.pixiContainer.alphaFilterVal = 0;\n }\n\n /**\n * 在此书写动画每一帧执行的函数\n * @param delta\n */\n function tickerFunc(delta: number) {\n if (target) {\n const targetContainer = target.pixiContainer;\n const baseDuration = WebGAL.gameplay.pixiStage!.frameDuration;\n const currentAddOplityDelta = (duration / baseDuration) * delta;\n const decreasement = 1 / currentAddOplityDelta;\n if (targetContainer.alphaFilterVal > 0) {\n targetContainer.alphaFilterVal -= decreasement;\n }\n }\n }\n\n return {\n setStartState,\n setEndState,\n tickerFunc,\n };\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\n\n/**\n * 游戏内变量\n * @interface IGameVar\n */\nexport interface IGameVar {\n [propName: string]: string | boolean | number | Array<string | boolean | number>;\n}\n\nexport interface ISetGameVar {\n key: string;\n value: string | boolean | number;\n}\n\n/**\n * 单个选项\n * @interface IChooseItem\n */\nexport interface IChooseItem {\n key: string; // 选项名称\n targetScene: string; // 选项target\n isSubScene: boolean; // 是否是子场景调用\n}\n\nexport interface ITransform {\n alpha: number;\n scale: {\n x: number;\n y: number;\n };\n // pivot: {\n // x: number;\n // y: number;\n // };\n position: {\n x: number;\n y: number;\n };\n rotation: number;\n blur: number;\n}\n\n/**\n * 基本效果接口\n * @interface IEffect\n */\nexport interface IEffect {\n target: string; // 作用目标\n transform?: ITransform; // 变换\n}\n\n/**\n * 基本变换预设\n */\nexport const baseTransform: ITransform = {\n alpha: 1,\n scale: {\n x: 1,\n y: 1,\n },\n // pivot: {\n // x: 0.5,\n // y: 0.5,\n // },\n position: {\n x: 0,\n y: 0,\n },\n rotation: 0,\n blur: 0,\n};\n\nexport interface IFreeFigure {\n basePosition: 'left' | 'center' | 'right';\n name: string;\n key: string;\n}\n\nexport interface IFigureAssociatedAnimation {\n mouthAnimation: IMouthAnimationFile;\n blinkAnimation: IEyesAnimationFile;\n targetId: string;\n animationFlag: string;\n}\n\nexport interface IMouthAnimationFile {\n open: string;\n close: string;\n halfOpen: string;\n}\n\nexport interface IEyesAnimationFile {\n open: string;\n close: string;\n}\n\n/**\n * 启动演出接口\n * @interface IRunPerform\n */\nexport interface IRunPerform {\n id: string;\n isHoldOn: boolean; // 演出类型\n script: ISentence; // 演出脚本\n}\n\nexport interface ILive2DMotion {\n target: string;\n motion: string;\n}\n\nexport interface ILive2DExpression {\n target: string;\n expression: string;\n}\n\n/**\n * @interface IStageState 游戏舞台数据接口\n */\nexport interface IStageState {\n oldBgName: string; // 旧背景的文件路径\n bgName: string; // 背景文件地址(相对或绝对)\n figName: string; // 立绘_中 文件地址(相对或绝对)\n figNameLeft: string; // 立绘_左 文件地址(相对或绝对)\n figNameRight: string; // 立绘_右 文件地址(相对或绝对)\n // 自由立绘\n freeFigure: Array<IFreeFigure>;\n figureAssociatedAnimation: Array<IFigureAssociatedAnimation>;\n showText: string; // 文字\n showTextSize: number; // 文字\n showName: string; // 人物名\n command: string; // 语句指令\n choose: Array<IChooseItem>; // 选项列表\n vocal: string; // 语音 文件地址(相对或绝对)\n playVocal: string; // 真实播放语音\n vocalVolume: number; // 语音 音量调整(0 - 100)\n bgm: {\n // 背景音乐\n src: string; // 背景音乐 文件地址(相对或绝对)\n enter: number; // 背景音乐 淡入或淡出的毫秒数\n volume: number; // 背景音乐 音量调整(0 - 100)\n };\n uiSe: string; // 用户界面音效 文件地址(相对或绝对)\n miniAvatar: string; // 小头像 文件地址(相对或绝对)\n GameVar: IGameVar; // 游戏内变量\n effects: Array<IEffect>; // 应用的变换\n bgTransform: string;\n bgFilter: string;\n PerformList: Array<IRunPerform>; // 要启动的演出列表\n currentDialogKey: string; // 当前对话的key\n live2dMotion: ILive2DMotion[];\n live2dExpression: ILive2DExpression[];\n // 当前演出的延迟,用于做对话插演出!\n // currentPerformDelay:number\n currentConcatDialogPrev: string;\n // 测试:电影叙事\n enableFilm: string;\n isDisableTextbox: boolean;\n replacedUIlable: Record<string, string>;\n}\n\n/**\n * @interface ISetStagePayload 设置舞台状态的Action的Payload的数据接口\n */\nexport interface ISetStagePayload {\n key: keyof IStageState;\n value: any;\n}\n\nexport interface IStageStore {\n stageState: IStageState;\n setStage: <K extends keyof IStageState>(key: K, value: any) => void;\n getStageState: () => IStageState;\n restoreStage: (newState: IStageState) => void;\n}\n\nexport type StageStore = IStageStore;\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","var warning = function () { };\r\nvar invariant = function () { };\r\nif (process.env.NODE_ENV !== 'production') {\r\n warning = function (check, message) {\r\n if (!check && typeof console !== 'undefined') {\r\n console.warn(message);\r\n }\r\n };\r\n invariant = function (check, message) {\r\n if (!check) {\r\n throw new Error(message);\r\n }\r\n };\r\n}\n\nexport { invariant, warning };\n","const clamp = (min, max, v) => Math.min(Math.max(v, min), max);\n\nexport { clamp };\n","import { warning } from 'hey-listen';\nimport { clamp } from '../../utils/clamp.mjs';\n\nconst safeMin = 0.001;\nconst minDuration = 0.01;\nconst maxDuration = 10.0;\nconst minDamping = 0.05;\nconst maxDamping = 1;\nfunction findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1, }) {\n let envelope;\n let derivative;\n warning(duration <= maxDuration * 1000, \"Spring duration must be 10 seconds or less\");\n let dampingRatio = 1 - bounce;\n dampingRatio = clamp(minDamping, maxDamping, dampingRatio);\n duration = clamp(minDuration, maxDuration, duration / 1000);\n if (dampingRatio < 1) {\n envelope = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const a = exponentialDecay - velocity;\n const b = calcAngularFreq(undampedFreq, dampingRatio);\n const c = Math.exp(-delta);\n return safeMin - (a / b) * c;\n };\n derivative = (undampedFreq) => {\n const exponentialDecay = undampedFreq * dampingRatio;\n const delta = exponentialDecay * duration;\n const d = delta * velocity + velocity;\n const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;\n const f = Math.exp(-delta);\n const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);\n const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;\n return (factor * ((d - e) * f)) / g;\n };\n }\n else {\n envelope = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (undampedFreq - velocity) * duration + 1;\n return -safeMin + a * b;\n };\n derivative = (undampedFreq) => {\n const a = Math.exp(-undampedFreq * duration);\n const b = (velocity - undampedFreq) * (duration * duration);\n return a * b;\n };\n }\n const initialGuess = 5 / duration;\n const undampedFreq = approximateRoot(envelope, derivative, initialGuess);\n duration = duration * 1000;\n if (isNaN(undampedFreq)) {\n return {\n stiffness: 100,\n damping: 10,\n duration,\n };\n }\n else {\n const stiffness = Math.pow(undampedFreq, 2) * mass;\n return {\n stiffness,\n damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),\n duration,\n };\n }\n}\nconst rootIterations = 12;\nfunction approximateRoot(envelope, derivative, initialGuess) {\n let result = initialGuess;\n for (let i = 1; i < rootIterations; i++) {\n result = result - envelope(result) / derivative(result);\n }\n return result;\n}\nfunction calcAngularFreq(undampedFreq, dampingRatio) {\n return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);\n}\n\nexport { calcAngularFreq, findSpring, maxDamping, maxDuration, minDamping, minDuration };\n","import { __rest } from 'tslib';\nimport { findSpring, calcAngularFreq } from '../utils/find-spring.mjs';\n\nconst durationKeys = [\"duration\", \"bounce\"];\nconst physicsKeys = [\"stiffness\", \"damping\", \"mass\"];\nfunction isSpringType(options, keys) {\n return keys.some((key) => options[key] !== undefined);\n}\nfunction getSpringOptions(options) {\n let springOptions = Object.assign({ velocity: 0.0, stiffness: 100, damping: 10, mass: 1.0, isResolvedFromDuration: false }, options);\n if (!isSpringType(options, physicsKeys) &&\n isSpringType(options, durationKeys)) {\n const derived = findSpring(options);\n springOptions = Object.assign(Object.assign(Object.assign({}, springOptions), derived), { velocity: 0.0, mass: 1.0 });\n springOptions.isResolvedFromDuration = true;\n }\n return springOptions;\n}\nfunction spring(_a) {\n var { from = 0.0, to = 1.0, restSpeed = 2, restDelta } = _a, options = __rest(_a, [\"from\", \"to\", \"restSpeed\", \"restDelta\"]);\n const state = { done: false, value: from };\n let { stiffness, damping, mass, velocity, duration, isResolvedFromDuration, } = getSpringOptions(options);\n let resolveSpring = zero;\n let resolveVelocity = zero;\n function createSpring() {\n const initialVelocity = velocity ? -(velocity / 1000) : 0.0;\n const initialDelta = to - from;\n const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));\n const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000;\n if (restDelta === undefined) {\n restDelta = Math.min(Math.abs(to - from) / 100, 0.4);\n }\n if (dampingRatio < 1) {\n const angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (to -\n envelope *\n (((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) /\n angularFreq) *\n Math.sin(angularFreq * t) +\n initialDelta * Math.cos(angularFreq * t)));\n };\n resolveVelocity = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n return (dampingRatio *\n undampedAngularFreq *\n envelope *\n ((Math.sin(angularFreq * t) *\n (initialVelocity +\n dampingRatio *\n undampedAngularFreq *\n initialDelta)) /\n angularFreq +\n initialDelta * Math.cos(angularFreq * t)) -\n envelope *\n (Math.cos(angularFreq * t) *\n (initialVelocity +\n dampingRatio *\n undampedAngularFreq *\n initialDelta) -\n angularFreq *\n initialDelta *\n Math.sin(angularFreq * t)));\n };\n }\n else if (dampingRatio === 1) {\n resolveSpring = (t) => to -\n Math.exp(-undampedAngularFreq * t) *\n (initialDelta +\n (initialVelocity + undampedAngularFreq * initialDelta) *\n t);\n }\n else {\n const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);\n resolveSpring = (t) => {\n const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);\n const freqForT = Math.min(dampedAngularFreq * t, 300);\n return (to -\n (envelope *\n ((initialVelocity +\n dampingRatio * undampedAngularFreq * initialDelta) *\n Math.sinh(freqForT) +\n dampedAngularFreq *\n initialDelta *\n Math.cosh(freqForT))) /\n dampedAngularFreq);\n };\n }\n }\n createSpring();\n return {\n next: (t) => {\n const current = resolveSpring(t);\n if (!isResolvedFromDuration) {\n const currentVelocity = resolveVelocity(t) * 1000;\n const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed;\n const isBelowDisplacementThreshold = Math.abs(to - current) <= restDelta;\n state.done =\n isBelowVelocityThreshold && isBelowDisplacementThreshold;\n }\n else {\n state.done = t >= duration;\n }\n state.value = state.done ? to : current;\n return state;\n },\n flipTarget: () => {\n velocity = -velocity;\n [from, to] = [to, from];\n createSpring();\n },\n };\n}\nspring.needsInterpolation = (a, b) => typeof a === \"string\" || typeof b === \"string\";\nconst zero = (_t) => 0;\n\nexport { spring };\n","const progress = (from, to, value) => {\n const toFromDifference = to - from;\n return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;\n};\n\nexport { progress };\n","const mix = (from, to, progress) => -progress * from + progress * to + from;\n\nexport { mix };\n","const clamp = (min, max) => (v) => Math.max(Math.min(v, max), min);\nconst sanitize = (v) => (v % 1 ? Number(v.toFixed(5)) : v);\nconst floatRegex = /(-)?([\\d]*\\.?[\\d])+/g;\nconst colorRegex = /(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2}(-?[\\d\\.]+%?)\\s*[\\,\\/]?\\s*[\\d\\.]*%?\\))/gi;\nconst singleColorRegex = /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\\((-?[\\d\\.]+%?[,\\s]+){2}(-?[\\d\\.]+%?)\\s*[\\,\\/]?\\s*[\\d\\.]*%?\\))$/i;\nfunction isString(v) {\n return typeof v === 'string';\n}\n\nexport { clamp, colorRegex, floatRegex, isString, sanitize, singleColorRegex };\n","import { clamp } from '../utils.mjs';\n\nconst number = {\n test: (v) => typeof v === 'number',\n parse: parseFloat,\n transform: (v) => v,\n};\nconst alpha = Object.assign(Object.assign({}, number), { transform: clamp(0, 1) });\nconst scale = Object.assign(Object.assign({}, number), { default: 1 });\n\nexport { alpha, number, scale };\n","import { isString } from '../utils.mjs';\n\nconst createUnitType = (unit) => ({\n test: (v) => isString(v) && v.endsWith(unit) && v.split(' ').length === 1,\n parse: parseFloat,\n transform: (v) => `${v}${unit}`,\n});\nconst degrees = createUnitType('deg');\nconst percent = createUnitType('%');\nconst px = createUnitType('px');\nconst vh = createUnitType('vh');\nconst vw = createUnitType('vw');\nconst progressPercentage = Object.assign(Object.assign({}, percent), { parse: (v) => percent.parse(v) / 100, transform: (v) => percent.transform(v * 100) });\n\nexport { degrees, percent, progressPercentage, px, vh, vw };\n","import { isString, singleColorRegex, floatRegex } from '../utils.mjs';\n\nconst isColorString = (type, testProp) => (v) => {\n return Boolean((isString(v) && singleColorRegex.test(v) && v.startsWith(type)) ||\n (testProp && Object.prototype.hasOwnProperty.call(v, testProp)));\n};\nconst splitColor = (aName, bName, cName) => (v) => {\n if (!isString(v))\n return v;\n const [a, b, c, alpha] = v.match(floatRegex);\n return {\n [aName]: parseFloat(a),\n [bName]: parseFloat(b),\n [cName]: parseFloat(c),\n alpha: alpha !== undefined ? parseFloat(alpha) : 1,\n };\n};\n\nexport { isColorString, splitColor };\n","import { alpha } from '../numbers/index.mjs';\nimport { percent } from '../numbers/units.mjs';\nimport { sanitize } from '../utils.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst hsla = {\n test: isColorString('hsl', 'hue'),\n parse: splitColor('hue', 'saturation', 'lightness'),\n transform: ({ hue, saturation, lightness, alpha: alpha$1 = 1 }) => {\n return ('hsla(' +\n Math.round(hue) +\n ', ' +\n percent.transform(sanitize(saturation)) +\n ', ' +\n percent.transform(sanitize(lightness)) +\n ', ' +\n sanitize(alpha.transform(alpha$1)) +\n ')');\n },\n};\n\nexport { hsla };\n","import { number, alpha } from '../numbers/index.mjs';\nimport { sanitize, clamp } from '../utils.mjs';\nimport { isColorString, splitColor } from './utils.mjs';\n\nconst clampRgbUnit = clamp(0, 255);\nconst rgbUnit = Object.assign(Object.assign({}, number), { transform: (v) => Math.round(clampRgbUnit(v)) });\nconst rgba = {\n test: isColorString('rgb', 'red'),\n parse: splitColor('red', 'green', 'blue'),\n transform: ({ red, green, blue, alpha: alpha$1 = 1 }) => 'rgba(' +\n rgbUnit.transform(red) +\n ', ' +\n rgbUnit.transform(green) +\n ', ' +\n rgbUnit.transform(blue) +\n ', ' +\n sanitize(alpha.transform(alpha$1)) +\n ')',\n};\n\nexport { rgbUnit, rgba };\n","import { rgba } from './rgba.mjs';\nimport { isColorString } from './utils.mjs';\n\nfunction parseHex(v) {\n let r = '';\n let g = '';\n let b = '';\n let a = '';\n if (v.length > 5) {\n r = v.substr(1, 2);\n g = v.substr(3, 2);\n b = v.substr(5, 2);\n a = v.substr(7, 2);\n }\n else {\n r = v.substr(1, 1);\n g = v.substr(2, 1);\n b = v.substr(3, 1);\n a = v.substr(4, 1);\n r += r;\n g += g;\n b += b;\n a += a;\n }\n return {\n red: parseInt(r, 16),\n green: parseInt(g, 16),\n blue: parseInt(b, 16),\n alpha: a ? parseInt(a, 16) / 255 : 1,\n };\n}\nconst hex = {\n test: isColorString('#'),\n parse: parseHex,\n transform: rgba.transform,\n};\n\nexport { hex };\n","import { isString } from '../utils.mjs';\nimport { hex } from './hex.mjs';\nimport { hsla } from './hsla.mjs';\nimport { rgba } from './rgba.mjs';\n\nconst color = {\n test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),\n parse: (v) => {\n if (rgba.test(v)) {\n return rgba.parse(v);\n }\n else if (hsla.test(v)) {\n return hsla.parse(v);\n }\n else {\n return hex.parse(v);\n }\n },\n transform: (v) => {\n return isString(v)\n ? v\n : v.hasOwnProperty('red')\n ? rgba.transform(v)\n : hsla.transform(v);\n },\n};\n\nexport { color };\n","import { color } from '../color/index.mjs';\nimport { number } from '../numbers/index.mjs';\nimport { isString, floatRegex, colorRegex, sanitize } from '../utils.mjs';\n\nconst colorToken = '${c}';\nconst numberToken = '${n}';\nfunction test(v) {\n var _a, _b, _c, _d;\n return (isNaN(v) &&\n isString(v) &&\n ((_b = (_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) + ((_d = (_c = v.match(colorRegex)) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0);\n}\nfunction analyse(v) {\n if (typeof v === 'number')\n v = `${v}`;\n const values = [];\n let numColors = 0;\n const colors = v.match(colorRegex);\n if (colors) {\n numColors = colors.length;\n v = v.replace(colorRegex, colorToken);\n values.push(...colors.map(color.parse));\n }\n const numbers = v.match(floatRegex);\n if (numbers) {\n v = v.replace(floatRegex, numberToken);\n values.push(...numbers.map(number.parse));\n }\n return { values, numColors, tokenised: v };\n}\nfunction parse(v) {\n return analyse(v).values;\n}\nfunction createTransformer(v) {\n const { values, numColors, tokenised } = analyse(v);\n const numValues = values.length;\n return (v) => {\n let output = tokenised;\n for (let i = 0; i < numValues; i++) {\n output = output.replace(i < numColors ? colorToken : numberToken, i < numColors ? color.transform(v[i]) : sanitize(v[i]));\n }\n return output;\n };\n}\nconst convertNumbersToZero = (v) => typeof v === 'number' ? 0 : v;\nfunction getAnimatableNone(v) {\n const parsed = parse(v);\n const transformer = createTransformer(v);\n return transformer(parsed.map(convertNumbersToZero));\n}\nconst complex = { test, parse, createTransformer, getAnimatableNone };\n\nexport { complex };\n","function hueToRgb(p, q, t) {\n if (t < 0)\n t += 1;\n if (t > 1)\n t -= 1;\n if (t < 1 / 6)\n return p + (q - p) * 6 * t;\n if (t < 1 / 2)\n return q;\n if (t < 2 / 3)\n return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\nfunction hslaToRgba({ hue, saturation, lightness, alpha }) {\n hue /= 360;\n saturation /= 100;\n lightness /= 100;\n let red = 0;\n let green = 0;\n let blue = 0;\n if (!saturation) {\n red = green = blue = lightness;\n }\n else {\n const q = lightness < 0.5\n ? lightness * (1 + saturation)\n : lightness + saturation - lightness * saturation;\n const p = 2 * lightness - q;\n red = hueToRgb(p, q, hue + 1 / 3);\n green = hueToRgb(p, q, hue);\n blue = hueToRgb(p, q, hue - 1 / 3);\n }\n return {\n red: Math.round(red * 255),\n green: Math.round(green * 255),\n blue: Math.round(blue * 255),\n alpha,\n };\n}\n\nexport { hslaToRgba };\n","import { mix } from './mix.mjs';\nimport { hsla, rgba, hex } from 'style-value-types';\nimport { invariant } from 'hey-listen';\nimport { hslaToRgba } from './hsla-to-rgba.mjs';\n\nconst mixLinearColor = (from, to, v) => {\n const fromExpo = from * from;\n const toExpo = to * to;\n return Math.sqrt(Math.max(0, v * (toExpo - fromExpo) + fromExpo));\n};\nconst colorTypes = [hex, rgba, hsla];\nconst getColorType = (v) => colorTypes.find((type) => type.test(v));\nconst notAnimatable = (color) => `'${color}' is not an animatable color. Use the equivalent color code instead.`;\nconst mixColor = (from, to) => {\n let fromColorType = getColorType(from);\n let toColorType = getColorType(to);\n invariant(!!fromColorType, notAnimatable(from));\n invariant(!!toColorType, notAnimatable(to));\n let fromColor = fromColorType.parse(from);\n let toColor = toColorType.parse(to);\n if (fromColorType === hsla) {\n fromColor = hslaToRgba(fromColor);\n fromColorType = rgba;\n }\n if (toColorType === hsla) {\n toColor = hslaToRgba(toColor);\n toColorType = rgba;\n }\n const blended = Object.assign({}, fromColor);\n return (v) => {\n for (const key in blended) {\n if (key !== \"alpha\") {\n blended[key] = mixLinearColor(fromColor[key], toColor[key], v);\n }\n }\n blended.alpha = mix(fromColor.alpha, toColor.alpha, v);\n return fromColorType.transform(blended);\n };\n};\n\nexport { mixColor, mixLinearColor };\n","const zeroPoint = {\n x: 0,\n y: 0,\n z: 0\n};\nconst isNum = (v) => typeof v === 'number';\n\nexport { isNum, zeroPoint };\n","const combineFunctions = (a, b) => (v) => b(a(v));\nconst pipe = (...transformers) => transformers.reduce(combineFunctions);\n\nexport { pipe };\n","import { complex, color } from 'style-value-types';\nimport { mix } from './mix.mjs';\nimport { mixColor } from './mix-color.mjs';\nimport { isNum } from './inc.mjs';\nimport { pipe } from './pipe.mjs';\nimport { warning } from 'hey-listen';\n\nfunction getMixer(origin, target) {\n if (isNum(origin)) {\n return (v) => mix(origin, target, v);\n }\n else if (color.test(origin)) {\n return mixColor(origin, target);\n }\n else {\n return mixComplex(origin, target);\n }\n}\nconst mixArray = (from, to) => {\n const output = [...from];\n const numValues = output.length;\n const blendValue = from.map((fromThis, i) => getMixer(fromThis, to[i]));\n return (v) => {\n for (let i = 0; i < numValues; i++) {\n output[i] = blendValue[i](v);\n }\n return output;\n };\n};\nconst mixObject = (origin, target) => {\n const output = Object.assign(Object.assign({}, origin), target);\n const blendValue = {};\n for (const key in output) {\n if (origin[key] !== undefined && target[key] !== undefined) {\n blendValue[key] = getMixer(origin[key], target[key]);\n }\n }\n return (v) => {\n for (const key in blendValue) {\n output[key] = blendValue[key](v);\n }\n return output;\n };\n};\nfunction analyse(value) {\n const parsed = complex.parse(value);\n const numValues = parsed.length;\n let numNumbers = 0;\n let numRGB = 0;\n let numHSL = 0;\n for (let i = 0; i < numValues; i++) {\n if (numNumbers || typeof parsed[i] === \"number\") {\n numNumbers++;\n }\n else {\n if (parsed[i].hue !== undefined) {\n numHSL++;\n }\n else {\n numRGB++;\n }\n }\n }\n return { parsed, numNumbers, numRGB, numHSL };\n}\nconst mixComplex = (origin, target) => {\n const template = complex.createTransformer(target);\n const originStats = analyse(origin);\n const targetStats = analyse(target);\n const canInterpolate = originStats.numHSL === targetStats.numHSL &&\n originStats.numRGB === targetStats.numRGB &&\n originStats.numNumbers >= targetStats.numNumbers;\n if (canInterpolate) {\n return pipe(mixArray(originStats.parsed, targetStats.parsed), template);\n }\n else {\n warning(true, `Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`);\n return (p) => `${p > 0 ? target : origin}`;\n }\n};\n\nexport { mixArray, mixComplex, mixObject };\n","import { progress } from './progress.mjs';\nimport { mix } from './mix.mjs';\nimport { mixColor } from './mix-color.mjs';\nimport { mixComplex, mixArray, mixObject } from './mix-complex.mjs';\nimport { color } from 'style-value-types';\nimport { clamp } from './clamp.mjs';\nimport { pipe } from './pipe.mjs';\nimport { invariant } from 'hey-listen';\n\nconst mixNumber = (from, to) => (p) => mix(from, to, p);\nfunction detectMixerFactory(v) {\n if (typeof v === 'number') {\n return mixNumber;\n }\n else if (typeof v === 'string') {\n if (color.test(v)) {\n return mixColor;\n }\n else {\n return mixComplex;\n }\n }\n else if (Array.isArray(v)) {\n return mixArray;\n }\n else if (typeof v === 'object') {\n return mixObject;\n }\n}\nfunction createMixers(output, ease, customMixer) {\n const mixers = [];\n const mixerFactory = customMixer || detectMixerFactory(output[0]);\n const numMixers = output.length - 1;\n for (let i = 0; i < numMixers; i++) {\n let mixer = mixerFactory(output[i], output[i + 1]);\n if (ease) {\n const easingFunction = Array.isArray(ease) ? ease[i] : ease;\n mixer = pipe(easingFunction, mixer);\n }\n mixers.push(mixer);\n }\n return mixers;\n}\nfunction fastInterpolate([from, to], [mixer]) {\n return (v) => mixer(progress(from, to, v));\n}\nfunction slowInterpolate(input, mixers) {\n const inputLength = input.length;\n const lastInputIndex = inputLength - 1;\n return (v) => {\n let mixerIndex = 0;\n let foundMixerIndex = false;\n if (v <= input[0]) {\n foundMixerIndex = true;\n }\n else if (v >= input[lastInputIndex]) {\n mixerIndex = lastInputIndex - 1;\n foundMixerIndex = true;\n }\n if (!foundMixerIndex) {\n let i = 1;\n for (; i < inputLength; i++) {\n if (input[i] > v || i === lastInputIndex) {\n break;\n }\n }\n mixerIndex = i - 1;\n }\n const progressInRange = progress(input[mixerIndex], input[mixerIndex + 1], v);\n return mixers[mixerIndex](progressInRange);\n };\n}\nfunction interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {\n const inputLength = input.length;\n invariant(inputLength === output.length, 'Both input and output ranges must be the same length');\n invariant(!ease || !Array.isArray(ease) || ease.length === inputLength - 1, 'Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values.');\n if (input[0] > input[inputLength - 1]) {\n input = [].concat(input);\n output = [].concat(output);\n input.reverse();\n output.reverse();\n }\n const mixers = createMixers(output, ease, mixer);\n const interpolator = inputLength === 2\n ? fastInterpolate(input, mixers)\n : slowInterpolate(input, mixers);\n return isClamp\n ? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))\n : interpolator;\n}\n\nexport { interpolate };\n","const reverseEasing = easing => p => 1 - easing(1 - p);\nconst mirrorEasing = easing => p => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2;\nconst createExpoIn = (power) => p => Math.pow(p, power);\nconst createBackIn = (power) => p => p * p * ((power + 1) * p - power);\nconst createAnticipate = (power) => {\n const backEasing = createBackIn(power);\n return p => (p *= 2) < 1\n ? 0.5 * backEasing(p)\n : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));\n};\n\nexport { createAnticipate, createBackIn, createExpoIn, mirrorEasing, reverseEasing };\n","import { createExpoIn, reverseEasing, mirrorEasing, createBackIn, createAnticipate } from './utils.mjs';\n\nconst DEFAULT_OVERSHOOT_STRENGTH = 1.525;\nconst BOUNCE_FIRST_THRESHOLD = 4.0 / 11.0;\nconst BOUNCE_SECOND_THRESHOLD = 8.0 / 11.0;\nconst BOUNCE_THIRD_THRESHOLD = 9.0 / 10.0;\nconst linear = p => p;\nconst easeIn = createExpoIn(2);\nconst easeOut = reverseEasing(easeIn);\nconst easeInOut = mirrorEasing(easeIn);\nconst circIn = p => 1 - Math.sin(Math.acos(p));\nconst circOut = reverseEasing(circIn);\nconst circInOut = mirrorEasing(circOut);\nconst backIn = createBackIn(DEFAULT_OVERSHOOT_STRENGTH);\nconst backOut = reverseEasing(backIn);\nconst backInOut = mirrorEasing(backIn);\nconst anticipate = createAnticipate(DEFAULT_OVERSHOOT_STRENGTH);\nconst ca = 4356.0 / 361.0;\nconst cb = 35442.0 / 1805.0;\nconst cc = 16061.0 / 1805.0;\nconst bounceOut = (p) => {\n if (p === 1 || p === 0)\n return p;\n const p2 = p * p;\n return p < BOUNCE_FIRST_THRESHOLD\n ? 7.5625 * p2\n : p < BOUNCE_SECOND_THRESHOLD\n ? 9.075 * p2 - 9.9 * p + 3.4\n : p < BOUNCE_THIRD_THRESHOLD\n ? ca * p2 - cb * p + cc\n : 10.8 * p * p - 20.52 * p + 10.72;\n};\nconst bounceIn = reverseEasing(bounceOut);\nconst bounceInOut = (p) => p < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - p * 2.0))\n : 0.5 * bounceOut(p * 2.0 - 1.0) + 0.5;\n\nexport { anticipate, backIn, backInOut, backOut, bounceIn, bounceInOut, bounceOut, circIn, circInOut, circOut, easeIn, easeInOut, easeOut, linear };\n","import { interpolate } from '../../utils/interpolate.mjs';\nimport { easeInOut } from '../../easing/index.mjs';\n\nfunction defaultEasing(values, easing) {\n return values.map(() => easing || easeInOut).splice(0, values.length - 1);\n}\nfunction defaultOffset(values) {\n const numValues = values.length;\n return values.map((_value, i) => i !== 0 ? i / (numValues - 1) : 0);\n}\nfunction convertOffsetToTimes(offset, duration) {\n return offset.map((o) => o * duration);\n}\nfunction keyframes({ from = 0, to = 1, ease, offset, duration = 300, }) {\n const state = { done: false, value: from };\n const values = Array.isArray(to) ? to : [from, to];\n const times = convertOffsetToTimes(offset && offset.length === values.length\n ? offset\n : defaultOffset(values), duration);\n function createInterpolator() {\n return interpolate(times, values, {\n ease: Array.isArray(ease) ? ease : defaultEasing(values, ease),\n });\n }\n let interpolator = createInterpolator();\n return {\n next: (t) => {\n state.value = interpolator(t);\n state.done = t >= duration;\n return state;\n },\n flipTarget: () => {\n values.reverse();\n interpolator = createInterpolator();\n },\n };\n}\n\nexport { convertOffsetToTimes, defaultEasing, defaultOffset, keyframes };\n","function decay({ velocity = 0, from = 0, power = 0.8, timeConstant = 350, restDelta = 0.5, modifyTarget, }) {\n const state = { done: false, value: from };\n let amplitude = power * velocity;\n const ideal = from + amplitude;\n const target = modifyTarget === undefined ? ideal : modifyTarget(ideal);\n if (target !== ideal)\n amplitude = target - from;\n return {\n next: (t) => {\n const delta = -amplitude * Math.exp(-t / timeConstant);\n state.done = !(delta > restDelta || delta < -restDelta);\n state.value = state.done ? target : target + delta;\n return state;\n },\n flipTarget: () => { },\n };\n}\n\nexport { decay };\n","import { spring } from '../generators/spring.mjs';\nimport { keyframes } from '../generators/keyframes.mjs';\nimport { decay } from '../generators/decay.mjs';\n\nconst types = { keyframes, spring, decay };\nfunction detectAnimationFromOptions(config) {\n if (Array.isArray(config.to)) {\n return keyframes;\n }\n else if (types[config.type]) {\n return types[config.type];\n }\n const keys = new Set(Object.keys(config));\n if (keys.has(\"ease\") ||\n (keys.has(\"duration\") && !keys.has(\"dampingRatio\"))) {\n return keyframes;\n }\n else if (keys.has(\"dampingRatio\") ||\n keys.has(\"stiffness\") ||\n keys.has(\"mass\") ||\n keys.has(\"damping\") ||\n keys.has(\"restSpeed\") ||\n keys.has(\"restDelta\")) {\n return spring;\n }\n return keyframes;\n}\n\nexport { detectAnimationFromOptions };\n","const defaultTimestep = (1 / 60) * 1000;\nconst getCurrentTime = typeof performance !== \"undefined\"\n ? () => performance.now()\n : () => Date.now();\nconst onNextFrame = typeof window !== \"undefined\"\n ? (callback) => window.requestAnimationFrame(callback)\n : (callback) => setTimeout(() => callback(getCurrentTime()), defaultTimestep);\n\nexport { defaultTimestep, onNextFrame };\n","function createRenderStep(runNextFrame) {\n let toRun = [];\n let toRunNextFrame = [];\n let numToRun = 0;\n let isProcessing = false;\n let flushNextFrame = false;\n const toKeepAlive = new WeakSet();\n const step = {\n schedule: (callback, keepAlive = false, immediate = false) => {\n const addToCurrentFrame = immediate && isProcessing;\n const buffer = addToCurrentFrame ? toRun : toRunNextFrame;\n if (keepAlive)\n toKeepAlive.add(callback);\n if (buffer.indexOf(callback) === -1) {\n buffer.push(callback);\n if (addToCurrentFrame && isProcessing)\n numToRun = toRun.length;\n }\n return callback;\n },\n cancel: (callback) => {\n const index = toRunNextFrame.indexOf(callback);\n if (index !== -1)\n toRunNextFrame.splice(index, 1);\n toKeepAlive.delete(callback);\n },\n process: (frameData) => {\n if (isProcessing) {\n flushNextFrame = true;\n return;\n }\n isProcessing = true;\n [toRun, toRunNextFrame] = [toRunNextFrame, toRun];\n toRunNextFrame.length = 0;\n numToRun = toRun.length;\n if (numToRun) {\n for (let i = 0; i < numToRun; i++) {\n const callback = toRun[i];\n callback(frameData);\n if (toKeepAlive.has(callback)) {\n step.schedule(callback);\n runNextFrame();\n }\n }\n }\n isProcessing = false;\n if (flushNextFrame) {\n flushNextFrame = false;\n step.process(frameData);\n }\n },\n };\n return step;\n}\n\nexport { createRenderStep };\n","import { onNextFrame, defaultTimestep } from './on-next-frame.mjs';\nimport { createRenderStep } from './create-render-step.mjs';\n\nconst maxElapsed = 40;\nlet useDefaultElapsed = true;\nlet runNextFrame = false;\nlet isProcessing = false;\nconst frame = {\n delta: 0,\n timestamp: 0,\n};\nconst stepsOrder = [\n \"read\",\n \"update\",\n \"preRender\",\n \"render\",\n \"postRender\",\n];\nconst steps = stepsOrder.reduce((acc, key) => {\n acc[key] = createRenderStep(() => (runNextFrame = true));\n return acc;\n}, {});\nconst sync = stepsOrder.reduce((acc, key) => {\n const step = steps[key];\n acc[key] = (process, keepAlive = false, immediate = false) => {\n if (!runNextFrame)\n startLoop();\n return step.schedule(process, keepAlive, immediate);\n };\n return acc;\n}, {});\nconst cancelSync = stepsOrder.reduce((acc, key) => {\n acc[key] = steps[key].cancel;\n return acc;\n}, {});\nconst flushSync = stepsOrder.reduce((acc, key) => {\n acc[key] = () => steps[key].process(frame);\n return acc;\n}, {});\nconst processStep = (stepId) => steps[stepId].process(frame);\nconst processFrame = (timestamp) => {\n runNextFrame = false;\n frame.delta = useDefaultElapsed\n ? defaultTimestep\n : Math.max(Math.min(timestamp - frame.timestamp, maxElapsed), 1);\n frame.timestamp = timestamp;\n isProcessing = true;\n stepsOrder.forEach(processStep);\n isProcessing = false;\n if (runNextFrame) {\n useDefaultElapsed = false;\n onNextFrame(processFrame);\n }\n};\nconst startLoop = () => {\n runNextFrame = true;\n useDefaultElapsed = true;\n if (!isProcessing)\n onNextFrame(processFrame);\n};\nconst getFrameData = () => frame;\n\nexport default sync;\nexport { cancelSync, flushSync, getFrameData };\n","function loopElapsed(elapsed, duration, delay = 0) {\n return elapsed - duration - delay;\n}\nfunction reverseElapsed(elapsed, duration, delay = 0, isForwardPlayback = true) {\n return isForwardPlayback\n ? loopElapsed(duration + -elapsed, duration, delay)\n : duration - (elapsed - duration) + delay;\n}\nfunction hasRepeatDelayElapsed(elapsed, duration, delay, isForwardPlayback) {\n return isForwardPlayback ? elapsed >= duration + delay : elapsed <= -delay;\n}\n\nexport { hasRepeatDelayElapsed, loopElapsed, reverseElapsed };\n","import { __rest } from 'tslib';\nimport { detectAnimationFromOptions } from './utils/detect-animation-from-options.mjs';\nimport sync, { cancelSync } from 'framesync';\nimport { interpolate } from '../utils/interpolate.mjs';\nimport { hasRepeatDelayElapsed, reverseElapsed, loopElapsed } from './utils/elapsed.mjs';\n\nconst framesync = (update) => {\n const passTimestamp = ({ delta }) => update(delta);\n return {\n start: () => sync.update(passTimestamp, true),\n stop: () => cancelSync.update(passTimestamp),\n };\n};\nfunction animate(_a) {\n var _b, _c;\n var { from, autoplay = true, driver = framesync, elapsed = 0, repeat: repeatMax = 0, repeatType = \"loop\", repeatDelay = 0, onPlay, onStop, onComplete, onRepeat, onUpdate } = _a, options = __rest(_a, [\"from\", \"autoplay\", \"driver\", \"elapsed\", \"repeat\", \"repeatType\", \"repeatDelay\", \"onPlay\", \"onStop\", \"onComplete\", \"onRepeat\", \"onUpdate\"]);\n let { to } = options;\n let driverControls;\n let repeatCount = 0;\n let computedDuration = options.duration;\n let latest;\n let isComplete = false;\n let isForwardPlayback = true;\n let interpolateFromNumber;\n const animator = detectAnimationFromOptions(options);\n if ((_c = (_b = animator).needsInterpolation) === null || _c === void 0 ? void 0 : _c.call(_b, from, to)) {\n interpolateFromNumber = interpolate([0, 100], [from, to], {\n clamp: false,\n });\n from = 0;\n to = 100;\n }\n const animation = animator(Object.assign(Object.assign({}, options), { from, to }));\n function repeat() {\n repeatCount++;\n if (repeatType === \"reverse\") {\n isForwardPlayback = repeatCount % 2 === 0;\n elapsed = reverseElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback);\n }\n else {\n elapsed = loopElapsed(elapsed, computedDuration, repeatDelay);\n if (repeatType === \"mirror\")\n animation.flipTarget();\n }\n isComplete = false;\n onRepeat && onRepeat();\n }\n function complete() {\n driverControls.stop();\n onComplete && onComplete();\n }\n function update(delta) {\n if (!isForwardPlayback)\n delta = -delta;\n elapsed += delta;\n if (!isComplete) {\n const state = animation.next(Math.max(0, elapsed));\n latest = state.value;\n if (interpolateFromNumber)\n latest = interpolateFromNumber(latest);\n isComplete = isForwardPlayback ? state.done : elapsed <= 0;\n }\n onUpdate === null || onUpdate === void 0 ? void 0 : onUpdate(latest);\n if (isComplete) {\n if (repeatCount === 0)\n computedDuration !== null && computedDuration !== void 0 ? computedDuration : (computedDuration = elapsed);\n if (repeatCount < repeatMax) {\n hasRepeatDelayElapsed(elapsed, computedDuration, repeatDelay, isForwardPlayback) && repeat();\n }\n else {\n complete();\n }\n }\n }\n function play() {\n onPlay === null || onPlay === void 0 ? void 0 : onPlay();\n driverControls = driver(update);\n driverControls.start();\n }\n autoplay && play();\n return {\n stop: () => {\n onStop === null || onStop === void 0 ? void 0 : onStop();\n driverControls.stop();\n },\n };\n}\n\nexport { animate };\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\nfunction negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n}\n\nmodule.exports = negate;\n","var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n basePickBy = require('./_basePickBy'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nmodule.exports = pickBy;\n","var baseIteratee = require('./_baseIteratee'),\n negate = require('./negate'),\n pickBy = require('./pickBy');\n\n/**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\nfunction omitBy(object, predicate) {\n return pickBy(object, negate(baseIteratee(predicate)));\n}\n\nmodule.exports = omitBy;\n","/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nmodule.exports = isUndefined;\n","import { ITransform } from '@/store/stageInterface';\nimport { animate } from 'popmotion';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { webgalStore } from '@/store/store';\nimport { stageActions } from '@/store/stageReducer';\nimport omitBy from 'lodash/omitBy';\nimport isUndefined from 'lodash/isUndefined';\n\n/**\n * 动画创建模板\n * @param timeline\n * @param targetKey 作用目标\n * @param duration 持续时间\n */\nexport function generateTimelineObj(\n timeline: Array<ITransform & { duration: number }>,\n targetKey: string,\n duration: number,\n) {\n for (const segment of timeline) {\n // 处理 alphaL\n // @ts-ignore\n segment['alphaFilterVal'] = segment.alpha;\n segment.alpha = 1;\n }\n const target = WebGAL.gameplay.pixiStage!.getStageObjByKey(targetKey);\n let currentDelay = 0;\n const values = [];\n const times: number[] = [];\n for (const segment of timeline) {\n const segmentDuration = segment.duration;\n currentDelay += segmentDuration;\n const { position, scale, ...segmentValues } = segment;\n // 不能用 scale,因为 popmotion 不能用嵌套\n values.push({ x: position.x, y: position.y, scaleX: scale.x, scaleY: scale.y, ...segmentValues });\n if (duration !== 0) {\n times.push(currentDelay / duration);\n } else times.push(0);\n }\n const container = target?.pixiContainer;\n let animateInstance: ReturnType<typeof animate> | null = null;\n // 只有有 duration 的时候才有动画\n if (duration > 0) {\n animateInstance = animate({\n to: values,\n offset: times,\n duration,\n onUpdate: (updateValue) => {\n if (container) {\n const { scaleX, scaleY, ...val } = updateValue;\n Object.assign(container, omitBy(val, isUndefined));\n // 因为 popmotion 不能用嵌套,scale 要手动设置\n if (!isUndefined(scaleX)) container.scale.x = scaleX;\n if (!isUndefined(scaleY)) container.scale.y = scaleY;\n }\n },\n });\n }\n\n const { duration: sliceDuration, ...endState } = getEndStateEffect();\n webgalStore.dispatch(stageActions.updateEffect({ target: targetKey, transform: endState }));\n\n /**\n * 在此书写为动画设置初态的操作\n */\n function setStartState() {\n if (target?.pixiContainer) {\n // 不能赋值到 position,因为 x 和 y 被 WebGALPixiContainer 代理,而 position 属性没有代理\n const { position, scale, ...state } = getStartStateEffect();\n const assignValue = omitBy({ x: position.x, y: position.y, ...state }, isUndefined);\n Object.assign(target?.pixiContainer, assignValue);\n if (target?.pixiContainer) {\n if (!isUndefined(scale.x)) {\n target.pixiContainer.scale.x = scale.x;\n }\n if (!isUndefined(scale?.y)) {\n target.pixiContainer.scale.y = scale.y;\n }\n }\n }\n }\n\n /**\n * 在此书写为动画设置终态的操作\n */\n function setEndState() {\n if (animateInstance) animateInstance.stop();\n animateInstance = null;\n if (target?.pixiContainer) {\n // 不能赋值到 position,因为 x 和 y 被 WebGALPixiContainer 代理,而 position 属性没有代理\n // 不能赋值到 position,因为 x 和 y 被 WebGALPixiContainer 代理,而 position 属性没有代理\n const { position, scale, ...state } = getEndStateEffect();\n const assignValue = omitBy({ x: position.x, y: position.y, ...state }, isUndefined);\n Object.assign(target?.pixiContainer, assignValue);\n if (target?.pixiContainer) {\n if (!isUndefined(scale.x)) {\n target.pixiContainer.scale.x = scale.x;\n }\n if (!isUndefined(scale?.y)) {\n target.pixiContainer.scale.y = scale.y;\n }\n }\n }\n }\n\n /**\n * 在此书写动画每一帧执行的函数\n * @param delta\n */\n function tickerFunc(delta: number) {}\n\n function getStartStateEffect() {\n return timeline[0];\n }\n\n function getEndStateEffect() {\n return timeline[timeline.length - 1];\n }\n\n function getEndFilterEffect() {\n const endSegment = timeline[timeline.length - 1];\n const { alpha, rotation, blur, duration, scale, position, ...rest } = endSegment;\n return rest;\n }\n\n return {\n setStartState,\n setEndState,\n tickerFunc,\n getEndFilterEffect,\n };\n}\n","import { generateUniversalSoftInAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftIn';\nimport { logger } from '@/Core/util/logger';\nimport { generateUniversalSoftOffAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftOff';\nimport { webgalStore } from '@/store/store';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { baseTransform } from '@/store/stageInterface';\nimport { generateTimelineObj } from '@/Core/controller/stage/pixi/animations/timeline';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport function getAnimationObject(animationName: string, target: string, duration: number) {\n const effect = WebGAL.animationManager.getAnimations().find((ani) => ani.name === animationName);\n if (effect) {\n const mappedEffects = effect.effects.map((effect) => {\n const targetSetEffect = webgalStore.getState().stage.effects.find((e) => e.target === target);\n const newEffect = cloneDeep({ ...(targetSetEffect?.transform ?? baseTransform), duration: 0 });\n Object.assign(newEffect, effect);\n newEffect.duration = effect.duration;\n return newEffect;\n });\n logger.debug('装载自定义动画', mappedEffects);\n return generateTimelineObj(mappedEffects, target, duration);\n }\n return null;\n}\n\nexport function getAnimateDuration(animationName: string) {\n const effect = WebGAL.animationManager.getAnimations().find((ani) => ani.name === animationName);\n if (effect) {\n let duration = 0;\n effect.effects.forEach((e) => {\n duration += e.duration;\n });\n return duration;\n }\n return 0;\n}\n\nexport function getEnterExitAnimation(\n target: string,\n type: 'enter' | 'exit',\n isBg = false,\n): {\n duration: number;\n animation: {\n setStartState: () => void;\n tickerFunc: (delta: number) => void;\n setEndState: () => void;\n } | null;\n} {\n if (type === 'enter') {\n let duration = 500;\n if (isBg) {\n duration = 1500;\n }\n // 走默认动画\n let animation: {\n setStartState: () => void;\n tickerFunc: (delta: number) => void;\n setEndState: () => void;\n } | null = generateUniversalSoftInAnimationObj(target, duration);\n const animarionName = WebGAL.animationManager.nextEnterAnimationName.get(target);\n if (animarionName) {\n logger.debug('取代默认进入动画', target);\n animation = getAnimationObject(animarionName, target, getAnimateDuration(animarionName));\n duration = getAnimateDuration(animarionName);\n // 用后重置\n WebGAL.animationManager.nextEnterAnimationName.delete(target);\n }\n return { duration, animation };\n } else {\n let duration = 750;\n if (isBg) {\n duration = 1500;\n }\n // 走默认动画\n let animation: {\n setStartState: () => void;\n tickerFunc: (delta: number) => void;\n setEndState: () => void;\n } | null = generateUniversalSoftOffAnimationObj(target, duration);\n const animarionName = WebGAL.animationManager.nextExitAnimationName.get(target);\n if (animarionName) {\n logger.debug('取代默认退出动画', target);\n animation = getAnimationObject(animarionName, target, getAnimateDuration(animarionName));\n duration = getAnimateDuration(animarionName);\n // 用后重置\n WebGAL.animationManager.nextExitAnimationName.delete(target);\n }\n return { duration, animation };\n }\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\n// import {getRandomPerformName} from '../../../util/getRandomPerformName';\nimport styles from '@/Stage/stage.module.scss';\nimport { webgalStore } from '@/store/store';\nimport { setStage, stageActions } from '@/store/stageReducer';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { unlockCgInUserData } from '@/store/userDataReducer';\nimport { logger } from '@/Core/util/logger';\nimport { ITransform } from '@/store/stageInterface';\nimport { generateTransformAnimationObj } from '@/Core/controller/stage/pixi/animations/generateTransformAnimationObj';\nimport { IUserAnimation } from '@/Core/Modules/animations';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { getAnimateDuration } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 进行背景图片的切换\n * @param sentence 语句\n * @return {IPerform}\n */\nexport const changeBg = (sentence: ISentence): IPerform => {\n const url = sentence.content;\n let name = '';\n let series = 'default';\n sentence.args.forEach((e) => {\n if (e.key === 'unlockname') {\n name = e.value.toString();\n }\n if (e.key === 'series') {\n series = e.value.toString();\n }\n });\n\n const dispatch = webgalStore.dispatch;\n if (name !== '') dispatch(unlockCgInUserData({ name, url, series }));\n\n /**\n * 删掉相关 Effects,因为已经移除了\n */\n dispatch(stageActions.removeEffectByTargetId(`bg-main`));\n\n // 处理 transform 和 默认 transform\n const transformString = getSentenceArgByKey(sentence, 'transform');\n let duration = getSentenceArgByKey(sentence, 'duration');\n if (!duration || typeof duration !== 'number') {\n duration = 1000;\n }\n let animationObj: (ITransform & {\n duration: number;\n })[];\n if (transformString) {\n try {\n const frame = JSON.parse(transformString.toString()) as ITransform & { duration: number };\n animationObj = generateTransformAnimationObj('bg-main', frame, duration);\n // 因为是切换,必须把一开始的 alpha 改为 0\n animationObj[0].alpha = 0;\n const animationName = (Math.random() * 10).toString(16);\n const newAnimation: IUserAnimation = { name: animationName, effects: animationObj };\n WebGAL.animationManager.addAnimation(newAnimation);\n duration = getAnimateDuration(animationName);\n WebGAL.animationManager.nextEnterAnimationName.set('bg-main', animationName);\n } catch (e) {\n // 解析都错误了,歇逼吧\n applyDefaultTransform();\n }\n } else {\n applyDefaultTransform();\n }\n\n function applyDefaultTransform() {\n // 应用默认的\n const frame = {};\n animationObj = generateTransformAnimationObj('bg-main', frame as ITransform & { duration: number }, duration);\n // 因为是切换,必须把一开始的 alpha 改为 0\n animationObj[0].alpha = 0;\n const animationName = (Math.random() * 10).toString(16);\n const newAnimation: IUserAnimation = { name: animationName, effects: animationObj };\n WebGAL.animationManager.addAnimation(newAnimation);\n duration = getAnimateDuration(animationName);\n WebGAL.animationManager.nextEnterAnimationName.set('bg-main', animationName);\n }\n\n // 应用动画的优先级更高一点\n if (getSentenceArgByKey(sentence, 'enter')) {\n WebGAL.animationManager.nextEnterAnimationName.set('bg-main', getSentenceArgByKey(sentence, 'enter')!.toString());\n duration = getAnimateDuration(getSentenceArgByKey(sentence, 'enter')!.toString());\n }\n if (getSentenceArgByKey(sentence, 'exit')) {\n WebGAL.animationManager.nextExitAnimationName.set('bg-main-off', getSentenceArgByKey(sentence, 'exit')!.toString());\n duration = getAnimateDuration(getSentenceArgByKey(sentence, 'exit')!.toString());\n }\n dispatch(setStage({ key: 'bgName', value: sentence.content }));\n\n return {\n performName: 'none',\n duration,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { setStage, stageActions } from '@/store/stageReducer';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { IFreeFigure, IStageState, ITransform } from '@/store/stageInterface';\nimport { IUserAnimation } from '@/Core/Modules/animations';\nimport { generateTransformAnimationObj } from '@/Core/controller/stage/pixi/animations/generateTransformAnimationObj';\nimport { assetSetter, fileType } from '@/Core/util/gameAssetsAccess/assetSetter';\nimport { logger } from '@/Core/util/logger';\nimport { getAnimateDuration } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n/**\n * 更改立绘\n * @param sentence 语句\n */\n// eslint-disable-next-line complexity\nexport function changeFigure(sentence: ISentence): IPerform {\n // 根据参数设置指定位置\n let pos: 'center' | 'left' | 'right' = 'center';\n let content = sentence.content;\n let isFreeFigure = false;\n let motion = '';\n let expression = '';\n let key = '';\n let duration = 500;\n let mouthOpen = '';\n let mouthClose = '';\n let mouthHalfOpen = '';\n let eyesOpen = '';\n let eyesClose = '';\n let animationFlag: any = '';\n let mouthAnimationKey: any = 'mouthAnimation';\n let eyesAnimationKey: any = 'blinkAnimation';\n const dispatch = webgalStore.dispatch;\n\n for (const e of sentence.args) {\n switch (e.key) {\n case 'left':\n if (e.value === true) {\n pos = 'left';\n mouthAnimationKey = 'mouthAnimationLeft';\n eyesAnimationKey = 'blinkAnimationLeft';\n }\n break;\n case 'right':\n if (e.value === true) {\n pos = 'right';\n mouthAnimationKey = 'mouthAnimationRight';\n eyesAnimationKey = 'blinkAnimationRight';\n }\n break;\n case 'clear':\n if (e.value === true) {\n content = '';\n }\n break;\n case 'id':\n isFreeFigure = true;\n key = e.value.toString();\n break;\n case 'motion':\n motion = e.value.toString();\n break;\n case 'expression':\n expression = e.value.toString();\n break;\n case 'mouthOpen':\n mouthOpen = e.value.toString();\n mouthOpen = assetSetter(mouthOpen, fileType.figure);\n break;\n case 'mouthClose':\n mouthClose = e.value.toString();\n mouthClose = assetSetter(mouthClose, fileType.figure);\n break;\n case 'mouthHalfOpen':\n mouthHalfOpen = e.value.toString();\n mouthHalfOpen = assetSetter(mouthHalfOpen, fileType.figure);\n break;\n case 'eyesOpen':\n eyesOpen = e.value.toString();\n eyesOpen = assetSetter(eyesOpen, fileType.figure);\n break;\n case 'eyesClose':\n eyesClose = e.value.toString();\n eyesClose = assetSetter(eyesClose, fileType.figure);\n break;\n case 'animationFlag':\n animationFlag = e.value.toString();\n break;\n case 'none':\n content = '';\n break;\n default:\n break;\n }\n }\n\n const id = key ? key : `fig-${pos}`;\n\n const currentFigureAssociatedAnimation = webgalStore.getState().stage.figureAssociatedAnimation;\n const filteredFigureAssociatedAnimation = currentFigureAssociatedAnimation.filter((item) => item.targetId !== id);\n const newFigureAssociatedAnimationItem = {\n targetId: id,\n animationFlag: animationFlag,\n mouthAnimation: {\n open: mouthOpen,\n close: mouthClose,\n halfOpen: mouthHalfOpen,\n },\n blinkAnimation: {\n open: eyesOpen,\n close: eyesClose,\n },\n };\n filteredFigureAssociatedAnimation.push(newFigureAssociatedAnimationItem);\n dispatch(setStage({ key: 'figureAssociatedAnimation', value: filteredFigureAssociatedAnimation }));\n\n /**\n * 如果 url 没变,不移除\n */\n let isRemoveEffects = true;\n if (key !== '') {\n const figWithKey = webgalStore.getState().stage.freeFigure.find((e) => e.key === key);\n if (figWithKey) {\n if (figWithKey.name === sentence.content) {\n isRemoveEffects = false;\n }\n }\n } else {\n if (pos === 'center') {\n if (webgalStore.getState().stage.figName === sentence.content) {\n isRemoveEffects = false;\n }\n }\n if (pos === 'left') {\n if (webgalStore.getState().stage.figNameLeft === sentence.content) {\n isRemoveEffects = false;\n }\n }\n if (pos === 'right') {\n if (webgalStore.getState().stage.figNameRight === sentence.content) {\n isRemoveEffects = false;\n }\n }\n }\n /**\n * 处理 Effects\n */\n if (isRemoveEffects) {\n const deleteKey = `fig-${pos}`;\n const deleteKey2 = `${key}`;\n webgalStore.dispatch(stageActions.removeEffectByTargetId(deleteKey));\n webgalStore.dispatch(stageActions.removeEffectByTargetId(deleteKey2));\n }\n const setAnimationNames = (key: string, sentence: ISentence) => {\n // 处理 transform 和 默认 transform\n const transformString = getSentenceArgByKey(sentence, 'transform');\n const durationFromArg = getSentenceArgByKey(sentence, 'duration');\n if (durationFromArg && typeof durationFromArg === 'number') {\n duration = durationFromArg;\n }\n let animationObj: (ITransform & {\n duration: number;\n })[];\n if (transformString) {\n console.log(transformString);\n try {\n const frame = JSON.parse(transformString.toString()) as ITransform & { duration: number };\n animationObj = generateTransformAnimationObj(key, frame, duration);\n // 因为是切换,必须把一开始的 alpha 改为 0\n animationObj[0].alpha = 0;\n const animationName = (Math.random() * 10).toString(16);\n const newAnimation: IUserAnimation = { name: animationName, effects: animationObj };\n WebGAL.animationManager.addAnimation(newAnimation);\n duration = getAnimateDuration(animationName);\n WebGAL.animationManager.nextEnterAnimationName.set(key, animationName);\n } catch (e) {\n // 解析都错误了,歇逼吧\n applyDefaultTransform();\n }\n } else {\n applyDefaultTransform();\n }\n\n function applyDefaultTransform() {\n // 应用默认的\n const frame = {};\n animationObj = generateTransformAnimationObj(key, frame as ITransform & { duration: number }, duration);\n // 因为是切换,必须把一开始的 alpha 改为 0\n animationObj[0].alpha = 0;\n const animationName = (Math.random() * 10).toString(16);\n const newAnimation: IUserAnimation = { name: animationName, effects: animationObj };\n WebGAL.animationManager.addAnimation(newAnimation);\n duration = getAnimateDuration(animationName);\n WebGAL.animationManager.nextEnterAnimationName.set(key, animationName);\n }\n const enterAnim = getSentenceArgByKey(sentence, 'enter');\n const exitAnim = getSentenceArgByKey(sentence, 'exit');\n if (enterAnim) {\n WebGAL.animationManager.nextEnterAnimationName.set(key, enterAnim.toString());\n duration = getAnimateDuration(enterAnim.toString());\n }\n if (exitAnim) {\n WebGAL.animationManager.nextExitAnimationName.set(key + '-off', exitAnim.toString());\n duration = getAnimateDuration(exitAnim.toString());\n }\n };\n if (isFreeFigure) {\n const currentFreeFigures = webgalStore.getState().stage.freeFigure;\n\n /**\n * 重设\n */\n const freeFigureItem: IFreeFigure = { key, name: content, basePosition: pos };\n setAnimationNames(key, sentence);\n if (motion) {\n dispatch(stageActions.setLive2dMotion({ target: key, motion }));\n }\n if (expression) {\n dispatch(stageActions.setLive2dExpression({ target: key, expression }));\n }\n dispatch(stageActions.setFreeFigureByKey(freeFigureItem));\n } else {\n const positionMap = {\n center: 'fig-center',\n left: 'fig-left',\n right: 'fig-right',\n };\n const dispatchMap: Record<string, keyof IStageState> = {\n center: 'figName',\n left: 'figNameLeft',\n right: 'figNameRight',\n };\n\n key = positionMap[pos];\n setAnimationNames(key, sentence);\n if (motion) {\n dispatch(stageActions.setLive2dMotion({ target: key, motion }));\n }\n if (expression) {\n dispatch(stageActions.setLive2dExpression({ target: key, expression }));\n }\n dispatch(setStage({ key: dispatchMap[pos], value: content }));\n }\n\n return {\n performName: 'none',\n duration,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => false,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n}\n","import { sceneFetcher } from './sceneFetcher';\nimport { sceneParser } from '../../parser/sceneParser';\nimport { logger } from '../../util/logger';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport uniqWith from 'lodash/uniqWith';\nimport { scenePrefetcher } from '@/Core/util/prefetcher/scenePrefetcher';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 切换场景\n * @param sceneUrl 场景路径\n * @param sceneName 场景名称\n */\nexport const changeScene = (sceneUrl: string, sceneName: string) => {\n if (WebGAL.sceneManager.lockSceneWrite) {\n return;\n }\n WebGAL.sceneManager.lockSceneWrite = true;\n // 场景写入到运行时\n sceneFetcher(sceneUrl)\n .then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, sceneName, sceneUrl);\n WebGAL.sceneManager.sceneData.currentSentenceId = 0;\n // 开始场景的预加载\n const subSceneList = WebGAL.sceneManager.sceneData.currentScene.subSceneList;\n WebGAL.sceneManager.settledScenes.push(sceneUrl); // 放入已加载场景列表,避免递归加载相同场景\n const subSceneListUniq = uniqWith(subSceneList); // 去重\n scenePrefetcher(subSceneListUniq);\n logger.debug('现在切换场景,切换后的结果:', WebGAL.sceneManager.sceneData);\n WebGAL.sceneManager.lockSceneWrite = false;\n nextSentence();\n })\n .catch((e) => {\n logger.error('场景调用错误', e);\n WebGAL.sceneManager.lockSceneWrite = false;\n });\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { changeScene } from '../controller/scene/changeScene';\n\n/**\n * 切换场景。在场景结束后不会回到父场景。\n * @param sentence\n */\nexport const changeSceneScript = (sentence: ISentence): IPerform => {\n const sceneNameArray: Array<string> = sentence.content.split('/');\n const sceneName = sceneNameArray[sceneNameArray.length - 1];\n changeScene(sentence.content, sceneName);\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: true,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { commandType } from '@/Core/controller/scene/sceneInterface';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport const jmp = (labelName: string) => {\n // 在当前场景中找到指定的标签。\n const currentLine = WebGAL.sceneManager.sceneData.currentSentenceId;\n let result = currentLine;\n WebGAL.sceneManager.sceneData.currentScene.sentenceList.forEach((sentence, index) => {\n if (sentence.command === commandType.label && sentence.content === labelName && index !== currentLine) {\n result = index;\n }\n });\n WebGAL.sceneManager.sceneData.currentSentenceId = result;\n setTimeout(nextSentence, 1);\n};\n","export default \"__VITE_ASSET__bd7e7ba9__\"","export default \"__VITE_ASSET__8c1e5f58__\"","export default \"data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjE0LjEwMAAAAAAAAAAAAAAA//OAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAHAAAGhgA/Pz8/Pz8/Pz8/Pz8/P19fX19fX19fX19fX19ff39/f39/f39/f39/f3+fn5+fn5+fn5+fn5+fn5+/v7+/v7+/v7+/v7+/v9/f39/f39/f39/f39/f//////////////////8AAAAATGF2YzU3LjE1AAAAAAAAAAAAAAAAJAAAAAAAAAAABoYV32R7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/zgGQAAAABpAAAAAAAAANIAAAAACADH/+QtN3NAAAKF6IiVEl7hE0Sv/+XsgGgCgQDQFAgGg3D+yBShQzd+K0qXyBQyRQUp3hEkUMGn/8oCBQ5KOIf+sPl3//+Xf/+GP//6w+EgFgk/nOfWhA4Q4ABxjnQhDhCD3pgIQLAARlkyZ8Ew+Ud1AgUOfy7/4OeGOUORPD//wwUd/KHP//+GPykMA445BCHBIYg4ZC4AyGP+PuWtgyRb6quwuJvp+v8wQwDAKoXYMnpC0w6gAc0HLf/84JkuwnkuN6ioaAAD3CpsVVFMAAFQBkWjRnE4hYMOnIaT5sXEGFH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egY3vXWaZv65cpZm36G/mMUpdalcpStzalb1KXUoUBf8pXKyGM5Sv/TRRPKoUSQMYKTJfSwiUDeW+ZhhmIXNYfiyfSbiqFFLNEQaajFVnrO9YLTodKvET9Z0FcSgq6s6eIz3uLcFQmCxJY06W/g0Cri31AqGrq56EgaXxLPCUNdBZ5USrBUse3BqpNF93yP//yMyMDWEJGQ01////MjMv//I1kcjJrLf/stlzL55SkyyOX5q0cjVrL//OCZC4KtfrOGgAjbodYBawMAEQAYf//+Rk1qGRqygo5GRq1sP/sln//cyNWCg0cj//ZZZZKh+asCHP8lAL////9n/////////GMYm3raaWKige/+sW+LesVTEFNRTMuOTkuNaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=\"","export default \"__VITE_ASSET__f8c41690__\"","export default \"data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjIzLjEwMQAAAAAAAAAAAAAA//OAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAHAAAGhgA/Pz8/Pz8/Pz8/Pz8/P19fX19fX19fX19fX19ff39/f39/f39/f39/f3+fn5+fn5+fn5+fn5+fn5+/v7+/v7+/v7+/v7+/v9/f39/f39/f39/f39/f//////////////////8AAAAATGF2YzU4LjQwAAAAAAAAAAAAAAAAJAL7AAAAAAAABobgvJxkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/zgGQADLH/PRigiACM0AZ+XUAQAoAVYA9AY3IAASAgeRjeQMhP0O/nec/1cn+Qnv/8n+RuhGUhPoQDPISc6HP1Oec7+pwAROeQikI3IT////z+p3Q56VOd/nOc5JzyAAhQAAI053QDFnoQjKACGvoQ7yThzoBgZ8ADMJQURtuNAkMH4P4P+XOZD4f5d/D/64f/3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LsY3+xpv///1aZAwAP///yghpkdW/5qt8OMEMKKg7/pDn///h1/Ues6P/xLEaAkoyibeSeC8E+AuhymiEos8tLHJNRoThxKnP/zgmQcDD0TFAk8xToRuh4sCGgPKooy1Y8s/q2X/ZH//6tqJAEEQwRKxjI9y1KWWqPDw8awiKqQPPob/pRUDwAioCEtX9R7/9eGlncrLPLBVgKmRZ+GpD/tqEogdIXwLlNkUnUxiamSS0W/ooqUlrot//zUCIHRc05Zrqaabod86PDZv/+b/UamAIGjTP+W/879s9liLSrmCVxXgq7xL+RKoQZ+UAAwBYQh4Rig2ZaVmytcNUuiO5/zP8jP1/+VMy/1RygyCgEMDDLv4CCZF3/S//OCZC8JaK7qfiQiTgxILdAAYYYEEhVLrP///S1HoCosaCoCCYZrZUSBkQDwESH/WkJSAZjByJI0oE4Z/////4FCQeBkVZ/xX/zIsRd/6hf7X//4qSfqwEEiLv1ciEyISQKqTEFNRTMuMTAwqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=\"","/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","// Default to a dummy \"batch\" implementation that just runs the callback\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\nlet batch = defaultNoopBatch; // Allow injecting another batching function later\n\nexport const setBatch = newBatch => batch = newBatch; // Supply a getter just to skip dealing with ESM bindings\n\nexport const getBatch = () => batch;","import * as React from 'react';\nconst ContextKey = Symbol.for(`react-redux-context`);\nconst gT = typeof globalThis !== \"undefined\" ? globalThis :\n/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */\n{};\n\nfunction getContext() {\n var _gT$ContextKey;\n\n if (!React.createContext) return {};\n const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map();\n let realContext = contextMap.get(React.createContext);\n\n if (!realContext) {\n realContext = React.createContext(null);\n\n if (process.env.NODE_ENV !== 'production') {\n realContext.displayName = 'ReactRedux';\n }\n\n contextMap.set(React.createContext, realContext);\n }\n\n return realContext;\n}\n\nexport const ReactReduxContext = /*#__PURE__*/getContext();\nexport default ReactReduxContext;","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n\n/**\r\n * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useReduxContext` hook bound to the specified context.\r\n */\nexport function createReduxContextHook(context = ReactReduxContext) {\n return function useReduxContext() {\n const contextValue = useContext(context);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');\n }\n\n return contextValue;\n };\n}\n/**\r\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @returns {any} the value of the `ReactReduxContext`\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useReduxContext } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const { store } = useReduxContext()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport const useReduxContext = /*#__PURE__*/createReduxContextHook();","export const notInitialized = () => {\n throw new Error('uSES not initialized!');\n};","import { useCallback, useDebugValue, useRef } from 'react';\nimport { createReduxContextHook, useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport { ReactReduxContext } from '../components/Context';\nimport { notInitialized } from '../utils/useSyncExternalStore';\nlet useSyncExternalStoreWithSelector = notInitialized;\nexport const initializeUseSelector = fn => {\n useSyncExternalStoreWithSelector = fn;\n};\n\nconst refEquality = (a, b) => a === b;\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context = ReactReduxContext) {\n const useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : createReduxContextHook(context);\n return function useSelector(selector, equalityFnOrOptions = {}) {\n const {\n equalityFn = refEquality,\n stabilityCheck = undefined,\n noopCheck = undefined\n } = typeof equalityFnOrOptions === 'function' ? {\n equalityFn: equalityFnOrOptions\n } : equalityFnOrOptions;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n\n if (typeof selector !== 'function') {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n\n if (typeof equalityFn !== 'function') {\n throw new Error(`You must pass a function as an equality function to useSelector`);\n }\n }\n\n const {\n store,\n subscription,\n getServerState,\n stabilityCheck: globalStabilityCheck,\n noopCheck: globalNoopCheck\n } = useReduxContext();\n const firstRun = useRef(true);\n const wrappedSelector = useCallback({\n [selector.name](state) {\n const selected = selector(state);\n\n if (process.env.NODE_ENV !== 'production') {\n const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck;\n\n if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) {\n const toCompare = selector(state);\n\n if (!equalityFn(selected, toCompare)) {\n let stack = undefined;\n\n try {\n throw new Error();\n } catch (e) {\n ;\n ({\n stack\n } = e);\n }\n\n console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {\n state,\n selected,\n selected2: toCompare,\n stack\n });\n }\n }\n\n const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck;\n\n if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {\n // @ts-ignore\n if (selected === state) {\n let stack = undefined;\n\n try {\n throw new Error();\n } catch (e) {\n ;\n ({\n stack\n } = e);\n }\n\n console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {\n stack\n });\n }\n }\n\n if (firstRun.current) firstRun.current = false;\n }\n\n return selected;\n }\n\n }[selector.name], [selector, globalStabilityCheck, stabilityCheck]);\n const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return <div>{counter}</div>\r\n * }\r\n */\n\nexport const useSelector = /*#__PURE__*/createSelectorHook();","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nfunction createListenerCollection() {\n const batch = getBatch();\n let first = null;\n let last = null;\n return {\n clear() {\n first = null;\n last = null;\n },\n\n notify() {\n batch(() => {\n let listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n\n get() {\n let listeners = [];\n let listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n\n subscribe(callback) {\n let isSubscribed = true;\n let listener = last = {\n callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n\n };\n}\n\nconst nullListeners = {\n notify() {},\n\n get: () => []\n};\nexport function createSubscription(store, parentSub) {\n let unsubscribe;\n let listeners = nullListeners; // Reasons to keep the subscription active\n\n let subscriptionsAmount = 0; // Is this specific subscription subscribed (or only nested ones?)\n\n let selfSubscribed = false;\n\n function addNestedSub(listener) {\n trySubscribe();\n const cleanupListener = listeners.subscribe(listener); // cleanup nested sub\n\n let removed = false;\n return () => {\n if (!removed) {\n removed = true;\n cleanupListener();\n tryUnsubscribe();\n }\n };\n }\n\n function notifyNestedSubs() {\n listeners.notify();\n }\n\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n\n function isSubscribed() {\n return selfSubscribed;\n }\n\n function trySubscribe() {\n subscriptionsAmount++;\n\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n\n function tryUnsubscribe() {\n subscriptionsAmount--;\n\n if (unsubscribe && subscriptionsAmount === 0) {\n unsubscribe();\n unsubscribe = undefined;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n\n function trySubscribeSelf() {\n if (!selfSubscribed) {\n selfSubscribed = true;\n trySubscribe();\n }\n }\n\n function tryUnsubscribeSelf() {\n if (selfSubscribed) {\n selfSubscribed = false;\n tryUnsubscribe();\n }\n }\n\n const subscription = {\n addNestedSub,\n notifyNestedSubs,\n handleChangeWrapper,\n isSubscribed,\n trySubscribe: trySubscribeSelf,\n tryUnsubscribe: tryUnsubscribeSelf,\n getListeners: () => listeners\n };\n return subscription;\n}","import * as React from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n// Matches logic in React's `shared/ExecutionEnvironment` file\n\nexport const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\nexport const useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect;","import * as React from 'react';\nimport { ReactReduxContext } from './Context';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\n\nfunction Provider({\n store,\n context,\n children,\n serverState,\n stabilityCheck = 'once',\n noopCheck = 'once'\n}) {\n const contextValue = React.useMemo(() => {\n const subscription = createSubscription(store);\n return {\n store,\n subscription,\n getServerState: serverState ? () => serverState : undefined,\n stabilityCheck,\n noopCheck\n };\n }, [store, serverState, stabilityCheck, noopCheck]);\n const previousState = React.useMemo(() => store.getState(), [store]);\n useIsomorphicLayoutEffect(() => {\n const {\n subscription\n } = contextValue;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return () => {\n subscription.tryUnsubscribe();\n subscription.onStateChange = undefined;\n };\n }, [contextValue, previousState]);\n const Context = context || ReactReduxContext; // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype\n\n return /*#__PURE__*/React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nexport default Provider;","import { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext, createReduxContextHook } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context = ReactReduxContext) {\n const useReduxContext = // @ts-ignore\n context === ReactReduxContext ? useDefaultReduxContext : // @ts-ignore\n createReduxContextHook(context);\n return function useStore() {\n const {\n store\n } = useReduxContext(); // @ts-ignore\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport const useStore = /*#__PURE__*/createStoreHook();","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context = ReactReduxContext) {\n const useStore = // @ts-ignore\n context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n const store = useStore(); // @ts-ignore\n\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n * <div>\r\n * <span>{value}</span>\r\n * <button onClick={increaseCounter}>Increase counter</button>\r\n * </div>\r\n * )\r\n * }\r\n */\n\nexport const useDispatch = /*#__PURE__*/createDispatchHook();","// The primary entry point assumes we're working with standard ReactDOM/RN, but\n// older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).\n// Because of that, the useSyncExternalStore compat shim is needed.\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport { setBatch } from './utils/batch';\nimport { initializeUseSelector } from './hooks/useSelector';\nimport { initializeConnect } from './components/connect';\ninitializeUseSelector(useSyncExternalStoreWithSelector);\ninitializeConnect(useSyncExternalStore); // Enable batched updates in our subscriptions for use\n// with standard React renderers (ReactDOM, React Native)\n\nsetBatch(batch);\nexport { batch };\nexport * from './exports';","import { setStage } from '@/store/stageReducer';\n\nimport page_flip_1 from '@/assets/se/page-flip-1.mp3';\nimport switch_1 from '@/assets/se/switch-1.mp3';\nimport mouse_enter from '@/assets/se/mouse-enter.mp3';\nimport dialog_se from '@/assets/se/dialog.mp3';\nimport click_se from '@/assets/se/click.mp3';\nimport { useDispatch } from 'react-redux';\nimport { webgalStore } from '@/store/store';\n\n/**\n * 调用音效\n */\nconst useSoundEffect = () => {\n const dispatch = useDispatch();\n\n const playSeEnter = () => {\n dispatch(setStage({ key: 'uiSe', value: mouse_enter }));\n };\n const playSeClick = () => {\n dispatch(setStage({ key: 'uiSe', value: click_se }));\n };\n const playSeSwitch = () => {\n dispatch(setStage({ key: 'uiSe', value: switch_1 }));\n };\n const playSePageChange = () => {\n dispatch(setStage({ key: 'uiSe', value: page_flip_1 }));\n };\n\n const playSeDialogOpen = () => {\n dispatch(setStage({ key: 'uiSe', value: dialog_se }));\n };\n\n return {\n playSeEnter,\n playSeClick,\n playSePageChange,\n playSeDialogOpen,\n playSeSwitch,\n };\n};\n\n/**\n * 调用音效(只供 choose.tsx 使用)\n */\nexport const useSEByWebgalStore = () => {\n const playSeEnter = () => {\n webgalStore.dispatch(setStage({ key: 'uiSe', value: mouse_enter }));\n };\n const playSeClick = () => {\n webgalStore.dispatch(setStage({ key: 'uiSe', value: click_se }));\n };\n return {\n playSeEnter, // 鼠标进入\n playSeClick, // 鼠标点击\n };\n};\n\nexport default useSoundEffect;\n","const escapeMap = [\n {\n reg: /\\\\\\\\/g,\n val: '\\\\',\n },\n {\n reg: /\\\\\\|/g,\n val: '|',\n },\n {\n reg: /\\\\:/g,\n val: ':',\n },\n {\n reg: /\\\\,/g,\n val: ',',\n },\n {\n reg: /\\\\;/g,\n val: ';',\n },\n {\n reg: /\\\\./g,\n val: '.',\n },\n];\nconst useEscape = (val: string): string => {\n let _res = val;\n for (let i of escapeMap) {\n _res = _res.replaceAll(i.reg, i.val);\n }\n return _res;\n};\nexport default useEscape;\n","import { IWebGALStyleObj } from 'webgal-parser/build/types/styleParser';\nimport { WebgalParser } from '@/Core/parser/sceneParser';\n\nexport function scss2cssinjsParser(scssString: string): IWebGALStyleObj {\n return WebgalParser.parseScssToWebgalStyleObj(scssString);\n}\n","import { useState } from 'react';\n\nexport function useValue<T>(initialState: T) {\n const [value, setValue] = useState<T>(initialState);\n return {\n _value: value,\n set: function (newValue: T) {\n this._value = newValue;\n setValue(newValue);\n },\n get value() {\n return this._value;\n },\n set value(newValue) {\n this.set(newValue);\n },\n };\n}\n","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, COMMENT, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule' || cache.compat) return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses) {\n var isNested = !!element.parent; // in nested rules comments become children of the \"auto-inserted\" rule and that's always the `element.parent`\n //\n // considering this input:\n // .a {\n // .b /* comm */ {}\n // color: hotpink;\n // }\n // we get output corresponding to this:\n // .a {\n // & {\n // /* comm */\n // color: hotpink;\n // }\n // .b {}\n // }\n\n var commentContainer = isNested ? element.parent.children : // global rule at the root level\n children;\n\n for (var i = commentContainer.length - 1; i >= 0; i--) {\n var node = commentContainer[i];\n\n if (node.line < element.line) {\n break;\n } // it is quite weird but comments are *usually* put at `column: element.column - 1`\n // so we seek *from the end* for the node that is earlier than the rule's `element` and check that\n // this will also match inputs like this:\n // .a {\n // /* comm */\n // .b {}\n // }\n //\n // but that is fine\n //\n // it would be the easiest to change the placement of the comment to be the first child of the rule:\n // .a {\n // .b { /* comm */ }\n // }\n // with such inputs we wouldn't have to search for the comment at all\n // TODO: consider changing this comment placement in the next major version\n\n\n if (node.column < element.column) {\n if (isIgnoringComment(node)) {\n return;\n }\n\n break;\n }\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","import createCache from '@emotion/cache';\nimport { serializeStyles } from '@emotion/serialize';\nimport { getRegisteredStyles, insertStyles } from '@emotion/utils';\n\nfunction insertWithoutScoping(cache, serialized) {\n if (cache.inserted[serialized.name] === undefined) {\n return cache.insert('', serialized, cache.sheet, true);\n }\n}\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar createEmotion = function createEmotion(options) {\n var cache = createCache(options); // $FlowFixMe\n\n cache.sheet.speedy = function (value) {\n if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) {\n throw new Error('speedy must be changed before any rules are inserted');\n }\n\n this.isSpeedy = value;\n };\n\n cache.compat = true;\n\n var css = function css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered, undefined);\n insertStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var keyframes = function keyframes() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n var animation = \"animation-\" + serialized.name;\n insertWithoutScoping(cache, {\n name: serialized.name,\n styles: \"@keyframes \" + animation + \"{\" + serialized.styles + \"}\"\n });\n return animation;\n };\n\n var injectGlobal = function injectGlobal() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n insertWithoutScoping(cache, serialized);\n };\n\n var cx = function cx() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n return {\n css: css,\n cx: cx,\n injectGlobal: injectGlobal,\n keyframes: keyframes,\n hydrate: function hydrate(ids) {\n ids.forEach(function (key) {\n cache.inserted[key] = true;\n });\n },\n flush: function flush() {\n cache.registered = {};\n cache.inserted = {};\n cache.sheet.flush();\n },\n // $FlowFixMe\n sheet: cache.sheet,\n cache: cache,\n getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),\n merge: merge.bind(null, cache.registered, css)\n };\n};\n\nvar classnames = function classnames(args) {\n var cls = '';\n\n for (var i = 0; i < args.length; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nexport { createEmotion as default };\n","import createEmotion from '../create-instance/dist/emotion-css-create-instance.esm.js';\nimport '@emotion/cache';\nimport '@emotion/serialize';\nimport '@emotion/utils';\n\nvar _createEmotion = createEmotion({\n key: 'css'\n}),\n flush = _createEmotion.flush,\n hydrate = _createEmotion.hydrate,\n cx = _createEmotion.cx,\n merge = _createEmotion.merge,\n getRegisteredStyles = _createEmotion.getRegisteredStyles,\n injectGlobal = _createEmotion.injectGlobal,\n keyframes = _createEmotion.keyframes,\n css = _createEmotion.css,\n sheet = _createEmotion.sheet,\n cache = _createEmotion.cache;\n\nexport { cache, css, cx, flush, getRegisteredStyles, hydrate, injectGlobal, keyframes, merge, sheet };\n","import { useEffect } from 'react';\nimport { WebGAL } from '@/Core/WebGAL';\nimport axios from 'axios';\nimport { scss2cssinjsParser } from '@/Core/controller/customUI/scss2cssinjsParser';\nimport { useValue } from '@/hooks/useValue';\nimport { css, injectGlobal } from '@emotion/css';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { IWebGALStyleObj } from 'webgal-parser/build/types/styleParser';\nimport { logger } from '@/Core/util/logger';\n\nexport default function useApplyStyle(url: string) {\n const styleObject = useValue<IWebGALStyleObj>({ classNameStyles: {}, others: '' });\n const replaced = useSelector((state: RootState) => state.stage.replacedUIlable);\n\n const applyStyle = (classNameLable: string, fallbackClassName: string) => {\n // 先看看是否被用户用 applyStyle 指令替换了类名\n const className = replaced?.[classNameLable] ?? classNameLable;\n if (Object.keys(styleObject.value.classNameStyles).includes(className)) {\n const cijClassName = css(styleObject.value.classNameStyles?.[className] ?? '');\n return `${fallbackClassName} ${cijClassName}`;\n }\n return fallbackClassName;\n };\n\n const updateStyleFile = async () => {\n logger.debug('更新 Scss 文件', url);\n const resp = await axios.get(`game/template/${url}`);\n const scssStr = resp.data;\n styleObject.set(scss2cssinjsParser(scssStr));\n };\n\n useEffect(() => {\n updateStyleFile();\n }, []);\n\n useEffect(() => {\n injectGlobal(styleObject.value.others);\n }, [styleObject.value.others]);\n\n useRigisterStyleUpdate(updateStyleFile);\n\n return applyStyle;\n}\n\nfunction useRigisterStyleUpdate(callback: Function) {\n const handler = () => {\n callback();\n };\n useEffect(() => {\n WebGAL.events.styleUpdate.on(handler);\n return () => WebGAL.events.styleUpdate.off(handler);\n }, []);\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { changeScene } from '@/Core/controller/scene/changeScene';\nimport { jmp } from '@/Core/gameScripts/label/jmp';\nimport ReactDOM from 'react-dom';\nimport React from 'react';\nimport styles from './choose.module.scss';\nimport { webgalStore } from '@/store/store';\nimport { textFont } from '@/store/userDataInterface';\nimport { PerformController } from '@/Core/Modules/perform/performController';\nimport { useSEByWebgalStore } from '@/hooks/useSoundEffect';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { whenChecker } from '@/Core/controller/gamePlay/scriptExecutor';\nimport useEscape from '@/hooks/useEscape';\nimport useApplyStyle from '@/hooks/useApplyStyle';\nimport { Provider } from 'react-redux';\n\nclass ChooseOption {\n /**\n * 格式:\n * (showConditionVar>1)[enableConditionVar>2]->text:jump\n */\n public static parse(script: string): ChooseOption {\n const parts = script.split('->');\n const conditonPart = parts.length > 1 ? parts[0] : null;\n const mainPart = parts.length > 1 ? parts[1] : parts[0];\n const mainPartNodes = mainPart.split(/(?<!\\\\):/g);\n const option = new ChooseOption(mainPartNodes[0], mainPartNodes[1]);\n if (conditonPart !== null) {\n const showConditionPart = conditonPart.match(/\\((.*)\\)/);\n if (showConditionPart) {\n option.showCondition = showConditionPart[1];\n }\n const enableConditionPart = conditonPart.match(/\\[(.*)\\]/);\n if (enableConditionPart) {\n option.enableCondition = enableConditionPart[1];\n }\n }\n return option;\n }\n public text: string;\n public jump: string;\n public jumpToScene: boolean;\n public showCondition?: string;\n public enableCondition?: string;\n\n public constructor(text: string, jump: string) {\n this.text = useEscape(text);\n this.jump = jump;\n this.jumpToScene = jump.match(/(?<!\\\\)\\./) !== null;\n }\n}\n\n/**\n * 显示选择枝\n * @param sentence\n */\nexport const choose = (sentence: ISentence): IPerform => {\n const chooseOptionScripts = sentence.content.split(/(?<!\\\\)\\|/);\n const chooseOptions = chooseOptionScripts.map((e) => ChooseOption.parse(e));\n\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(\n <Provider store={webgalStore}>\n <Choose chooseOptions={chooseOptions} />\n </Provider>,\n document.getElementById('chooseContainer'),\n );\n return {\n performName: 'choose',\n duration: 1000 * 60 * 60 * 24,\n isHoldOn: false,\n stopFunction: () => {\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(<div />, document.getElementById('chooseContainer'));\n },\n blockingNext: () => true,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n\nfunction Choose(props: { chooseOptions: ChooseOption[] }) {\n const fontFamily = webgalStore.getState().userData.optionData.textboxFont;\n const font = fontFamily === textFont.song ? '\"思源宋体\", serif' : '\"WebgalUI\", serif';\n const { playSeEnter, playSeClick } = useSEByWebgalStore();\n const applyStyle = useApplyStyle('Stage/Choose/choose.scss');\n // 运行时计算JSX.Element[]\n const runtimeBuildList = (chooseListFull: ChooseOption[]) => {\n return chooseListFull\n .filter((e, i) => whenChecker(e.showCondition))\n .map((e, i) => {\n const enable = whenChecker(e.enableCondition);\n const className = enable\n ? applyStyle('Choose_item', styles.Choose_item)\n : applyStyle('Choose_item_disabled', styles.Choose_item_disabled);\n const onClick = enable\n ? () => {\n playSeClick();\n if (e.jumpToScene) {\n changeScene(e.jump, e.text);\n } else {\n jmp(e.jump);\n }\n WebGAL.gameplay.performController.unmountPerform('choose');\n }\n : () => {};\n return (\n <div className={applyStyle('Choose_item_outer', styles.Choose_item_outer)} key={e.jump + i}>\n <div className={className} style={{ fontFamily: font }} onClick={onClick} onMouseEnter={playSeEnter}>\n {e.text}\n </div>\n </div>\n );\n });\n };\n\n return <div className={applyStyle('Choose_Main', styles.Choose_Main)}>{runtimeBuildList(props.chooseOptions)}</div>;\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { logger } from '@/Core/util/logger';\n\n/**\n * 注释,打LOG\n * @param sentence\n */\nexport const comment = (sentence: ISentence): IPerform => {\n logger.debug(`脚本内注释${sentence.content}`);\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\n\n/**\n * 语句执行的模板代码\n * @param sentence\n */\nexport const filmMode = (sentence: ISentence): IPerform => {\n if (sentence.content !== '' && sentence.content !== 'none') {\n webgalStore.dispatch(setStage({ key: 'enableFilm', value: sentence.content }));\n } else {\n webgalStore.dispatch(setStage({ key: 'enableFilm', value: '' }));\n }\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { changeScene } from '@/Core/controller/scene/changeScene';\nimport { jmp } from '@/Core/gameScripts/label/jmp';\nimport ReactDOM from 'react-dom';\nimport React from 'react';\nimport styles from './getUserInput.module.scss';\nimport { webgalStore } from '@/store/store';\nimport { textFont } from '@/store/userDataInterface';\nimport { PerformController } from '@/Core/Modules/perform/performController';\nimport { useSEByWebgalStore } from '@/hooks/useSoundEffect';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport { setStageVar } from '@/store/stageReducer';\n\n/**\n * 显示选择枝\n * @param sentence\n */\nexport const getUserInput = (sentence: ISentence): IPerform => {\n const varKey = sentence.content.toString().trim();\n const titleFromArgs = getSentenceArgByKey(sentence, 'title');\n const title = (titleFromArgs === 0 ? 'Please Input' : titleFromArgs) ?? 'Please Input';\n const buttonTextFromArgs = getSentenceArgByKey(sentence, 'buttonText');\n const buttonText = (buttonTextFromArgs === 0 ? 'OK' : buttonTextFromArgs) ?? 'OK';\n const fontFamily = webgalStore.getState().userData.optionData.textboxFont;\n const font = fontFamily === textFont.song ? '\"思源宋体\", serif' : '\"WebgalUI\", serif';\n const { playSeEnter, playSeClick } = useSEByWebgalStore();\n const chooseElements = (\n <div style={{ fontFamily: font }} className={styles.glabalDialog_container}>\n <div className={styles.glabalDialog_container_inner}>\n <div className={styles.title}>{title}</div>\n <input id=\"user-input\" className={styles.Choose_item} />\n <div\n onMouseEnter={playSeEnter}\n onClick={() => {\n const userInput: HTMLInputElement = document.getElementById('user-input') as HTMLInputElement;\n if (userInput) {\n webgalStore.dispatch(\n setStageVar({ key: varKey, value: (userInput?.value ?? '') === '' ? ' ' : userInput?.value ?? '' }),\n );\n }\n playSeClick();\n WebGAL.gameplay.performController.unmountPerform('userInput');\n nextSentence();\n }}\n className={styles.button}\n >\n {buttonText}\n </div>\n </div>\n </div>\n );\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(\n <div className={styles.Choose_Main}>{chooseElements}</div>,\n document.getElementById('chooseContainer'),\n );\n return {\n performName: 'userInput',\n duration: 1000 * 60 * 60 * 24,\n isHoldOn: false,\n stopFunction: () => {\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(<div />, document.getElementById('chooseContainer'));\n },\n blockingNext: () => true,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport styles from '@/Stage/FullScreenPerform/fullScreenPerform.module.scss';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport { PerformController } from '@/Core/Modules/perform/performController';\nimport { logger } from '@/Core/util/logger';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { replace } from 'lodash';\nimport useEscape from '@/hooks/useEscape';\n/**\n * 显示一小段黑屏演示\n * @param sentence\n */\nexport const intro = (sentence: ISentence): IPerform => {\n /**\n * intro 内部控制\n */\n\n const performName = `introPerform${Math.random().toString()}`;\n let fontSize: string | undefined;\n let backgroundColor: any = 'rgba(0, 0, 0, 1)';\n let color: any = 'rgba(255, 255, 255, 1)';\n const animationClass: any = (type: string, length = 0) => {\n switch (type) {\n case 'fadeIn':\n return styles.fadeIn;\n case 'slideIn':\n return styles.slideIn;\n case 'typingEffect':\n return `${styles.typingEffect} ${length}`;\n case 'pixelateEffect':\n return styles.pixelateEffect;\n case 'revealAnimation':\n return styles.revealAnimation;\n default:\n return styles.fadeIn;\n }\n };\n let chosenAnimationClass = styles.fadeIn;\n let delayTime = 1500;\n let isHold = false;\n\n for (const e of sentence.args) {\n if (e.key === 'backgroundColor') {\n backgroundColor = e.value || 'rgba(0, 0, 0, 1)';\n }\n if (e.key === 'fontColor') {\n color = e.value || 'rgba(255, 255, 255, 1)';\n }\n if (e.key === 'fontSize') {\n switch (e.value) {\n case 'small':\n fontSize = '280%';\n break;\n case 'medium':\n fontSize = '350%';\n break;\n case 'large':\n fontSize = '420%';\n break;\n }\n }\n if (e.key === 'animation') {\n chosenAnimationClass = animationClass(e.value);\n }\n if (e.key === 'delayTime') {\n const parsedValue = parseInt(e.value.toString(), 10);\n delayTime = isNaN(parsedValue) ? delayTime : parsedValue;\n }\n if (e.key === 'hold') {\n if (e.value === true) {\n isHold = true;\n }\n }\n }\n\n const introContainerStyle = {\n background: backgroundColor,\n color: color,\n fontSize: fontSize || '350%',\n width: '100%',\n height: '100%',\n };\n const introArray: Array<string> = sentence.content.split(/(?<!\\\\)\\|/).map((val: string) => useEscape(val));\n\n let endWait = 1000;\n let baseDuration = endWait + delayTime * introArray.length;\n const duration = isHold ? 1000 * 60 * 60 * 24 : 1000 + delayTime * introArray.length;\n let isBlocking = true;\n let setBlockingStateTimeout = setTimeout(() => {\n isBlocking = false;\n }, baseDuration);\n\n let timeout = setTimeout(() => {});\n const toNextIntroElement = () => {\n const introContainer = document.getElementById('introContainer');\n // 由于用户操作,相当于时间向前推进,这时候更新这个演出的预计完成时间\n baseDuration -= delayTime;\n clearTimeout(setBlockingStateTimeout);\n setBlockingStateTimeout = setTimeout(() => {\n isBlocking = false;\n }, baseDuration);\n if (introContainer) {\n const children = introContainer.childNodes[0].childNodes[0].childNodes as any;\n const len = children.length;\n children.forEach((node: HTMLDivElement, index: number) => {\n // 当前语句的延迟显示时间\n const currentDelay = Number(node.style.animationDelay.split('ms')[0]);\n // 当前语句还没有显示,降低显示延迟,因为现在时间因为用户操作,相当于向前推进了\n if (currentDelay > 0) {\n node.style.animationDelay = `${currentDelay - delayTime}ms`;\n }\n // 最后一个元素了\n if (index === len - 1) {\n // 并且已经完全显示了,这时候进行下一步\n if (currentDelay === 0) {\n clearTimeout(timeout);\n WebGAL.gameplay.performController.unmountPerform(performName);\n // 卸载函数发生在 nextSentence 生效前,所以不需要做下一行的操作。\n // setTimeout(nextSentence, 0);\n } else {\n // 还没有完全显示,但是因为时间的推进,要提前完成演出,更新用于结束演出的计时器\n clearTimeout(timeout);\n // 如果 Hold 了,自然不要自动结束\n if (!isHold) {\n timeout = setTimeout(() => {\n WebGAL.gameplay.performController.unmountPerform(performName);\n }, baseDuration);\n }\n }\n }\n });\n }\n };\n\n /**\n * 接受 next 事件\n */\n WebGAL.events.userInteractNext.on(toNextIntroElement);\n\n const showIntro = introArray.map((e, i) => (\n <div\n key={'introtext' + i + Math.random().toString()}\n style={{ animationDelay: `${delayTime * i}ms` }}\n className={chosenAnimationClass}\n >\n {e}\n {e === '' ? '\\u00a0' : ''}\n </div>\n ));\n const intro = (\n <div style={introContainerStyle}>\n <div style={{ padding: '3em 4em 3em 4em' }}>{showIntro}</div>\n </div>\n );\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(intro, document.getElementById('introContainer'));\n const introContainer = document.getElementById('introContainer');\n\n if (introContainer) {\n introContainer.style.display = 'block';\n }\n\n return {\n performName,\n duration,\n isHoldOn: false,\n stopFunction: () => {\n const introContainer = document.getElementById('introContainer');\n if (introContainer) {\n introContainer.style.display = 'none';\n }\n WebGAL.events.userInteractNext.off(toNextIntroElement);\n },\n blockingNext: () => isBlocking,\n blockingAuto: () => isBlocking,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n goNextWhenOver: true,\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\n\n/**\n * 标签代码,什么也不做\n * @param sentence\n */\nexport const label = (sentence: ISentence): IPerform => {\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\n\n/**\n * 显示小头像\n * @param sentence\n */\nexport const miniAvatar = (sentence: ISentence): IPerform => {\n let content = sentence.content;\n if (sentence.content === 'none' || sentence.content === '') {\n content = '';\n }\n webgalStore.dispatch(setStage({ key: 'miniAvatar', value: content }));\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: true,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import type { Container } from 'pixi.js';\nimport { logger } from '../logger';\n\n/**\n * 特效执行返回的结果\n */\nexport type IResult<R extends Omit<Record<string | symbol | number, unknown>, 'container' | 'tickerKey'> = {}> = {\n container: Container;\n tickerKey: string;\n} & R;\n\ntype IName = string | (() => string);\ntype IPerformCallback = () => IResult;\n\nconst performs = new Map<string, IPerformCallback>();\n\n/**\n * 获取名称, 可能报空\n * @param name 名称或者返回名称的函数\n * @returns {string}\n */\nfunction getName(name: IName): string | null {\n if (!name) return null;\n if (typeof name === 'string') return name;\n return name();\n}\n\n/**\n * 获取名称, 不会报空\n * @param name 名称或者返回名称的函数\n * @returns {string}\n */\nfunction getKey(name: IName): string {\n const key = getName(name);\n if (!key) {\n logger.error('Get name of perform failed. There no name of the perform.');\n return '';\n }\n return key;\n}\n\n/**\n * 注册特效, 注意, 同名会注销旧特效\n * @param name 特效名\n * @param callback 调用特效的函数\n */\nexport function registerPerform(name: IName, callback: IPerformCallback): void {\n if (!callback || typeof callback !== 'function') throw new Error(`\"${name}\" is not a callback.`);\n performs.set(getKey(name), callback);\n}\n\n/**\n * 调用特效\n * @param name 特效名\n * @param args 自定义的参数\n * @returns {IResult}\n */\nexport function call(name: IName, args: unknown[] = []): IResult {\n const callback = performs.get(getKey(name));\n\n if (!callback || !(callback instanceof Function)) {\n logger.error(`Can\\'t call the perform named \"${name}\"`);\n throw new Error(`\"${name}\" don't have the pixiPerform callback.`);\n }\n return (callback as IPerformCallback)(...(args as []));\n}\n\n/**\n * 注销特效\n * @param name 特效名\n */\nexport function unregisterPerform(name: IName) {\n performs.delete(getKey(name));\n}\n\n/**\n * 获取全部可调用的特效特效名\n */\nexport function getPerforms(): string[] {\n return [...performs.keys()];\n}\n\nimport('./initRegister');\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { logger } from '@/Core/util/logger';\nimport { IResult, call } from '../../util/pixiPerformManager/pixiPerformManager';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 运行一段pixi演出\n * @param sentence\n */\nexport const pixi = (sentence: ISentence): IPerform => {\n const pixiPerformName = 'PixiPerform' + sentence.content;\n WebGAL.gameplay.performController.performList.forEach((e) => {\n if (e.performName === pixiPerformName) {\n return {\n performName: 'none',\n duration: 0,\n isOver: false,\n isHoldOn: true,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => false,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n }\n });\n const res: IResult = call(sentence.content);\n const { container, tickerKey } = res;\n\n return {\n performName: pixiPerformName,\n duration: 0,\n isHoldOn: true,\n stopFunction: () => {\n logger.warn('现在正在卸载pixi演出');\n container.destroy({ texture: true, baseTexture: true });\n WebGAL.gameplay.pixiStage?.effectsContainer.removeChild(container);\n WebGAL.gameplay.pixiStage?.removeAnimation(tickerKey);\n },\n blockingNext: () => false,\n blockingAuto: () => false,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { logger } from '@/Core/util/logger';\nimport { RootState, webgalStore } from '@/store/store';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { useSelector } from 'react-redux';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 播放一段效果音\n * @param sentence 语句\n */\nexport const playEffect = (sentence: ISentence): IPerform => {\n logger.debug('play SE');\n // 如果有ID,这里被覆写,一般用于循环的情况\n // 有循环参数且有 ID,就循环\n let performInitName = 'effect-sound';\n // 清除先前的效果音\n WebGAL.gameplay.performController.unmountPerform(performInitName, true);\n let url = sentence.content;\n let isLoop = false;\n // 清除带 id 的效果音\n if (getSentenceArgByKey(sentence, 'id')) {\n const id = getSentenceArgByKey(sentence, 'id')?.toString() ?? '';\n performInitName = `effect-sound-${id}`;\n WebGAL.gameplay.performController.unmountPerform(performInitName, true);\n isLoop = true;\n }\n let isOver = false;\n return {\n performName: 'none',\n blockingAuto(): boolean {\n return false;\n },\n blockingNext(): boolean {\n return false;\n },\n isHoldOn: false,\n stopFunction(): void {},\n stopTimeout: undefined,\n\n duration: 1000 * 60 * 60,\n arrangePerformPromise: new Promise((resolve) => {\n // 播放效果音\n setTimeout(() => {\n const volumeArg = getSentenceArgByKey(sentence, 'volume');\n let seElement = document.createElement('audio');\n seElement.src = url;\n if (isLoop) {\n seElement.loop = true;\n }\n const userDataState = webgalStore.getState().userData;\n const mainVol = userDataState.optionData.volumeMain;\n // Work when volumeArg is a number between 0 and 100\n const volume = typeof volumeArg === 'number' && volumeArg >= 0 && volumeArg <= 100 ? volumeArg : 100;\n const seVol = mainVol * 0.01 * (userDataState.optionData?.seVolume ?? 100) * 0.01 * volume * 0.01;\n seElement.volume = seVol;\n seElement.currentTime = 0;\n const perform = {\n performName: performInitName,\n duration: 1000 * 60 * 60,\n isHoldOn: isLoop,\n skipNextCollect: true,\n stopFunction: () => {\n // 演出已经结束了,所以不用播放效果音了\n seElement.pause();\n },\n blockingNext: () => false,\n blockingAuto: () => {\n // loop 的话就不 block auto\n if (isLoop) return false;\n return !isOver;\n },\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n resolve(perform);\n seElement?.play();\n seElement.onended = () => {\n for (const e of WebGAL.gameplay.performController.performList) {\n if (e.performName === performInitName) {\n isOver = true;\n e.stopFunction();\n WebGAL.gameplay.performController.unmountPerform(e.performName);\n }\n }\n };\n }, 1);\n }),\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport styles from '@/Stage/FullScreenPerform/fullScreenPerform.module.scss';\nimport { webgalStore } from '@/store/store';\nimport { getRandomPerformName, PerformController } from '@/Core/Modules/perform/performController';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { WebGAL } from '@/Core/WebGAL';\n/**\n * 播放一段视频 * @param sentence\n */\nexport const playVideo = (sentence: ISentence): IPerform => {\n const userDataState = webgalStore.getState().userData;\n const mainVol = userDataState.optionData.volumeMain;\n const vocalVol = mainVol * 0.01 * userDataState.optionData.vocalVolume * 0.01;\n const bgmVol = mainVol * 0.01 * userDataState.optionData.bgmVolume * 0.01;\n const performInitName: string = getRandomPerformName();\n\n let blockingNext = getSentenceArgByKey(sentence, 'skipOff');\n let blockingNextFlag = false;\n if (blockingNext) {\n blockingNextFlag = true;\n }\n\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(\n <div className={styles.videoContainer}>\n <video className={styles.fullScreen_video} id=\"playVideoElement\" src={sentence.content} autoPlay={true} />\n </div>,\n document.getElementById('videoContainer'),\n );\n let isOver = false;\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => blockingNextFlag,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n arrangePerformPromise: new Promise<IPerform>((resolve) => {\n /**\n * 启动视频播放\n */\n setTimeout(() => {\n let VocalControl: any = document.getElementById('playVideoElement');\n if (VocalControl !== null) {\n VocalControl.currentTime = 0;\n VocalControl.volume = bgmVol;\n const endPerform = () => {\n for (const e of WebGAL.gameplay.performController.performList) {\n if (e.performName === performInitName) {\n isOver = true;\n e.stopFunction();\n WebGAL.gameplay.performController.unmountPerform(e.performName);\n }\n }\n };\n const skipVideo = () => {\n endPerform();\n };\n // 双击可跳过视频\n WebGAL.events.fullscreenDbClick.on(skipVideo);\n // 播放并作为一个特别演出加入\n const perform = {\n performName: performInitName,\n duration: 1000 * 60 * 60,\n isOver: false,\n isHoldOn: false,\n stopFunction: () => {\n WebGAL.events.fullscreenDbClick.off(skipVideo);\n /**\n * 恢复音量\n */\n const bgmElement: any = document.getElementById('currentBgm');\n if (bgmElement) {\n bgmElement.volume = bgmVol.toString();\n }\n const vocalElement: any = document.getElementById('currentVocal');\n if (bgmElement) {\n vocalElement.volume = vocalVol.toString();\n }\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(<div />, document.getElementById('videoContainer'));\n },\n blockingNext: () => blockingNextFlag,\n blockingAuto: () => {\n return !isOver;\n },\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n goNextWhenOver: true,\n };\n resolve(perform);\n /**\n * 把bgm和语音的音量设为0\n */\n const vocalVol2 = 0;\n const bgmVol2 = 0;\n const bgmElement: any = document.getElementById('currentBgm');\n if (bgmElement) {\n bgmElement.volume = bgmVol2.toString();\n }\n const vocalElement: any = document.getElementById('currentVocal');\n if (bgmElement) {\n vocalElement.volume = vocalVol2.toString();\n }\n\n VocalControl?.play();\n\n VocalControl.onended = () => {\n endPerform();\n };\n }\n }, 1);\n }),\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { IAnimationObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { logger } from '@/Core/util/logger';\nimport { webgalStore } from '@/store/store';\n\nimport { getAnimateDuration, getAnimationObject } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 设置背景动画\n * @param sentence\n */\nexport const setAnimation = (sentence: ISentence): IPerform => {\n const startDialogKey = webgalStore.getState().stage.currentDialogKey;\n const animationName = sentence.content;\n const animationDuration = getAnimateDuration(animationName);\n const target = (getSentenceArgByKey(sentence, 'target')?.toString() ?? 'default_id').toString();\n const key = `${target}-${animationName}-${animationDuration}`;\n let stopFunction;\n setTimeout(() => {\n WebGAL.gameplay.pixiStage?.stopPresetAnimationOnTarget(target);\n const animationObj: IAnimationObject | null = getAnimationObject(animationName, target, animationDuration);\n if (animationObj) {\n logger.debug(`动画${animationName}作用在${target}`, animationDuration);\n WebGAL.gameplay.pixiStage?.registerAnimation(animationObj, key, target);\n }\n }, 0);\n stopFunction = () => {\n setTimeout(() => {\n const endDialogKey = webgalStore.getState().stage.currentDialogKey;\n const isHasNext = startDialogKey !== endDialogKey;\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects(key);\n }, 0);\n };\n\n return {\n performName: key,\n duration: animationDuration,\n isHoldOn: false,\n stopFunction,\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { WebGAL } from '@/Core/WebGAL';\n\nexport function generateTestblurAnimationObj(targetKey: string, duration: number) {\n const target = WebGAL.gameplay.pixiStage!.getStageObjByKey(targetKey);\n\n // 先设置一个通用的初态\n\n // TODO:通用初态设置\n /**\n * 在此书写为动画设置初态的操作\n */\n function setStartState() {\n if (target) {\n target.pixiContainer.alpha = 0;\n // @ts-ignore\n target.pixiContainer.blur = 0;\n }\n }\n\n // TODO:通用终态设置\n /**\n * 在此书写为动画设置终态的操作\n */\n function setEndState() {\n if (target) {\n target.pixiContainer.alpha = 1;\n // @ts-ignore\n target.pixiContainer.blur = 5;\n }\n }\n\n /**\n * 在此书写动画每一帧执行的函数\n * @param delta\n */\n function tickerFunc(delta: number) {\n if (target) {\n const container = target.pixiContainer;\n const baseDuration = WebGAL.gameplay.pixiStage!.frameDuration;\n const currentAddOplityDelta = (duration / baseDuration) * delta;\n const increasement = 1 / currentAddOplityDelta;\n const decreasement = 5 / currentAddOplityDelta;\n if (container.alpha < 1) {\n container.alpha += increasement;\n }\n // @ts-ignore\n if (container.blur < 5) {\n // @ts-ignore\n container.blur += decreasement;\n }\n }\n }\n\n return {\n setStartState,\n setEndState,\n tickerFunc,\n };\n}\n","import { generateUniversalSoftInAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftIn';\nimport { generateUniversalSoftOffAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftOff';\nimport { generateTestblurAnimationObj } from '@/Core/controller/stage/pixi/animations/testblur';\n\nexport const webgalAnimations: Array<{ name: string; animationGenerateFunc: Function }> = [\n { name: 'universalSoftIn', animationGenerateFunc: generateUniversalSoftInAnimationObj },\n { name: 'universalSoftOff', animationGenerateFunc: generateUniversalSoftOffAnimationObj },\n { name: 'testblur', animationGenerateFunc: generateTestblurAnimationObj },\n];\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { webgalAnimations } from '@/Core/controller/stage/pixi/animations';\nimport { IAnimationObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { logger } from '@/Core/util/logger';\nimport { webgalStore } from '@/store/store';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 设置背景动画\n * @param sentence\n */\nexport const setComplexAnimation = (sentence: ISentence): IPerform => {\n const startDialogKey = webgalStore.getState().stage.currentDialogKey;\n const animationName = sentence.content;\n const animationDuration = (getSentenceArgByKey(sentence, 'duration') ?? 0) as number;\n const target = (getSentenceArgByKey(sentence, 'target')?.toString() ?? '0') as string;\n const key = `${target}-${animationName}-${animationDuration}`;\n const animationFunction: Function | null = getAnimationObject(animationName);\n let stopFunction: () => void = () => {};\n if (animationFunction) {\n logger.debug(`动画${animationName}作用在${target}`, animationDuration);\n const animationObj: IAnimationObject = animationFunction(target, animationDuration);\n WebGAL.gameplay.pixiStage?.stopPresetAnimationOnTarget(target);\n WebGAL.gameplay.pixiStage?.registerAnimation(animationObj, key, target);\n stopFunction = () => {\n const endDialogKey = webgalStore.getState().stage.currentDialogKey;\n const isHasNext = startDialogKey !== endDialogKey;\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects(key);\n };\n }\n return {\n performName: key,\n duration: animationDuration,\n isHoldOn: false,\n stopFunction,\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n\nfunction getAnimationObject(animationName: string): Function | null {\n const result = webgalAnimations.find((e) => e.name === animationName);\n logger.debug('装载动画', result);\n if (result) {\n return result.animationGenerateFunc;\n }\n return null;\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\n\n/**\n * 设置背景效果\n * @param sentence\n */\nexport const setFilter = (sentence: ISentence): IPerform => {\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { IAnimationObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { logger } from '@/Core/util/logger';\nimport { webgalStore } from '@/store/store';\nimport { generateTimelineObj } from '@/Core/controller/stage/pixi/animations/timeline';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { baseTransform } from '@/store/stageInterface';\nimport { IUserAnimation } from '../Modules/animations';\nimport { getAnimateDuration, getAnimationObject } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 设置临时动画\n * @param sentence\n */\nexport const setTempAnimation = (sentence: ISentence): IPerform => {\n const startDialogKey = webgalStore.getState().stage.currentDialogKey;\n const animationName = (Math.random() * 10).toString(16);\n const animationString = sentence.content;\n let animationObj;\n try {\n animationObj = JSON.parse(animationString);\n } catch (e) {\n animationObj = [];\n }\n const newAnimation: IUserAnimation = { name: animationName, effects: animationObj };\n WebGAL.animationManager.addAnimation(newAnimation);\n const animationDuration = getAnimateDuration(animationName);\n const target = (getSentenceArgByKey(sentence, 'target')?.toString() ?? '0') as string;\n const key = `${target}-${animationName}-${animationDuration}`;\n let stopFunction = () => {};\n setTimeout(() => {\n WebGAL.gameplay.pixiStage?.stopPresetAnimationOnTarget(target);\n const animationObj: IAnimationObject | null = getAnimationObject(animationName, target, animationDuration);\n if (animationObj) {\n logger.debug(`动画${animationName}作用在${target}`, animationDuration);\n WebGAL.gameplay.pixiStage?.registerAnimation(animationObj, key, target);\n }\n }, 0);\n stopFunction = () => {\n setTimeout(() => {\n const endDialogKey = webgalStore.getState().stage.currentDialogKey;\n const isHasNext = startDialogKey !== endDialogKey;\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects(key);\n }, 0);\n };\n\n return {\n performName: key,\n duration: animationDuration,\n isHoldOn: false,\n stopFunction,\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\n\n/**\n * 语句执行的模板代码\n * @param sentence\n */\nexport function setTextbox(sentence: ISentence): IPerform {\n if (sentence.content === 'hide') {\n webgalStore.dispatch(setStage({ key: 'isDisableTextbox', value: true }));\n } else {\n webgalStore.dispatch(setStage({ key: 'isDisableTextbox', value: false }));\n }\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { IAnimationObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { logger } from '@/Core/util/logger';\nimport { webgalStore } from '@/store/store';\nimport { generateTimelineObj } from '@/Core/controller/stage/pixi/animations/timeline';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { baseTransform, ITransform } from '@/store/stageInterface';\nimport { IUserAnimation } from '../Modules/animations';\nimport { generateTransformAnimationObj } from '@/Core/controller/stage/pixi/animations/generateTransformAnimationObj';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 设置变换\n * @param sentence\n */\nexport const setTransform = (sentence: ISentence): IPerform => {\n const startDialogKey = webgalStore.getState().stage.currentDialogKey;\n const animationName = (Math.random() * 10).toString(16);\n const animationString = sentence.content;\n let animationObj: (ITransform & {\n duration: number;\n })[];\n const duration = getSentenceArgByKey(sentence, 'duration');\n const target = (getSentenceArgByKey(sentence, 'target')?.toString() ?? '0') as string;\n try {\n const frame = JSON.parse(animationString) as ITransform & { duration: number };\n animationObj = generateTransformAnimationObj(target, frame, duration);\n } catch (e) {\n // 解析都错误了,歇逼吧\n animationObj = [];\n }\n\n const newAnimation: IUserAnimation = { name: animationName, effects: animationObj };\n WebGAL.animationManager.addAnimation(newAnimation);\n const animationDuration = getAnimateDuration(animationName);\n\n const key = `${target}-${animationName}-${animationDuration}`;\n let stopFunction = () => {};\n setTimeout(() => {\n WebGAL.gameplay.pixiStage?.stopPresetAnimationOnTarget(target);\n const animationObj: IAnimationObject | null = getAnimationObject(animationName, target, animationDuration);\n if (animationObj) {\n logger.debug(`动画${animationName}作用在${target}`, animationDuration);\n WebGAL.gameplay.pixiStage?.registerAnimation(animationObj, key, target);\n }\n }, 0);\n stopFunction = () => {\n setTimeout(() => {\n const endDialogKey = webgalStore.getState().stage.currentDialogKey;\n const isHasNext = startDialogKey !== endDialogKey;\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects(key);\n }, 0);\n };\n\n return {\n performName: key,\n duration: animationDuration,\n isHoldOn: false,\n stopFunction,\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n\nfunction getAnimationObject(animationName: string, target: string, duration: number) {\n const effect = WebGAL.animationManager.getAnimations().find((ani) => ani.name === animationName);\n if (effect) {\n const mappedEffects = effect.effects.map((effect) => {\n const newEffect = cloneDeep({ ...baseTransform, duration: 0 });\n Object.assign(newEffect, effect);\n newEffect.duration = effect.duration;\n return newEffect;\n });\n logger.debug('装载自定义动画', mappedEffects);\n return generateTimelineObj(mappedEffects, target, duration);\n }\n return null;\n}\n\nfunction getAnimateDuration(animationName: string) {\n const effect = WebGAL.animationManager.getAnimations().find((ani) => ani.name === animationName);\n if (effect) {\n let duration = 0;\n effect.effects.forEach((e) => {\n duration += e.duration;\n });\n return duration;\n }\n return 0;\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { setStage } from '@/store/stageReducer';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 设置转场效果\n * @param sentence\n */\nexport const setTransition = (sentence: ISentence): IPerform => {\n // 根据参数设置指定位置\n let key = '0';\n for (const e of sentence.args) {\n if (e.key === 'target') {\n key = e.value.toString();\n }\n }\n if (getSentenceArgByKey(sentence, 'enter')) {\n WebGAL.animationManager.nextEnterAnimationName.set(key, getSentenceArgByKey(sentence, 'enter')!.toString());\n }\n if (getSentenceArgByKey(sentence, 'exit')) {\n WebGAL.animationManager.nextExitAnimationName.set(key + '-off', getSentenceArgByKey(sentence, 'exit')!.toString());\n }\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => false,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { unlockBgmInUserData } from '@/store/userDataReducer';\nimport localforage from 'localforage';\nimport { logger } from '@/Core/util/logger';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 解锁bgm\n * @param sentence\n */\nexport const unlockBgm = (sentence: ISentence): IPerform => {\n const url = sentence.content;\n let name = sentence.content;\n let series = 'default';\n sentence.args.forEach((e) => {\n if (e.key === 'name') {\n name = e.value.toString();\n }\n if (e.key === 'series') {\n series = e.value.toString();\n }\n });\n logger.info(`解锁BGM:${name},路径:${url},所属系列:${series}`);\n webgalStore.dispatch(unlockBgmInUserData({ name, url, series }));\n const userDataState = webgalStore.getState().userData;\n localforage.setItem(WebGAL.gameKey, userDataState).then(() => {});\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { unlockCgInUserData } from '@/store/userDataReducer';\nimport { logger } from '@/Core/util/logger';\nimport localforage from 'localforage';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 解锁cg\n * @param sentence\n */\nexport const unlockCg = (sentence: ISentence): IPerform => {\n const url = sentence.content;\n let name = sentence.content;\n let series = 'default';\n sentence.args.forEach((e) => {\n if (e.key === 'name') {\n name = e.value.toString();\n }\n if (e.key === 'series') {\n series = e.value.toString();\n }\n });\n logger.info(`解锁CG:${name},路径:${url},所属系列:${series}`);\n webgalStore.dispatch(unlockCgInUserData({ name, url, series }));\n const userDataState = webgalStore.getState().userData;\n localforage.setItem(WebGAL.gameKey, userDataState).then(() => {});\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { initState, resetStageState, setStage } from '@/store/stageReducer';\nimport { webgalStore } from '@/store/store';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport const resetStage = (resetBacklog: boolean, resetSceneAndVar = true) => {\n /**\n * 清空运行时\n */\n if (resetBacklog) {\n WebGAL.backlogManager.makeBacklogEmpty();\n }\n // 清空sceneData,并重新获取\n if (resetSceneAndVar) {\n WebGAL.sceneManager.resetScene();\n }\n\n // 清空所有演出和timeOut\n WebGAL.gameplay.performController.removeAllPerform();\n WebGAL.gameplay.resetGamePlay();\n\n // 清空舞台状态表\n const initSceneDataCopy = cloneDeep(initState);\n const currentVars = webgalStore.getState().stage.GameVar;\n webgalStore.dispatch(resetStageState(initSceneDataCopy));\n if (!resetSceneAndVar) {\n webgalStore.dispatch(setStage({ key: 'GameVar', value: currentVars }));\n }\n};\n","import { ISaveData } from './userDataInterface';\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport cloneDeep from 'lodash/cloneDeep';\n\nexport interface ISavesData {\n saveData: Array<ISaveData>; // 用户存档数据\n quickSaveData: ISaveData | null;\n}\n\nconst initState: ISavesData = {\n saveData: [],\n quickSaveData: null,\n};\n\ninterface SaveAction {\n saveData: ISaveData;\n index: number;\n}\n\nconst saveDataSlice = createSlice({\n name: 'saveData',\n initialState: cloneDeep(initState),\n reducers: {\n setFastSave: (state, action: PayloadAction<ISaveData | null>) => {\n state.quickSaveData = action.payload;\n },\n resetFastSave: (state) => {\n state.quickSaveData = null;\n },\n resetSaves: (state) => {\n state.quickSaveData = null;\n state.saveData = [];\n },\n saveGame: (state, action: PayloadAction<SaveAction>) => {\n state.saveData[action.payload.index] = action.payload.saveData;\n },\n replaceSaveGame: (state, action: PayloadAction<ISaveData[]>) => {\n state.saveData = action.payload;\n },\n },\n});\n\nexport const saveActions = saveDataSlice.actions;\n\nexport default saveDataSlice.reducer;\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { assetSetter, fileType } from '@/Core/util/gameAssetsAccess/assetSetter';\nimport { sceneFetcher } from '@/Core/controller/scene/sceneFetcher';\nimport { sceneParser } from '@/Core/parser/sceneParser';\nimport { resetStage } from '@/Core/controller/stage/resetStage';\nimport { webgalStore } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { playBgm } from '@/Core/controller/stage/playBgm';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { dumpToStorageFast } from '@/Core/controller/storage/storageController';\nimport { saveActions } from '@/store/savesReducer';\n\n/**\n * 结束游戏\n * @param sentence\n */\nexport const end = (sentence: ISentence): IPerform => {\n resetStage(true);\n const dispatch = webgalStore.dispatch;\n // 重新获取初始场景\n const sceneUrl: string = assetSetter('start.txt', fileType.scene);\n // 为了在 scriptExecutor 自增 sentenceId 后再重置场景\n setTimeout(() => {\n WebGAL.sceneManager.resetScene();\n }, 5);\n dispatch(saveActions.resetFastSave());\n dumpToStorageFast();\n sceneFetcher(sceneUrl).then((rawScene) => {\n // 场景写入到运行时\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, 'start.txt', sceneUrl);\n });\n dispatch(setVisibility({ component: 'showTitle', visibility: true }));\n playBgm(webgalStore.getState().GUI.titleBgm);\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { jmp } from '@/Core/gameScripts/label/jmp';\n\n/**\n * 跳转到指定标签\n * @param sentence\n */\nexport const jumpLabel = (sentence: ISentence): IPerform => {\n jmp(sentence.content);\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { commandType, ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { logger } from '@/Core/util/logger';\nimport { webgalStore } from '@/store/store';\nimport { resetStageState, stageActions } from '@/store/stageReducer';\nimport cloneDeep from 'lodash/cloneDeep';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { IRunPerform } from '@/store/stageInterface';\n\n/**\n * 初始化pixi\n * @param sentence\n */\nexport const pixiInit = (sentence: ISentence): IPerform => {\n WebGAL.gameplay.performController.performList.forEach((e) => {\n if (e.performName.match(/PixiPerform/)) {\n logger.warn('pixi 被脚本重新初始化', e.performName);\n /**\n * 卸载演出\n */\n for (let i = 0; i < WebGAL.gameplay.performController.performList.length; i++) {\n const e2 = WebGAL.gameplay.performController.performList[i];\n if (e2.performName === e.performName) {\n e2.stopFunction();\n clearTimeout(e2.stopTimeout as unknown as number);\n WebGAL.gameplay.performController.performList.splice(i, 1);\n i--;\n }\n }\n /**\n * 从状态表里清除演出\n */\n webgalStore.dispatch(stageActions.removeAllPixiPerforms());\n }\n });\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { WebGAL } from '@/Core/WebGAL';\n\ninterface IAudioContextWrapper {\n audioContext: AudioContext;\n source: MediaElementAudioSourceNode | null;\n analyser: AnalyserNode | undefined;\n dataArray: Uint8Array | undefined;\n audioLevelInterval: ReturnType<typeof setInterval>;\n blinkTimerID: ReturnType<typeof setTimeout>;\n maxAudioLevel: number;\n}\n\n// Initialize the object based on the interface\nexport const audioContextWrapper: IAudioContextWrapper = {\n audioContext: new AudioContext(),\n source: null,\n analyser: undefined,\n dataArray: undefined,\n audioLevelInterval: setInterval(() => {}, 0), // dummy interval\n blinkTimerID: setTimeout(() => {}, 0), // dummy timeout\n maxAudioLevel: 0,\n};\n\nexport const updateThresholds = (audioLevel: number) => {\n audioContextWrapper.maxAudioLevel = Math.max(audioLevel, audioContextWrapper.maxAudioLevel);\n return {\n OPEN_THRESHOLD: audioContextWrapper.maxAudioLevel * 0.75,\n HALF_OPEN_THRESHOLD: audioContextWrapper.maxAudioLevel * 0.5,\n };\n};\n\nexport const performBlinkAnimation = (params: {\n key: string;\n animationItem: any;\n pos: string;\n animationEndTime: number;\n}) => {\n let isBlinking = false;\n\n function blink() {\n if (isBlinking || (params.animationEndTime && Date.now() > params.animationEndTime)) return;\n isBlinking = true;\n WebGAL.gameplay.pixiStage?.performBlinkAnimation(params.key, params.animationItem, 'closed', params.pos);\n audioContextWrapper.blinkTimerID = setTimeout(() => {\n WebGAL.gameplay.pixiStage?.performBlinkAnimation(params.key, params.animationItem, 'open', params.pos);\n isBlinking = false;\n const nextBlinkTime = Math.random() * 300 + 3500;\n audioContextWrapper.blinkTimerID = setTimeout(blink, nextBlinkTime);\n }, 200);\n }\n blink();\n};\n\n// Updated getAudioLevel function\nexport const getAudioLevel = (analyser: AnalyserNode, dataArray: Uint8Array, bufferLength: number): number => {\n analyser.getByteFrequencyData(dataArray);\n let sum = 0;\n for (let i = 0; i < bufferLength; i++) {\n sum += dataArray[i];\n }\n return sum / bufferLength;\n};\n\nexport const performMouthAnimation = (params: {\n audioLevel: number;\n OPEN_THRESHOLD: number;\n HALF_OPEN_THRESHOLD: number;\n currentMouthValue: number;\n lerpSpeed: number;\n key: string;\n animationItem: any;\n pos: string;\n}) => {\n const { audioLevel, OPEN_THRESHOLD, HALF_OPEN_THRESHOLD, currentMouthValue, lerpSpeed, key, animationItem, pos } =\n params;\n\n let targetValue;\n if (audioLevel > OPEN_THRESHOLD) {\n targetValue = 1; // open\n } else if (audioLevel > HALF_OPEN_THRESHOLD) {\n targetValue = 0.5; // half_open\n } else {\n targetValue = 0; // closed\n }\n // Lerp\n const mouthValue = currentMouthValue + (targetValue - currentMouthValue) * lerpSpeed;\n WebGAL.gameplay.pixiStage?.setModelMouthY(key, audioLevel);\n\n let mouthState;\n if (mouthValue > 0.75) {\n mouthState = 'open';\n } else if (mouthValue > 0.25) {\n mouthState = 'half_open';\n } else {\n mouthState = 'closed';\n }\n if (animationItem !== undefined) {\n WebGAL.gameplay.pixiStage?.performMouthSyncAnimation(key, animationItem, mouthState, pos);\n }\n};\n","class Matcher<T, R = any> {\n private subject: T;\n private result: R | undefined;\n private isEnd = false;\n\n public constructor(subject: T) {\n this.subject = subject;\n }\n\n public with(pattern: T, fn: () => R): this {\n if (!this.isEnd && this.subject === pattern) {\n this.result = fn();\n this.isEnd = true;\n }\n return this;\n }\n\n public endsWith(pattern: T, fn: () => R) {\n if (!this.isEnd && this.subject === pattern) {\n this.result = fn();\n this.isEnd = true;\n }\n return this.evaluate();\n }\n\n public default(fn: () => R) {\n if (!this.isEnd) this.result = fn();\n return this.evaluate();\n }\n\n private evaluate(): R | undefined {\n return this.result;\n }\n}\n\nexport function match<T, R = any>(subject: T): Matcher<T, R> {\n return new Matcher(subject);\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { logger } from '@/Core/util/logger';\nimport { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { IStageState } from '@/store/stageInterface';\nimport {\n audioContextWrapper,\n getAudioLevel,\n performBlinkAnimation,\n performMouthAnimation,\n updateThresholds,\n} from '@/Core/gameScripts/vocal/vocalAnimation';\nimport { match } from '../../util/match';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 播放一段语音\n * @param sentence 语句\n */\nexport const playVocal = (sentence: ISentence) => {\n logger.debug('play vocal');\n const performInitName = 'vocal-play';\n const url = getSentenceArgByKey(sentence, 'vocal'); // 获取语音的url\n const volume = getSentenceArgByKey(sentence, 'volume'); // 获取语音的音量比\n let currentStageState: IStageState;\n currentStageState = webgalStore.getState().stage;\n let pos = '';\n let key = '';\n const freeFigure = currentStageState.freeFigure;\n const figureAssociatedAnimation = currentStageState.figureAssociatedAnimation;\n let bufferLength = 0;\n let currentMouthValue = 0;\n const lerpSpeed = 1;\n\n // 先停止之前的语音\n let VocalControl: any = document.getElementById('currentVocal');\n WebGAL.gameplay.performController.unmountPerform('vocal-play', true);\n if (VocalControl !== null) {\n VocalControl.currentTime = 0;\n VocalControl.pause();\n }\n\n for (const e of sentence.args) {\n if (e.value === true) {\n match(e.key)\n .with('left', () => {\n pos = 'left';\n })\n .with('right', () => {\n pos = 'right';\n })\n .endsWith('center', () => {\n pos = 'center';\n });\n }\n if (e.key === 'figureId') {\n key = `${e.value.toString()}`;\n }\n }\n\n // 获得舞台状态\n webgalStore.dispatch(setStage({ key: 'playVocal', value: url }));\n webgalStore.dispatch(setStage({ key: 'vocal', value: url }));\n\n let isOver = false;\n\n /**\n * 嘴型同步\n */\n\n return {\n arrangePerformPromise: new Promise((resolve) => {\n // 播放语音\n setTimeout(() => {\n let VocalControl: any = document.getElementById('currentVocal');\n // 设置语音音量\n typeof volume === 'number' && volume >= 0 && volume <= 100\n ? webgalStore.dispatch(setStage({ key: 'vocalVolume', value: volume }))\n : webgalStore.dispatch(setStage({ key: 'vocalVolume', value: 100 }));\n // 设置语音\n if (VocalControl !== null) {\n VocalControl.currentTime = 0;\n // 播放并作为一个特别演出加入\n const perform = {\n performName: performInitName,\n duration: 1000 * 60 * 60,\n isOver: false,\n isHoldOn: false,\n stopFunction: () => {\n clearInterval(audioContextWrapper.audioLevelInterval);\n VocalControl.pause();\n key = key ? key : `fig-${pos}`;\n const animationItem = figureAssociatedAnimation.find((tid) => tid.targetId === key);\n performMouthAnimation({\n audioLevel: 0,\n OPEN_THRESHOLD: 1,\n HALF_OPEN_THRESHOLD: 1,\n currentMouthValue,\n lerpSpeed,\n key,\n animationItem,\n pos,\n });\n clearTimeout(audioContextWrapper.blinkTimerID);\n },\n blockingNext: () => false,\n blockingAuto: () => {\n return !isOver;\n },\n skipNextCollect: true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n WebGAL.gameplay.performController.arrangeNewPerform(perform, sentence, false);\n key = key ? key : `fig-${pos}`;\n const animationItem = figureAssociatedAnimation.find((tid) => tid.targetId === key);\n if (animationItem) {\n let maxAudioLevel = 0;\n\n const foundFigure = freeFigure.find((figure) => figure.key === key);\n\n if (foundFigure) {\n pos = foundFigure.basePosition;\n }\n\n if (!audioContextWrapper.audioContext) {\n let audioContext: AudioContext | null;\n audioContext = new AudioContext();\n audioContextWrapper.analyser = audioContext.createAnalyser();\n audioContextWrapper.analyser.fftSize = 256;\n audioContextWrapper.dataArray = new Uint8Array(audioContextWrapper.analyser.frequencyBinCount);\n }\n\n if (!audioContextWrapper.analyser) {\n audioContextWrapper.analyser = audioContextWrapper.audioContext.createAnalyser();\n audioContextWrapper.analyser.fftSize = 256;\n }\n\n bufferLength = audioContextWrapper.analyser.frequencyBinCount;\n audioContextWrapper.dataArray = new Uint8Array(bufferLength);\n let vocalControl = document.getElementById('currentVocal') as HTMLMediaElement;\n\n if (!audioContextWrapper.source) {\n audioContextWrapper.source = audioContextWrapper.audioContext.createMediaElementSource(vocalControl);\n audioContextWrapper.source.connect(audioContextWrapper.analyser);\n }\n\n audioContextWrapper.analyser.connect(audioContextWrapper.audioContext.destination);\n\n // Lip-snc Animation\n audioContextWrapper.audioLevelInterval = setInterval(() => {\n const audioLevel = getAudioLevel(\n audioContextWrapper.analyser!,\n audioContextWrapper.dataArray!,\n bufferLength,\n );\n const { OPEN_THRESHOLD, HALF_OPEN_THRESHOLD } = updateThresholds(audioLevel);\n\n performMouthAnimation({\n audioLevel,\n OPEN_THRESHOLD,\n HALF_OPEN_THRESHOLD,\n currentMouthValue,\n lerpSpeed,\n key,\n animationItem,\n pos,\n });\n }, 50);\n\n // blinkAnimation\n let animationEndTime: number;\n\n // 10sec\n animationEndTime = Date.now() + 10000;\n performBlinkAnimation({ key, animationItem, pos, animationEndTime });\n\n // 10sec\n setTimeout(() => {\n clearTimeout(audioContextWrapper.blinkTimerID);\n }, 10000);\n }\n\n VocalControl?.play();\n\n VocalControl.onended = () => {\n for (const e of WebGAL.gameplay.performController.performList) {\n if (e.performName === performInitName) {\n isOver = true;\n e.stopFunction();\n WebGAL.gameplay.performController.unmountPerform(e.performName);\n }\n }\n };\n }\n }, 1);\n }),\n };\n};\n","import { playSpeed } from '@/store/userDataInterface';\n\nexport function useTextDelay(type: playSpeed) {\n switch (type) {\n case playSpeed.slow:\n return 80;\n case playSpeed.normal:\n return 35;\n case playSpeed.fast:\n return 3;\n }\n}\n\nexport function useTextAnimationDuration(type: playSpeed) {\n switch (type) {\n case playSpeed.slow:\n return 800;\n case playSpeed.normal:\n return 350;\n case playSpeed.fast:\n return 200;\n }\n}\n","import { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { textFont } from '@/store/userDataInterface';\nimport { match } from '@/Core/util/match';\n\nexport function useFontFamily() {\n const fontFamily = useSelector((state: RootState) => state.userData.optionData.textboxFont);\n\n function getFont() {\n return match(fontFamily)\n .with(textFont.song, () => '\"思源宋体\", serif')\n .with(textFont.lxgw, () => '\"LXGW\", serif')\n .with(textFont.hei, () => '\"WebgalUI\", serif')\n .default(() => '\"WebgalUI\", serif');\n }\n\n return getFont();\n}\n","export function getTextSize(size: number) {\n switch (size) {\n case 0:\n return 150;\n case 1:\n return 205;\n case 2:\n return 240;\n default:\n return 205;\n }\n}\n","import styles from './textbox.module.scss';\nimport { ReactNode, useEffect } from 'react';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { ITextboxProps } from './types';\nimport useApplyStyle from '@/hooks/useApplyStyle';\nimport { css } from '@emotion/css';\n\nexport default function IMSSTextbox(props: ITextboxProps) {\n const {\n textArray,\n textDelay,\n currentConcatDialogPrev,\n currentDialogKey,\n isText,\n isSafari,\n isFirefox: boolean,\n fontSize,\n miniAvatar,\n showName,\n font,\n textDuration,\n isUseStroke,\n textboxOpacity,\n } = props;\n\n const applyStyle = useApplyStyle('Stage/TextBox/textbox.scss');\n\n useEffect(() => {\n function settleText() {\n const textElements = document.querySelectorAll('.Textelement_start');\n const textArray = [...textElements];\n textArray.forEach((e) => {\n e.className = applyStyle('TextBox_textElement_Settled', styles.TextBox_textElement_Settled);\n });\n }\n\n WebGAL.events.textSettle.on(settleText);\n return () => {\n WebGAL.events.textSettle.off(settleText);\n };\n }, []);\n\n let allTextIndex = 0;\n const textElementList = textArray.map((line, index) => {\n const textLine = line.map((en, index) => {\n const e = en.reactNode;\n let style = '';\n let tips = '';\n let style_alltext = '';\n if (en.enhancedValue) {\n const data = en.enhancedValue;\n console.log(data);\n for (const dataElem of data) {\n const { key, value } = dataElem;\n switch (key) {\n case 'style':\n style = value;\n break;\n case 'tips':\n tips = value;\n break;\n case 'style-alltext':\n style_alltext = value;\n break;\n }\n }\n }\n // if (e === '<br />') {\n // return <br key={`br${index}`} />;\n // }\n let delay = allTextIndex * textDelay;\n allTextIndex++;\n let prevLength = currentConcatDialogPrev.length;\n if (currentConcatDialogPrev !== '' && allTextIndex >= prevLength) {\n delay = delay - prevLength * textDelay;\n }\n const styleClassName = ' ' + css(style);\n const styleAllText = ' ' + css(style_alltext);\n if (allTextIndex < prevLength) {\n return (\n <span\n // data-text={e}\n id={`${delay}`}\n className={applyStyle('TextBox_textElement_Settled', styles.TextBox_textElement_Settled)}\n key={currentDialogKey + index}\n style={{ animationDelay: `${delay}ms`, animationDuration: `${textDuration}ms` }}\n >\n <span className={styles.zhanwei + styleAllText}>\n {e}\n <span className={applyStyle('outer', styles.outer) + styleClassName + styleAllText}>{e}</span>\n {isUseStroke && <span className={applyStyle('inner', styles.inner) + styleAllText}>{e}</span>}\n </span>\n </span>\n );\n }\n return (\n <span\n // data-text={e}\n id={`${delay}`}\n className={`${applyStyle('TextBox_textElement_start', styles.TextBox_textElement_start)} Textelement_start`}\n key={currentDialogKey + index}\n style={{ animationDelay: `${delay}ms`, position: 'relative' }}\n >\n <span className={styles.zhanwei + styleAllText}>\n {e}\n <span className={applyStyle('outer', styles.outer) + styleClassName + styleAllText}>{e}</span>\n {isUseStroke && <span className={applyStyle('inner', styles.inner) + styleAllText}>{e}</span>}\n </span>\n </span>\n );\n });\n return (\n <div\n style={{\n wordBreak: isSafari || props.isFirefox ? 'break-all' : undefined,\n display: isSafari ? 'flex' : undefined,\n flexWrap: isSafari ? 'wrap' : undefined,\n }}\n key={`text-line-${index}`}\n >\n {textLine}\n </div>\n );\n });\n\n return (\n <>\n {isText && (\n <div className={styles.TextBox_Container}>\n <div\n className={\n applyStyle('TextBox_main', styles.TextBox_main) +\n ' ' +\n applyStyle('TextBox_Background', styles.TextBox_Background) +\n ' ' +\n (miniAvatar === ''\n ? applyStyle('TextBox_main_miniavatarOff', styles.TextBox_main_miniavatarOff)\n : undefined)\n }\n style={{\n opacity: `${textboxOpacity / 100}`,\n }}\n />\n <div\n id=\"textBoxMain\"\n className={\n applyStyle('TextBox_main', styles.TextBox_main) +\n ' ' +\n (miniAvatar === ''\n ? applyStyle('TextBox_main_miniavatarOff', styles.TextBox_main_miniavatarOff)\n : undefined)\n }\n style={{\n fontFamily: font,\n }}\n >\n <div id=\"miniAvatar\" className={applyStyle('miniAvatarContainer', styles.miniAvatarContainer)}>\n {miniAvatar !== '' && (\n <img className={applyStyle('miniAvatarImg', styles.miniAvatarImg)} alt=\"miniAvatar\" src={miniAvatar} />\n )}\n </div>\n {showName !== '' && (\n <>\n <div\n className={\n applyStyle('TextBox_showName', styles.TextBox_showName) +\n ' ' +\n applyStyle('TextBox_ShowName_Background', styles.TextBox_ShowName_Background)\n }\n style={{\n opacity: `${textboxOpacity / 100}`,\n fontSize: '200%',\n }}\n >\n <div style={{ opacity: 0 }}>\n {showName.split('').map((e, i) => {\n return (\n <span key={e + i} style={{ position: 'relative' }}>\n <span className={styles.zhanwei}>\n {e}\n <span className={applyStyle('outerName', styles.outerName)}>{e}</span>\n {isUseStroke && <span className={applyStyle('innerName', styles.innerName)}>{e}</span>}\n </span>\n </span>\n );\n })}\n </div>\n </div>\n <div\n key={showName}\n className={applyStyle('TextBox_showName', styles.TextBox_showName)}\n style={{\n fontSize: '200%',\n }}\n >\n {showName.split('').map((e, i) => {\n return (\n <span key={e + i} style={{ position: 'relative' }}>\n <span className={styles.zhanwei}>\n {e}\n <span className={applyStyle('outerName', styles.outerName)}>{e}</span>\n {isUseStroke && <span className={applyStyle('innerName', styles.innerName)}>{e}</span>}\n </span>\n </span>\n );\n })}\n </div>\n </>\n )}\n <div\n className={applyStyle('text', styles.text)}\n style={{\n fontSize,\n flexFlow: 'column',\n overflow: 'hidden',\n paddingLeft: '0.1em',\n }}\n >\n {textElementList}\n </div>\n </div>\n </div>\n )}\n </>\n );\n}\n","export const SCREEN_CONSTANTS = {\n height: 1440,\n width: 2560,\n};\n","import { ReactNode, useEffect, useState } from 'react';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useFontFamily } from '@/hooks/useFontFamily';\nimport { useTextAnimationDuration, useTextDelay } from '@/hooks/useTextOptions';\nimport { getTextSize } from '@/UI/getTextSize';\nimport { match } from '@/Core/util/match';\nimport { textSize } from '@/store/userDataInterface';\nimport IMSSTextbox from '@/Stage/TextBox/IMSSTextbox';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\nimport useEscape from '@/hooks/useEscape';\n\nconst userAgent = navigator.userAgent;\nconst isFirefox = /firefox/i.test(userAgent);\nconst isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);\n\nexport interface EnhancedNode {\n reactNode: ReactNode;\n enhancedValue?: { key: string; value: string }[];\n}\n\nexport const TextBox = () => {\n const [isShowStroke, setIsShowStroke] = useState(true);\n\n useEffect(() => {\n const handleResize = () => {\n const targetHeight = SCREEN_CONSTANTS.height;\n const targetWidth = SCREEN_CONSTANTS.width;\n\n const h = window.innerHeight; // 窗口高度\n const w = window.innerWidth; // 窗口宽度\n const zoomH = h / targetHeight; // 以窗口高度为基准的变换比\n const zoomW = w / targetWidth; // 以窗口宽度为基准的变换比\n const zoomH2 = w / targetHeight; // 竖屏时以窗口高度为基础的变换比\n const zoomW2 = h / targetWidth; // 竖屏时以窗口宽度为基础的变换比\n [zoomH, zoomW, zoomH2, zoomW2].forEach((e) => {\n if (e <= 0.2) {\n setIsShowStroke(false);\n } else {\n setIsShowStroke(true);\n }\n });\n };\n window.addEventListener('resize', handleResize);\n handleResize();\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n const stageState = useSelector((state: RootState) => state.stage);\n const userDataState = useSelector((state: RootState) => state.userData);\n const textDelay = useTextDelay(userDataState.optionData.textSpeed);\n const textDuration = useTextAnimationDuration(userDataState.optionData.textSpeed);\n let size = getTextSize(userDataState.optionData.textSize) + '%';\n const font = useFontFamily();\n const isText = stageState.showText !== '' || stageState.showName !== '';\n let textSizeState = userDataState.optionData.textSize;\n if (isText && stageState.showTextSize !== -1) {\n size = getTextSize(stageState.showTextSize) + '%';\n textSizeState = stageState.showTextSize;\n }\n const lineLimit = match(userDataState.optionData.textSize)\n .with(textSize.small, () => 3)\n .with(textSize.medium, () => 2)\n .with(textSize.large, () => 2)\n .default(() => 2);\n // 拆字\n const textArray = compileSentence(stageState.showText, lineLimit);\n const showName = stageState.showName;\n const currentConcatDialogPrev = stageState.currentConcatDialogPrev;\n const currentDialogKey = stageState.currentDialogKey;\n const miniAvatar = stageState.miniAvatar;\n const textboxOpacity = userDataState.optionData.textboxOpacity;\n const Textbox = IMSSTextbox;\n return (\n <Textbox\n textArray={textArray}\n isText={isText}\n textDelay={textDelay}\n showName={showName}\n currentConcatDialogPrev={currentConcatDialogPrev}\n fontSize={size}\n currentDialogKey={currentDialogKey}\n isSafari={isSafari}\n isFirefox={isFirefox}\n miniAvatar={miniAvatar}\n textDuration={textDuration}\n font={font}\n textSizeState={textSizeState}\n lineLimit={lineLimit}\n isUseStroke={isShowStroke}\n textboxOpacity={textboxOpacity}\n />\n );\n};\n\nfunction isCJK(character: string) {\n return !!character.match(/[\\u4e00-\\u9fa5]|[\\u0800-\\u4e00]|[\\uac00-\\ud7ff]/);\n}\n\nexport function compileSentence(sentence: string, lineLimit: number, ignoreLineLimit?: boolean): EnhancedNode[][] {\n // 先拆行\n const lines = sentence.split(/(?<!\\\\)\\|/).map((val: string) => useEscape(val));\n // 对每一行进行注音处理\n const rubyLines = lines.map((line) => parseString(line));\n const nodeLines = rubyLines.map((line) => {\n const ln: EnhancedNode[] = [];\n line.forEach((node, index) => {\n match(node.type)\n .with(SegmentType.String, () => {\n const chars = splitChars(node.value as string);\n // eslint-disable-next-line max-nested-callbacks\n ln.push(...chars.map((c) => ({ reactNode: c })));\n })\n .endsWith(SegmentType.Link, () => {\n const val = node.value as EnhancedValue;\n const enhancedNode = (\n <span className=\"__enhanced_text\" key={val.text + `${index}`}>\n <ruby key={index + val.text}>\n {val.text}\n <rt>{val.ruby}</rt>\n </ruby>\n </span>\n );\n ln.push({ reactNode: enhancedNode, enhancedValue: val.values });\n });\n });\n return ln;\n });\n return nodeLines.slice(0, ignoreLineLimit ? undefined : lineLimit);\n}\n\n/**\n * @param sentence\n */\nexport function splitChars(sentence: string) {\n if (!sentence) return [];\n const words: string[] = [];\n let word = '';\n let cjkFlag = isCJK(sentence[0]);\n\n const isPunctuation = (ch: string): boolean => {\n const regex = /[!-\\/:-@\\[-`{-~\\u2000-\\u206F\\u3000-\\u303F\\uff00-\\uffef]/g;\n return regex.test(ch);\n };\n\n for (const character of sentence) {\n // if (character === '|') {\n // if (word) {\n // words.push(word);\n // word = '';\n // }\n // words.push('<br />');\n // cjkFlag = false;\n // continue;\n // }\n if (character === ' ') {\n // Space\n if (word) {\n words.push(word);\n word = '';\n }\n words.push('\\u00a0');\n cjkFlag = false;\n } else if (isCJK(character) && !isPunctuation(character)) {\n if (!cjkFlag && word) {\n words.push(word);\n word = '';\n }\n words.push(character);\n cjkFlag = true;\n } else {\n if (isPunctuation(character)) {\n if (word) {\n // If it is a punctuation and there is a preceding word, add it to the word\n word += character;\n words.push(word);\n word = '';\n } else if (words.length > 0) {\n // If no preceding word in the current iteration, but there are already words in the array, append to the last word\n words[words.length - 1] += character;\n } else {\n // If no preceding word, still add the punctuation as a new word\n words.push(character);\n }\n continue;\n }\n\n if (cjkFlag && word) {\n words.push(word);\n word = '';\n }\n word += character;\n cjkFlag = false;\n }\n }\n\n if (word) {\n words.push(word);\n }\n\n return words;\n}\n\nenum SegmentType {\n String = 'SegmentType.String',\n Link = 'SegmentType.Link',\n}\n\ninterface EnhancedValue {\n text: string;\n ruby: string;\n values: { key: string; value: string }[];\n}\n\ninterface Segment {\n type: SegmentType;\n value?: string | EnhancedValue;\n}\n\nfunction parseString(input: string): Segment[] {\n const regex = /(\\[(.*?)\\]\\((.*?)\\))|([^\\[\\]]+)/g;\n const result: Segment[] = [];\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(input)) !== null) {\n if (match[1]) {\n // 链接部分\n const text = match[2];\n const enhance = match[3];\n let parsedEnhanced: KeyValuePair[] = [];\n let ruby = '';\n if (enhance.match(/style=|tips=|ruby=|style-alltext=/)) {\n parsedEnhanced = parseEnhancedString(enhance);\n const rubyKvPair = parsedEnhanced.find((e) => e.key === 'ruby');\n if (rubyKvPair) {\n ruby = rubyKvPair.value;\n }\n } else {\n ruby = enhance;\n }\n result.push({ type: SegmentType.Link, value: { text, ruby, values: parsedEnhanced } });\n } else {\n // 普通文本\n const text = match[0];\n result.push({ type: SegmentType.String, value: text });\n }\n }\n\n return result;\n}\n\ninterface KeyValuePair {\n key: string;\n value: string;\n}\n\nfunction parseEnhancedString(enhanced: string): KeyValuePair[] {\n const result: KeyValuePair[] = [];\n const regex = /(\\S+)=(.*?)(?=\\s+\\S+=|\\s*$)/g;\n let match: RegExpExecArray | null;\n\n while ((match = regex.exec(enhanced)) !== null) {\n result.push({\n key: match[1],\n value: match[2].trim(),\n });\n }\n\n return result;\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { playVocal } from './vocal';\nimport { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { useTextDelay } from '@/hooks/useTextOptions';\nimport { getRandomPerformName, PerformController } from '@/Core/Modules/perform/performController';\nimport { getSentenceArgByKey } from '@/Core/util/getSentenceArg';\nimport { textSize, voiceOption } from '@/store/userDataInterface';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { compileSentence } from '@/Stage/TextBox/TextBox';\n\n/**\n * 进行普通对话的显示\n * @param sentence 语句\n * @return {IPerform} 执行的演出\n */\nexport const say = (sentence: ISentence): IPerform => {\n const stageState = webgalStore.getState().stage;\n const userDataState = webgalStore.getState().userData;\n const dispatch = webgalStore.dispatch;\n let dialogKey = Math.random().toString(); // 生成一个随机的key\n let dialogToShow = sentence.content; // 获取对话内容\n const isConcat = getSentenceArgByKey(sentence, 'concat'); // 是否是继承语句\n const isNotend = getSentenceArgByKey(sentence, 'notend') as boolean; // 是否有 notend 参数\n const speaker = getSentenceArgByKey(sentence, 'speaker'); // 获取说话者\n const clear = getSentenceArgByKey(sentence, 'clear'); // 是否清除说话者\n const vocal = getSentenceArgByKey(sentence, 'vocal'); // 是否播放语音\n\n // 如果是concat,那么就继承上一句的key,并且继承上一句对话。\n if (isConcat) {\n dialogKey = stageState.currentDialogKey;\n dialogToShow = stageState.showText + dialogToShow;\n dispatch(setStage({ key: 'currentConcatDialogPrev', value: stageState.showText }));\n } else {\n dispatch(setStage({ key: 'currentConcatDialogPrev', value: '' }));\n }\n\n // 设置文本显示\n dispatch(setStage({ key: 'showText', value: dialogToShow }));\n dispatch(setStage({ key: 'vocal', value: '' }));\n\n // 清除语音\n if (!(userDataState.optionData.voiceInterruption === voiceOption.no && vocal === null)) {\n // 只有开关设置为不中断,并且没有语音的时候,才需要不中断\n dispatch(setStage({ key: 'playVocal', value: '' }));\n WebGAL.gameplay.performController.unmountPerform('vocal-play', true);\n }\n // 设置key\n dispatch(setStage({ key: 'currentDialogKey', value: dialogKey }));\n // 计算延迟\n const textDelay = useTextDelay(userDataState.optionData.textSpeed);\n // 本句延迟\n const textNodes = compileSentence(sentence.content, 3);\n const len = textNodes.reduce((prev, curr) => prev + curr.length, 0);\n const sentenceDelay = textDelay * len;\n\n for (const e of sentence.args) {\n if (e.key === 'fontSize') {\n switch (e.value) {\n case 'default':\n dispatch(setStage({ key: 'showTextSize', value: -1 }));\n break;\n case 'small':\n dispatch(setStage({ key: 'showTextSize', value: textSize.small }));\n break;\n case 'medium':\n dispatch(setStage({ key: 'showTextSize', value: textSize.medium }));\n break;\n case 'large':\n dispatch(setStage({ key: 'showTextSize', value: textSize.large }));\n break;\n }\n }\n }\n\n // 设置显示的角色名称\n let showName: string | number | boolean = stageState.showName; // 先默认继承\n if (speaker !== null) {\n showName = speaker;\n }\n if (clear) {\n showName = '';\n }\n dispatch(setStage({ key: 'showName', value: showName }));\n\n // 播放一段语音\n if (vocal) {\n playVocal(sentence);\n }\n\n const performInitName: string = getRandomPerformName();\n let endDelay = 750 - userDataState.optionData.textSpeed * 250;\n // 如果有 notend 参数,那么就不需要等待\n if (isNotend) {\n endDelay = 0;\n }\n\n return {\n performName: performInitName,\n duration: sentenceDelay + endDelay,\n isHoldOn: false,\n stopFunction: () => {\n WebGAL.events.textSettle.emit();\n },\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n goNextWhenOver: isNotend,\n };\n};\n","/* remove eslint errors to see if there is something really wrong */\n/*eslint quotes: [0]*/\n/*eslint indent: [0]*/\n/*eslint vars-on-top: [0]*/\n/*eslint yoda: 0*/\n/*eslint curly: 0*/\n/*eslint no-implicit-coercion: 0*/\n/*eslint newline-after-var: 0*/\n/*eslint space-before-function-paren: 0*/\n/*eslint block-spacing: 0*/\n/*eslint brace-style: 0*/\n/*eslint complexity: 0*/\n/*eslint one-var: 0*/\n/*eslint eqeqeq: 0*/\n/*eslint object-curly-spacing: 0*/\n/*eslint quote-props: 0*/\n/*eslint key-spacing: 0*/\n/*eslint valid-jsdoc: 0*/\n/*eslint func-style: 0*/\n/*eslint no-nested-ternary: 0*/\n/*eslint operator-linebreak: 0*/\n/*eslint no-multi-spaces: 0*/\n/*eslint no-constant-condition: 0*/\n/*eslint comma-spacing: 0*/\n/*eslint no-else-return: 0*/\n/*eslint no-warning-comments: 0*/\n/*eslint default-case: 0*/\n/*eslint consistent-return: 0*/\n/*eslint no-undefined: 0*/\n/*eslint no-new-func: 0*/\n/*eslint max-nested-callbacks: 0*/\n/*eslint padded-blocks: 0*/\n/*eslint no-self-compare: 0*/\n/*eslint no-multiple-empty-lines: 0*/\n/*eslint no-new: 0*/\n/*eslint no-unused-vars: 0*/\n\"use strict\";\n\nvar window = { document: {} };\n\n/* We need to tell ESLint what variables are being exported */\n/* exported\n angular,\n msie,\n jqLite,\n jQuery,\n slice,\n splice,\n push,\n toString,\n ngMinErr,\n angularModule,\n uid,\n REGEX_STRING_REGEXP,\n VALIDITY_STATE_PROPERTY,\n\n lowercase,\n uppercase,\n manualLowercase,\n manualUppercase,\n nodeName_,\n isArrayLike,\n forEach,\n forEachSorted,\n reverseParams,\n nextUid,\n setHashKey,\n extend,\n toInt,\n inherit,\n merge,\n noop,\n identity,\n valueFn,\n isUndefined,\n isDefined,\n isObject,\n isBlankObject,\n isString,\n isNumber,\n isNumberNaN,\n isDate,\n isArray,\n isFunction,\n isRegExp,\n isWindow,\n isScope,\n isFile,\n isFormData,\n isBlob,\n isBoolean,\n isPromiseLike,\n trim,\n escapeForRegexp,\n isElement,\n makeMap,\n includes,\n arrayRemove,\n copy,\n equals,\n csp,\n jq,\n concat,\n sliceArgs,\n bind,\n toJsonReplacer,\n toJson,\n fromJson,\n convertTimezoneToLocal,\n timezoneToOffset,\n startingTag,\n tryDecodeURIComponent,\n parseKeyValue,\n toKeyValue,\n encodeUriSegment,\n encodeUriQuery,\n angularInit,\n bootstrap,\n getTestability,\n snake_case,\n bindJQuery,\n assertArg,\n assertArgFn,\n assertNotHasOwnProperty,\n getter,\n getBlockNodes,\n hasOwnProperty,\n createMap,\n stringify,\n\n NODE_TYPE_ELEMENT,\n NODE_TYPE_ATTRIBUTE,\n NODE_TYPE_TEXT,\n NODE_TYPE_COMMENT,\n NODE_TYPE_DOCUMENT,\n NODE_TYPE_DOCUMENT_FRAGMENT\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc module\n * @name ng\n * @module ng\n * @installation\n * @description\n *\n * # ng (core module)\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n * <div doc-module-components=\"ng\"></div>\n */\n\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_ATTRIBUTE = 2;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_COMMENT = 8;\nvar NODE_TYPE_DOCUMENT = 9;\nvar NODE_TYPE_DOCUMENT_FRAGMENT = 11;\nvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n// The name of a form control's ValidityState property.\n// This is used so that it's possible for internal tests to create mock ValidityStates.\nvar VALIDITY_STATE_PROPERTY = \"validity\";\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar lowercase = function (string) {\n\treturn isString(string) ? string.toLowerCase() : string;\n};\nvar uppercase = function (string) {\n\treturn isString(string) ? string.toUpperCase() : string;\n};\n\n/**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\nvar isArray = Array.isArray;\n\nvar ngAttrPrefixes = [\"ng-\", \"data-ng-\", \"ng:\", \"x-ng-\"];\n\nvar manualLowercase = function (s) {\n\t/* eslint-disable no-bitwise */\n\treturn isString(s)\n\t\t? s.replace(/[A-Z]/g, function (ch) {\n\t\t\t\treturn String.fromCharCode(ch.charCodeAt(0) | 32);\n\t\t\t})\n\t\t: s;\n\t/* eslint-enable */\n};\nvar manualUppercase = function (s) {\n\t/* eslint-disable no-bitwise */\n\treturn isString(s)\n\t\t? s.replace(/[a-z]/g, function (ch) {\n\t\t\t\treturn String.fromCharCode(ch.charCodeAt(0) & ~32);\n\t\t\t})\n\t\t: s;\n\t/* eslint-enable */\n};\n\n// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish\n// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods\n// with correct but slower alternatives. See https://github.com/angular/angular.js/issues/11387\nif (\"i\" !== \"I\".toLowerCase()) {\n\tlowercase = manualLowercase;\n\tuppercase = manualUppercase;\n}\n\nvar msie, // holds major version number for IE, or NaN if UA is not IE.\n\tjqLite, // delay binding since jQuery could be loaded after us.\n\tjQuery, // delay binding\n\tslice = [].slice,\n\tsplice = [].splice,\n\tpush = [].push,\n\ttoString = Object.prototype.toString,\n\tgetPrototypeOf = Object.getPrototypeOf,\n\tngMinErr = minErr(\"ng\"),\n\t/** @name angular */\n\tangular = window.angular || (window.angular = {}),\n\tangularModule,\n\tuid = 0;\n\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nmsie = window.document.documentMode;\n\n/**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n * String ...)\n */\nfunction isArrayLike(obj) {\n\t// `null`, `undefined` and `window` are not array-like\n\tif (obj == null || isWindow(obj)) return false;\n\n\t// arrays, strings and jQuery/jqLite objects are array like\n\t// * jqLite is either the jQuery or jqLite constructor function\n\t// * we have to check the existence of jqLite first as this method is called\n\t// via the forEach method when constructing the jqLite object in the first place\n\tif (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite))\n\t\treturn true;\n\n\t// Support: iOS 8.2 (not reproducible in simulator)\n\t// \"length\" in obj used to prevent JIT error (gh-11508)\n\tvar length = \"length\" in Object(obj) && obj.length;\n\n\t// NodeList objects (with `item` method) and\n\t// other objects with suitable length characteristics are array-like\n\treturn (\n\t\tisNumber(length) &&\n\t\t((length >= 0 && (length - 1 in obj || obj instanceof Array)) ||\n\t\t\ttypeof obj.item === \"function\")\n\t);\n}\n\n/**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n ```js\n var values = {name: 'misko', gender: 'male'};\n var log = [];\n angular.forEach(values, function(value, key) {\n this.push(key + ': ' + value);\n }, log);\n expect(log).toEqual(['name: misko', 'gender: male']);\n ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\nfunction forEach(obj, iterator, context) {\n\tvar key, length;\n\tif (obj) {\n\t\tif (isFunction(obj)) {\n\t\t\tfor (key in obj) {\n\t\t\t\tif (\n\t\t\t\t\tkey !== \"prototype\" &&\n\t\t\t\t\tkey !== \"length\" &&\n\t\t\t\t\tkey !== \"name\" &&\n\t\t\t\t\tobj.hasOwnProperty(key)\n\t\t\t\t) {\n\t\t\t\t\titerator.call(context, obj[key], key, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isArray(obj) || isArrayLike(obj)) {\n\t\t\tvar isPrimitive = typeof obj !== \"object\";\n\t\t\tfor (key = 0, length = obj.length; key < length; key++) {\n\t\t\t\tif (isPrimitive || key in obj) {\n\t\t\t\t\titerator.call(context, obj[key], key, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (obj.forEach && obj.forEach !== forEach) {\n\t\t\tobj.forEach(iterator, context, obj);\n\t\t} else if (isBlankObject(obj)) {\n\t\t\t// createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n\t\t\t// eslint-disable-next-line guard-for-in\n\t\t\tfor (key in obj) {\n\t\t\t\titerator.call(context, obj[key], key, obj);\n\t\t\t}\n\t\t} else if (typeof obj.hasOwnProperty === \"function\") {\n\t\t\t// Slow path for objects inheriting Object.prototype, hasOwnProperty check needed\n\t\t\tfor (key in obj) {\n\t\t\t\tif (obj.hasOwnProperty(key)) {\n\t\t\t\t\titerator.call(context, obj[key], key, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Slow path for objects which do not have a method `hasOwnProperty`\n\t\t\tfor (key in obj) {\n\t\t\t\tif (hasOwnProperty.call(obj, key)) {\n\t\t\t\t\titerator.call(context, obj[key], key, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn obj;\n}\n\nfunction forEachSorted(obj, iterator, context) {\n\tvar keys = Object.keys(obj).sort();\n\tfor (var i = 0; i < keys.length; i++) {\n\t\titerator.call(context, obj[keys[i]], keys[i]);\n\t}\n\treturn keys;\n}\n\n/**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\nfunction reverseParams(iteratorFn) {\n\treturn function (value, key) {\n\t\titeratorFn(key, value);\n\t};\n}\n\n/**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\nfunction nextUid() {\n\treturn ++uid;\n}\n\n/**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\nfunction setHashKey(obj, h) {\n\tif (h) {\n\t\tobj.$$hashKey = h;\n\t} else {\n\t\tdelete obj.$$hashKey;\n\t}\n}\n\nfunction baseExtend(dst, objs, deep) {\n\tvar h = dst.$$hashKey;\n\n\tfor (var i = 0, ii = objs.length; i < ii; ++i) {\n\t\tvar obj = objs[i];\n\t\tif (!isObject(obj) && !isFunction(obj)) continue;\n\t\tvar keys = Object.keys(obj);\n\t\tfor (var j = 0, jj = keys.length; j < jj; j++) {\n\t\t\tvar key = keys[j];\n\t\t\tvar src = obj[key];\n\n\t\t\tif (deep && isObject(src)) {\n\t\t\t\tif (isDate(src)) {\n\t\t\t\t\tdst[key] = new Date(src.valueOf());\n\t\t\t\t} else if (isRegExp(src)) {\n\t\t\t\t\tdst[key] = new RegExp(src);\n\t\t\t\t} else if (src.nodeName) {\n\t\t\t\t\tdst[key] = src.cloneNode(true);\n\t\t\t\t} else if (isElement(src)) {\n\t\t\t\t\tdst[key] = src.clone();\n\t\t\t\t} else {\n\t\t\t\t\tif (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};\n\t\t\t\t\tbaseExtend(dst[key], [src], true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdst[key] = src;\n\t\t\t}\n\t\t}\n\t}\n\n\tsetHashKey(dst, h);\n\treturn dst;\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n *\n * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use\n * {@link angular.merge} for this.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction extend(dst) {\n\treturn baseExtend(dst, slice.call(arguments, 1), false);\n}\n\n/**\n * @ngdoc function\n * @name angular.merge\n * @module ng\n * @kind function\n *\n * @description\n * Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.\n *\n * Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source\n * objects, performing a deep copy.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction merge(dst) {\n\treturn baseExtend(dst, slice.call(arguments, 1), true);\n}\n\nfunction toInt(str) {\n\treturn parseInt(str, 10);\n}\n\nvar isNumberNaN =\n\tNumber.isNaN ||\n\tfunction isNumberNaN(num) {\n\t\t// eslint-disable-next-line no-self-compare\n\t\treturn num !== num;\n\t};\n\nfunction inherit(parent, extra) {\n\treturn extend(Object.create(parent), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n ```js\n function foo(callback) {\n var result = calculateResult();\n (callback || angular.noop)(result);\n }\n ```\n */\nfunction noop() {}\nnoop.$inject = [];\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n ```js\n function transformer(transformationFn, value) {\n return (transformationFn || angular.identity)(value);\n };\n\n // E.g.\n function getResult(fn, input) {\n return (fn || angular.identity)(input);\n };\n\n getResult(function(n) { return n * 2; }, 21); // returns 42\n getResult(null, 21); // returns 21\n getResult(undefined, 21); // returns 21\n ```\n *\n * @param {*} value to be returned.\n * @returns {*} the value passed in.\n */\nfunction identity($) {\n\treturn $;\n}\nidentity.$inject = [];\n\nfunction valueFn(value) {\n\treturn function valueRef() {\n\t\treturn value;\n\t};\n}\n\nfunction hasCustomToString(obj) {\n\treturn isFunction(obj.toString) && obj.toString !== toString;\n}\n\n/**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\nfunction isUndefined(value) {\n\treturn typeof value === \"undefined\";\n}\n\n/**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\nfunction isDefined(value) {\n\treturn typeof value !== \"undefined\";\n}\n\n/**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value) {\n\t// http://jsperf.com/isobject4\n\treturn value !== null && typeof value === \"object\";\n}\n\n/**\n * Determine if a value is an object with a null prototype\n *\n * @returns {boolean} True if `value` is an `Object` with a null prototype\n */\nfunction isBlankObject(value) {\n\treturn value !== null && typeof value === \"object\" && !getPrototypeOf(value);\n}\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\nfunction isString(value) {\n\treturn typeof value === \"string\";\n}\n\n/**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * This includes the \"special\" numbers `NaN`, `+Infinity` and `-Infinity`.\n *\n * If you wish to exclude these then you can use the native\n * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)\n * method.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\nfunction isNumber(value) {\n\treturn typeof value === \"number\";\n}\n\n/**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\nfunction isDate(value) {\n\treturn toString.call(value) === \"[object Date]\";\n}\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\nfunction isFunction(value) {\n\treturn typeof value === \"function\";\n}\n\n/**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\nfunction isRegExp(value) {\n\treturn toString.call(value) === \"[object RegExp]\";\n}\n\n/**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\nfunction isWindow(obj) {\n\treturn obj && obj.window === obj;\n}\n\nfunction isScope(obj) {\n\treturn obj && obj.$evalAsync && obj.$watch;\n}\n\nfunction isFile(obj) {\n\treturn toString.call(obj) === \"[object File]\";\n}\n\nfunction isFormData(obj) {\n\treturn toString.call(obj) === \"[object FormData]\";\n}\n\nfunction isBlob(obj) {\n\treturn toString.call(obj) === \"[object Blob]\";\n}\n\nfunction isBoolean(value) {\n\treturn typeof value === \"boolean\";\n}\n\nfunction isPromiseLike(obj) {\n\treturn obj && isFunction(obj.then);\n}\n\nvar TYPED_ARRAY_REGEXP =\n\t/^\\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\\]$/;\nfunction isTypedArray(value) {\n\treturn (\n\t\tvalue &&\n\t\tisNumber(value.length) &&\n\t\tTYPED_ARRAY_REGEXP.test(toString.call(value))\n\t);\n}\n\nfunction isArrayBuffer(obj) {\n\treturn toString.call(obj) === \"[object ArrayBuffer]\";\n}\n\nvar trim = function (value) {\n\treturn isString(value) ? value.trim() : value;\n};\n\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n// Prereq: s is a string.\nvar escapeForRegexp = function (s) {\n\treturn (\n\t\ts\n\t\t\t.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, \"\\\\$1\")\n\t\t\t// eslint-disable-next-line no-control-regex\n\t\t\t.replace(/\\x08/g, \"\\\\x08\")\n\t);\n};\n\n/**\n * @ngdoc function\n * @name angular.isElement\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a DOM element (or wrapped jQuery element).\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).\n */\nfunction isElement(node) {\n\treturn !!(\n\t\tnode &&\n\t\t(node.nodeName || // We are a direct element.\n\t\t\t(node.prop && node.attr && node.find))\n\t); // We have an on and find method part of jQuery API.\n}\n\n/**\n * @param str 'key1,key2,...'\n * @returns {object} in the form of {key1:true, key2:true, ...}\n */\nfunction makeMap(str) {\n\tvar obj = {},\n\t\titems = str.split(\",\"),\n\t\ti;\n\tfor (i = 0; i < items.length; i++) {\n\t\tobj[items[i]] = true;\n\t}\n\treturn obj;\n}\n\nfunction nodeName_(element) {\n\treturn lowercase(element.nodeName || (element[0] && element[0].nodeName));\n}\n\nfunction includes(array, obj) {\n\treturn Array.prototype.indexOf.call(array, obj) !== -1;\n}\n\nfunction arrayRemove(array, value) {\n\tvar index = array.indexOf(value);\n\tif (index >= 0) {\n\t\tarray.splice(index, 1);\n\t}\n\treturn index;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array.\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n * are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to `destination` an exception will be thrown.\n *\n * <br />\n * <div class=\"alert alert-warning\">\n * Only enumerable properties are taken into account. Non-enumerable properties (both on `source`\n * and on `destination`) will be ignored.\n * </div>\n *\n * @param {*} source The source that will be used to make a copy.\n * Can be any type, including primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If\n * provided, must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n <example module=\"copyExample\" name=\"angular-copy\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form novalidate class=\"simple-form\">\n <label>Name: <input type=\"text\" ng-model=\"user.name\" /></label><br />\n <label>Age: <input type=\"number\" ng-model=\"user.age\" /></label><br />\n Gender: <label><input type=\"radio\" ng-model=\"user.gender\" value=\"male\" />male</label>\n <label><input type=\"radio\" ng-model=\"user.gender\" value=\"female\" />female</label><br />\n <button ng-click=\"reset()\">RESET</button>\n <button ng-click=\"update(user)\">SAVE</button>\n </form>\n <pre>form = {{user | json}}</pre>\n <pre>master = {{master | json}}</pre>\n </div>\n </file>\n <file name=\"script.js\">\n // Module: copyExample\n angular.\n module('copyExample', []).\n controller('ExampleController', ['$scope', function($scope) {\n $scope.master = {};\n\n $scope.reset = function() {\n // Example with 1 argument\n $scope.user = angular.copy($scope.master);\n };\n\n $scope.update = function(user) {\n // Example with 2 arguments\n angular.copy(user, $scope.master);\n };\n\n $scope.reset();\n }]);\n </file>\n </example>\n */\nfunction copy(source, destination) {\n\tvar stackSource = [];\n\tvar stackDest = [];\n\n\tif (destination) {\n\t\tif (isTypedArray(destination) || isArrayBuffer(destination)) {\n\t\t\tthrow ngMinErr(\n\t\t\t\t\"cpta\",\n\t\t\t\t\"Can't copy! TypedArray destination cannot be mutated.\"\n\t\t\t);\n\t\t}\n\t\tif (source === destination) {\n\t\t\tthrow ngMinErr(\n\t\t\t\t\"cpi\",\n\t\t\t\t\"Can't copy! Source and destination are identical.\"\n\t\t\t);\n\t\t}\n\n\t\t// Empty the destination object\n\t\tif (isArray(destination)) {\n\t\t\tdestination.length = 0;\n\t\t} else {\n\t\t\tforEach(destination, function (value, key) {\n\t\t\t\tif (key !== \"$$hashKey\") {\n\t\t\t\t\tdelete destination[key];\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tstackSource.push(source);\n\t\tstackDest.push(destination);\n\t\treturn copyRecurse(source, destination);\n\t}\n\n\treturn copyElement(source);\n\n\tfunction copyRecurse(source, destination) {\n\t\tvar h = destination.$$hashKey;\n\t\tvar key;\n\t\tif (isArray(source)) {\n\t\t\tfor (var i = 0, ii = source.length; i < ii; i++) {\n\t\t\t\tdestination.push(copyElement(source[i]));\n\t\t\t}\n\t\t} else if (isBlankObject(source)) {\n\t\t\t// createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n\t\t\t// eslint-disable-next-line guard-for-in\n\t\t\tfor (key in source) {\n\t\t\t\tdestination[key] = copyElement(source[key]);\n\t\t\t}\n\t\t} else if (source && typeof source.hasOwnProperty === \"function\") {\n\t\t\t// Slow path, which must rely on hasOwnProperty\n\t\t\tfor (key in source) {\n\t\t\t\tif (source.hasOwnProperty(key)) {\n\t\t\t\t\tdestination[key] = copyElement(source[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Slowest path --- hasOwnProperty can't be called as a method\n\t\t\tfor (key in source) {\n\t\t\t\tif (hasOwnProperty.call(source, key)) {\n\t\t\t\t\tdestination[key] = copyElement(source[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsetHashKey(destination, h);\n\t\treturn destination;\n\t}\n\n\tfunction copyElement(source) {\n\t\t// Simple values\n\t\tif (!isObject(source)) {\n\t\t\treturn source;\n\t\t}\n\n\t\t// Already copied values\n\t\tvar index = stackSource.indexOf(source);\n\t\tif (index !== -1) {\n\t\t\treturn stackDest[index];\n\t\t}\n\n\t\tif (isWindow(source) || isScope(source)) {\n\t\t\tthrow ngMinErr(\n\t\t\t\t\"cpws\",\n\t\t\t\t\"Can't copy! Making copies of Window or Scope instances is not supported.\"\n\t\t\t);\n\t\t}\n\n\t\tvar needsRecurse = false;\n\t\tvar destination = copyType(source);\n\n\t\tif (destination === undefined) {\n\t\t\tdestination = isArray(source)\n\t\t\t\t? []\n\t\t\t\t: Object.create(getPrototypeOf(source));\n\t\t\tneedsRecurse = true;\n\t\t}\n\n\t\tstackSource.push(source);\n\t\tstackDest.push(destination);\n\n\t\treturn needsRecurse ? copyRecurse(source, destination) : destination;\n\t}\n\n\tfunction copyType(source) {\n\t\tswitch (toString.call(source)) {\n\t\t\tcase \"[object Int8Array]\":\n\t\t\tcase \"[object Int16Array]\":\n\t\t\tcase \"[object Int32Array]\":\n\t\t\tcase \"[object Float32Array]\":\n\t\t\tcase \"[object Float64Array]\":\n\t\t\tcase \"[object Uint8Array]\":\n\t\t\tcase \"[object Uint8ClampedArray]\":\n\t\t\tcase \"[object Uint16Array]\":\n\t\t\tcase \"[object Uint32Array]\":\n\t\t\t\treturn new source.constructor(\n\t\t\t\t\tcopyElement(source.buffer),\n\t\t\t\t\tsource.byteOffset,\n\t\t\t\t\tsource.length\n\t\t\t\t);\n\n\t\t\tcase \"[object ArrayBuffer]\":\n\t\t\t\t// Support: IE10\n\t\t\t\tif (!source.slice) {\n\t\t\t\t\t// If we're in this case we know the environment supports ArrayBuffer\n\t\t\t\t\t/* eslint-disable no-undef */\n\t\t\t\t\tvar copied = new ArrayBuffer(source.byteLength);\n\t\t\t\t\tnew Uint8Array(copied).set(new Uint8Array(source));\n\t\t\t\t\t/* eslint-enable */\n\t\t\t\t\treturn copied;\n\t\t\t\t}\n\t\t\t\treturn source.slice(0);\n\n\t\t\tcase \"[object Boolean]\":\n\t\t\tcase \"[object Number]\":\n\t\t\tcase \"[object String]\":\n\t\t\tcase \"[object Date]\":\n\t\t\t\treturn new source.constructor(source.valueOf());\n\n\t\t\tcase \"[object RegExp]\":\n\t\t\t\tvar re = new RegExp(\n\t\t\t\t\tsource.source,\n\t\t\t\t\tsource.toString().match(/[^\\/]*$/)[0]\n\t\t\t\t);\n\t\t\t\tre.lastIndex = source.lastIndex;\n\t\t\t\treturn re;\n\n\t\t\tcase \"[object Blob]\":\n\t\t\t\treturn new source.constructor([source], { type: source.type });\n\t\t}\n\n\t\tif (isFunction(source.cloneNode)) {\n\t\t\treturn source.cloneNode(true);\n\t\t}\n\t}\n}\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n * representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n *\n * @example\n <example module=\"equalsExample\" name=\"equalsExample\">\n <file name=\"index.html\">\n <div ng-controller=\"ExampleController\">\n <form novalidate>\n <h3>User 1</h3>\n Name: <input type=\"text\" ng-model=\"user1.name\">\n Age: <input type=\"number\" ng-model=\"user1.age\">\n\n <h3>User 2</h3>\n Name: <input type=\"text\" ng-model=\"user2.name\">\n Age: <input type=\"number\" ng-model=\"user2.age\">\n\n <div>\n <br/>\n <input type=\"button\" value=\"Compare\" ng-click=\"compare()\">\n </div>\n User 1: <pre>{{user1 | json}}</pre>\n User 2: <pre>{{user2 | json}}</pre>\n Equal: <pre>{{result}}</pre>\n </form>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) {\n $scope.user1 = {};\n $scope.user2 = {};\n $scope.compare = function() {\n $scope.result = angular.equals($scope.user1, $scope.user2);\n };\n }]);\n </file>\n </example>\n */\nfunction equals(o1, o2) {\n\tif (o1 === o2) return true;\n\tif (o1 === null || o2 === null) return false;\n\t// eslint-disable-next-line no-self-compare\n\tif (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n\tvar t1 = typeof o1,\n\t\tt2 = typeof o2,\n\t\tlength,\n\t\tkey,\n\t\tkeySet;\n\tif (t1 === t2 && t1 === \"object\") {\n\t\tif (isArray(o1)) {\n\t\t\tif (!isArray(o2)) return false;\n\t\t\tif ((length = o1.length) === o2.length) {\n\t\t\t\tfor (key = 0; key < length; key++) {\n\t\t\t\t\tif (!equals(o1[key], o2[key])) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (isDate(o1)) {\n\t\t\tif (!isDate(o2)) return false;\n\t\t\treturn equals(o1.getTime(), o2.getTime());\n\t\t} else if (isRegExp(o1)) {\n\t\t\tif (!isRegExp(o2)) return false;\n\t\t\treturn o1.toString() === o2.toString();\n\t\t} else {\n\t\t\tif (\n\t\t\t\tisScope(o1) ||\n\t\t\t\tisScope(o2) ||\n\t\t\t\tisWindow(o1) ||\n\t\t\t\tisWindow(o2) ||\n\t\t\t\tisArray(o2) ||\n\t\t\t\tisDate(o2) ||\n\t\t\t\tisRegExp(o2)\n\t\t\t)\n\t\t\t\treturn false;\n\t\t\tkeySet = createMap();\n\t\t\tfor (key in o1) {\n\t\t\t\tif (key.charAt(0) === \"$\" || isFunction(o1[key])) continue;\n\t\t\t\tif (!equals(o1[key], o2[key])) return false;\n\t\t\t\tkeySet[key] = true;\n\t\t\t}\n\t\t\tfor (key in o2) {\n\t\t\t\tif (\n\t\t\t\t\t!(key in keySet) &&\n\t\t\t\t\tkey.charAt(0) !== \"$\" &&\n\t\t\t\t\tisDefined(o2[key]) &&\n\t\t\t\t\t!isFunction(o2[key])\n\t\t\t\t)\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nvar csp = function () {\n\tif (!isDefined(csp.rules)) {\n\t\tvar ngCspElement =\n\t\t\twindow.document.querySelector(\"[ng-csp]\") ||\n\t\t\twindow.document.querySelector(\"[data-ng-csp]\");\n\n\t\tif (ngCspElement) {\n\t\t\tvar ngCspAttribute =\n\t\t\t\tngCspElement.getAttribute(\"ng-csp\") ||\n\t\t\t\tngCspElement.getAttribute(\"data-ng-csp\");\n\t\t\tcsp.rules = {\n\t\t\t\tnoUnsafeEval:\n\t\t\t\t\t!ngCspAttribute || ngCspAttribute.indexOf(\"no-unsafe-eval\") !== -1,\n\t\t\t\tnoInlineStyle:\n\t\t\t\t\t!ngCspAttribute || ngCspAttribute.indexOf(\"no-inline-style\") !== -1,\n\t\t\t};\n\t\t} else {\n\t\t\tcsp.rules = {\n\t\t\t\tnoUnsafeEval: noUnsafeEval(),\n\t\t\t\tnoInlineStyle: false,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn csp.rules;\n\n\tfunction noUnsafeEval() {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-new, no-new-func\n\t\t\tnew Function(\"\");\n\t\t\treturn false;\n\t\t} catch (e) {\n\t\t\treturn true;\n\t\t}\n\t}\n};\n\n/**\n * @ngdoc directive\n * @module ng\n * @name ngJq\n *\n * @element ANY\n * @param {string=} ngJq the name of the library available under `window`\n * to be used for angular.element\n * @description\n * Use this directive to force the angular.element library. This should be\n * used to force either jqLite by leaving ng-jq blank or setting the name of\n * the jquery variable under window (eg. jQuery).\n *\n * Since angular looks for this directive when it is loaded (doesn't wait for the\n * DOMContentLoaded event), it must be placed on an element that comes before the script\n * which loads angular. Also, only the first instance of `ng-jq` will be used and all\n * others ignored.\n *\n * @example\n * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.\n ```html\n <!doctype html>\n <html ng-app ng-jq>\n ...\n ...\n </html>\n ```\n * @example\n * This example shows how to use a jQuery based library of a different name.\n * The library name must be available at the top most 'window'.\n ```html\n <!doctype html>\n <html ng-app ng-jq=\"jQueryLib\">\n ...\n ...\n </html>\n ```\n */\nvar jq = function () {\n\tif (isDefined(jq.name_)) return jq.name_;\n\tvar el;\n\tvar i,\n\t\tii = ngAttrPrefixes.length,\n\t\tprefix,\n\t\tname;\n\tfor (i = 0; i < ii; ++i) {\n\t\tprefix = ngAttrPrefixes[i];\n\t\tel = window.document.querySelector(\n\t\t\t\"[\" + prefix.replace(\":\", \"\\\\:\") + \"jq]\"\n\t\t);\n\t\tif (el) {\n\t\t\tname = el.getAttribute(prefix + \"jq\");\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn (jq.name_ = name);\n};\n\nfunction concat(array1, array2, index) {\n\treturn array1.concat(slice.call(array2, index));\n}\n\nfunction sliceArgs(args, startIndex) {\n\treturn slice.call(args, startIndex || 0);\n}\n\n/**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\n// eslint-disable-next-line consistent-this\nfunction bind(self, fn) {\n\tvar curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n\tif (isFunction(fn) && !(fn instanceof RegExp)) {\n\t\treturn curryArgs.length\n\t\t\t? function () {\n\t\t\t\t\treturn arguments.length\n\t\t\t\t\t\t? fn.apply(self, concat(curryArgs, arguments, 0))\n\t\t\t\t\t\t: fn.apply(self, curryArgs);\n\t\t\t\t}\n\t\t\t: function () {\n\t\t\t\t\treturn arguments.length ? fn.apply(self, arguments) : fn.call(self);\n\t\t\t\t};\n\t} else {\n\t\t// In IE, native methods are not functions so they cannot be bound (note: they don't need to be).\n\t\treturn fn;\n\t}\n}\n\nfunction toJsonReplacer(key, value) {\n\tvar val = value;\n\n\tif (\n\t\ttypeof key === \"string\" &&\n\t\tkey.charAt(0) === \"$\" &&\n\t\tkey.charAt(1) === \"$\"\n\t) {\n\t\tval = undefined;\n\t} else if (isWindow(value)) {\n\t\tval = \"$WINDOW\";\n\t} else if (value && window.document === value) {\n\t\tval = \"$DOCUMENT\";\n\t} else if (isScope(value)) {\n\t\tval = \"$SCOPE\";\n\t}\n\n\treturn val;\n}\n\n/**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since angular uses this notation internally.\n *\n * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON.\n * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.\n * If set to an integer, the JSON output will contain that many spaces per indentation.\n * @returns {string|undefined} JSON-ified string representing `obj`.\n * @knownIssue\n *\n * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date`\n * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the\n * `Date.prototype.toJSON` method as follows:\n *\n * ```\n * var _DatetoJSON = Date.prototype.toJSON;\n * Date.prototype.toJSON = function() {\n * try {\n * return _DatetoJSON.call(this);\n * } catch(e) {\n * if (e instanceof RangeError) {\n * return null;\n * }\n * throw e;\n * }\n * };\n * ```\n *\n * See https://github.com/angular/angular.js/pull/14221 for more information.\n */\nfunction toJson(obj, pretty) {\n\tif (isUndefined(obj)) return undefined;\n\tif (!isNumber(pretty)) {\n\t\tpretty = pretty ? 2 : null;\n\t}\n\treturn JSON.stringify(obj, toJsonReplacer, pretty);\n}\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\nfunction fromJson(json) {\n\treturn isString(json) ? JSON.parse(json) : json;\n}\n\nvar ALL_COLONS = /:/g;\nfunction timezoneToOffset(timezone, fallback) {\n\t// IE/Edge do not \"understand\" colon (`:`) in timezone\n\ttimezone = timezone.replace(ALL_COLONS, \"\");\n\tvar requestedTimezoneOffset =\n\t\tDate.parse(\"Jan 01, 1970 00:00:00 \" + timezone) / 60000;\n\treturn isNumberNaN(requestedTimezoneOffset)\n\t\t? fallback\n\t\t: requestedTimezoneOffset;\n}\n\nfunction addDateMinutes(date, minutes) {\n\tdate = new Date(date.getTime());\n\tdate.setMinutes(date.getMinutes() + minutes);\n\treturn date;\n}\n\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n\treverse = reverse ? -1 : 1;\n\tvar dateTimezoneOffset = date.getTimezoneOffset();\n\tvar timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n\treturn addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n}\n\n/**\n * @returns {string} Returns the string representation of the element.\n */\nfunction startingTag(element) {\n\telement = jqLite(element).clone();\n\ttry {\n\t\t// turns out IE does not let you set .html() on elements which\n\t\t// are not allowed to have children. So we just ignore it.\n\t\telement.empty();\n\t} catch (e) {\n\t\t/* empty */\n\t}\n\tvar elemHtml = jqLite(\"<div>\").append(element).html();\n\ttry {\n\t\treturn element[0].nodeType === NODE_TYPE_TEXT\n\t\t\t? lowercase(elemHtml)\n\t\t\t: elemHtml\n\t\t\t\t\t.match(/^(<[^>]+>)/)[1]\n\t\t\t\t\t.replace(/^<([\\w\\-]+)/, function (match, nodeName) {\n\t\t\t\t\t\treturn \"<\" + lowercase(nodeName);\n\t\t\t\t\t});\n\t} catch (e) {\n\t\treturn lowercase(elemHtml);\n\t}\n}\n\n/////////////////////////////////////////////////\n\n/**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\nfunction tryDecodeURIComponent(value) {\n\ttry {\n\t\treturn decodeURIComponent(value);\n\t} catch (e) {\n\t\t// Ignore any invalid uri component.\n\t}\n}\n\n/**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.<string,boolean|Array>}\n */\nfunction parseKeyValue(/**string*/ keyValue) {\n\tvar obj = {};\n\tforEach((keyValue || \"\").split(\"&\"), function (keyValue) {\n\t\tvar splitPoint, key, val;\n\t\tif (keyValue) {\n\t\t\tkey = keyValue = keyValue.replace(/\\+/g, \"%20\");\n\t\t\tsplitPoint = keyValue.indexOf(\"=\");\n\t\t\tif (splitPoint !== -1) {\n\t\t\t\tkey = keyValue.substring(0, splitPoint);\n\t\t\t\tval = keyValue.substring(splitPoint + 1);\n\t\t\t}\n\t\t\tkey = tryDecodeURIComponent(key);\n\t\t\tif (isDefined(key)) {\n\t\t\t\tval = isDefined(val) ? tryDecodeURIComponent(val) : true;\n\t\t\t\tif (!hasOwnProperty.call(obj, key)) {\n\t\t\t\t\tobj[key] = val;\n\t\t\t\t} else if (isArray(obj[key])) {\n\t\t\t\t\tobj[key].push(val);\n\t\t\t\t} else {\n\t\t\t\t\tobj[key] = [obj[key], val];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn obj;\n}\n\nfunction toKeyValue(obj) {\n\tvar parts = [];\n\tforEach(obj, function (value, key) {\n\t\tif (isArray(value)) {\n\t\t\tforEach(value, function (arrayValue) {\n\t\t\t\tparts.push(\n\t\t\t\t\tencodeUriQuery(key, true) +\n\t\t\t\t\t\t(arrayValue === true ? \"\" : \"=\" + encodeUriQuery(arrayValue, true))\n\t\t\t\t);\n\t\t\t});\n\t\t} else {\n\t\t\tparts.push(\n\t\t\t\tencodeUriQuery(key, true) +\n\t\t\t\t\t(value === true ? \"\" : \"=\" + encodeUriQuery(value, true))\n\t\t\t);\n\t\t}\n\t});\n\treturn parts.length ? parts.join(\"&\") : \"\";\n}\n\n/**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n * segment = *pchar\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriSegment(val) {\n\treturn encodeUriQuery(val, true)\n\t\t.replace(/%26/gi, \"&\")\n\t\t.replace(/%3D/gi, \"=\")\n\t\t.replace(/%2B/gi, \"+\");\n}\n\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriQuery(val, pctEncodeSpaces) {\n\treturn encodeURIComponent(val)\n\t\t.replace(/%40/gi, \"@\")\n\t\t.replace(/%3A/gi, \":\")\n\t\t.replace(/%24/g, \"$\")\n\t\t.replace(/%2C/gi, \",\")\n\t\t.replace(/%3B/gi, \";\")\n\t\t.replace(/%20/g, pctEncodeSpaces ? \"%20\" : \"+\");\n}\n\nfunction getNgAttribute(element, ngAttr) {\n\tvar attr,\n\t\ti,\n\t\tii = ngAttrPrefixes.length;\n\tfor (i = 0; i < ii; ++i) {\n\t\tattr = ngAttrPrefixes[i] + ngAttr;\n\t\tif (isString((attr = element.getAttribute(attr)))) {\n\t\t\treturn attr;\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction allowAutoBootstrap(document) {\n\tif (!document.currentScript) {\n\t\treturn true;\n\t}\n\tvar src = document.currentScript.getAttribute(\"src\");\n\tvar link = document.createElement(\"a\");\n\tlink.href = src;\n\tvar scriptProtocol = link.protocol;\n\tvar docLoadProtocol = document.location.protocol;\n\tif (\n\t\t(scriptProtocol === \"resource:\" ||\n\t\t\tscriptProtocol === \"chrome-extension:\") &&\n\t\tdocLoadProtocol !== scriptProtocol\n\t) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n// Cached as it has to run during loading so that document.currentScript is available.\nvar isAutoBootstrapAllowed = allowAutoBootstrap(window.document);\n\n/**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n * {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n * created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n * do not use explicit function annotation (and are thus unsuitable for minification), as described\n * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n * tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `<body>` or `<html>` tags.\n *\n * There are a few things to keep in mind when using `ngApp`:\n * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead.\n * - AngularJS applications cannot be nested within each other.\n * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.\n * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and\n * {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application. This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n <example module=\"ngAppDemo\" name=\"ng-app\">\n <file name=\"index.html\">\n <div ng-controller=\"ngAppDemoController\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n });\n </file>\n </example>\n *\n * Using `ngStrictDi`, you would see something like this:\n *\n <example ng-app-included=\"true\" name=\"strict-di\">\n <file name=\"index.html\">\n <div ng-app=\"ngAppStrictDemo\" ng-strict-di>\n <div ng-controller=\"GoodController1\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n\n <p>This renders because the controller does not fail to\n instantiate, by using explicit annotation style (see\n script.js for details)\n </p>\n </div>\n\n <div ng-controller=\"GoodController2\">\n Name: <input ng-model=\"name\"><br />\n Hello, {{name}}!\n\n <p>This renders because the controller does not fail to\n instantiate, by using explicit annotation style\n (see script.js for details)\n </p>\n </div>\n\n <div ng-controller=\"BadController\">\n I can add: {{a}} + {{b}} = {{ a+b }}\n\n <p>The controller could not be instantiated, due to relying\n on automatic function annotations (which are disabled in\n strict mode). As such, the content of this section is not\n interpolated, and there should be an error in your web console.\n </p>\n </div>\n </div>\n </file>\n <file name=\"script.js\">\n angular.module('ngAppStrictDemo', [])\n // BadController will fail to instantiate, due to relying on automatic function annotation,\n // rather than an explicit annotation\n .controller('BadController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n })\n // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n // due to using explicit annotations using the array style and $inject property, respectively.\n .controller('GoodController1', ['$scope', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n }])\n .controller('GoodController2', GoodController2);\n function GoodController2($scope) {\n $scope.name = 'World';\n }\n GoodController2.$inject = ['$scope'];\n </file>\n <file name=\"style.css\">\n div[ng-controller] {\n margin-bottom: 1em;\n -webkit-border-radius: 4px;\n border-radius: 4px;\n border: 1px solid;\n padding: .5em;\n }\n div[ng-controller^=Good] {\n border-color: #d6e9c6;\n background-color: #dff0d8;\n color: #3c763d;\n }\n div[ng-controller^=Bad] {\n border-color: #ebccd1;\n background-color: #f2dede;\n color: #a94442;\n margin-bottom: 0;\n }\n </file>\n </example>\n */\n\n/**\n * @ngdoc function\n * @name angular.bootstrap\n * @module ng\n * @description\n * Use this function to manually start up angular application.\n *\n * For more information, see the {@link guide/bootstrap Bootstrap guide}.\n *\n * Angular will detect if it has been loaded into the browser more than once and only allow the\n * first loaded script to be bootstrapped and will report a warning to the browser console for\n * each of the subsequent scripts. This prevents strange results in applications, where otherwise\n * multiple instances of Angular try to work on the DOM.\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Protractor based end-to-end tests cannot use this function to bootstrap manually.\n * They must use {@link ng.directive:ngApp ngApp}.\n * </div>\n *\n * <div class=\"alert alert-warning\">\n * **Note:** Do not bootstrap the app on an element with a directive that uses {@link ng.$compile#transclusion transclusion},\n * such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n * </div>\n *\n * ```html\n * <!doctype html>\n * <html>\n * <body>\n * <div ng-controller=\"WelcomeController\">\n * {{greeting}}\n * </div>\n *\n * <script src=\"angular.js\"></script>\n * <script>\n * var app = angular.module('demo', [])\n * .controller('WelcomeController', function($scope) {\n * $scope.greeting = 'Welcome!';\n * });\n * angular.bootstrap(document, ['demo']);\n * </script>\n * </body>\n * </html>\n * ```\n *\n * @param {DOMElement} element DOM element which is the root of angular application.\n * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n * following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n * assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules, config) {\n\tif (!isObject(config)) config = {};\n\tvar defaultConfig = {\n\t\tstrictDi: false,\n\t};\n\tconfig = extend(defaultConfig, config);\n\tvar doBootstrap = function () {\n\t\telement = jqLite(element);\n\n\t\tif (element.injector()) {\n\t\t\tvar tag =\n\t\t\t\telement[0] === window.document ? \"document\" : startingTag(element);\n\t\t\t// Encode angle brackets to prevent input from being sanitized to empty string #8683.\n\t\t\tthrow ngMinErr(\n\t\t\t\t\"btstrpd\",\n\t\t\t\t\"App already bootstrapped with this element '{0}'\",\n\t\t\t\ttag.replace(/</, \"<\").replace(/>/, \">\")\n\t\t\t);\n\t\t}\n\n\t\tmodules = modules || [];\n\t\tmodules.unshift([\n\t\t\t\"$provide\",\n\t\t\tfunction ($provide) {\n\t\t\t\t$provide.value(\"$rootElement\", element);\n\t\t\t},\n\t\t]);\n\n\t\tif (config.debugInfoEnabled) {\n\t\t\t// Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n\t\t\tmodules.push([\n\t\t\t\t\"$compileProvider\",\n\t\t\t\tfunction ($compileProvider) {\n\t\t\t\t\t$compileProvider.debugInfoEnabled(true);\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\tmodules.unshift(\"ng\");\n\t};\n\n\tvar NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n\tvar NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n\n\tif (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n\t\tconfig.debugInfoEnabled = true;\n\t\twindow.name = window.name.replace(NG_ENABLE_DEBUG_INFO, \"\");\n\t}\n\n\tif (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n\t\treturn doBootstrap();\n\t}\n\n\twindow.name = window.name.replace(NG_DEFER_BOOTSTRAP, \"\");\n\tangular.resumeBootstrap = function (extraModules) {\n\t\tforEach(extraModules, function (module) {\n\t\t\tmodules.push(module);\n\t\t});\n\t\treturn doBootstrap();\n\t};\n\n\tif (isFunction(angular.resumeDeferredBootstrap)) {\n\t\tangular.resumeDeferredBootstrap();\n\t}\n}\n\n/**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\nfunction reloadWithDebugInfo() {\n\twindow.name = \"NG_ENABLE_DEBUG_INFO!\" + window.name;\n\twindow.location.reload();\n}\n\n/**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of Angular on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of angular application.\n */\nfunction getTestability(rootElement) {\n\tvar injector = angular.element(rootElement).injector();\n\tif (!injector) {\n\t\tthrow ngMinErr(\n\t\t\t\"test\",\n\t\t\t\"no injector found for element argument to getTestability\"\n\t\t);\n\t}\n\treturn injector.get(\"$$testability\");\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n\tseparator = separator || \"_\";\n\treturn name.replace(SNAKE_CASE_REGEXP, function (letter, pos) {\n\t\treturn (pos ? separator : \"\") + letter.toLowerCase();\n\t});\n}\n\nvar bindJQueryFired = false;\nfunction bindJQuery() {\n\tvar originalCleanData;\n\n\tif (bindJQueryFired) {\n\t\treturn;\n\t}\n\n\t// bind to jQuery if present;\n\tvar jqName = jq();\n\tjQuery = isUndefined(jqName)\n\t\t? window.jQuery // use jQuery (if present)\n\t\t: !jqName\n\t\t\t? undefined // use jqLite\n\t\t\t: window[jqName]; // use jQuery specified by `ngJq`\n\n\t// Use jQuery if it exists with proper functionality, otherwise default to us.\n\t// Angular 1.2+ requires jQuery 1.7+ for on()/off() support.\n\t// Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n\t// versions. It will not work for sure with jQuery <1.7, though.\n\tif (jQuery && jQuery.fn.on) {\n\t\tjqLite = jQuery;\n\t\textend(jQuery.fn, {\n\t\t\tscope: JQLitePrototype.scope,\n\t\t\tisolateScope: JQLitePrototype.isolateScope,\n\t\t\tcontroller: JQLitePrototype.controller,\n\t\t\tinjector: JQLitePrototype.injector,\n\t\t\tinheritedData: JQLitePrototype.inheritedData,\n\t\t});\n\n\t\t// All nodes removed from the DOM via various jQuery APIs like .remove()\n\t\t// are passed through jQuery.cleanData. Monkey-patch this method to fire\n\t\t// the $destroy event on all removed nodes.\n\t\toriginalCleanData = jQuery.cleanData;\n\t\tjQuery.cleanData = function (elems) {\n\t\t\tvar events;\n\t\t\tfor (var i = 0, elem; (elem = elems[i]) != null; i++) {\n\t\t\t\tevents = jQuery._data(elem, \"events\");\n\t\t\t\tif (events && events.$destroy) {\n\t\t\t\t\tjQuery(elem).triggerHandler(\"$destroy\");\n\t\t\t\t}\n\t\t\t}\n\t\t\toriginalCleanData(elems);\n\t\t};\n\t} else {\n\t\tjqLite = JQLite;\n\t}\n\n\tangular.element = jqLite;\n\n\t// Prevent double-proxying.\n\tbindJQueryFired = true;\n}\n\n/**\n * throw error if the argument is falsy.\n */\nfunction assertArg(arg, name, reason) {\n\tif (!arg) {\n\t\tthrow ngMinErr(\n\t\t\t\"areq\",\n\t\t\t\"Argument '{0}' is {1}\",\n\t\t\tname || \"?\",\n\t\t\treason || \"required\"\n\t\t);\n\t}\n\treturn arg;\n}\n\nfunction assertArgFn(arg, name, acceptArrayAnnotation) {\n\tif (acceptArrayAnnotation && isArray(arg)) {\n\t\targ = arg[arg.length - 1];\n\t}\n\n\tassertArg(\n\t\tisFunction(arg),\n\t\tname,\n\t\t\"not a function, got \" +\n\t\t\t(arg && typeof arg === \"object\"\n\t\t\t\t? arg.constructor.name || \"Object\"\n\t\t\t\t: typeof arg)\n\t);\n\treturn arg;\n}\n\n/**\n * throw error if the name given is hasOwnProperty\n * @param {String} name the name to test\n * @param {String} context the context in which the name is used, such as module or directive\n */\nfunction assertNotHasOwnProperty(name, context) {\n\tif (name === \"hasOwnProperty\") {\n\t\tthrow ngMinErr(\n\t\t\t\"badname\",\n\t\t\t\"hasOwnProperty is not a valid {0} name\",\n\t\t\tcontext\n\t\t);\n\t}\n}\n\n/**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n//TODO(misko): this function needs to be removed\nfunction getter(obj, path, bindFnToScope) {\n\tif (!path) return obj;\n\tvar keys = path.split(\".\");\n\tvar key;\n\tvar lastInstance = obj;\n\tvar len = keys.length;\n\n\tfor (var i = 0; i < len; i++) {\n\t\tkey = keys[i];\n\t\tif (obj) {\n\t\t\tobj = (lastInstance = obj)[key];\n\t\t}\n\t}\n\tif (!bindFnToScope && isFunction(obj)) {\n\t\treturn bind(lastInstance, obj);\n\t}\n\treturn obj;\n}\n\n/**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {Array} the inputted object or a jqLite collection containing the nodes\n */\nfunction getBlockNodes(nodes) {\n\t// TODO(perf): update `nodes` instead of creating a new object?\n\tvar node = nodes[0];\n\tvar endNode = nodes[nodes.length - 1];\n\tvar blockNodes;\n\n\tfor (var i = 1; node !== endNode && (node = node.nextSibling); i++) {\n\t\tif (blockNodes || nodes[i] !== node) {\n\t\t\tif (!blockNodes) {\n\t\t\t\tblockNodes = jqLite(slice.call(nodes, 0, i));\n\t\t\t}\n\t\t\tblockNodes.push(node);\n\t\t}\n\t}\n\n\treturn blockNodes || nodes;\n}\n\n/**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\nfunction createMap() {\n\treturn Object.create(null);\n}\n\nfunction stringify(value) {\n\tif (value == null) {\n\t\t// null || undefined\n\t\treturn \"\";\n\t}\n\tswitch (typeof value) {\n\t\tcase \"string\":\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tvalue = \"\" + value;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (hasCustomToString(value) && !isArray(value) && !isDate(value)) {\n\t\t\t\tvalue = value.toString();\n\t\t\t} else {\n\t\t\t\tvalue = toJson(value);\n\t\t\t}\n\t}\n\n\treturn value;\n}\n\n/* global toDebugString: true */\n\nfunction serializeObject(obj) {\n\tvar seen = [];\n\n\treturn JSON.stringify(obj, function (key, val) {\n\t\tval = toJsonReplacer(key, val);\n\t\tif (isObject(val)) {\n\t\t\tif (seen.indexOf(val) >= 0) return \"...\";\n\n\t\t\tseen.push(val);\n\t\t}\n\t\treturn val;\n\t});\n}\n\nfunction toDebugString(obj) {\n\tif (typeof obj === \"function\") {\n\t\treturn obj.toString().replace(/ \\{[\\s\\S]*$/, \"\");\n\t} else if (isUndefined(obj)) {\n\t\treturn \"undefined\";\n\t} else if (typeof obj !== \"string\") {\n\t\treturn serializeObject(obj);\n\t}\n\treturn obj;\n}\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * Angular. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one. The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace') . Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n * error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n\tErrorConstructor = ErrorConstructor || Error;\n\treturn function () {\n\t\tvar SKIP_INDEXES = 2;\n\n\t\tvar templateArgs = arguments,\n\t\t\tcode = templateArgs[0],\n\t\t\tmessage = \"[\" + (module ? module + \":\" : \"\") + code + \"] \",\n\t\t\ttemplate = templateArgs[1],\n\t\t\tparamPrefix,\n\t\t\ti;\n\n\t\tmessage += template.replace(/\\{\\d+\\}/g, function (match) {\n\t\t\tvar index = +match.slice(1, -1),\n\t\t\t\tshiftedIndex = index + SKIP_INDEXES;\n\n\t\t\tif (shiftedIndex < templateArgs.length) {\n\t\t\t\treturn toDebugString(templateArgs[shiftedIndex]);\n\t\t\t}\n\n\t\t\treturn match;\n\t\t});\n\n\t\tmessage +=\n\t\t\t'\\nhttp://errors.angularjs.org/\"NG_VERSION_FULL\"/' +\n\t\t\t(module ? module + \"/\" : \"\") +\n\t\t\tcode;\n\n\t\tfor (\n\t\t\ti = SKIP_INDEXES, paramPrefix = \"?\";\n\t\t\ti < templateArgs.length;\n\t\t\ti++, paramPrefix = \"&\"\n\t\t) {\n\t\t\tmessage +=\n\t\t\t\tparamPrefix +\n\t\t\t\t\"p\" +\n\t\t\t\t(i - SKIP_INDEXES) +\n\t\t\t\t\"=\" +\n\t\t\t\tencodeURIComponent(toDebugString(templateArgs[i]));\n\t\t}\n\n\t\treturn new ErrorConstructor(message);\n\t};\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $parseMinErr = minErr(\"$parse\");\n\nvar objectValueOf = {}.constructor.prototype.valueOf;\n\n// Sandboxing Angular Expressions\n// ------------------------------\n// Angular expressions are no longer sandboxed. So it is now even easier to access arbitrary JS code by\n// various means such as obtaining a reference to native JS functions like the Function constructor.\n//\n// As an example, consider the following Angular expression:\n//\n// {}.toString.constructor('alert(\"evil JS code\")')\n//\n// It is important to realize that if you create an expression from a string that contains user provided\n// content then it is possible that your application contains a security vulnerability to an XSS style attack.\n//\n// See https://docs.angularjs.org/guide/security\n\nfunction getStringValue(name) {\n\t// Property names must be strings. This means that non-string objects cannot be used\n\t// as keys in an object. Any non-string object, including a number, is typecasted\n\t// into a string via the toString method.\n\t// -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names\n\t//\n\t// So, to ensure that we are checking the same `name` that JavaScript would use, we cast it\n\t// to a string. It's not always possible. If `name` is an object and its `toString` method is\n\t// 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:\n\t//\n\t// TypeError: Cannot convert object to primitive value\n\t//\n\t// For performance reasons, we don't catch this error here and allow it to propagate up the call\n\t// stack. Note that you'll get the same error in JavaScript if you try to access a property using\n\t// such a 'broken' object as a key.\n\treturn name + \"\";\n}\n\nvar OPERATORS = createMap();\nforEach(\n\t\"+ - * / % === !== == != < > <= >= && || ! = |\".split(\" \"),\n\tfunction (operator) {\n\t\tOPERATORS[operator] = true;\n\t}\n);\nvar ESCAPE = {\n\tn: \"\\n\",\n\tf: \"\\f\",\n\tr: \"\\r\",\n\tt: \"\\t\",\n\tv: \"\\v\",\n\t\"'\": \"'\",\n\t'\"': '\"',\n};\n\n/////////////////////////////////////////\n\n/**\n * @constructor\n */\nvar Lexer = function Lexer(options) {\n\tthis.options = options;\n};\n\nLexer.prototype = {\n\tconstructor: Lexer,\n\n\tlex: function (text) {\n\t\tthis.text = text;\n\t\tthis.index = 0;\n\t\tthis.tokens = [];\n\n\t\twhile (this.index < this.text.length) {\n\t\t\tvar ch = this.text.charAt(this.index);\n\t\t\tif (ch === '\"' || ch === \"'\") {\n\t\t\t\tthis.readString(ch);\n\t\t\t} else if (\n\t\t\t\tthis.isNumber(ch) ||\n\t\t\t\t(ch === \".\" && this.isNumber(this.peek()))\n\t\t\t) {\n\t\t\t\tthis.readNumber();\n\t\t\t} else if (this.isIdentifierStart(this.peekMultichar())) {\n\t\t\t\tthis.readIdent();\n\t\t\t} else if (this.is(ch, \"(){}[].,;:?\")) {\n\t\t\t\tthis.tokens.push({ index: this.index, text: ch });\n\t\t\t\tthis.index++;\n\t\t\t} else if (this.isWhitespace(ch)) {\n\t\t\t\tthis.index++;\n\t\t\t} else {\n\t\t\t\tvar ch2 = ch + this.peek();\n\t\t\t\tvar ch3 = ch2 + this.peek(2);\n\t\t\t\tvar op1 = OPERATORS[ch];\n\t\t\t\tvar op2 = OPERATORS[ch2];\n\t\t\t\tvar op3 = OPERATORS[ch3];\n\t\t\t\tif (op1 || op2 || op3) {\n\t\t\t\t\tvar token = op3 ? ch3 : op2 ? ch2 : ch;\n\t\t\t\t\tthis.tokens.push({ index: this.index, text: token, operator: true });\n\t\t\t\t\tthis.index += token.length;\n\t\t\t\t} else {\n\t\t\t\t\tthis.throwError(\n\t\t\t\t\t\t\"Unexpected next character \",\n\t\t\t\t\t\tthis.index,\n\t\t\t\t\t\tthis.index + 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.tokens;\n\t},\n\n\tis: function (ch, chars) {\n\t\treturn chars.indexOf(ch) !== -1;\n\t},\n\n\tpeek: function (i) {\n\t\tvar num = i || 1;\n\t\treturn this.index + num < this.text.length\n\t\t\t? this.text.charAt(this.index + num)\n\t\t\t: false;\n\t},\n\n\tisNumber: function (ch) {\n\t\treturn \"0\" <= ch && ch <= \"9\" && typeof ch === \"string\";\n\t},\n\n\tisWhitespace: function (ch) {\n\t\t// IE treats non-breaking space as \\u00A0\n\t\treturn (\n\t\t\tch === \" \" ||\n\t\t\tch === \"\\r\" ||\n\t\t\tch === \"\\t\" ||\n\t\t\tch === \"\\n\" ||\n\t\t\tch === \"\\v\" ||\n\t\t\tch === \"\\u00A0\"\n\t\t);\n\t},\n\n\tisIdentifierStart: function (ch) {\n\t\treturn this.options.isIdentifierStart\n\t\t\t? this.options.isIdentifierStart(ch, this.codePointAt(ch))\n\t\t\t: this.isValidIdentifierStart(ch);\n\t},\n\n\tisValidIdentifierStart: function (ch) {\n\t\treturn (\n\t\t\t(\"a\" <= ch && ch <= \"z\") ||\n\t\t\t(\"A\" <= ch && ch <= \"Z\") ||\n\t\t\t\"_\" === ch ||\n\t\t\tch === \"$\"\n\t\t);\n\t},\n\n\tisIdentifierContinue: function (ch) {\n\t\treturn this.options.isIdentifierContinue\n\t\t\t? this.options.isIdentifierContinue(ch, this.codePointAt(ch))\n\t\t\t: this.isValidIdentifierContinue(ch);\n\t},\n\n\tisValidIdentifierContinue: function (ch, cp) {\n\t\treturn this.isValidIdentifierStart(ch, cp) || this.isNumber(ch);\n\t},\n\n\tcodePointAt: function (ch) {\n\t\tif (ch.length === 1) return ch.charCodeAt(0);\n\t\t// eslint-disable-next-line no-bitwise\n\t\treturn (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35fdc00;\n\t},\n\n\tpeekMultichar: function () {\n\t\tvar ch = this.text.charAt(this.index);\n\t\tvar peek = this.peek();\n\t\tif (!peek) {\n\t\t\treturn ch;\n\t\t}\n\t\tvar cp1 = ch.charCodeAt(0);\n\t\tvar cp2 = peek.charCodeAt(0);\n\t\tif (cp1 >= 0xd800 && cp1 <= 0xdbff && cp2 >= 0xdc00 && cp2 <= 0xdfff) {\n\t\t\treturn ch + peek;\n\t\t}\n\t\treturn ch;\n\t},\n\n\tisExpOperator: function (ch) {\n\t\treturn ch === \"-\" || ch === \"+\" || this.isNumber(ch);\n\t},\n\n\tthrowError: function (error, start, end) {\n\t\tend = end || this.index;\n\t\tvar colStr = isDefined(start)\n\t\t\t? \"s \" +\n\t\t\t\tstart +\n\t\t\t\t\"-\" +\n\t\t\t\tthis.index +\n\t\t\t\t\" [\" +\n\t\t\t\tthis.text.substring(start, end) +\n\t\t\t\t\"]\"\n\t\t\t: \" \" + end;\n\t\tthrow $parseMinErr(\n\t\t\t\"lexerr\",\n\t\t\t\"Lexer Error: {0} at column{1} in expression [{2}].\",\n\t\t\terror,\n\t\t\tcolStr,\n\t\t\tthis.text\n\t\t);\n\t},\n\n\treadNumber: function () {\n\t\tvar number = \"\";\n\t\tvar start = this.index;\n\t\twhile (this.index < this.text.length) {\n\t\t\tvar ch = lowercase(this.text.charAt(this.index));\n\t\t\tif (ch === \".\" || this.isNumber(ch)) {\n\t\t\t\tnumber += ch;\n\t\t\t} else {\n\t\t\t\tvar peekCh = this.peek();\n\t\t\t\tif (ch === \"e\" && this.isExpOperator(peekCh)) {\n\t\t\t\t\tnumber += ch;\n\t\t\t\t} else if (\n\t\t\t\t\tthis.isExpOperator(ch) &&\n\t\t\t\t\tpeekCh &&\n\t\t\t\t\tthis.isNumber(peekCh) &&\n\t\t\t\t\tnumber.charAt(number.length - 1) === \"e\"\n\t\t\t\t) {\n\t\t\t\t\tnumber += ch;\n\t\t\t\t} else if (\n\t\t\t\t\tthis.isExpOperator(ch) &&\n\t\t\t\t\t(!peekCh || !this.isNumber(peekCh)) &&\n\t\t\t\t\tnumber.charAt(number.length - 1) === \"e\"\n\t\t\t\t) {\n\t\t\t\t\tthis.throwError(\"Invalid exponent\");\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.index++;\n\t\t}\n\t\tthis.tokens.push({\n\t\t\tindex: start,\n\t\t\ttext: number,\n\t\t\tconstant: true,\n\t\t\tvalue: Number(number),\n\t\t});\n\t},\n\n\treadIdent: function () {\n\t\tvar start = this.index;\n\t\tthis.index += this.peekMultichar().length;\n\t\twhile (this.index < this.text.length) {\n\t\t\tvar ch = this.peekMultichar();\n\t\t\tif (!this.isIdentifierContinue(ch)) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.index += ch.length;\n\t\t}\n\t\tthis.tokens.push({\n\t\t\tindex: start,\n\t\t\ttext: this.text.slice(start, this.index),\n\t\t\tidentifier: true,\n\t\t});\n\t},\n\n\treadString: function (quote) {\n\t\tvar start = this.index;\n\t\tthis.index++;\n\t\tvar string = \"\";\n\t\tvar rawString = quote;\n\t\tvar escape = false;\n\t\twhile (this.index < this.text.length) {\n\t\t\tvar ch = this.text.charAt(this.index);\n\t\t\trawString += ch;\n\t\t\tif (escape) {\n\t\t\t\tif (ch === \"u\") {\n\t\t\t\t\tvar hex = this.text.substring(this.index + 1, this.index + 5);\n\t\t\t\t\tif (!hex.match(/[\\da-f]{4}/i)) {\n\t\t\t\t\t\tthis.throwError(\"Invalid unicode escape [\\\\u\" + hex + \"]\");\n\t\t\t\t\t}\n\t\t\t\t\tthis.index += 4;\n\t\t\t\t\tstring += String.fromCharCode(parseInt(hex, 16));\n\t\t\t\t} else {\n\t\t\t\t\tvar rep = ESCAPE[ch];\n\t\t\t\t\tstring = string + (rep || ch);\n\t\t\t\t}\n\t\t\t\tescape = false;\n\t\t\t} else if (ch === \"\\\\\") {\n\t\t\t\tescape = true;\n\t\t\t} else if (ch === quote) {\n\t\t\t\tthis.index++;\n\t\t\t\tthis.tokens.push({\n\t\t\t\t\tindex: start,\n\t\t\t\t\ttext: rawString,\n\t\t\t\t\tconstant: true,\n\t\t\t\t\tvalue: string,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tstring += ch;\n\t\t\t}\n\t\t\tthis.index++;\n\t\t}\n\t\tthis.throwError(\"Unterminated quote\", start);\n\t},\n};\n\nvar AST = function AST(lexer, options) {\n\tthis.lexer = lexer;\n\tthis.options = options;\n};\n\nAST.Program = \"Program\";\nAST.ExpressionStatement = \"ExpressionStatement\";\nAST.AssignmentExpression = \"AssignmentExpression\";\nAST.ConditionalExpression = \"ConditionalExpression\";\nAST.LogicalExpression = \"LogicalExpression\";\nAST.BinaryExpression = \"BinaryExpression\";\nAST.UnaryExpression = \"UnaryExpression\";\nAST.CallExpression = \"CallExpression\";\nAST.MemberExpression = \"MemberExpression\";\nAST.Identifier = \"Identifier\";\nAST.Literal = \"Literal\";\nAST.ArrayExpression = \"ArrayExpression\";\nAST.Property = \"Property\";\nAST.ObjectExpression = \"ObjectExpression\";\nAST.ThisExpression = \"ThisExpression\";\nAST.LocalsExpression = \"LocalsExpression\";\n\n// Internal use only\nAST.NGValueParameter = \"NGValueParameter\";\n\nAST.prototype = {\n\tast: function (text) {\n\t\tthis.text = text;\n\t\tthis.tokens = this.lexer.lex(text);\n\n\t\tvar value = this.program();\n\n\t\tif (this.tokens.length !== 0) {\n\t\t\tthis.throwError(\"is an unexpected token\", this.tokens[0]);\n\t\t}\n\n\t\treturn value;\n\t},\n\n\tprogram: function () {\n\t\tvar body = [];\n\t\twhile (true) {\n\t\t\tif (this.tokens.length > 0 && !this.peek(\"}\", \")\", \";\", \"]\"))\n\t\t\t\tbody.push(this.expressionStatement());\n\t\t\tif (!this.expect(\";\")) {\n\t\t\t\treturn { type: AST.Program, body: body };\n\t\t\t}\n\t\t}\n\t},\n\n\texpressionStatement: function () {\n\t\treturn { type: AST.ExpressionStatement, expression: this.filterChain() };\n\t},\n\n\tfilterChain: function () {\n\t\tvar left = this.expression();\n\t\twhile (this.expect(\"|\")) {\n\t\t\tleft = this.filter(left);\n\t\t}\n\t\treturn left;\n\t},\n\n\texpression: function () {\n\t\treturn this.assignment();\n\t},\n\n\tassignment: function () {\n\t\tvar result = this.ternary();\n\t\tif (this.expect(\"=\")) {\n\t\t\tif (!isAssignable(result)) {\n\t\t\t\tthrow $parseMinErr(\"lval\", \"Trying to assign a value to a non l-value\");\n\t\t\t}\n\n\t\t\tresult = {\n\t\t\t\ttype: AST.AssignmentExpression,\n\t\t\t\tleft: result,\n\t\t\t\tright: this.assignment(),\n\t\t\t\toperator: \"=\",\n\t\t\t};\n\t\t}\n\t\treturn result;\n\t},\n\n\tternary: function () {\n\t\tvar test = this.logicalOR();\n\t\tvar alternate;\n\t\tvar consequent;\n\t\tif (this.expect(\"?\")) {\n\t\t\talternate = this.expression();\n\t\t\tif (this.consume(\":\")) {\n\t\t\t\tconsequent = this.expression();\n\t\t\t\treturn {\n\t\t\t\t\ttype: AST.ConditionalExpression,\n\t\t\t\t\ttest: test,\n\t\t\t\t\talternate: alternate,\n\t\t\t\t\tconsequent: consequent,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn test;\n\t},\n\n\tlogicalOR: function () {\n\t\tvar left = this.logicalAND();\n\t\twhile (this.expect(\"||\")) {\n\t\t\tleft = {\n\t\t\t\ttype: AST.LogicalExpression,\n\t\t\t\toperator: \"||\",\n\t\t\t\tleft: left,\n\t\t\t\tright: this.logicalAND(),\n\t\t\t};\n\t\t}\n\t\treturn left;\n\t},\n\n\tlogicalAND: function () {\n\t\tvar left = this.equality();\n\t\twhile (this.expect(\"&&\")) {\n\t\t\tleft = {\n\t\t\t\ttype: AST.LogicalExpression,\n\t\t\t\toperator: \"&&\",\n\t\t\t\tleft: left,\n\t\t\t\tright: this.equality(),\n\t\t\t};\n\t\t}\n\t\treturn left;\n\t},\n\n\tequality: function () {\n\t\tvar left = this.relational();\n\t\tvar token;\n\t\twhile ((token = this.expect(\"==\", \"!=\", \"===\", \"!==\"))) {\n\t\t\tleft = {\n\t\t\t\ttype: AST.BinaryExpression,\n\t\t\t\toperator: token.text,\n\t\t\t\tleft: left,\n\t\t\t\tright: this.relational(),\n\t\t\t};\n\t\t}\n\t\treturn left;\n\t},\n\n\trelational: function () {\n\t\tvar left = this.additive();\n\t\tvar token;\n\t\twhile ((token = this.expect(\"<\", \">\", \"<=\", \">=\"))) {\n\t\t\tleft = {\n\t\t\t\ttype: AST.BinaryExpression,\n\t\t\t\toperator: token.text,\n\t\t\t\tleft: left,\n\t\t\t\tright: this.additive(),\n\t\t\t};\n\t\t}\n\t\treturn left;\n\t},\n\n\tadditive: function () {\n\t\tvar left = this.multiplicative();\n\t\tvar token;\n\t\twhile ((token = this.expect(\"+\", \"-\"))) {\n\t\t\tleft = {\n\t\t\t\ttype: AST.BinaryExpression,\n\t\t\t\toperator: token.text,\n\t\t\t\tleft: left,\n\t\t\t\tright: this.multiplicative(),\n\t\t\t};\n\t\t}\n\t\treturn left;\n\t},\n\n\tmultiplicative: function () {\n\t\tvar left = this.unary();\n\t\tvar token;\n\t\twhile ((token = this.expect(\"*\", \"/\", \"%\"))) {\n\t\t\tleft = {\n\t\t\t\ttype: AST.BinaryExpression,\n\t\t\t\toperator: token.text,\n\t\t\t\tleft: left,\n\t\t\t\tright: this.unary(),\n\t\t\t};\n\t\t}\n\t\treturn left;\n\t},\n\n\tunary: function () {\n\t\tvar token;\n\t\tif ((token = this.expect(\"+\", \"-\", \"!\"))) {\n\t\t\treturn {\n\t\t\t\ttype: AST.UnaryExpression,\n\t\t\t\toperator: token.text,\n\t\t\t\tprefix: true,\n\t\t\t\targument: this.unary(),\n\t\t\t};\n\t\t} else {\n\t\t\treturn this.primary();\n\t\t}\n\t},\n\n\tprimary: function () {\n\t\tvar primary;\n\t\tif (this.expect(\"(\")) {\n\t\t\tprimary = this.filterChain();\n\t\t\tthis.consume(\")\");\n\t\t} else if (this.expect(\"[\")) {\n\t\t\tprimary = this.arrayDeclaration();\n\t\t} else if (this.expect(\"{\")) {\n\t\t\tprimary = this.object();\n\t\t} else if (this.selfReferential.hasOwnProperty(this.peek().text)) {\n\t\t\tprimary = copy(this.selfReferential[this.consume().text]);\n\t\t} else if (this.options.literals.hasOwnProperty(this.peek().text)) {\n\t\t\tprimary = {\n\t\t\t\ttype: AST.Literal,\n\t\t\t\tvalue: this.options.literals[this.consume().text],\n\t\t\t};\n\t\t} else if (this.peek().identifier) {\n\t\t\tprimary = this.identifier();\n\t\t} else if (this.peek().constant) {\n\t\t\tprimary = this.constant();\n\t\t} else {\n\t\t\tthis.throwError(\"not a primary expression\", this.peek());\n\t\t}\n\n\t\tvar next;\n\t\twhile ((next = this.expect(\"(\", \"[\", \".\"))) {\n\t\t\tif (next.text === \"(\") {\n\t\t\t\tprimary = {\n\t\t\t\t\ttype: AST.CallExpression,\n\t\t\t\t\tcallee: primary,\n\t\t\t\t\targuments: this.parseArguments(),\n\t\t\t\t};\n\t\t\t\tthis.consume(\")\");\n\t\t\t} else if (next.text === \"[\") {\n\t\t\t\tprimary = {\n\t\t\t\t\ttype: AST.MemberExpression,\n\t\t\t\t\tobject: primary,\n\t\t\t\t\tproperty: this.expression(),\n\t\t\t\t\tcomputed: true,\n\t\t\t\t};\n\t\t\t\tthis.consume(\"]\");\n\t\t\t} else if (next.text === \".\") {\n\t\t\t\tprimary = {\n\t\t\t\t\ttype: AST.MemberExpression,\n\t\t\t\t\tobject: primary,\n\t\t\t\t\tproperty: this.identifier(),\n\t\t\t\t\tcomputed: false,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tthis.throwError(\"IMPOSSIBLE\");\n\t\t\t}\n\t\t}\n\t\treturn primary;\n\t},\n\n\tfilter: function (baseExpression) {\n\t\tvar args = [baseExpression];\n\t\tvar result = {\n\t\t\ttype: AST.CallExpression,\n\t\t\tcallee: this.identifier(),\n\t\t\targuments: args,\n\t\t\tfilter: true,\n\t\t};\n\n\t\twhile (this.expect(\":\")) {\n\t\t\targs.push(this.expression());\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tparseArguments: function () {\n\t\tvar args = [];\n\t\tif (this.peekToken().text !== \")\") {\n\t\t\tdo {\n\t\t\t\targs.push(this.filterChain());\n\t\t\t} while (this.expect(\",\"));\n\t\t}\n\t\treturn args;\n\t},\n\n\tidentifier: function () {\n\t\tvar token = this.consume();\n\t\tif (!token.identifier) {\n\t\t\tthis.throwError(\"is not a valid identifier\", token);\n\t\t}\n\t\treturn { type: AST.Identifier, name: token.text };\n\t},\n\n\tconstant: function () {\n\t\t// TODO check that it is a constant\n\t\treturn { type: AST.Literal, value: this.consume().value };\n\t},\n\n\tarrayDeclaration: function () {\n\t\tvar elements = [];\n\t\tif (this.peekToken().text !== \"]\") {\n\t\t\tdo {\n\t\t\t\tif (this.peek(\"]\")) {\n\t\t\t\t\t// Support trailing commas per ES5.1.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telements.push(this.expression());\n\t\t\t} while (this.expect(\",\"));\n\t\t}\n\t\tthis.consume(\"]\");\n\n\t\treturn { type: AST.ArrayExpression, elements: elements };\n\t},\n\n\tobject: function () {\n\t\tvar properties = [],\n\t\t\tproperty;\n\t\tif (this.peekToken().text !== \"}\") {\n\t\t\tdo {\n\t\t\t\tif (this.peek(\"}\")) {\n\t\t\t\t\t// Support trailing commas per ES5.1.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tproperty = { type: AST.Property, kind: \"init\" };\n\t\t\t\tif (this.peek().constant) {\n\t\t\t\t\tproperty.key = this.constant();\n\t\t\t\t\tproperty.computed = false;\n\t\t\t\t\tthis.consume(\":\");\n\t\t\t\t\tproperty.value = this.expression();\n\t\t\t\t} else if (this.peek().identifier) {\n\t\t\t\t\tproperty.key = this.identifier();\n\t\t\t\t\tproperty.computed = false;\n\t\t\t\t\tif (this.peek(\":\")) {\n\t\t\t\t\t\tthis.consume(\":\");\n\t\t\t\t\t\tproperty.value = this.expression();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tproperty.value = property.key;\n\t\t\t\t\t}\n\t\t\t\t} else if (this.peek(\"[\")) {\n\t\t\t\t\tthis.consume(\"[\");\n\t\t\t\t\tproperty.key = this.expression();\n\t\t\t\t\tthis.consume(\"]\");\n\t\t\t\t\tproperty.computed = true;\n\t\t\t\t\tthis.consume(\":\");\n\t\t\t\t\tproperty.value = this.expression();\n\t\t\t\t} else {\n\t\t\t\t\tthis.throwError(\"invalid key\", this.peek());\n\t\t\t\t}\n\t\t\t\tproperties.push(property);\n\t\t\t} while (this.expect(\",\"));\n\t\t}\n\t\tthis.consume(\"}\");\n\n\t\treturn { type: AST.ObjectExpression, properties: properties };\n\t},\n\n\tthrowError: function (msg, token) {\n\t\tthrow $parseMinErr(\n\t\t\t\"syntax\",\n\t\t\t\"Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].\",\n\t\t\ttoken.text,\n\t\t\tmsg,\n\t\t\ttoken.index + 1,\n\t\t\tthis.text,\n\t\t\tthis.text.substring(token.index)\n\t\t);\n\t},\n\n\tconsume: function (e1) {\n\t\tif (this.tokens.length === 0) {\n\t\t\tthrow $parseMinErr(\n\t\t\t\t\"ueoe\",\n\t\t\t\t\"Unexpected end of expression: {0}\",\n\t\t\t\tthis.text\n\t\t\t);\n\t\t}\n\n\t\tvar token = this.expect(e1);\n\t\tif (!token) {\n\t\t\tthis.throwError(\"is unexpected, expecting [\" + e1 + \"]\", this.peek());\n\t\t}\n\t\treturn token;\n\t},\n\n\tpeekToken: function () {\n\t\tif (this.tokens.length === 0) {\n\t\t\tthrow $parseMinErr(\n\t\t\t\t\"ueoe\",\n\t\t\t\t\"Unexpected end of expression: {0}\",\n\t\t\t\tthis.text\n\t\t\t);\n\t\t}\n\t\treturn this.tokens[0];\n\t},\n\n\tpeek: function (e1, e2, e3, e4) {\n\t\treturn this.peekAhead(0, e1, e2, e3, e4);\n\t},\n\n\tpeekAhead: function (i, e1, e2, e3, e4) {\n\t\tif (this.tokens.length > i) {\n\t\t\tvar token = this.tokens[i];\n\t\t\tvar t = token.text;\n\t\t\tif (\n\t\t\t\tt === e1 ||\n\t\t\t\tt === e2 ||\n\t\t\t\tt === e3 ||\n\t\t\t\tt === e4 ||\n\t\t\t\t(!e1 && !e2 && !e3 && !e4)\n\t\t\t) {\n\t\t\t\treturn token;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\n\texpect: function (e1, e2, e3, e4) {\n\t\tvar token = this.peek(e1, e2, e3, e4);\n\t\tif (token) {\n\t\t\tthis.tokens.shift();\n\t\t\treturn token;\n\t\t}\n\t\treturn false;\n\t},\n\n\tselfReferential: {\n\t\tthis: { type: AST.ThisExpression },\n\t\t$locals: { type: AST.LocalsExpression },\n\t},\n};\n\nfunction ifDefined(v, d) {\n\treturn typeof v !== \"undefined\" ? v : d;\n}\n\nfunction plusFn(l, r) {\n\tif (typeof l === \"undefined\") return r;\n\tif (typeof r === \"undefined\") return l;\n\treturn l + r;\n}\n\nfunction isStateless($filter, filterName) {\n\tvar fn = $filter(filterName);\n\tif (!fn) {\n\t\tthrow new Error(\"Filter '\" + filterName + \"' is not defined\");\n\t}\n\treturn !fn.$stateful;\n}\n\nfunction findConstantAndWatchExpressions(ast, $filter) {\n\tvar allConstants;\n\tvar argsToWatch;\n\tvar isStatelessFilter;\n\tswitch (ast.type) {\n\t\tcase AST.Program:\n\t\t\tallConstants = true;\n\t\t\tforEach(ast.body, function (expr) {\n\t\t\t\tfindConstantAndWatchExpressions(expr.expression, $filter);\n\t\t\t\tallConstants = allConstants && expr.expression.constant;\n\t\t\t});\n\t\t\tast.constant = allConstants;\n\t\t\tbreak;\n\t\tcase AST.Literal:\n\t\t\tast.constant = true;\n\t\t\tast.toWatch = [];\n\t\t\tbreak;\n\t\tcase AST.UnaryExpression:\n\t\t\tfindConstantAndWatchExpressions(ast.argument, $filter);\n\t\t\tast.constant = ast.argument.constant;\n\t\t\tast.toWatch = ast.argument.toWatch;\n\t\t\tbreak;\n\t\tcase AST.BinaryExpression:\n\t\t\tfindConstantAndWatchExpressions(ast.left, $filter);\n\t\t\tfindConstantAndWatchExpressions(ast.right, $filter);\n\t\t\tast.constant = ast.left.constant && ast.right.constant;\n\t\t\tast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);\n\t\t\tbreak;\n\t\tcase AST.LogicalExpression:\n\t\t\tfindConstantAndWatchExpressions(ast.left, $filter);\n\t\t\tfindConstantAndWatchExpressions(ast.right, $filter);\n\t\t\tast.constant = ast.left.constant && ast.right.constant;\n\t\t\tast.toWatch = ast.constant ? [] : [ast];\n\t\t\tbreak;\n\t\tcase AST.ConditionalExpression:\n\t\t\tfindConstantAndWatchExpressions(ast.test, $filter);\n\t\t\tfindConstantAndWatchExpressions(ast.alternate, $filter);\n\t\t\tfindConstantAndWatchExpressions(ast.consequent, $filter);\n\t\t\tast.constant =\n\t\t\t\tast.test.constant && ast.alternate.constant && ast.consequent.constant;\n\t\t\tast.toWatch = ast.constant ? [] : [ast];\n\t\t\tbreak;\n\t\tcase AST.Identifier:\n\t\t\tast.constant = false;\n\t\t\tast.toWatch = [ast];\n\t\t\tbreak;\n\t\tcase AST.MemberExpression:\n\t\t\tfindConstantAndWatchExpressions(ast.object, $filter);\n\t\t\tif (ast.computed) {\n\t\t\t\tfindConstantAndWatchExpressions(ast.property, $filter);\n\t\t\t}\n\t\t\tast.constant =\n\t\t\t\tast.object.constant && (!ast.computed || ast.property.constant);\n\t\t\tast.toWatch = [ast];\n\t\t\tbreak;\n\t\tcase AST.CallExpression:\n\t\t\tisStatelessFilter = ast.filter\n\t\t\t\t? isStateless($filter, ast.callee.name)\n\t\t\t\t: false;\n\t\t\tallConstants = isStatelessFilter;\n\t\t\targsToWatch = [];\n\t\t\tforEach(ast.arguments, function (expr) {\n\t\t\t\tfindConstantAndWatchExpressions(expr, $filter);\n\t\t\t\tallConstants = allConstants && expr.constant;\n\t\t\t\tif (!expr.constant) {\n\t\t\t\t\targsToWatch.push.apply(argsToWatch, expr.toWatch);\n\t\t\t\t}\n\t\t\t});\n\t\t\tast.constant = allConstants;\n\t\t\tast.toWatch = isStatelessFilter ? argsToWatch : [ast];\n\t\t\tbreak;\n\t\tcase AST.AssignmentExpression:\n\t\t\tfindConstantAndWatchExpressions(ast.left, $filter);\n\t\t\tfindConstantAndWatchExpressions(ast.right, $filter);\n\t\t\tast.constant = ast.left.constant && ast.right.constant;\n\t\t\tast.toWatch = [ast];\n\t\t\tbreak;\n\t\tcase AST.ArrayExpression:\n\t\t\tallConstants = true;\n\t\t\targsToWatch = [];\n\t\t\tforEach(ast.elements, function (expr) {\n\t\t\t\tfindConstantAndWatchExpressions(expr, $filter);\n\t\t\t\tallConstants = allConstants && expr.constant;\n\t\t\t\tif (!expr.constant) {\n\t\t\t\t\targsToWatch.push.apply(argsToWatch, expr.toWatch);\n\t\t\t\t}\n\t\t\t});\n\t\t\tast.constant = allConstants;\n\t\t\tast.toWatch = argsToWatch;\n\t\t\tbreak;\n\t\tcase AST.ObjectExpression:\n\t\t\tallConstants = true;\n\t\t\targsToWatch = [];\n\t\t\tforEach(ast.properties, function (property) {\n\t\t\t\tfindConstantAndWatchExpressions(property.value, $filter);\n\t\t\t\tallConstants =\n\t\t\t\t\tallConstants && property.value.constant && !property.computed;\n\t\t\t\tif (!property.value.constant) {\n\t\t\t\t\targsToWatch.push.apply(argsToWatch, property.value.toWatch);\n\t\t\t\t}\n\t\t\t});\n\t\t\tast.constant = allConstants;\n\t\t\tast.toWatch = argsToWatch;\n\t\t\tbreak;\n\t\tcase AST.ThisExpression:\n\t\t\tast.constant = false;\n\t\t\tast.toWatch = [];\n\t\t\tbreak;\n\t\tcase AST.LocalsExpression:\n\t\t\tast.constant = false;\n\t\t\tast.toWatch = [];\n\t\t\tbreak;\n\t}\n}\n\nfunction getInputs(body) {\n\tif (body.length !== 1) return;\n\tvar lastExpression = body[0].expression;\n\tvar candidate = lastExpression.toWatch;\n\tif (candidate.length !== 1) return candidate;\n\treturn candidate[0] !== lastExpression ? candidate : undefined;\n}\n\nfunction isAssignable(ast) {\n\treturn ast.type === AST.Identifier || ast.type === AST.MemberExpression;\n}\n\nfunction assignableAST(ast) {\n\tif (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {\n\t\treturn {\n\t\t\ttype: AST.AssignmentExpression,\n\t\t\tleft: ast.body[0].expression,\n\t\t\tright: { type: AST.NGValueParameter },\n\t\t\toperator: \"=\",\n\t\t};\n\t}\n}\n\nfunction isLiteral(ast) {\n\treturn (\n\t\tast.body.length === 0 ||\n\t\t(ast.body.length === 1 &&\n\t\t\t(ast.body[0].expression.type === AST.Literal ||\n\t\t\t\tast.body[0].expression.type === AST.ArrayExpression ||\n\t\t\t\tast.body[0].expression.type === AST.ObjectExpression))\n\t);\n}\n\nfunction isConstant(ast) {\n\treturn ast.constant;\n}\n\nfunction ASTCompiler(astBuilder, $filter) {\n\tthis.astBuilder = astBuilder;\n\tthis.$filter = $filter;\n}\n\nASTCompiler.prototype = {\n\tcompile: function (expression) {\n\t\tvar self = this;\n\t\tvar ast = this.astBuilder.ast(expression);\n\t\tthis.state = {\n\t\t\tnextId: 0,\n\t\t\tfilters: {},\n\t\t\tfn: { vars: [], body: [], own: {} },\n\t\t\tassign: { vars: [], body: [], own: {} },\n\t\t\tinputs: [],\n\t\t};\n\t\tfindConstantAndWatchExpressions(ast, self.$filter);\n\t\tvar extra = \"\";\n\t\tvar assignable;\n\t\tthis.stage = \"assign\";\n\t\tif ((assignable = assignableAST(ast))) {\n\t\t\tthis.state.computing = \"assign\";\n\t\t\tvar result = this.nextId();\n\t\t\tthis.recurse(assignable, result);\n\t\t\tthis.return_(result);\n\t\t\textra = \"fn.assign=\" + this.generateFunction(\"assign\", \"s,v,l\");\n\t\t}\n\t\tvar toWatch = getInputs(ast.body);\n\t\tself.stage = \"inputs\";\n\t\tforEach(toWatch, function (watch, key) {\n\t\t\tvar fnKey = \"fn\" + key;\n\t\t\tself.state[fnKey] = { vars: [], body: [], own: {} };\n\t\t\tself.state.computing = fnKey;\n\t\t\tvar intoId = self.nextId();\n\t\t\tself.recurse(watch, intoId);\n\t\t\tself.return_(intoId);\n\t\t\tself.state.inputs.push(fnKey);\n\t\t\twatch.watchId = key;\n\t\t});\n\t\tthis.state.computing = \"fn\";\n\t\tthis.stage = \"main\";\n\t\tthis.recurse(ast);\n\t\tvar fnString =\n\t\t\t// The build and minification steps remove the string \"use strict\" from the code, but this is done using a regex.\n\t\t\t// This is a workaround for this until we do a better job at only removing the prefix only when we should.\n\t\t\t'\"' +\n\t\t\tthis.USE +\n\t\t\t\" \" +\n\t\t\tthis.STRICT +\n\t\t\t'\";\\n' +\n\t\t\tthis.filterPrefix() +\n\t\t\t\"var fn=\" +\n\t\t\tthis.generateFunction(\"fn\", \"s,l,a,i\") +\n\t\t\textra +\n\t\t\tthis.watchFns() +\n\t\t\t\"return fn;\";\n\t\t// eslint-disable-next-line no-new-func\n\t\tvar fn = new Function(\n\t\t\t\"$filter\",\n\t\t\t\"getStringValue\",\n\t\t\t\"ifDefined\",\n\t\t\t\"plus\",\n\t\t\tfnString\n\t\t)(this.$filter, getStringValue, ifDefined, plusFn);\n\n\t\tthis.state = this.stage = undefined;\n\t\tfn.ast = ast;\n\t\tfn.literal = isLiteral(ast);\n\t\tfn.constant = isConstant(ast);\n\t\treturn fn;\n\t},\n\n\tUSE: \"use\",\n\n\tSTRICT: \"strict\",\n\n\twatchFns: function () {\n\t\tvar result = [];\n\t\tvar fns = this.state.inputs;\n\t\tvar self = this;\n\t\tforEach(fns, function (name) {\n\t\t\tresult.push(\"var \" + name + \"=\" + self.generateFunction(name, \"s\"));\n\t\t});\n\t\tif (fns.length) {\n\t\t\tresult.push(\"fn.inputs=[\" + fns.join(\",\") + \"];\");\n\t\t}\n\t\treturn result.join(\"\");\n\t},\n\n\tgenerateFunction: function (name, params) {\n\t\treturn (\n\t\t\t\"function(\" +\n\t\t\tparams +\n\t\t\t\"){\" +\n\t\t\tthis.varsPrefix(name) +\n\t\t\tthis.body(name) +\n\t\t\t\"};\"\n\t\t);\n\t},\n\n\tfilterPrefix: function () {\n\t\tvar parts = [];\n\t\tvar self = this;\n\t\tforEach(this.state.filters, function (id, filter) {\n\t\t\tparts.push(id + \"=$filter(\" + self.escape(filter) + \")\");\n\t\t});\n\t\tif (parts.length) return \"var \" + parts.join(\",\") + \";\";\n\t\treturn \"\";\n\t},\n\n\tvarsPrefix: function (section) {\n\t\treturn this.state[section].vars.length\n\t\t\t? \"var \" + this.state[section].vars.join(\",\") + \";\"\n\t\t\t: \"\";\n\t},\n\n\tbody: function (section) {\n\t\treturn this.state[section].body.join(\"\");\n\t},\n\n\trecurse: function (\n\t\tast,\n\t\tintoId,\n\t\tnameId,\n\t\trecursionFn,\n\t\tcreate,\n\t\tskipWatchIdCheck\n\t) {\n\t\tvar left,\n\t\t\tright,\n\t\t\tself = this,\n\t\t\targs,\n\t\t\texpression,\n\t\t\tcomputed;\n\t\trecursionFn = recursionFn || noop;\n\t\tif (!skipWatchIdCheck && isDefined(ast.watchId)) {\n\t\t\tintoId = intoId || this.nextId();\n\t\t\tthis.if_(\n\t\t\t\t\"i\",\n\t\t\t\tthis.lazyAssign(intoId, this.unsafeComputedMember(\"i\", ast.watchId)),\n\t\t\t\tthis.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tswitch (ast.type) {\n\t\t\tcase AST.Program:\n\t\t\t\tforEach(ast.body, function (expression, pos) {\n\t\t\t\t\tself.recurse(\n\t\t\t\t\t\texpression.expression,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tfunction (expr) {\n\t\t\t\t\t\t\tright = expr;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tif (pos !== ast.body.length - 1) {\n\t\t\t\t\t\tself.current().body.push(right, \";\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.return_(right);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase AST.Literal:\n\t\t\t\texpression = this.escape(ast.value);\n\t\t\t\tthis.assign(intoId, expression);\n\t\t\t\trecursionFn(intoId || expression);\n\t\t\t\tbreak;\n\t\t\tcase AST.UnaryExpression:\n\t\t\t\tthis.recurse(ast.argument, undefined, undefined, function (expr) {\n\t\t\t\t\tright = expr;\n\t\t\t\t});\n\t\t\t\texpression = ast.operator + \"(\" + this.ifDefined(right, 0) + \")\";\n\t\t\t\tthis.assign(intoId, expression);\n\t\t\t\trecursionFn(expression);\n\t\t\t\tbreak;\n\t\t\tcase AST.BinaryExpression:\n\t\t\t\tthis.recurse(ast.left, undefined, undefined, function (expr) {\n\t\t\t\t\tleft = expr;\n\t\t\t\t});\n\t\t\t\tthis.recurse(ast.right, undefined, undefined, function (expr) {\n\t\t\t\t\tright = expr;\n\t\t\t\t});\n\t\t\t\tif (ast.operator === \"+\") {\n\t\t\t\t\texpression = this.plus(left, right);\n\t\t\t\t} else if (ast.operator === \"-\") {\n\t\t\t\t\texpression =\n\t\t\t\t\t\tthis.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);\n\t\t\t\t} else {\n\t\t\t\t\texpression = \"(\" + left + \")\" + ast.operator + \"(\" + right + \")\";\n\t\t\t\t}\n\t\t\t\tthis.assign(intoId, expression);\n\t\t\t\trecursionFn(expression);\n\t\t\t\tbreak;\n\t\t\tcase AST.LogicalExpression:\n\t\t\t\tintoId = intoId || this.nextId();\n\t\t\t\tself.recurse(ast.left, intoId);\n\t\t\t\tself.if_(\n\t\t\t\t\tast.operator === \"&&\" ? intoId : self.not(intoId),\n\t\t\t\t\tself.lazyRecurse(ast.right, intoId)\n\t\t\t\t);\n\t\t\t\trecursionFn(intoId);\n\t\t\t\tbreak;\n\t\t\tcase AST.ConditionalExpression:\n\t\t\t\tintoId = intoId || this.nextId();\n\t\t\t\tself.recurse(ast.test, intoId);\n\t\t\t\tself.if_(\n\t\t\t\t\tintoId,\n\t\t\t\t\tself.lazyRecurse(ast.alternate, intoId),\n\t\t\t\t\tself.lazyRecurse(ast.consequent, intoId)\n\t\t\t\t);\n\t\t\t\trecursionFn(intoId);\n\t\t\t\tbreak;\n\t\t\tcase AST.Identifier:\n\t\t\t\tintoId = intoId || this.nextId();\n\t\t\t\tvar inAssignment = self.current().inAssignment;\n\t\t\t\tif (nameId) {\n\t\t\t\t\tif (inAssignment) {\n\t\t\t\t\t\tnameId.context = this.assign(this.nextId(), \"s\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnameId.context =\n\t\t\t\t\t\t\tself.stage === \"inputs\"\n\t\t\t\t\t\t\t\t? \"s\"\n\t\t\t\t\t\t\t\t: this.assign(\n\t\t\t\t\t\t\t\t\t\tthis.nextId(),\n\t\t\t\t\t\t\t\t\t\tthis.getHasOwnProperty(\"l\", ast.name) + \"?l:s\"\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tnameId.computed = false;\n\t\t\t\t\tnameId.name = ast.name;\n\t\t\t\t}\n\t\t\t\tself.if_(\n\t\t\t\t\tself.stage === \"inputs\" ||\n\t\t\t\t\t\tself.not(self.getHasOwnProperty(\"l\", ast.name)),\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\tself.if_(\n\t\t\t\t\t\t\tself.stage === \"inputs\" ||\n\t\t\t\t\t\t\t\tself.and_(\n\t\t\t\t\t\t\t\t\t\"s\",\n\t\t\t\t\t\t\t\t\tself.or_(\n\t\t\t\t\t\t\t\t\t\tself.isNull(self.nonComputedMember(\"s\", ast.name)),\n\t\t\t\t\t\t\t\t\t\tself.hasOwnProperty_(\"s\", ast.name)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\tif (create && create !== 1) {\n\t\t\t\t\t\t\t\t\tself.if_(\n\t\t\t\t\t\t\t\t\t\tself.isNull(self.nonComputedMember(\"s\", ast.name)),\n\t\t\t\t\t\t\t\t\t\tself.lazyAssign(self.nonComputedMember(\"s\", ast.name), \"{}\")\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tself.assign(intoId, self.nonComputedMember(\"s\", ast.name));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\tintoId &&\n\t\t\t\t\t\tself.lazyAssign(intoId, self.nonComputedMember(\"l\", ast.name))\n\t\t\t\t);\n\t\t\t\trecursionFn(intoId);\n\t\t\t\tbreak;\n\t\t\tcase AST.MemberExpression:\n\t\t\t\tleft = (nameId && (nameId.context = this.nextId())) || this.nextId();\n\t\t\t\tintoId = intoId || this.nextId();\n\t\t\t\tself.recurse(\n\t\t\t\t\tast.object,\n\t\t\t\t\tleft,\n\t\t\t\t\tundefined,\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\tvar member = null;\n\t\t\t\t\t\tvar inAssignment = self.current().inAssignment;\n\t\t\t\t\t\tif (ast.computed) {\n\t\t\t\t\t\t\tright = self.nextId();\n\t\t\t\t\t\t\tif (inAssignment || self.state.computing === \"assign\") {\n\t\t\t\t\t\t\t\tmember = self.unsafeComputedMember(left, right);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmember = self.computedMember(left, right);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (inAssignment || self.state.computing === \"assign\") {\n\t\t\t\t\t\t\t\tmember = self.unsafeNonComputedMember(left, ast.property.name);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmember = self.nonComputedMember(left, ast.property.name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tright = ast.property.name;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (ast.computed) {\n\t\t\t\t\t\t\tif (ast.property.type === AST.Literal) {\n\t\t\t\t\t\t\t\tself.recurse(ast.property, right);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tself.if_(\n\t\t\t\t\t\t\tself.and_(\n\t\t\t\t\t\t\t\tself.notNull(left),\n\t\t\t\t\t\t\t\tself.or_(\n\t\t\t\t\t\t\t\t\tself.isNull(member),\n\t\t\t\t\t\t\t\t\tself.hasOwnProperty_(left, right, ast.computed)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\tif (ast.computed) {\n\t\t\t\t\t\t\t\t\tif (ast.property.type !== AST.Literal) {\n\t\t\t\t\t\t\t\t\t\tself.recurse(ast.property, right);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (create && create !== 1) {\n\t\t\t\t\t\t\t\t\t\tself.if_(self.not(member), self.lazyAssign(member, \"{}\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tself.assign(intoId, member);\n\t\t\t\t\t\t\t\t\tif (nameId) {\n\t\t\t\t\t\t\t\t\t\tnameId.computed = true;\n\t\t\t\t\t\t\t\t\t\tnameId.name = right;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif (create && create !== 1) {\n\t\t\t\t\t\t\t\t\t\tself.if_(\n\t\t\t\t\t\t\t\t\t\t\tself.isNull(member),\n\t\t\t\t\t\t\t\t\t\t\tself.lazyAssign(member, \"{}\")\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tself.assign(intoId, member);\n\t\t\t\t\t\t\t\t\tif (nameId) {\n\t\t\t\t\t\t\t\t\t\tnameId.computed = false;\n\t\t\t\t\t\t\t\t\t\tnameId.name = ast.property.name;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\tself.assign(intoId, \"undefined\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\trecursionFn(intoId);\n\t\t\t\t\t},\n\t\t\t\t\t!!create\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase AST.CallExpression:\n\t\t\t\tintoId = intoId || this.nextId();\n\t\t\t\tif (ast.filter) {\n\t\t\t\t\tright = self.filter(ast.callee.name);\n\t\t\t\t\targs = [];\n\t\t\t\t\tforEach(ast.arguments, function (expr) {\n\t\t\t\t\t\tvar argument = self.nextId();\n\t\t\t\t\t\tself.recurse(expr, argument);\n\t\t\t\t\t\targs.push(argument);\n\t\t\t\t\t});\n\t\t\t\t\texpression = right + \".call(\" + right + \",\" + args.join(\",\") + \")\";\n\t\t\t\t\tself.assign(intoId, expression);\n\t\t\t\t\trecursionFn(intoId);\n\t\t\t\t} else {\n\t\t\t\t\tright = self.nextId();\n\t\t\t\t\tleft = {};\n\t\t\t\t\targs = [];\n\t\t\t\t\tself.recurse(ast.callee, right, left, function () {\n\t\t\t\t\t\tself.if_(\n\t\t\t\t\t\t\tself.notNull(right),\n\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\tforEach(ast.arguments, function (expr) {\n\t\t\t\t\t\t\t\t\tself.recurse(\n\t\t\t\t\t\t\t\t\t\texpr,\n\t\t\t\t\t\t\t\t\t\tast.constant ? undefined : self.nextId(),\n\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\tfunction (argument) {\n\t\t\t\t\t\t\t\t\t\t\targs.push(argument);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tif (left.name) {\n\t\t\t\t\t\t\t\t\tvar x = self.member(left.context, left.name, left.computed);\n\t\t\t\t\t\t\t\t\texpression =\n\t\t\t\t\t\t\t\t\t\t\"(\" +\n\t\t\t\t\t\t\t\t\t\tx +\n\t\t\t\t\t\t\t\t\t\t\" === null ? null : \" +\n\t\t\t\t\t\t\t\t\t\tself.unsafeMember(left.context, left.name, left.computed) +\n\t\t\t\t\t\t\t\t\t\t\".call(\" +\n\t\t\t\t\t\t\t\t\t\t[left.context].concat(args).join(\",\") +\n\t\t\t\t\t\t\t\t\t\t\"))\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\texpression = right + \"(\" + args.join(\",\") + \")\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tself.assign(intoId, expression);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\tself.assign(intoId, \"undefined\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\trecursionFn(intoId);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AST.AssignmentExpression:\n\t\t\t\tright = this.nextId();\n\t\t\t\tleft = {};\n\t\t\t\tself.current().inAssignment = true;\n\t\t\t\tthis.recurse(\n\t\t\t\t\tast.left,\n\t\t\t\t\tundefined,\n\t\t\t\t\tleft,\n\t\t\t\t\tfunction () {\n\t\t\t\t\t\tself.if_(\n\t\t\t\t\t\t\tself.and_(\n\t\t\t\t\t\t\t\tself.notNull(left.context),\n\t\t\t\t\t\t\t\tself.or_(\n\t\t\t\t\t\t\t\t\tself.hasOwnProperty_(left.context, left.name),\n\t\t\t\t\t\t\t\t\tself.isNull(\n\t\t\t\t\t\t\t\t\t\tself.member(left.context, left.name, left.computed)\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\tself.recurse(ast.right, right);\n\t\t\t\t\t\t\t\texpression =\n\t\t\t\t\t\t\t\t\tself.member(left.context, left.name, left.computed) +\n\t\t\t\t\t\t\t\t\tast.operator +\n\t\t\t\t\t\t\t\t\tright;\n\t\t\t\t\t\t\t\tself.assign(intoId, expression);\n\t\t\t\t\t\t\t\trecursionFn(intoId || expression);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tself.current().inAssignment = false;\n\t\t\t\t\t\tself.recurse(ast.right, right);\n\t\t\t\t\t\tself.current().inAssignment = true;\n\t\t\t\t\t},\n\t\t\t\t\t1\n\t\t\t\t);\n\t\t\t\tself.current().inAssignment = false;\n\t\t\t\tbreak;\n\t\t\tcase AST.ArrayExpression:\n\t\t\t\targs = [];\n\t\t\t\tforEach(ast.elements, function (expr) {\n\t\t\t\t\tself.recurse(\n\t\t\t\t\t\texpr,\n\t\t\t\t\t\tast.constant ? undefined : self.nextId(),\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tfunction (argument) {\n\t\t\t\t\t\t\targs.push(argument);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t\texpression = \"[\" + args.join(\",\") + \"]\";\n\t\t\t\tthis.assign(intoId, expression);\n\t\t\t\trecursionFn(intoId || expression);\n\t\t\t\tbreak;\n\t\t\tcase AST.ObjectExpression:\n\t\t\t\targs = [];\n\t\t\t\tcomputed = false;\n\t\t\t\tforEach(ast.properties, function (property) {\n\t\t\t\t\tif (property.computed) {\n\t\t\t\t\t\tcomputed = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (computed) {\n\t\t\t\t\tintoId = intoId || this.nextId();\n\t\t\t\t\tthis.assign(intoId, \"{}\");\n\t\t\t\t\tforEach(ast.properties, function (property) {\n\t\t\t\t\t\tif (property.computed) {\n\t\t\t\t\t\t\tleft = self.nextId();\n\t\t\t\t\t\t\tself.recurse(property.key, left);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tleft =\n\t\t\t\t\t\t\t\tproperty.key.type === AST.Identifier\n\t\t\t\t\t\t\t\t\t? property.key.name\n\t\t\t\t\t\t\t\t\t: \"\" + property.key.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tright = self.nextId();\n\t\t\t\t\t\tself.recurse(property.value, right);\n\t\t\t\t\t\tself.assign(\n\t\t\t\t\t\t\tself.unsafeMember(intoId, left, property.computed),\n\t\t\t\t\t\t\tright\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tforEach(ast.properties, function (property) {\n\t\t\t\t\t\tself.recurse(\n\t\t\t\t\t\t\tproperty.value,\n\t\t\t\t\t\t\tast.constant ? undefined : self.nextId(),\n\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\tfunction (expr) {\n\t\t\t\t\t\t\t\targs.push(\n\t\t\t\t\t\t\t\t\tself.escape(\n\t\t\t\t\t\t\t\t\t\tproperty.key.type === AST.Identifier\n\t\t\t\t\t\t\t\t\t\t\t? property.key.name\n\t\t\t\t\t\t\t\t\t\t\t: \"\" + property.key.value\n\t\t\t\t\t\t\t\t\t) +\n\t\t\t\t\t\t\t\t\t\t\":\" +\n\t\t\t\t\t\t\t\t\t\texpr\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t\texpression = \"{\" + args.join(\",\") + \"}\";\n\t\t\t\t\tthis.assign(intoId, expression);\n\t\t\t\t}\n\t\t\t\trecursionFn(intoId || expression);\n\t\t\t\tbreak;\n\t\t\tcase AST.ThisExpression:\n\t\t\t\tthis.assign(intoId, \"s\");\n\t\t\t\trecursionFn(intoId || \"s\");\n\t\t\t\tbreak;\n\t\t\tcase AST.LocalsExpression:\n\t\t\t\tthis.assign(intoId, \"l\");\n\t\t\t\trecursionFn(intoId || \"l\");\n\t\t\t\tbreak;\n\t\t\tcase AST.NGValueParameter:\n\t\t\t\tthis.assign(intoId, \"v\");\n\t\t\t\trecursionFn(intoId || \"v\");\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\tgetHasOwnProperty: function (element, property) {\n\t\tvar key = element + \".\" + property;\n\t\tvar own = this.current().own;\n\t\tif (!own.hasOwnProperty(key)) {\n\t\t\town[key] = this.nextId(\n\t\t\t\tfalse,\n\t\t\t\telement + \"&&(\" + this.escape(property) + \" in \" + element + \")\"\n\t\t\t);\n\t\t}\n\t\treturn own[key];\n\t},\n\n\tassign: function (id, value) {\n\t\tif (!id) return;\n\t\tthis.current().body.push(id, \"=\", value, \";\");\n\t\treturn id;\n\t},\n\n\tfilter: function (filterName) {\n\t\tif (!this.state.filters.hasOwnProperty(filterName)) {\n\t\t\tthis.state.filters[filterName] = this.nextId(true);\n\t\t}\n\t\treturn this.state.filters[filterName];\n\t},\n\n\tifDefined: function (id, defaultValue) {\n\t\treturn \"ifDefined(\" + id + \",\" + this.escape(defaultValue) + \")\";\n\t},\n\n\tplus: function (left, right) {\n\t\treturn \"plus(\" + left + \",\" + right + \")\";\n\t},\n\n\treturn_: function (id) {\n\t\tthis.current().body.push(\"return \", id, \";\");\n\t},\n\n\tif_: function (test, alternate, consequent) {\n\t\tif (test === true) {\n\t\t\talternate();\n\t\t} else {\n\t\t\tvar body = this.current().body;\n\t\t\tbody.push(\"if(\", test, \"){\");\n\t\t\talternate();\n\t\t\tbody.push(\"}\");\n\t\t\tif (consequent) {\n\t\t\t\tbody.push(\"else{\");\n\t\t\t\tconsequent();\n\t\t\t\tbody.push(\"}\");\n\t\t\t}\n\t\t}\n\t},\n\tor_: function (expr1, expr2) {\n\t\treturn \"(\" + expr1 + \") || (\" + expr2 + \")\";\n\t},\n\thasOwnProperty_: function (obj, prop, computed) {\n\t\tif (computed) {\n\t\t\treturn \"(Object.prototype.hasOwnProperty.call(\" + obj + \",\" + prop + \"))\";\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\"(Object.prototype.hasOwnProperty.call(\" + obj + \",'\" + prop + \"'))\"\n\t\t\t);\n\t\t}\n\t},\n\tand_: function (expr1, expr2) {\n\t\treturn \"(\" + expr1 + \") && (\" + expr2 + \")\";\n\t},\n\tnot: function (expression) {\n\t\treturn \"!(\" + expression + \")\";\n\t},\n\n\tisNull: function (expression) {\n\t\treturn expression + \"==null\";\n\t},\n\n\tnotNull: function (expression) {\n\t\treturn expression + \"!=null\";\n\t},\n\n\tnonComputedMember: function (left, right) {\n\t\tvar SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;\n\t\tvar UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g;\n\t\tvar expr = \"\";\n\t\tif (SAFE_IDENTIFIER.test(right)) {\n\t\t\texpr = left + \".\" + right;\n\t\t} else {\n\t\t\tright = right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn);\n\t\t\texpr = left + '[\"' + right + '\"]';\n\t\t}\n\n\t\treturn expr;\n\t},\n\n\tunsafeComputedMember: function (left, right) {\n\t\treturn left + \"[\" + right + \"]\";\n\t},\n\tunsafeNonComputedMember: function (left, right) {\n\t\treturn this.nonComputedMember(left, right);\n\t},\n\n\tcomputedMember: function (left, right) {\n\t\tif (this.state.computing === \"assign\") {\n\t\t\treturn this.unsafeComputedMember(left, right);\n\t\t}\n\t\t// return left + \"[\" + right + \"]\";\n\t\treturn (\n\t\t\t\"(\" +\n\t\t\tleft +\n\t\t\t\".hasOwnProperty(\" +\n\t\t\tright +\n\t\t\t\") ? \" +\n\t\t\tleft +\n\t\t\t\"[\" +\n\t\t\tright +\n\t\t\t\"] : null)\"\n\t\t);\n\t},\n\n\tunsafeMember: function (left, right, computed) {\n\t\tif (computed) return this.unsafeComputedMember(left, right);\n\t\treturn this.unsafeNonComputedMember(left, right);\n\t},\n\n\tmember: function (left, right, computed) {\n\t\tif (computed) return this.computedMember(left, right);\n\t\treturn this.nonComputedMember(left, right);\n\t},\n\n\tgetStringValue: function (item) {\n\t\tthis.assign(item, \"getStringValue(\" + item + \")\");\n\t},\n\n\tlazyRecurse: function (\n\t\tast,\n\t\tintoId,\n\t\tnameId,\n\t\trecursionFn,\n\t\tcreate,\n\t\tskipWatchIdCheck\n\t) {\n\t\tvar self = this;\n\t\treturn function () {\n\t\t\tself.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);\n\t\t};\n\t},\n\n\tlazyAssign: function (id, value) {\n\t\tvar self = this;\n\t\treturn function () {\n\t\t\tself.assign(id, value);\n\t\t};\n\t},\n\n\tstringEscapeRegex: /[^ a-zA-Z0-9]/g,\n\n\tstringEscapeFn: function (c) {\n\t\treturn \"\\\\u\" + (\"0000\" + c.charCodeAt(0).toString(16)).slice(-4);\n\t},\n\n\tescape: function (value) {\n\t\tif (isString(value))\n\t\t\treturn (\n\t\t\t\t\"'\" + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + \"'\"\n\t\t\t);\n\t\tif (isNumber(value)) return value.toString();\n\t\tif (value === true) return \"true\";\n\t\tif (value === false) return \"false\";\n\t\tif (value === null) return \"null\";\n\t\tif (typeof value === \"undefined\") return \"undefined\";\n\n\t\tthrow $parseMinErr(\"esc\", \"IMPOSSIBLE\");\n\t},\n\n\tnextId: function (skip, init) {\n\t\tvar id = \"v\" + this.state.nextId++;\n\t\tif (!skip) {\n\t\t\tthis.current().vars.push(id + (init ? \"=\" + init : \"\"));\n\t\t}\n\t\treturn id;\n\t},\n\n\tcurrent: function () {\n\t\treturn this.state[this.state.computing];\n\t},\n};\n\nfunction ASTInterpreter(astBuilder, $filter) {\n\tthis.astBuilder = astBuilder;\n\tthis.$filter = $filter;\n}\n\nASTInterpreter.prototype = {\n\tcompile: function (expression) {\n\t\tvar self = this;\n\t\tvar ast = this.astBuilder.ast(expression);\n\t\tfindConstantAndWatchExpressions(ast, self.$filter);\n\t\tvar assignable;\n\t\tvar assign;\n\t\tif ((assignable = assignableAST(ast))) {\n\t\t\tassign = this.recurse(assignable);\n\t\t}\n\t\tvar toWatch = getInputs(ast.body);\n\t\tvar inputs;\n\t\tif (toWatch) {\n\t\t\tinputs = [];\n\t\t\tforEach(toWatch, function (watch, key) {\n\t\t\t\tvar input = self.recurse(watch);\n\t\t\t\twatch.input = input;\n\t\t\t\tinputs.push(input);\n\t\t\t\twatch.watchId = key;\n\t\t\t});\n\t\t}\n\t\tvar expressions = [];\n\t\tforEach(ast.body, function (expression) {\n\t\t\texpressions.push(self.recurse(expression.expression));\n\t\t});\n\t\tvar fn =\n\t\t\tast.body.length === 0\n\t\t\t\t? noop\n\t\t\t\t: ast.body.length === 1\n\t\t\t\t\t? expressions[0]\n\t\t\t\t\t: function (scope, locals) {\n\t\t\t\t\t\t\tvar lastValue;\n\t\t\t\t\t\t\tforEach(expressions, function (exp) {\n\t\t\t\t\t\t\t\tlastValue = exp(scope, locals);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn lastValue;\n\t\t\t\t\t\t};\n\n\t\tif (assign) {\n\t\t\tfn.assign = function (scope, value, locals) {\n\t\t\t\treturn assign(scope, locals, value);\n\t\t\t};\n\t\t}\n\t\tif (inputs) {\n\t\t\tfn.inputs = inputs;\n\t\t}\n\t\tfn.ast = ast;\n\t\tfn.literal = isLiteral(ast);\n\t\tfn.constant = isConstant(ast);\n\t\treturn fn;\n\t},\n\n\trecurse: function (ast, context, create) {\n\t\tvar left,\n\t\t\tright,\n\t\t\tself = this,\n\t\t\targs;\n\t\tif (ast.input) {\n\t\t\treturn this.inputs(ast.input, ast.watchId);\n\t\t}\n\t\tswitch (ast.type) {\n\t\t\tcase AST.Literal:\n\t\t\t\treturn this.value(ast.value, context);\n\t\t\tcase AST.UnaryExpression:\n\t\t\t\tright = this.recurse(ast.argument);\n\t\t\t\treturn this[\"unary\" + ast.operator](right, context);\n\t\t\tcase AST.BinaryExpression:\n\t\t\t\tleft = this.recurse(ast.left);\n\t\t\t\tright = this.recurse(ast.right);\n\t\t\t\treturn this[\"binary\" + ast.operator](left, right, context);\n\t\t\tcase AST.LogicalExpression:\n\t\t\t\tleft = this.recurse(ast.left);\n\t\t\t\tright = this.recurse(ast.right);\n\t\t\t\treturn this[\"binary\" + ast.operator](left, right, context);\n\t\t\tcase AST.ConditionalExpression:\n\t\t\t\treturn this[\"ternary?:\"](\n\t\t\t\t\tthis.recurse(ast.test),\n\t\t\t\t\tthis.recurse(ast.alternate),\n\t\t\t\t\tthis.recurse(ast.consequent),\n\t\t\t\t\tcontext\n\t\t\t\t);\n\t\t\tcase AST.Identifier:\n\t\t\t\treturn self.identifier(ast.name, context, create);\n\t\t\tcase AST.MemberExpression:\n\t\t\t\tleft = this.recurse(ast.object, false, !!create);\n\t\t\t\tif (!ast.computed) {\n\t\t\t\t\tright = ast.property.name;\n\t\t\t\t}\n\t\t\t\tif (ast.computed) right = this.recurse(ast.property);\n\n\t\t\t\treturn ast.computed\n\t\t\t\t\t? this.computedMember(left, right, context, create)\n\t\t\t\t\t: this.nonComputedMember(left, right, context, create);\n\t\t\tcase AST.CallExpression:\n\t\t\t\targs = [];\n\t\t\t\tforEach(ast.arguments, function (expr) {\n\t\t\t\t\targs.push(self.recurse(expr));\n\t\t\t\t});\n\t\t\t\tif (ast.filter) right = this.$filter(ast.callee.name);\n\t\t\t\tif (!ast.filter) right = this.recurse(ast.callee, true);\n\t\t\t\treturn ast.filter\n\t\t\t\t\t? function (scope, locals, assign, inputs) {\n\t\t\t\t\t\t\tvar values = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < args.length; ++i) {\n\t\t\t\t\t\t\t\tvalues.push(args[i](scope, locals, assign, inputs));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar value = right.apply(undefined, values, inputs);\n\t\t\t\t\t\t\treturn context\n\t\t\t\t\t\t\t\t? { context: undefined, name: undefined, value: value }\n\t\t\t\t\t\t\t\t: value;\n\t\t\t\t\t\t}\n\t\t\t\t\t: function (scope, locals, assign, inputs) {\n\t\t\t\t\t\t\tvar rhs = right(scope, locals, assign, inputs);\n\t\t\t\t\t\t\tvar value;\n\t\t\t\t\t\t\tif (rhs.value != null) {\n\t\t\t\t\t\t\t\tvar values = [];\n\t\t\t\t\t\t\t\tfor (var i = 0; i < args.length; ++i) {\n\t\t\t\t\t\t\t\t\tvalues.push(args[i](scope, locals, assign, inputs));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tvalue = rhs.value.apply(rhs.context, values);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn context ? { value: value } : value;\n\t\t\t\t\t\t};\n\t\t\tcase AST.AssignmentExpression:\n\t\t\t\tleft = this.recurse(ast.left, true, 1);\n\t\t\t\tright = this.recurse(ast.right);\n\t\t\t\treturn function (scope, locals, assign, inputs) {\n\t\t\t\t\tvar lhs = left(scope, false, assign, inputs);\n\t\t\t\t\tvar rhs = right(scope, locals, assign, inputs);\n\t\t\t\t\tlhs.context[lhs.name] = rhs;\n\t\t\t\t\treturn context ? { value: rhs } : rhs;\n\t\t\t\t};\n\t\t\tcase AST.ArrayExpression:\n\t\t\t\targs = [];\n\t\t\t\tforEach(ast.elements, function (expr) {\n\t\t\t\t\targs.push(self.recurse(expr));\n\t\t\t\t});\n\t\t\t\treturn function (scope, locals, assign, inputs) {\n\t\t\t\t\tvar value = [];\n\t\t\t\t\tfor (var i = 0; i < args.length; ++i) {\n\t\t\t\t\t\tvalue.push(args[i](scope, locals, assign, inputs));\n\t\t\t\t\t}\n\t\t\t\t\treturn context ? { value: value } : value;\n\t\t\t\t};\n\t\t\tcase AST.ObjectExpression:\n\t\t\t\targs = [];\n\t\t\t\tforEach(ast.properties, function (property) {\n\t\t\t\t\tif (property.computed) {\n\t\t\t\t\t\targs.push({\n\t\t\t\t\t\t\tkey: self.recurse(property.key),\n\t\t\t\t\t\t\tcomputed: true,\n\t\t\t\t\t\t\tvalue: self.recurse(property.value),\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\targs.push({\n\t\t\t\t\t\t\tkey:\n\t\t\t\t\t\t\t\tproperty.key.type === AST.Identifier\n\t\t\t\t\t\t\t\t\t? property.key.name\n\t\t\t\t\t\t\t\t\t: \"\" + property.key.value,\n\t\t\t\t\t\t\tcomputed: false,\n\t\t\t\t\t\t\tvalue: self.recurse(property.value),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn function (scope, locals, assign, inputs) {\n\t\t\t\t\tvar value = {};\n\t\t\t\t\tfor (var i = 0; i < args.length; ++i) {\n\t\t\t\t\t\tif (args[i].computed) {\n\t\t\t\t\t\t\tvalue[args[i].key(scope, locals, assign, inputs)] = args[i].value(\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\tlocals,\n\t\t\t\t\t\t\t\tassign,\n\t\t\t\t\t\t\t\tinputs\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvalue[args[i].key] = args[i].value(scope, locals, assign, inputs);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn context ? { value: value } : value;\n\t\t\t\t};\n\t\t\tcase AST.ThisExpression:\n\t\t\t\treturn function (scope) {\n\t\t\t\t\treturn context ? { value: scope } : scope;\n\t\t\t\t};\n\t\t\tcase AST.LocalsExpression:\n\t\t\t\treturn function (scope, locals) {\n\t\t\t\t\treturn context ? { value: locals } : locals;\n\t\t\t\t};\n\t\t\tcase AST.NGValueParameter:\n\t\t\t\treturn function (scope, locals, assign) {\n\t\t\t\t\treturn context ? { value: assign } : assign;\n\t\t\t\t};\n\t\t}\n\t},\n\n\t\"unary+\": function (argument, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg = argument(scope, locals, assign, inputs);\n\t\t\tif (isDefined(arg)) {\n\t\t\t\targ = +arg;\n\t\t\t} else {\n\t\t\t\targ = 0;\n\t\t\t}\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"unary-\": function (argument, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg = argument(scope, locals, assign, inputs);\n\t\t\tif (isDefined(arg)) {\n\t\t\t\targ = -arg;\n\t\t\t} else {\n\t\t\t\targ = -0;\n\t\t\t}\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"unary!\": function (argument, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg = !argument(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary+\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar lhs = left(scope, locals, assign, inputs);\n\t\t\tvar rhs = right(scope, locals, assign, inputs);\n\t\t\tvar arg = plusFn(lhs, rhs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary-\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar lhs = left(scope, locals, assign, inputs);\n\t\t\tvar rhs = right(scope, locals, assign, inputs);\n\t\t\tvar arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary*\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) *\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary/\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) /\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary%\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) %\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary===\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) ===\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary!==\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) !==\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary==\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) ==\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary!=\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) !=\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary<\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) <\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary>\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) >\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary<=\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) <=\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary>=\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) >=\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary&&\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) &&\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"binary||\": function (left, right, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg =\n\t\t\t\tleft(scope, locals, assign, inputs) ||\n\t\t\t\tright(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\t\"ternary?:\": function (test, alternate, consequent, context) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar arg = test(scope, locals, assign, inputs)\n\t\t\t\t? alternate(scope, locals, assign, inputs)\n\t\t\t\t: consequent(scope, locals, assign, inputs);\n\t\t\treturn context ? { value: arg } : arg;\n\t\t};\n\t},\n\tvalue: function (value, context) {\n\t\treturn function () {\n\t\t\treturn context\n\t\t\t\t? { context: undefined, name: undefined, value: value }\n\t\t\t\t: value;\n\t\t};\n\t},\n\tidentifier: function (name, context, create) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar base = locals && name in locals ? locals : scope;\n\t\t\tif (create && create !== 1 && base && base[name] == null) {\n\t\t\t\tbase[name] = {};\n\t\t\t}\n\t\t\tvar value = base ? base[name] : undefined;\n\t\t\tif (context) {\n\t\t\t\treturn { context: base, name: name, value: value };\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\t},\n\tcomputedMember: function (left, right, context, create) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar lhs = left(scope, locals, assign, inputs);\n\t\t\tvar rhs;\n\t\t\tvar value;\n\t\t\tif (lhs != null) {\n\t\t\t\trhs = right(scope, locals, assign, inputs);\n\t\t\t\trhs = getStringValue(rhs);\n\t\t\t\tif (create && create !== 1) {\n\t\t\t\t\tif (lhs && !lhs[rhs]) {\n\t\t\t\t\t\tlhs[rhs] = {};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(lhs, rhs)) {\n\t\t\t\t\tvalue = lhs[rhs];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (context) {\n\t\t\t\treturn { context: lhs, name: rhs, value: value };\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\t},\n\tnonComputedMember: function (left, right, context, create) {\n\t\treturn function (scope, locals, assign, inputs) {\n\t\t\tvar lhs = left(scope, locals, assign, inputs);\n\t\t\tif (create && create !== 1) {\n\t\t\t\tif (lhs && lhs[right] == null) {\n\t\t\t\t\tlhs[right] = {};\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar value = undefined;\n\t\t\tif (lhs != null && Object.prototype.hasOwnProperty.call(lhs, right)) {\n\t\t\t\tvalue = lhs[right];\n\t\t\t}\n\n\t\t\tif (context) {\n\t\t\t\treturn { context: lhs, name: right, value: value };\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t};\n\t},\n\tinputs: function (input, watchId) {\n\t\treturn function (scope, value, locals, inputs) {\n\t\t\tif (inputs) return inputs[watchId];\n\t\t\treturn input(scope, value, locals);\n\t\t};\n\t},\n};\n\n/**\n * @constructor\n */\nvar Parser = function Parser(lexer, $filter, options) {\n\tthis.lexer = lexer;\n\tthis.$filter = $filter;\n\tthis.options = options;\n\tthis.ast = new AST(lexer, options);\n\tthis.astCompiler = options.csp\n\t\t? new ASTInterpreter(this.ast, $filter)\n\t\t: new ASTCompiler(this.ast, $filter);\n};\n\nParser.prototype = {\n\tconstructor: Parser,\n\n\tparse: function (text) {\n\t\treturn this.astCompiler.compile(text);\n\t},\n};\n\nfunction getValueOf(value) {\n\treturn isFunction(value.valueOf)\n\t\t? value.valueOf()\n\t\t: objectValueOf.call(value);\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts Angular {@link guide/expression expression} into a function.\n *\n * ```js\n * var getter = $parse('user.name');\n * var setter = getter.assign;\n * var context = {user:{name:'angular'}};\n * var locals = {user:{name:'local'}};\n *\n * expect(getter(context)).toEqual('angular');\n * setter(context, 'newValue');\n * expect(context.user.name).toEqual('newValue');\n * expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n *\n * The returned function also has the following properties:\n * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n * literal.\n * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n * constant literals.\n * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n * set to a function to change its value on the given context.\n *\n */\n\n/**\n * @ngdoc provider\n * @name $parseProvider\n * @this\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n * service.\n */\nfunction $ParseProvider() {\n\tvar cache = createMap();\n\tvar literals = {\n\t\ttrue: true,\n\t\tfalse: false,\n\t\tnull: null,\n\t\tundefined: undefined,\n\t};\n\tvar identStart, identContinue;\n\n\t/**\n\t * @ngdoc method\n\t * @name $parseProvider#addLiteral\n\t * @description\n\t *\n\t * Configure $parse service to add literal values that will be present as literal at expressions.\n\t *\n\t * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name.\n\t * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`.\n\t *\n\t **/\n\tthis.addLiteral = function (literalName, literalValue) {\n\t\tliterals[literalName] = literalValue;\n\t};\n\n\t/**\n\t * @ngdoc method\n\t * @name $parseProvider#setIdentifierFns\n\t *\n\t * @description\n\t *\n\t * Allows defining the set of characters that are allowed in Angular expressions. The function\n\t * `identifierStart` will get called to know if a given character is a valid character to be the\n\t * first character for an identifier. The function `identifierContinue` will get called to know if\n\t * a given character is a valid character to be a follow-up identifier character. The functions\n\t * `identifierStart` and `identifierContinue` will receive as arguments the single character to be\n\t * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in\n\t * mind that the `string` parameter can be two characters long depending on the character\n\t * representation. It is expected for the function to return `true` or `false`, whether that\n\t * character is allowed or not.\n\t *\n\t * Since this function will be called extensively, keep the implementation of these functions fast,\n\t * as the performance of these functions have a direct impact on the expressions parsing speed.\n\t *\n\t * @param {function=} identifierStart The function that will decide whether the given character is\n\t * a valid identifier start character.\n\t * @param {function=} identifierContinue The function that will decide whether the given character is\n\t * a valid identifier continue character.\n\t */\n\tthis.setIdentifierFns = function (identifierStart, identifierContinue) {\n\t\tidentStart = identifierStart;\n\t\tidentContinue = identifierContinue;\n\t\treturn this;\n\t};\n\n\tthis.$get = [\n\t\t\"$filter\",\n\t\tfunction ($filter) {\n\t\t\tvar noUnsafeEval = csp().noUnsafeEval;\n\t\t\tvar $parseOptions = {\n\t\t\t\tcsp: noUnsafeEval,\n\t\t\t\tliterals: copy(literals),\n\t\t\t\tisIdentifierStart: isFunction(identStart) && identStart,\n\t\t\t\tisIdentifierContinue: isFunction(identContinue) && identContinue,\n\t\t\t};\n\t\t\treturn $parse;\n\n\t\t\tfunction $parse(exp, interceptorFn) {\n\t\t\t\tvar parsedExpression, oneTime, cacheKey;\n\n\t\t\t\tswitch (typeof exp) {\n\t\t\t\t\tcase \"string\":\n\t\t\t\t\t\texp = exp.trim();\n\t\t\t\t\t\tcacheKey = exp;\n\n\t\t\t\t\t\tparsedExpression = cache[cacheKey];\n\n\t\t\t\t\t\tif (!parsedExpression) {\n\t\t\t\t\t\t\tif (exp.charAt(0) === \":\" && exp.charAt(1) === \":\") {\n\t\t\t\t\t\t\t\toneTime = true;\n\t\t\t\t\t\t\t\texp = exp.substring(2);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar lexer = new Lexer($parseOptions);\n\t\t\t\t\t\t\tvar parser = new Parser(lexer, $filter, $parseOptions);\n\t\t\t\t\t\t\tparsedExpression = parser.parse(exp);\n\t\t\t\t\t\t\tif (parsedExpression.constant) {\n\t\t\t\t\t\t\t\tparsedExpression.$$watchDelegate = constantWatchDelegate;\n\t\t\t\t\t\t\t} else if (oneTime) {\n\t\t\t\t\t\t\t\tparsedExpression.$$watchDelegate = parsedExpression.literal\n\t\t\t\t\t\t\t\t\t? oneTimeLiteralWatchDelegate\n\t\t\t\t\t\t\t\t\t: oneTimeWatchDelegate;\n\t\t\t\t\t\t\t} else if (parsedExpression.inputs) {\n\t\t\t\t\t\t\t\tparsedExpression.$$watchDelegate = inputsWatchDelegate;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcache[cacheKey] = parsedExpression;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn addInterceptor(parsedExpression, interceptorFn);\n\n\t\t\t\t\tcase \"function\":\n\t\t\t\t\t\treturn addInterceptor(exp, interceptorFn);\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn addInterceptor(noop, interceptorFn);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction expressionInputDirtyCheck(newValue, oldValueOfValue) {\n\t\t\t\tif (newValue == null || oldValueOfValue == null) {\n\t\t\t\t\t// null/undefined\n\t\t\t\t\treturn newValue === oldValueOfValue;\n\t\t\t\t}\n\n\t\t\t\tif (typeof newValue === \"object\") {\n\t\t\t\t\t// attempt to convert the value to a primitive type\n\t\t\t\t\t// TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n\t\t\t\t\t// be cheaply dirty-checked\n\t\t\t\t\tnewValue = getValueOf(newValue);\n\n\t\t\t\t\tif (typeof newValue === \"object\") {\n\t\t\t\t\t\t// objects/arrays are not supported - deep-watching them would be too expensive\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// fall-through to the primitive equality check\n\t\t\t\t}\n\n\t\t\t\t//Primitive or NaN\n\t\t\t\t// eslint-disable-next-line no-self-compare\n\t\t\t\treturn (\n\t\t\t\t\tnewValue === oldValueOfValue ||\n\t\t\t\t\t(newValue !== newValue && oldValueOfValue !== oldValueOfValue)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfunction inputsWatchDelegate(\n\t\t\t\tscope,\n\t\t\t\tlistener,\n\t\t\t\tobjectEquality,\n\t\t\t\tparsedExpression,\n\t\t\t\tprettyPrintExpression\n\t\t\t) {\n\t\t\t\tvar inputExpressions = parsedExpression.inputs;\n\t\t\t\tvar lastResult;\n\n\t\t\t\tif (inputExpressions.length === 1) {\n\t\t\t\t\tvar oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails\n\t\t\t\t\tinputExpressions = inputExpressions[0];\n\t\t\t\t\treturn scope.$watch(\n\t\t\t\t\t\tfunction expressionInputWatch(scope) {\n\t\t\t\t\t\t\tvar newInputValue = inputExpressions(scope);\n\t\t\t\t\t\t\tif (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {\n\t\t\t\t\t\t\t\tlastResult = parsedExpression(scope, undefined, undefined, [\n\t\t\t\t\t\t\t\t\tnewInputValue,\n\t\t\t\t\t\t\t\t]);\n\t\t\t\t\t\t\t\toldInputValueOf = newInputValue && getValueOf(newInputValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn lastResult;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tlistener,\n\t\t\t\t\t\tobjectEquality,\n\t\t\t\t\t\tprettyPrintExpression\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tvar oldInputValueOfValues = [];\n\t\t\t\tvar oldInputValues = [];\n\t\t\t\tfor (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n\t\t\t\t\toldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n\t\t\t\t\toldInputValues[i] = null;\n\t\t\t\t}\n\n\t\t\t\treturn scope.$watch(\n\t\t\t\t\tfunction expressionInputsWatch(scope) {\n\t\t\t\t\t\tvar changed = false;\n\n\t\t\t\t\t\tfor (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n\t\t\t\t\t\t\tvar newInputValue = inputExpressions[i](scope);\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tchanged ||\n\t\t\t\t\t\t\t\t(changed = !expressionInputDirtyCheck(\n\t\t\t\t\t\t\t\t\tnewInputValue,\n\t\t\t\t\t\t\t\t\toldInputValueOfValues[i]\n\t\t\t\t\t\t\t\t))\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\toldInputValues[i] = newInputValue;\n\t\t\t\t\t\t\t\toldInputValueOfValues[i] =\n\t\t\t\t\t\t\t\t\tnewInputValue && getValueOf(newInputValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (changed) {\n\t\t\t\t\t\t\tlastResult = parsedExpression(\n\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\toldInputValues\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn lastResult;\n\t\t\t\t\t},\n\t\t\t\t\tlistener,\n\t\t\t\t\tobjectEquality,\n\t\t\t\t\tprettyPrintExpression\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfunction oneTimeWatchDelegate(\n\t\t\t\tscope,\n\t\t\t\tlistener,\n\t\t\t\tobjectEquality,\n\t\t\t\tparsedExpression,\n\t\t\t\tprettyPrintExpression\n\t\t\t) {\n\t\t\t\tvar unwatch, lastValue;\n\t\t\t\tif (parsedExpression.inputs) {\n\t\t\t\t\tunwatch = inputsWatchDelegate(\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\toneTimeListener,\n\t\t\t\t\t\tobjectEquality,\n\t\t\t\t\t\tparsedExpression,\n\t\t\t\t\t\tprettyPrintExpression\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tunwatch = scope.$watch(oneTimeWatch, oneTimeListener, objectEquality);\n\t\t\t\t}\n\t\t\t\treturn unwatch;\n\n\t\t\t\tfunction oneTimeWatch(scope) {\n\t\t\t\t\treturn parsedExpression(scope);\n\t\t\t\t}\n\t\t\t\tfunction oneTimeListener(value, old, scope) {\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tif (isFunction(listener)) {\n\t\t\t\t\t\tlistener(value, old, scope);\n\t\t\t\t\t}\n\t\t\t\t\tif (isDefined(value)) {\n\t\t\t\t\t\tscope.$$postDigest(function () {\n\t\t\t\t\t\t\tif (isDefined(lastValue)) {\n\t\t\t\t\t\t\t\tunwatch();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction oneTimeLiteralWatchDelegate(\n\t\t\t\tscope,\n\t\t\t\tlistener,\n\t\t\t\tobjectEquality,\n\t\t\t\tparsedExpression\n\t\t\t) {\n\t\t\t\tvar unwatch, lastValue;\n\t\t\t\tunwatch = scope.$watch(\n\t\t\t\t\tfunction oneTimeWatch(scope) {\n\t\t\t\t\t\treturn parsedExpression(scope);\n\t\t\t\t\t},\n\t\t\t\t\tfunction oneTimeListener(value, old, scope) {\n\t\t\t\t\t\tlastValue = value;\n\t\t\t\t\t\tif (isFunction(listener)) {\n\t\t\t\t\t\t\tlistener(value, old, scope);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isAllDefined(value)) {\n\t\t\t\t\t\t\tscope.$$postDigest(function () {\n\t\t\t\t\t\t\t\tif (isAllDefined(lastValue)) unwatch();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tobjectEquality\n\t\t\t\t);\n\n\t\t\t\treturn unwatch;\n\n\t\t\t\tfunction isAllDefined(value) {\n\t\t\t\t\tvar allDefined = true;\n\t\t\t\t\tforEach(value, function (val) {\n\t\t\t\t\t\tif (!isDefined(val)) allDefined = false;\n\t\t\t\t\t});\n\t\t\t\t\treturn allDefined;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction constantWatchDelegate(\n\t\t\t\tscope,\n\t\t\t\tlistener,\n\t\t\t\tobjectEquality,\n\t\t\t\tparsedExpression\n\t\t\t) {\n\t\t\t\tvar unwatch = scope.$watch(\n\t\t\t\t\tfunction constantWatch(scope) {\n\t\t\t\t\t\tunwatch();\n\t\t\t\t\t\treturn parsedExpression(scope);\n\t\t\t\t\t},\n\t\t\t\t\tlistener,\n\t\t\t\t\tobjectEquality\n\t\t\t\t);\n\t\t\t\treturn unwatch;\n\t\t\t}\n\n\t\t\tfunction addInterceptor(parsedExpression, interceptorFn) {\n\t\t\t\tif (!interceptorFn) return parsedExpression;\n\t\t\t\tvar watchDelegate = parsedExpression.$$watchDelegate;\n\t\t\t\tvar useInputs = false;\n\n\t\t\t\tvar regularWatch =\n\t\t\t\t\twatchDelegate !== oneTimeLiteralWatchDelegate &&\n\t\t\t\t\twatchDelegate !== oneTimeWatchDelegate;\n\n\t\t\t\tvar fn = regularWatch\n\t\t\t\t\t? function regularInterceptedExpression(\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tlocals,\n\t\t\t\t\t\t\tassign,\n\t\t\t\t\t\t\tinputs\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tvar value =\n\t\t\t\t\t\t\t\tuseInputs && inputs\n\t\t\t\t\t\t\t\t\t? inputs[0]\n\t\t\t\t\t\t\t\t\t: parsedExpression(scope, locals, assign, inputs);\n\t\t\t\t\t\t\treturn interceptorFn(value, scope, locals);\n\t\t\t\t\t\t}\n\t\t\t\t\t: function oneTimeInterceptedExpression(\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tlocals,\n\t\t\t\t\t\t\tassign,\n\t\t\t\t\t\t\tinputs\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tvar value = parsedExpression(scope, locals, assign, inputs);\n\t\t\t\t\t\t\tvar result = interceptorFn(value, scope, locals);\n\t\t\t\t\t\t\t// we only return the interceptor's result if the\n\t\t\t\t\t\t\t// initial value is defined (for bind-once)\n\t\t\t\t\t\t\treturn isDefined(value) ? result : value;\n\t\t\t\t\t\t};\n\n\t\t\t\t// Propagate $$watchDelegates other then inputsWatchDelegate\n\t\t\t\tuseInputs = !parsedExpression.inputs;\n\t\t\t\tif (\n\t\t\t\t\tparsedExpression.$$watchDelegate &&\n\t\t\t\t\tparsedExpression.$$watchDelegate !== inputsWatchDelegate\n\t\t\t\t) {\n\t\t\t\t\tfn.$$watchDelegate = parsedExpression.$$watchDelegate;\n\t\t\t\t\tfn.inputs = parsedExpression.inputs;\n\t\t\t\t} else if (!interceptorFn.$stateful) {\n\t\t\t\t\t// If there is an interceptor, but no watchDelegate then treat the interceptor like\n\t\t\t\t\t// we treat filters - it is assumed to be a pure function unless flagged with $stateful\n\t\t\t\t\tfn.$$watchDelegate = inputsWatchDelegate;\n\t\t\t\t\tfn.inputs = parsedExpression.inputs\n\t\t\t\t\t\t? parsedExpression.inputs\n\t\t\t\t\t\t: [parsedExpression];\n\t\t\t\t}\n\n\t\t\t\treturn fn;\n\t\t\t}\n\t\t},\n\t];\n}\n\nexports.Lexer = Lexer;\nexports.Parser = Parser;\n","\"use strict\";\n\nvar parse = require(\"./parse.js\");\n\nvar filters = {};\nvar Lexer = parse.Lexer;\nvar Parser = parse.Parser;\n\n/**\n * Compiles src and returns a function that executes src on a target object.\n * To speed up further calls the compiled function is cached under compile.cache[src] if options.filters is not present.\n *\n * @param {string} src\n * @param {object | undefined} options\n * @returns {function}\n */\nfunction compile(src, options) {\n\toptions = options || {};\n\tvar localFilters = options.filters || filters;\n\tvar cache = options.filters ? options.cache || {} : compile.cache;\n\tvar lexerOptions = options;\n\n\tvar cached;\n\n\tif (typeof src !== \"string\") {\n\t\tthrow new TypeError(\n\t\t\t\"src must be a string, instead saw '\" + typeof src + \"'\"\n\t\t);\n\t}\n\tvar parserOptions = {\n\t\tcsp: options.csp != null ? options.csp : false, // noUnsafeEval,\n\t\tliterals:\n\t\t\toptions.literals != null\n\t\t\t\t? options.literals\n\t\t\t\t: {\n\t\t\t\t\t\t// defined at: function $ParseProvider() {\n\t\t\t\t\t\ttrue: true,\n\t\t\t\t\t\tfalse: false,\n\t\t\t\t\t\tnull: null,\n\t\t\t\t\t\t/*eslint no-undefined: 0*/\n\t\t\t\t\t\tundefined: undefined,\n\t\t\t\t\t\t/* eslint: no-undefined: 1 */\n\t\t\t\t\t},\n\t};\n\n\tvar lexer = new Lexer(lexerOptions);\n\tvar parser = new Parser(\n\t\tlexer,\n\t\tfunction getFilter(name) {\n\t\t\treturn localFilters[name];\n\t\t},\n\t\tparserOptions\n\t);\n\n\tif (!cache) {\n\t\treturn parser.parse(src);\n\t}\n\n\tcached = cache[src];\n\tif (!cached) {\n\t\tcached = cache[src] = parser.parse(src);\n\t}\n\n\treturn cached;\n}\n\n/**\n * A cache containing all compiled functions. The src is used as key.\n * Set this on false to disable the cache.\n *\n * @type {object}\n */\ncompile.cache = Object.create(null);\n\nexports.Lexer = Lexer;\nexports.Parser = Parser;\nexports.compile = compile;\nexports.filters = filters;\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { setStageVar } from '@/store/stageReducer';\nimport { logger } from '@/Core/util/logger';\nimport { compile } from 'angular-expressions';\nimport { setScriptManagedGlobalVar } from '@/store/userDataReducer';\nimport { ActionCreatorWithPayload } from '@reduxjs/toolkit';\nimport { ISetGameVar } from '@/store/stageInterface';\nimport { dumpToStorageFast } from '@/Core/controller/storage/storageController';\nimport get from 'lodash/get';\n/**\n * 设置变量\n * @param sentence\n */\nexport const setVar = (sentence: ISentence): IPerform => {\n let setGlobal = false;\n sentence.args.forEach((e) => {\n if (e.key === 'global') {\n setGlobal = true;\n }\n });\n let targetReducerFunction: ActionCreatorWithPayload<ISetGameVar, string>;\n if (setGlobal) {\n targetReducerFunction = setScriptManagedGlobalVar;\n } else {\n targetReducerFunction = setStageVar;\n }\n // 先把表达式拆分为变量名和赋值语句\n if (sentence.content.match(/\\s*=\\s*/)) {\n const key = sentence.content.split(/\\s*=\\s*/)[0];\n const valExp = sentence.content.split(/\\s*=\\s*/)[1];\n if (valExp === 'random()') {\n webgalStore.dispatch(targetReducerFunction({ key, value: Math.random() }));\n } else if (valExp.match(/[+\\-*\\/()]/)) {\n // 如果包含加减乘除号,则运算\n // 先取出运算表达式中的变量\n const valExpArr = valExp.split(/([+\\-*\\/()])/g);\n // 将变量替换为变量的值,然后合成表达式字符串\n const valExp2 = valExpArr\n .map((e) => {\n if (!e.trim().match(/^[a-zA-Z_$][a-zA-Z0-9_.]*$/)) {\n // 检查是否是变量名,不是就返回本身\n return e;\n }\n const _r = getValueFromStateElseKey(e.trim());\n return typeof _r === 'string' ? `'${_r}'` : _r;\n })\n .reduce((pre, curr) => pre + curr, '');\n let result = '';\n try {\n const exp = compile(valExp2);\n result = exp();\n } catch (e) {\n logger.error('expression compile error', e);\n }\n webgalStore.dispatch(targetReducerFunction({ key, value: result }));\n } else if (valExp.match(/true|false/)) {\n if (valExp.match(/true/)) {\n webgalStore.dispatch(targetReducerFunction({ key, value: true }));\n }\n if (valExp.match(/false/)) {\n webgalStore.dispatch(targetReducerFunction({ key, value: false }));\n }\n } else if (valExp.length === 0) {\n webgalStore.dispatch(targetReducerFunction({ key, value: '' }));\n } else {\n if (!isNaN(Number(valExp))) {\n webgalStore.dispatch(targetReducerFunction({ key, value: Number(valExp) }));\n } else {\n webgalStore.dispatch(targetReducerFunction({ key, value: getValueFromStateElseKey(valExp) }));\n }\n }\n if (setGlobal) {\n logger.debug('设置全局变量:', { key, value: webgalStore.getState().userData.globalGameVar[key] });\n dumpToStorageFast();\n } else {\n logger.debug('设置变量:', { key, value: webgalStore.getState().stage.GameVar[key] });\n }\n }\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n\ntype BaseVal = string | number | boolean | undefined;\n\n/**\n * 取不到时返回 undefined\n */\nexport function getValueFromState(key: string) {\n let ret: any;\n const stage = webgalStore.getState().stage;\n const userData = webgalStore.getState().userData;\n const _Merge = { stage, userData }; // 不要直接合并到一起,防止可能的键冲突\n if (stage.GameVar.hasOwnProperty(key)) {\n ret = stage.GameVar[key];\n } else if (userData.globalGameVar.hasOwnProperty(key)) {\n ret = userData.globalGameVar[key];\n } else if (key.startsWith('$')) {\n const propertyKey = key.replace('$', '');\n ret = get(_Merge, propertyKey, undefined) as BaseVal;\n }\n return ret;\n}\n\n/**\n * 取不到时返回 {key}\n */\nexport function getValueFromStateElseKey(key: string) {\n const valueFromState = getValueFromState(key);\n if (valueFromState === null || valueFromState === undefined) {\n logger.warn('valueFromState result null, key = ' + key);\n return `{${key}}`;\n }\n return valueFromState;\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { logger } from '@/Core/util/logger';\nimport { getRandomPerformName } from '@/Core/Modules/perform/performController';\nimport { PERFORM_CONFIG } from '@/config';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 进行普通对话的显示\n * @param sentence 语句\n * @return {IPerform} 执行的演出\n */\nexport const showVars = (sentence: ISentence): IPerform => {\n const stageState = webgalStore.getState().stage;\n const userDataState = webgalStore.getState().userData;\n const dispatch = webgalStore.dispatch;\n // 设置文本显示\n const allVar = {\n stageGameVar: stageState.GameVar,\n globalGameVar: userDataState.globalGameVar,\n };\n dispatch(setStage({ key: 'showText', value: JSON.stringify(allVar) }));\n dispatch(setStage({ key: 'showName', value: '展示变量' }));\n logger.debug('展示变量:', allVar);\n setTimeout(() => {\n WebGAL.events.textSettle.emit();\n }, 0);\n const performInitName: string = getRandomPerformName();\n const endDelay = 750 - userDataState.optionData.textSpeed * 250;\n return {\n performName: performInitName,\n duration: endDelay,\n isHoldOn: false,\n stopFunction: () => {\n WebGAL.events.textSettle.emit();\n },\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { commandType, ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\n\n/**\n * 规范函数的类型\n * @type {(sentence: ISentence) => IPerform}\n */\nexport type ScriptFunction = (sentence: ISentence) => IPerform;\n\nexport interface ScriptConfig {\n scriptType: commandType;\n scriptFunction: ScriptFunction;\n next?: boolean;\n}\n\nexport interface IConfigInterface extends ScriptConfig {\n scriptString: string;\n}\n\nexport function ScriptConfig(\n scriptType: commandType,\n scriptFunction: ScriptFunction,\n config?: Omit<ScriptConfig, 'scriptType' | 'scriptFunction'>,\n): ScriptConfig {\n return { scriptType, scriptFunction, ...config };\n}\n\nexport const scriptRegistry: Record<commandType, IConfigInterface> = {} as any;\n\nexport function defineScripts<R extends Record<string, Omit<IConfigInterface, 'scriptString'>>>(\n record: R,\n): {\n [K in keyof R]: IConfigInterface;\n} {\n // eslint-disable-next-line\n const result = {} as Record<keyof R, IConfigInterface>;\n for (const [scriptString, config] of Object.entries(record)) {\n result[scriptString as keyof R] = scriptRegistry[config.scriptType] = { scriptString, ...config };\n }\n return result;\n}\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { webgalStore } from '@/store/store';\nimport { stageActions } from '@/store/stageReducer';\n\n/**\n * 语句执行的模板代码\n * @param sentence\n */\nexport const applyStyle = (sentence: ISentence): IPerform => {\n const { content } = sentence;\n const applyStyleSegments = content.split(',');\n for (const applyStyleSegment of applyStyleSegments) {\n const splitSegment = applyStyleSegment.split('->');\n if (splitSegment.length >= 2) {\n const classNameToBeChange = splitSegment[0];\n const classNameChangeTo = splitSegment[1];\n webgalStore.dispatch(stageActions.replaceUIlable([classNameToBeChange, classNameChangeTo]));\n }\n }\n return {\n performName: 'none',\n duration: 0,\n isHoldOn: false,\n stopFunction: () => {},\n blockingNext: () => false,\n blockingAuto: () => true,\n stopTimeout: undefined, // 暂时不用,后面会交给自动清除\n };\n};\n","import { assetSetter } from '@/Core/util/gameAssetsAccess/assetSetter';\nimport { assetsPrefetcher } from '@/Core/util/prefetcher/assetsPrefetcher';\nimport SceneParser from 'webgal-parser';\nimport { commandType, IScene } from '../controller/scene/sceneInterface';\nimport { logger } from '../util/logger';\nimport { bgm } from '@/Core/gameScripts/bgm';\nimport { callSceneScript } from '@/Core/gameScripts/callSceneScript';\nimport { changeBg } from '@/Core/gameScripts/changeBg';\nimport { changeFigure } from '@/Core/gameScripts/changeFigure';\nimport { changeSceneScript } from '@/Core/gameScripts/changeSceneScript';\nimport { choose } from '@/Core/gameScripts/choose';\nimport { comment } from '@/Core/gameScripts/comment';\nimport { filmMode } from '@/Core/gameScripts/filmMode';\nimport { getUserInput } from '@/Core/gameScripts/getUserInput';\nimport { intro } from '@/Core/gameScripts/intro';\nimport { label } from '@/Core/gameScripts/label';\nimport { miniAvatar } from '@/Core/gameScripts/miniAvatar';\nimport { pixi } from '@/Core/gameScripts/pixi';\nimport { playEffect } from '@/Core/gameScripts/playEffect';\nimport { playVideo } from '@/Core/gameScripts/playVideo';\nimport { setAnimation } from '@/Core/gameScripts/setAnimation';\nimport { setComplexAnimation } from '@/Core/gameScripts/setComplexAnimation';\nimport { setFilter } from '@/Core/gameScripts/setFilter';\nimport { setTempAnimation } from '@/Core/gameScripts/setTempAnimation';\nimport { setTextbox } from '@/Core/gameScripts/setTextbox';\nimport { setTransform } from '@/Core/gameScripts/setTransform';\nimport { setTransition } from '@/Core/gameScripts/setTransition';\nimport { unlockBgm } from '@/Core/gameScripts/unlockBgm';\nimport { unlockCg } from '@/Core/gameScripts/unlockCg';\nimport { end } from '../gameScripts/end';\nimport { jumpLabel } from '../gameScripts/jumpLabel';\nimport { pixiInit } from '../gameScripts/pixi/pixiInit';\nimport { say } from '../gameScripts/say';\nimport { setVar } from '../gameScripts/setVar';\nimport { showVars } from '../gameScripts/showVars';\nimport { defineScripts, IConfigInterface, ScriptConfig, ScriptFunction, scriptRegistry } from './utils';\nimport { applyStyle } from '@/Core/gameScripts/applyStyle';\n\nexport const SCRIPT_TAG_MAP = defineScripts({\n intro: ScriptConfig(commandType.intro, intro),\n changeBg: ScriptConfig(commandType.changeBg, changeBg),\n changeFigure: ScriptConfig(commandType.changeFigure, changeFigure),\n miniAvatar: ScriptConfig(commandType.miniAvatar, miniAvatar, { next: true }),\n changeScene: ScriptConfig(commandType.changeScene, changeSceneScript),\n choose: ScriptConfig(commandType.choose, choose),\n end: ScriptConfig(commandType.end, end),\n bgm: ScriptConfig(commandType.bgm, bgm, { next: true }),\n playVideo: ScriptConfig(commandType.video, playVideo),\n setComplexAnimation: ScriptConfig(commandType.setComplexAnimation, setComplexAnimation),\n setFilter: ScriptConfig(commandType.setFilter, setFilter),\n pixiInit: ScriptConfig(commandType.pixiInit, pixiInit, { next: true }),\n pixiPerform: ScriptConfig(commandType.pixi, pixi, { next: true }),\n label: ScriptConfig(commandType.label, label, { next: true }),\n jumpLabel: ScriptConfig(commandType.jumpLabel, jumpLabel),\n setVar: ScriptConfig(commandType.setVar, setVar, { next: true }),\n showVars: ScriptConfig(commandType.showVars, showVars),\n unlockCg: ScriptConfig(commandType.unlockCg, unlockCg, { next: true }),\n unlockBgm: ScriptConfig(commandType.unlockBgm, unlockBgm, { next: true }),\n say: ScriptConfig(commandType.say, say),\n filmMode: ScriptConfig(commandType.filmMode, filmMode, { next: true }),\n callScene: ScriptConfig(commandType.callScene, callSceneScript),\n setTextbox: ScriptConfig(commandType.setTextbox, setTextbox),\n setAnimation: ScriptConfig(commandType.setAnimation, setAnimation),\n playEffect: ScriptConfig(commandType.playEffect, playEffect, { next: true }),\n setTempAnimation: ScriptConfig(commandType.setTempAnimation, setTempAnimation),\n __commment: ScriptConfig(commandType.comment, comment, { next: true }),\n setTransform: ScriptConfig(commandType.setTransform, setTransform),\n setTransition: ScriptConfig(commandType.setTransition, setTransition, { next: true }),\n getUserInput: ScriptConfig(commandType.getUserInput, getUserInput),\n applyStyle: ScriptConfig(commandType.applyStyle, applyStyle, { next: true }),\n // if: ScriptConfig(commandType.if, undefined, { next: true }),\n});\n\nexport const SCRIPT_CONFIG: IConfigInterface[] = Object.values(SCRIPT_TAG_MAP);\n\nexport const ADD_NEXT_ARG_LIST = SCRIPT_CONFIG.filter((config) => config.next).map((config) => config.scriptType);\n\n/**\n * 场景解析器\n * @param rawScene 原始场景\n * @param sceneName 场景名称\n * @param sceneUrl 场景url\n * @return {IScene} 解析后的场景\n */\nexport const WebgalParser = new SceneParser(assetsPrefetcher, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG);\n\nexport const sceneParser = (rawScene: string, sceneName: string, sceneUrl: string): IScene => {\n const parsedScene = WebgalParser.parse(rawScene, sceneName, sceneUrl);\n logger.info(`解析场景:${sceneName},数据为:`, parsedScene);\n return parsedScene;\n};\n\nexport { scriptRegistry, type ScriptFunction };\n","import { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { initPerform, IPerform } from '@/Core/Modules/perform/performInterface';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { scriptRegistry, SCRIPT_TAG_MAP, ScriptFunction } from '@/Core/parser/sceneParser';\n\n/**\n * 语句调用器,真正执行语句的调用,并自动将演出在指定时间卸载\n * @param script 调用的语句\n */\nexport const runScript = (script: ISentence) => {\n let perform: IPerform = initPerform;\n const funcToRun: ScriptFunction = scriptRegistry[script.command]?.scriptFunction ?? SCRIPT_TAG_MAP.say.scriptFunction; // 默认是say\n\n // 调用脚本对应的函数\n perform = funcToRun(script);\n\n if (perform.arrangePerformPromise) {\n perform.arrangePerformPromise.then((resolovedPerform) =>\n WebGAL.gameplay.performController.arrangeNewPerform(resolovedPerform, script),\n );\n } else {\n WebGAL.gameplay.performController.arrangeNewPerform(perform, script);\n }\n};\n","import { sceneFetcher } from './sceneFetcher';\nimport { sceneParser } from '../../parser/sceneParser';\nimport { logger } from '../../util/logger';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport { ISceneEntry } from '@/Core/Modules/scene';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 恢复场景\n * @param entry 场景入口\n */\nexport const restoreScene = (entry: ISceneEntry) => {\n if (WebGAL.sceneManager.lockSceneWrite) {\n return;\n }\n WebGAL.sceneManager.lockSceneWrite = true;\n // 场景写入到运行时\n sceneFetcher(entry.sceneUrl)\n .then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, entry.sceneName, entry.sceneUrl);\n WebGAL.sceneManager.sceneData.currentSentenceId = entry.continueLine + 1; // 重设场景\n logger.debug('现在恢复场景,恢复后场景:', WebGAL.sceneManager.sceneData.currentScene);\n WebGAL.sceneManager.lockSceneWrite = false;\n nextSentence();\n })\n .catch((e) => {\n logger.error('场景调用错误', e);\n WebGAL.sceneManager.lockSceneWrite = false;\n });\n};\n","import { compile } from 'angular-expressions';\n\nexport function strIf(s: string) {\n try {\n const res = compile(s);\n return res();\n } catch {\n return false;\n }\n}\n","import { commandType, ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { runScript } from './runScript';\nimport { logger } from '../../util/logger';\nimport { IStageState } from '@/store/stageInterface';\nimport { restoreScene } from '../scene/restoreScene';\nimport { webgalStore } from '@/store/store';\nimport { getValueFromStateElseKey } from '@/Core/gameScripts/setVar';\nimport { strIf } from '@/Core/controller/gamePlay/strIf';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { ISceneEntry } from '@/Core/Modules/scene';\nimport { IBacklogItem } from '@/Core/Modules/backlog';\nimport { SYSTEM_CONFIG } from '@/config';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport const whenChecker = (whenValue: string | undefined): boolean => {\n if (whenValue === undefined) {\n return true;\n }\n // 先把变量解析出来\n const valExpArr = whenValue.split(/([+\\-*\\/()><!]|>=|<=|==|&&|\\|\\||!=)/g);\n const valExp = valExpArr\n .map((e) => {\n if (e.match(/[a-zA-Z]/)) {\n if (e.match(/true/) || e.match(/false/)) {\n return e;\n }\n return getValueFromStateElseKey(e);\n } else return e;\n })\n .reduce((pre, curr) => pre + curr, '');\n return !!strIf(valExp);\n};\n\n/**\n * 语句执行器\n * 执行语句,同步场景状态,并根据情况立即执行下一句或者加入backlog\n */\nexport const scriptExecutor = () => {\n // 超过总语句数量,则从场景栈拿出一个需要继续的场景,然后继续流程。若场景栈清空,则停止流程\n if (\n WebGAL.sceneManager.sceneData.currentSentenceId >\n WebGAL.sceneManager.sceneData.currentScene.sentenceList.length - 1\n ) {\n if (WebGAL.sceneManager.sceneData.sceneStack.length !== 0) {\n const sceneToRestore: ISceneEntry | undefined = WebGAL.sceneManager.sceneData.sceneStack.pop();\n if (sceneToRestore !== undefined) {\n restoreScene(sceneToRestore);\n }\n }\n return;\n }\n const currentScript: ISentence =\n WebGAL.sceneManager.sceneData.currentScene.sentenceList[WebGAL.sceneManager.sceneData.currentSentenceId];\n\n const interpolationOneItem = (content: string): string => {\n let retContent = content;\n const contentExp = retContent.match(/(?<!\\\\)\\{(.*?)\\}/g);\n\n if (contentExp !== null) {\n contentExp.forEach((e) => {\n const contentVarValue = getValueFromStateElseKey(e.replace(/(?<!\\\\)\\{(.*)\\}/, '$1'));\n retContent = retContent.replace(e, contentVarValue);\n });\n }\n retContent = retContent.replace(/\\\\{/g, '{').replace(/\\\\}/g, '}');\n return retContent;\n };\n\n /**\n * Variable interpolation\n */\n const variableInterpolation = () => {\n currentScript.content = interpolationOneItem(currentScript.content);\n\n currentScript.args.forEach((arg) => {\n if (arg.value && typeof arg.value === 'string') {\n arg.value = interpolationOneItem(arg.value);\n }\n });\n };\n\n variableInterpolation();\n\n // 判断这个脚本要不要执行\n let runThis = true;\n let isHasWhenArg = false;\n let whenValue = '';\n currentScript.args.forEach((e) => {\n if (e.key === 'when') {\n isHasWhenArg = true;\n whenValue = e.value.toString();\n }\n });\n // 如果语句有 when\n if (isHasWhenArg) {\n runThis = whenChecker(whenValue);\n }\n\n // 执行语句\n if (!runThis) {\n logger.warn('不满足条件,跳过本句!');\n WebGAL.sceneManager.sceneData.currentSentenceId++;\n nextSentence();\n return;\n }\n runScript(currentScript);\n let isNext = false; // 是否要进行下一句\n currentScript.args.forEach((e) => {\n // 判断是否有下一句的参数\n if (e.key === 'next' && e.value) {\n isNext = true;\n }\n });\n\n let isSaveBacklog = currentScript.command === commandType.say; // 是否在本句保存backlog(一般遇到对话保存)\n // 检查当前对话是否有 notend 参数\n currentScript.args.forEach((e) => {\n if (e.key === 'notend' && e.value === true) {\n isSaveBacklog = false;\n }\n });\n let currentStageState: IStageState;\n\n // 执行至指定 sentenceID\n // if (runToSentence >= 0 && runtime_currentSceneData.currentSentenceId < runToSentence) {\n // runtime_currentSceneData.currentSentenceId++;\n // scriptExecutor(runToSentence);\n // return;\n // }\n\n // 执行“下一句”\n if (isNext) {\n WebGAL.sceneManager.sceneData.currentSentenceId++;\n scriptExecutor();\n return;\n }\n\n /**\n * 为了让 backlog 拿到连续执行了多条语句后正确的数据,放到下一个宏任务中执行(我也不知道为什么这样能正常,有能力的可以研究一下\n */\n setTimeout(() => {\n // 同步当前舞台数据\n currentStageState = webgalStore.getState().stage;\n const allState = {\n currentStageState: currentStageState,\n globalGameVar: webgalStore.getState().userData.globalGameVar,\n };\n logger.debug('本条语句执行结果', allState);\n // 保存 backlog\n if (isSaveBacklog) {\n // WebGAL.backlogManager.isSaveBacklogNext = true;\n WebGAL.backlogManager.saveCurrentStateToBacklog();\n }\n }, 0);\n WebGAL.sceneManager.sceneData.currentSentenceId++;\n};\n","import { scriptExecutor } from './scriptExecutor';\nimport { logger } from '../../util/logger';\nimport { webgalStore } from '@/store/store';\nimport { resetStageState } from '@/store/stageReducer';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { IBacklogItem } from '@/Core/Modules/backlog';\n\nimport { SYSTEM_CONFIG } from '@/config';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { IRunPerform } from '@/store/stageInterface';\n\n/**\n * 进行下一句\n */\nexport const nextSentence = () => {\n /**\n * 发送 “发生点击下一句” 事件。\n */\n WebGAL.events.userInteractNext.emit();\n\n // 如果当前显示标题,那么不进行下一句\n const GUIState = webgalStore.getState().GUI;\n if (GUIState.showTitle) {\n return;\n }\n\n // 第一步,检查是否存在 blockNext 的演出\n let isBlockingNext = false;\n WebGAL.gameplay.performController.performList.forEach((e) => {\n if (e.blockingNext())\n // 阻塞且没有结束的演出\n isBlockingNext = true;\n });\n if (isBlockingNext) {\n // 有阻塞,提前结束\n logger.warn('next 被阻塞!');\n return;\n }\n\n // 检查是否处于演出完成状态,不是则结束所有普通演出(保持演出不算做普通演出)\n let allSettled = true;\n WebGAL.gameplay.performController.performList.forEach((e) => {\n if (!e.isHoldOn && !e.skipNextCollect) allSettled = false;\n });\n if (allSettled) {\n // 所有普通演出已经结束\n // if (WebGAL.backlogManager.isSaveBacklogNext) {\n // WebGAL.backlogManager.isSaveBacklogNext = false;\n // }\n // 清除状态表的演出序列(因为这时候已经准备进行下一句了)\n const stageState = webgalStore.getState().stage;\n const newStageState = cloneDeep(stageState);\n for (let i = 0; i < newStageState.PerformList.length; i++) {\n const e: IRunPerform = newStageState.PerformList[i];\n if (!e.isHoldOn) {\n newStageState.PerformList.splice(i, 1);\n i--;\n }\n }\n webgalStore.dispatch(resetStageState(newStageState));\n scriptExecutor();\n return;\n }\n\n // 不处于 allSettled 状态,清除所有普通演出,强制进入settled。\n logger.debug('提前结束被触发,现在清除普通演出');\n let isGoNext = false;\n for (let i = 0; i < WebGAL.gameplay.performController.performList.length; i++) {\n const e = WebGAL.gameplay.performController.performList[i];\n if (!e.isHoldOn) {\n if (e.goNextWhenOver) {\n isGoNext = true;\n }\n if (!e.skipNextCollect) {\n // 由于提前结束使用的不是 unmountPerform 标准 API,所以不会触发两次 nextSentence\n e.stopFunction();\n clearTimeout(e.stopTimeout as unknown as number);\n WebGAL.gameplay.performController.performList.splice(i, 1);\n i--;\n }\n }\n }\n if (isGoNext) {\n // 由于不使用 unmountPerform 标准 API,这里需要手动收集一下 isGoNext\n nextSentence();\n }\n};\n","import { IPerform } from '@/Core/Modules/perform/performInterface';\nimport { ISentence } from '@/Core/controller/scene/sceneInterface';\nimport { webgalStore } from '@/store/store';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { resetStageState, stageActions } from '@/store/stageReducer';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport { IRunPerform } from '@/store/stageInterface';\n\n/**\n * 获取随机演出名称\n */\nexport const getRandomPerformName = (): string => {\n return Math.random().toString().substring(0, 10);\n};\n\nexport class PerformController {\n public performList: Array<IPerform> = [];\n public timeoutList: Array<ReturnType<typeof setTimeout>> = [];\n\n public arrangeNewPerform(perform: IPerform, script: ISentence, syncPerformState = true) {\n // 语句不执行演出\n if (perform.performName === 'none') {\n return;\n }\n // 同步演出状态\n if (syncPerformState) {\n const performToAdd = { id: perform.performName, isHoldOn: perform.isHoldOn, script: script };\n webgalStore.dispatch(stageActions.addPerform(performToAdd));\n }\n\n // 时间到后自动清理演出\n perform.stopTimeout = setTimeout(() => {\n // perform.stopFunction();\n // perform.isOver = true;\n if (!perform.isHoldOn) {\n // 如果不是保持演出,清除\n this.unmountPerform(perform.performName);\n }\n }, perform.duration);\n\n if (script.args.find((e) => e.key === 'continue' && e.value === true)) perform.goNextWhenOver = true;\n\n this.performList.push(perform);\n }\n\n public unmountPerform(name: string, force = false) {\n if (!force) {\n for (let i = 0; i < this.performList.length; i++) {\n const e = this.performList[i];\n if (!e.isHoldOn && e.performName === name) {\n e.stopFunction();\n clearTimeout(e.stopTimeout as unknown as number);\n if (e.goNextWhenOver) {\n // nextSentence();\n this.goNextWhenOver();\n }\n this.performList.splice(i, 1);\n i--;\n }\n }\n } else {\n for (let i = 0; i < this.performList.length; i++) {\n const e = this.performList[i];\n if (e.performName === name) {\n e.stopFunction();\n clearTimeout(e.stopTimeout as unknown as number);\n if (e.goNextWhenOver) {\n // nextSentence();\n this.goNextWhenOver();\n }\n this.performList.splice(i, 1);\n i--;\n /**\n * 从状态表里清除演出\n */\n this.erasePerformFromState(name);\n }\n }\n }\n }\n\n public erasePerformFromState(name: string) {\n webgalStore.dispatch(stageActions.removePerformByName(name));\n }\n\n public removeAllPerform() {\n for (const e of this.performList) {\n e.stopFunction();\n }\n this.performList = [];\n for (const e of this.timeoutList) {\n clearTimeout(e);\n }\n }\n\n private goNextWhenOver() {\n let isBlockingAuto = false;\n this.performList?.forEach((e) => {\n if (e.blockingAuto())\n // 阻塞且没有结束的演出\n isBlockingAuto = true;\n });\n if (isBlockingAuto) {\n // 有阻塞,提前结束\n setTimeout(this.goNextWhenOver, 100);\n } else {\n nextSentence();\n }\n }\n}\n","import PixiStage from '@/Core/controller/stage/pixi/PixiController';\nimport { PerformController } from '@/Core/Modules/perform/performController';\n\n/**\n * 游戏运行时变量\n */\nexport class Gameplay {\n public isAuto = false;\n public isFast = false;\n public autoInterval: ReturnType<typeof setInterval> | null = null;\n public fastInterval: ReturnType<typeof setInterval> | null = null;\n public autoTimeout: ReturnType<typeof setTimeout> | null = null;\n public pixiStage: PixiStage | null = null;\n public performController = new PerformController();\n public resetGamePlay() {\n this.performController.timeoutList = [];\n this.isAuto = false;\n this.isFast = false;\n const autoInterval = this.autoInterval;\n if (autoInterval !== null) clearInterval(autoInterval);\n this.autoInterval = null;\n const fastInterval = this.fastInterval;\n if (fastInterval !== null) clearInterval(fastInterval);\n this.fastInterval = null;\n const autoTimeout = this.autoTimeout;\n if (autoTimeout !== null) clearInterval(autoTimeout);\n this.autoTimeout = null;\n }\n}\n","export default function(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e)}),(i=n.get(\"*\"))&&i.slice().map(function(n){n(t,e)})}}}\n//# sourceMappingURL=mitt.mjs.map\n","import mitt from 'mitt';\n\ninterface IWebgalEvent<T> {\n on: (callback: (message?: T) => void, id?: string) => void;\n off: (callback: (message?: T) => void, id?: string) => void;\n emit: (message?: T, id?: string) => void;\n}\n\nexport class Events {\n public textSettle = formEvent('text-settle');\n public userInteractNext = formEvent('__NEXT');\n public fullscreenDbClick = formEvent('fullscreen-dbclick');\n public styleUpdate = formEvent('style-update');\n}\n\nconst eventBus = mitt();\n\nfunction formEvent<T>(eventName: string): IWebgalEvent<T> {\n return {\n on: (callback, id?) => {\n // @ts-ignore\n eventBus.on(`${eventName}-${id ?? ''}`, callback);\n },\n emit: (message?, id?) => {\n eventBus.emit(`${eventName}-${id ?? ''}`, message);\n },\n off: (callback, id?) => {\n // @ts-ignore\n eventBus.off(`${eventName}-${id ?? ''}`, callback);\n },\n };\n}\n","import { BacklogManager } from '@/Core/Modules/backlog';\nimport mitt from 'mitt';\nimport { SceneManager } from '@/Core/Modules/scene';\nimport { AnimationManager } from '@/Core/Modules/animations';\nimport { Gameplay } from './Modules/gamePlay';\nimport { Events } from '@/Core/Modules/events';\n\nexport class WebgalCore {\n public sceneManager = new SceneManager();\n public backlogManager = new BacklogManager(this.sceneManager);\n public animationManager = new AnimationManager();\n public gameplay = new Gameplay();\n public gameName = '';\n public gameKey = '';\n public events = new Events();\n}\n","import { WebgalCore } from '@/Core/webgalCore';\n\nexport const WebGAL = new WebgalCore();\n\n// 调试,不调试给去掉\n// @ts-ignore\n// window.WebGAL = WebGAL;\n","import * as localforage from 'localforage';\nimport { IUserData } from '@/store/userDataInterface';\nimport { logger } from '../../util/logger';\nimport { webgalStore } from '@/store/store';\nimport { initState, resetUserData } from '@/store/userDataReducer';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 写入本地存储\n */\nexport const setStorage = debounce(() => {\n const userDataState = webgalStore.getState().userData;\n localforage.setItem(WebGAL.gameKey, userDataState).then(() => {\n logger.info('写入本地存储');\n });\n}, 100);\n\n/**\n * 从本地存储获取数据\n */\nexport const getStorage = debounce(() => {\n localforage.getItem(WebGAL.gameKey).then((newUserData) => {\n // 如果没有数据或者属性不完全,重新初始化\n if (!newUserData || !checkUserDataProperty(newUserData)) {\n logger.warn('现在重置数据');\n setStorage();\n return;\n }\n webgalStore.dispatch(resetUserData(newUserData as IUserData));\n });\n}, 100);\n\n/**\n * 防抖函数\n * @param func 要执行的函数\n * @param wait 防抖等待时间\n */\nfunction debounce<T, K>(func: (...args: T[]) => K, wait: number) {\n let timeout: ReturnType<typeof setTimeout>;\n\n function context(...args: T[]): K {\n clearTimeout(timeout);\n let ret!: K;\n timeout = setTimeout(() => {\n ret = func.apply(context, args);\n }, wait);\n return ret;\n }\n\n return context;\n}\n\nexport const dumpToStorageFast = () => {\n const userDataState = webgalStore.getState().userData;\n localforage.setItem(WebGAL.gameKey, userDataState).then(() => {\n localforage.getItem(WebGAL.gameKey).then((newUserData) => {\n // 如果没有数据,初始化\n if (!newUserData) {\n setStorage();\n return;\n }\n webgalStore.dispatch(resetUserData(newUserData as IUserData));\n });\n logger.info('同步本地存储');\n });\n};\n\n/**\n * 检查用户数据属性是否齐全\n * @param userData 需要检查的数据\n */\nfunction checkUserDataProperty(userData: any) {\n let result = true;\n for (const key in initState) {\n if (!userData.hasOwnProperty(key)) {\n result = false;\n }\n }\n return result;\n}\n\nexport async function setStorageAsync() {\n const userDataState = webgalStore.getState().userData;\n return await localforage.setItem(WebGAL.gameKey, userDataState);\n}\n\nexport async function getStorageAsync() {\n const newUserData = await localforage.getItem(WebGAL.gameKey);\n if (!newUserData || !checkUserDataProperty(newUserData)) {\n const userDataState = webgalStore.getState().userData;\n logger.warn('现在重置数据');\n return await localforage.setItem(WebGAL.gameKey, userDataState);\n } else webgalStore.dispatch(resetUserData(newUserData as IUserData));\n return;\n}\n","import { IWebGalTextBoxTheme } from '@/Stage/themeInterface';\n\n/**\n * 当前Menu页面显示的Tag\n */\nexport enum MenuPanelTag {\n Save, // “保存”选项卡\n Load, // “读取”选项卡\n Option, // “设置”选项卡\n}\n\n/**\n * @interface IGuiState GUI状态接口\n */\nexport interface IGuiState {\n showStarter: boolean; // 是否显示初始界面(用于使得bgm可以播放)\n showTitle: boolean; // 是否显示标题界面\n showMenuPanel: boolean; // 是否显示Menu界面\n showTextBox: boolean;\n showControls: boolean;\n controlsVisibility: boolean;\n currentMenuTag: MenuPanelTag; // 当前Menu界面的选项卡\n showBacklog: boolean;\n titleBgm: string; // 标题背景音乐\n titleBg: string; // 标题背景图片\n logoImage: string[];\n showExtra: boolean;\n showGlobalDialog: boolean;\n showPanicOverlay: boolean;\n isEnterGame: boolean;\n isShowLogo: boolean;\n}\n\nexport type componentsVisibility = Pick<\n IGuiState,\n Exclude<keyof IGuiState, 'currentMenuTag' | 'titleBg' | 'titleBgm' | 'logoImage' | 'theme'>\n>;\n// 标题资源\nexport type GuiAsset = Pick<IGuiState, 'titleBgm' | 'titleBg'>;\n\nexport interface IGuiStore {\n GuiState: IGuiState;\n setGuiAsset: <K extends keyof GuiAsset>(key: K, value: string) => void;\n setVisibility: <K extends keyof componentsVisibility>(key: K, value: boolean) => void;\n setMenuPanelTag: (value: MenuPanelTag) => void;\n}\n\nexport interface setVisibilityPayload {\n component: keyof componentsVisibility;\n visibility: boolean;\n}\n\nexport interface setAssetPayload {\n asset: keyof GuiAsset;\n value: string;\n}\n\nexport type GuiStore = IGuiStore;\n","/**\n * @file 记录当前GUI的状态信息,引擎初始化时会重置。\n * @author Mahiru\n */\nimport { getStorage } from '@/Core/controller/storage/storageController';\nimport { GuiAsset, IGuiState, MenuPanelTag, setAssetPayload, setVisibilityPayload } from '@/store/guiInterface';\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { key } from 'localforage';\n\n/**\n * 初始GUI状态表\n */\nconst initState: IGuiState = {\n showBacklog: false,\n showStarter: true,\n showTitle: true,\n showMenuPanel: false,\n showTextBox: true,\n showControls: true,\n controlsVisibility: true,\n currentMenuTag: MenuPanelTag.Option,\n titleBg: '',\n titleBgm: '',\n logoImage: [],\n showExtra: false,\n showGlobalDialog: false,\n showPanicOverlay: false,\n isEnterGame: false,\n isShowLogo: true,\n};\n\n/**\n * GUI状态的Reducer\n */\nconst GUISlice = createSlice({\n name: 'gui',\n initialState: initState,\n reducers: {\n /**\n * 设置GUI的各组件的显示状态\n * @param state 当前GUI状态\n * @param action 改变显示状态的Action\n */\n setVisibility: (state, action: PayloadAction<setVisibilityPayload>) => {\n getStorage();\n const { component, visibility } = action.payload;\n state[component] = visibility;\n },\n /**\n * 设置MenuPanel的当前选中项\n * @param state 当前GUI状态\n * @param action 改变当前选中项的Action\n */\n setMenuPanelTag: (state, action: PayloadAction<MenuPanelTag>) => {\n getStorage();\n state.currentMenuTag = action.payload;\n },\n /**\n * 设置GUI资源的值\n * @param state 当前GUI状态\n * @param action 改变资源的Action\n */\n setGuiAsset: (state, action: PayloadAction<setAssetPayload>) => {\n const { asset, value } = action.payload;\n state[asset] = value;\n },\n setLogoImage: (state, action: PayloadAction<string[]>) => {\n state.logoImage = [...action.payload];\n },\n },\n});\n\nexport const { setVisibility, setMenuPanelTag, setGuiAsset, setLogoImage } = GUISlice.actions;\nexport default GUISlice.reducer;\n\n// export function GuiStateStore(): GuiStore {\n// const [GuiState, setGuiState] = useState(initState);\n// /**\n// * 设置各组件的可见性\n// * @param key 设置的组件\n// * @param value 可见性,true or false\n// */\n// const setVisibility = <K extends keyof componentsVisibility>(key: K, value: boolean) => {\n//\n// setGuiState(state => {\n// getStorage();\n// state[key] = value;\n// if (key === 'showMenuPanel' || key === 'showBacklog') {\n// state['showTextBox'] = !value;\n// }\n// return {...state};\n// });\n//\n// };\n//\n// /**\n// * 设置Menu组件显示的标签页\n// * @param value 标签页\n// */\n// const setMenuPanelTag = (value: MenuPanelTag) => {\n//\n// setGuiState(state => {\n// getStorage();\n// state.currentMenuTag = value;\n// return {...state};\n// });\n//\n// };\n//\n// /**\n// * 设置标题页的资源路径\n// * @param key 资源名\n// * @param value 资源路径\n// */\n// const setGuiAsset = <K extends keyof GuiAsset>(key: K, value: string) => {\n//\n// setGuiState(state => {\n// state[key] = value;\n// return {...state};\n// });\n//\n// };\n//\n// return {\n// GuiState,\n// setGuiAsset,\n// setVisibility,\n// setMenuPanelTag,\n// };\n// }\n","import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit';\nimport stageReducer from '@/store/stageReducer';\nimport GUIReducer from '@/store/GUIReducer';\nimport userDataReducer from '@/store/userDataReducer';\nimport savesReducer from '@/store/savesReducer';\n\n/**\n * WebGAL 全局状态管理\n */\nexport const webgalStore = configureStore({\n reducer: {\n stage: stageReducer,\n GUI: GUIReducer,\n userData: userDataReducer,\n saveData: savesReducer,\n },\n middleware: getDefaultMiddleware({\n serializableCheck: false,\n }),\n});\n\n// 在 TS 中的类型声明\nexport type RootState = ReturnType<typeof webgalStore.getState>;\n","import { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { logger } from '@/Core/util/logger';\n\n// /**\n// * 停止bgm\n// */\n// export const eraseBgm = () => {\n// logger.debug(`停止bgm`);\n// // 停止之前的bgm\n// let VocalControl: any = document.getElementById('currentBgm');\n// if (VocalControl !== null) {\n// VocalControl.currentTime = 0;\n// if (!VocalControl.paused) VocalControl.pause();\n// }\n// // 获得舞台状态并设置\n// webgalStore.dispatch(setStage({key: 'bgm', value: ''}));\n// };\n\nlet emptyBgmTimeout: ReturnType<typeof setTimeout>;\n\n/**\n * 播放bgm\n * @param url bgm路径\n * @param enter 淡入时间(单位毫秒)\n * @param volume 背景音乐 音量调整(0 - 100)\n */\nexport function playBgm(url: string, enter = 0, volume = 100): void {\n logger.debug('playing bgm' + url);\n if (url === '') {\n emptyBgmTimeout = setTimeout(() => {\n // 淡入淡出效果结束后,将 bgm 置空\n webgalStore.dispatch(setStage({ key: 'bgm', value: { src: '', enter: 0, volume: 100 } }));\n }, enter);\n const lastSrc = webgalStore.getState().stage.bgm.src;\n webgalStore.dispatch(setStage({ key: 'bgm', value: { src: lastSrc, enter: -enter, volume: volume } }));\n } else {\n // 不要清除bgm了!\n clearTimeout(emptyBgmTimeout);\n webgalStore.dispatch(setStage({ key: 'bgm', value: { src: url, enter: enter, volume: volume } }));\n }\n setTimeout(() => {\n const audioElement = document.getElementById('currentBgm') as HTMLAudioElement;\n if (audioElement.src) {\n audioElement?.play();\n }\n }, 0);\n}\n","export function setEbg(url: string) {\n const ebg = document.getElementById('ebg');\n if (ebg) {\n ebg.style.backgroundImage = `url(\"${url}\")`;\n }\n}\n","import { logger } from '@/Core/util/logger';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport const stopAllPerform = () => {\n logger.warn('清除所有演出');\n for (let i = 0; i < WebGAL.gameplay.performController.performList.length; i++) {\n const e = WebGAL.gameplay.performController.performList[i];\n e.stopFunction();\n clearTimeout(e.stopTimeout as unknown as number);\n WebGAL.gameplay.performController.performList.splice(i, 1);\n i--;\n }\n};\n","import { logger } from '../../util/logger';\nimport { sceneFetcher } from '../scene/sceneFetcher';\nimport { sceneParser } from '../../parser/sceneParser';\nimport { IStageState } from '@/store/stageInterface';\nimport { webgalStore } from '@/store/store';\nimport { resetStageState } from '@/store/stageReducer';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { runScript } from '@/Core/controller/gamePlay/runScript';\nimport { stopAllPerform } from '@/Core/controller/gamePlay/stopAllPerform';\nimport cloneDeep from 'lodash/cloneDeep';\nimport uniqWith from 'lodash/uniqWith';\nimport { scenePrefetcher } from '@/Core/util/prefetcher/scenePrefetcher';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 恢复演出\n */\nexport const restorePerform = () => {\n const stageState = webgalStore.getState().stage;\n stageState.PerformList.forEach((e) => {\n runScript(e.script);\n });\n};\n\n/**\n * 从 backlog 跳转至一个先前的状态\n * @param index\n * @param refetchScene\n */\nexport const jumpFromBacklog = (index: number, refetchScene = true) => {\n const dispatch = webgalStore.dispatch;\n // 获得存档文件\n const backlogFile = WebGAL.backlogManager.getBacklog()[index];\n logger.debug('读取的backlog数据', backlogFile);\n // 重新获取并同步场景状态\n if (refetchScene)\n sceneFetcher(backlogFile.saveScene.sceneUrl).then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(\n rawScene,\n backlogFile.saveScene.sceneName,\n backlogFile.saveScene.sceneUrl,\n );\n // 开始场景的预加载\n const subSceneList = WebGAL.sceneManager.sceneData.currentScene.subSceneList;\n WebGAL.sceneManager.settledScenes.push(WebGAL.sceneManager.sceneData.currentScene.sceneUrl); // 放入已加载场景列表,避免递归加载相同场景\n const subSceneListUniq = uniqWith(subSceneList); // 去重\n scenePrefetcher(subSceneListUniq);\n });\n WebGAL.sceneManager.sceneData.currentSentenceId = backlogFile.saveScene.currentSentenceId;\n WebGAL.sceneManager.sceneData.sceneStack = cloneDeep(backlogFile.saveScene.sceneStack);\n\n // 强制停止所有演出\n stopAllPerform();\n\n // 弹出backlog项目到指定状态\n for (let i = WebGAL.backlogManager.getBacklog().length - 1; i > index; i--) {\n WebGAL.backlogManager.getBacklog().pop();\n }\n\n // 要记录本句 Backlog\n WebGAL.backlogManager.isSaveBacklogNext = true;\n\n // 恢复舞台状态\n const newStageState: IStageState = cloneDeep(backlogFile.currentStageState);\n\n dispatch(resetStageState(newStageState));\n\n // 恢复演出\n setTimeout(restorePerform, 0);\n\n // 关闭backlog界面\n dispatch(setVisibility({ component: 'showBacklog', visibility: false }));\n\n // 重新显示 TextBox\n dispatch(setVisibility({ component: 'showTextBox', visibility: true }));\n};\n","import { ISaveData } from '@/store/userDataInterface';\nimport { logger } from '../../util/logger';\nimport { sceneFetcher } from '../scene/sceneFetcher';\nimport { sceneParser } from '../../parser/sceneParser';\nimport { webgalStore } from '@/store/store';\nimport { resetStageState } from '@/store/stageReducer';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { restorePerform } from './jumpFromBacklog';\nimport { stopAllPerform } from '@/Core/controller/gamePlay/stopAllPerform';\nimport cloneDeep from 'lodash/cloneDeep';\nimport uniqWith from 'lodash/uniqWith';\nimport { scenePrefetcher } from '@/Core/util/prefetcher/scenePrefetcher';\nimport { setEbg } from '@/Core/gameScripts/changeBg/setEbg';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 读取游戏存档\n * @param index 要读取的存档的档位\n */\nexport const loadGame = (index: number) => {\n const userDataState = webgalStore.getState().saveData;\n // 获得存档文件\n const loadFile: ISaveData = userDataState.saveData[index];\n logger.debug('读取的存档数据', loadFile);\n // 加载存档\n loadGameFromStageData(loadFile);\n};\n\nexport function loadGameFromStageData(stageData: ISaveData) {\n if (!stageData) {\n logger.info('暂无存档');\n return;\n }\n const loadFile = stageData;\n // 重新获取并同步场景状态\n sceneFetcher(loadFile.sceneData.sceneUrl).then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(\n rawScene,\n loadFile.sceneData.sceneName,\n loadFile.sceneData.sceneUrl,\n );\n // 开始场景的预加载\n const subSceneList = WebGAL.sceneManager.sceneData.currentScene.subSceneList;\n WebGAL.sceneManager.settledScenes.push(WebGAL.sceneManager.sceneData.currentScene.sceneUrl); // 放入已加载场景列表,避免递归加载相同场景\n const subSceneListUniq = uniqWith(subSceneList); // 去重\n scenePrefetcher(subSceneListUniq);\n });\n WebGAL.sceneManager.sceneData.currentSentenceId = loadFile.sceneData.currentSentenceId;\n WebGAL.sceneManager.sceneData.sceneStack = cloneDeep(loadFile.sceneData.sceneStack);\n\n // 强制停止所有演出\n stopAllPerform();\n\n // 恢复backlog\n const newBacklog = loadFile.backlog;\n WebGAL.backlogManager.getBacklog().splice(0, WebGAL.backlogManager.getBacklog().length); // 清空原backlog\n for (const e of newBacklog) {\n WebGAL.backlogManager.getBacklog().push(e);\n }\n\n // 恢复舞台状态\n const newStageState = cloneDeep(loadFile.nowStageState);\n const dispatch = webgalStore.dispatch;\n dispatch(resetStageState(newStageState));\n\n // 恢复演出\n setTimeout(restorePerform, 0);\n // restorePerform();\n\n dispatch(setVisibility({ component: 'showTitle', visibility: false }));\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: false }));\n /**\n * 恢复模糊背景\n */\n setEbg(webgalStore.getState().stage.bgName);\n}\n","import localforage from 'localforage';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { logger } from '@/Core/util/logger';\nimport { webgalStore } from '@/store/store';\nimport { saveActions } from '@/store/savesReducer';\nimport { ISaveData } from '@/store/userDataInterface';\n\nexport function dumpSavesToStorage(startIndex: number, endIndex: number) {\n for (let i = startIndex; i <= endIndex; i++) {\n const save = webgalStore.getState().saveData.saveData[i];\n localforage.setItem(`${WebGAL.gameKey}-saves${i}`, save).then(() => {\n logger.info(`存档${i}写入本地存储`);\n });\n }\n}\n\nexport function getSavesFromStorage(startIndex: number, endIndex: number) {\n for (let i = startIndex; i <= endIndex; i++) {\n localforage.getItem(`${WebGAL.gameKey}-saves${i}`).then((save) => {\n webgalStore.dispatch(saveActions.saveGame({ index: i, saveData: save as ISaveData }));\n logger.info(`存档${i}读取自本地存储`);\n });\n }\n}\n\nexport async function dumpFastSaveToStorage() {\n const save = webgalStore.getState().saveData.quickSaveData;\n await localforage.setItem(`${WebGAL.gameKey}-saves-fast`, save);\n logger.info(`快速存档写入本地存储`);\n}\n\nexport async function getFastSaveFromStorage() {\n const save = await localforage.getItem(`${WebGAL.gameKey}-saves-fast`);\n webgalStore.dispatch(saveActions.setFastSave(save as ISaveData));\n logger.info(`快速存档读取自本地存储`);\n}\n","import { logger } from '../../util/logger';\nimport { ISaveData } from '@/store/userDataInterface';\nimport { dumpToStorageFast } from './storageController';\nimport { webgalStore } from '@/store/store';\nimport { setUserData } from '@/store/userDataReducer';\nimport cloneDeep from 'lodash/cloneDeep';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { saveActions } from '@/store/savesReducer';\nimport { dumpSavesToStorage } from '@/Core/controller/storage/savesController';\n\n/**\n * 保存游戏\n * @param index 游戏的档位\n */\nexport const saveGame = (index: number) => {\n const saveData: ISaveData = generateCurrentStageData(index);\n webgalStore.dispatch(saveActions.saveGame({ index, saveData }));\n dumpSavesToStorage(index, index);\n};\n\n/**\n * 生成现在游戏的数据快照\n * @param index 游戏的档位\n */\nexport function generateCurrentStageData(index: number, isSavePreviewImage = true) {\n const stageState = webgalStore.getState().stage;\n const saveBacklog = cloneDeep(WebGAL.backlogManager.getBacklog());\n\n /**\n * 生成缩略图\n */\n\n let urlToSave = '';\n if (isSavePreviewImage) {\n const canvas: HTMLCanvasElement = document.getElementById('pixiCanvas')! as HTMLCanvasElement;\n const canvas2 = document.createElement('canvas');\n const context = canvas2.getContext('2d');\n canvas2.width = 480;\n canvas2.height = 270;\n context!.drawImage(canvas, 0, 0, 480, 270);\n urlToSave = canvas2.toDataURL('image/webp', 0.5);\n canvas2.remove();\n }\n const saveData: ISaveData = {\n nowStageState: cloneDeep(stageState),\n backlog: saveBacklog, // 舞台数据\n index: index, // 存档的序号\n saveTime: new Date().toLocaleDateString() + ' ' + new Date().toLocaleTimeString('chinese', { hour12: false }), // 保存时间\n // 场景数据\n sceneData: {\n currentSentenceId: WebGAL.sceneManager.sceneData.currentSentenceId, // 当前语句ID\n sceneStack: cloneDeep(WebGAL.sceneManager.sceneData.sceneStack), // 场景栈\n sceneName: WebGAL.sceneManager.sceneData.currentScene.sceneName, // 场景名称\n sceneUrl: WebGAL.sceneManager.sceneData.currentScene.sceneUrl, // 场景url\n },\n previewImage: urlToSave,\n };\n return saveData;\n}\n","import { webgalStore } from '@/store/store';\nimport { getStorageAsync, setStorageAsync } from '@/Core/controller/storage/storageController';\nimport { ISaveData } from '@/store/userDataInterface';\nimport { loadGameFromStageData } from '@/Core/controller/storage/loadGame';\nimport { generateCurrentStageData } from '@/Core/controller/storage/saveGame';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { saveActions } from '@/store/savesReducer';\nimport { dumpFastSaveToStorage, getFastSaveFromStorage } from '@/Core/controller/storage/savesController';\n\nexport let fastSaveGameKey = '';\nexport let isFastSaveKey = '';\nlet lock = true;\n\nexport function initKey() {\n lock = false;\n fastSaveGameKey = `FastSaveKey-${WebGAL.gameName}-${WebGAL.gameKey}`;\n isFastSaveKey = `FastSaveActive-${WebGAL.gameName}-${WebGAL.gameKey}`;\n}\n\n/**\n * 用于紧急回避时的数据存储 & 快速保存\n */\nexport async function fastSaveGame() {\n const saveData: ISaveData = generateCurrentStageData(-1, false);\n const newSaveData = cloneDeep(saveData);\n webgalStore.dispatch(saveActions.setFastSave(newSaveData));\n await dumpFastSaveToStorage();\n}\n\n/**\n * 判断是否有无存储紧急回避时的数据\n */\nexport async function hasFastSaveRecord() {\n // return await localforage.getItem(isFastSaveKey);\n await getStorageAsync();\n return webgalStore.getState().saveData.quickSaveData !== null;\n}\n\n/**\n * 加载紧急回避时的数据\n */\nexport async function loadFastSaveGame() {\n // 获得存档文件\n // const loadFile: ISaveData | null = await localforage.getItem(fastSaveGameKey);\n await getFastSaveFromStorage();\n const loadFile: ISaveData | null = webgalStore.getState().saveData.quickSaveData;\n if (!loadFile) {\n return;\n }\n loadGameFromStageData(loadFile);\n}\n\n/**\n * 移除紧急回避的数据\n */\nexport async function removeFastSaveGameRecord() {\n webgalStore.dispatch(saveActions.resetFastSave());\n await setStorageAsync();\n // await localforage.setItem(isFastSaveKey, false);\n // await localforage.setItem(fastSaveGameKey, null);\n}\n","import { assetSetter, fileType } from '../../util/gameAssetsAccess/assetSetter';\nimport { sceneFetcher } from '../scene/sceneFetcher';\nimport { sceneParser } from '../../parser/sceneParser';\nimport { resetStage } from '@/Core/controller/stage/resetStage';\nimport { webgalStore } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport { setEbg } from '@/Core/gameScripts/changeBg/setEbg';\nimport { restorePerform } from '@/Core/controller/storage/jumpFromBacklog';\n\nimport { hasFastSaveRecord, loadFastSaveGame } from '@/Core/controller/storage/fastSaveLoad';\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 从头开始游戏\n */\nexport const startGame = () => {\n resetStage(true);\n\n // 重新获取初始场景\n const sceneUrl: string = assetSetter('start.txt', fileType.scene);\n // 场景写入到运行时\n sceneFetcher(sceneUrl).then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, 'start.txt', sceneUrl);\n // 开始第一条语句\n nextSentence();\n });\n webgalStore.dispatch(setVisibility({ component: 'showTitle', visibility: false }));\n};\n\nexport async function continueGame() {\n /**\n * 重设模糊背景\n */\n setEbg(webgalStore.getState().stage.bgName);\n // 当且仅当游戏未开始时使用快速存档\n // 当游戏开始后 使用原来的逻辑\n if ((await hasFastSaveRecord()) && WebGAL.sceneManager.sceneData.currentSentenceId === 0) {\n // 恢复记录\n await loadFastSaveGame();\n return;\n }\n if (\n WebGAL.sceneManager.sceneData.currentSentenceId === 0 &&\n WebGAL.sceneManager.sceneData.currentScene.sceneName === 'start.txt'\n ) {\n // 如果游戏没有开始,开始游戏\n nextSentence();\n } else {\n restorePerform();\n }\n}\n","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n return target;\n}","/**\n * This file automatically generated from `pre-publish.js`.\n * Do not manually edit.\n */\n\nmodule.exports = {\n \"area\": true,\n \"base\": true,\n \"br\": true,\n \"col\": true,\n \"embed\": true,\n \"hr\": true,\n \"img\": true,\n \"input\": true,\n \"link\": true,\n \"meta\": true,\n \"param\": true,\n \"source\": true,\n \"track\": true,\n \"wbr\": true\n};\n","import e from\"void-elements\";var t=/\\s([^'\"/\\s><]+?)[\\s/>]|([^\\s=]+)=\\s?(\".*?\"|'.*?')/g;function n(n){var r={type:\"tag\",name:\"\",voidElement:!1,attrs:{},children:[]},i=n.match(/<\\/?([^\\s]+?)[/\\s>]/);if(i&&(r.name=i[1],(e[i[1]]||\"/\"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith(\"!--\"))){var s=n.indexOf(\"--\\x3e\");return{type:\"comment\",comment:-1!==s?n.slice(4,s):\"\"}}for(var a=new RegExp(t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,\"\"];o.indexOf(\"=\")>-1&&(l=o.split(\"=\")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\\-\\!\\/](?:\"[^\"]*\"|'[^']*'|[^'\">])*>/g,i=/^\\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case\"text\":return e+t.content;case\"tag\":return e+=\"<\"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'=\"'+e[n]+'\"');return t.length?\" \"+t.join(\" \"):\"\"}(t.attrs):\"\")+(t.voidElement?\"/>\":\">\"),t.voidElement?e:e+t.children.reduce(a,\"\")+\"</\"+t.name+\">\";case\"comment\":return e+\"\\x3c!--\"+t.comment+\"--\\x3e\"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf(\"<\")){var u=e.indexOf(\"<\");c.push({type:\"text\",content:-1===u?e:e.substring(0,u)})}return e.replace(r,function(r,s){if(m){if(r!==\"</\"+a.name+\">\")return;m=!1}var u,f=\"/\"!==r.charAt(1),h=r.startsWith(\"\\x3c!--\"),p=s+r.length,d=e.charAt(p);if(h){var v=n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,\"tag\"===(a=n(r)).type&&t.components[a.name]&&(a.type=\"component\",m=!0),a.voidElement||m||!d||\"<\"===d||a.children.push({type:\"text\",content:e.slice(p,e.indexOf(\"<\",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&\"<\"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf(\"<\",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=\" \"),(x>-1&&l+u.length>=0||\" \"!==g)&&u.push({type:\"text\",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a(\"\",t)},\"\")}};export default c;\n//# sourceMappingURL=html-parse-stringify.module.js.map\n","export function warn() {\n if (console && console.warn) {\n var _console;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[0] === 'string') args[0] = \"react-i18next:: \".concat(args[0]);\n\n (_console = console).warn.apply(_console, args);\n }\n}\nvar alreadyWarned = {};\nexport function warnOnce() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;\n if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();\n warn.apply(void 0, args);\n}\n\nvar loadedClb = function loadedClb(i18n, cb) {\n return function () {\n if (i18n.isInitialized) {\n cb();\n } else {\n var initialized = function initialized() {\n setTimeout(function () {\n i18n.off('initialized', initialized);\n }, 0);\n cb();\n };\n\n i18n.on('initialized', initialized);\n }\n };\n};\n\nexport function loadNamespaces(i18n, ns, cb) {\n i18n.loadNamespaces(ns, loadedClb(i18n, cb));\n}\nexport function loadLanguages(i18n, lng, ns, cb) {\n if (typeof ns === 'string') ns = [ns];\n ns.forEach(function (n) {\n if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);\n });\n i18n.loadLanguages(lng, loadedClb(i18n, cb));\n}\n\nfunction oldI18nextHasLoadedNamespace(ns, i18n) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var lng = i18n.languages[0];\n var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;\n var lastLng = i18n.languages[i18n.languages.length - 1];\n if (lng.toLowerCase() === 'cimode') return true;\n\n var loadNotPending = function loadNotPending(l, n) {\n var loadState = i18n.services.backendConnector.state[\"\".concat(l, \"|\").concat(n)];\n return loadState === -1 || loadState === 2;\n };\n\n if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;\n if (i18n.hasResourceBundle(lng, ns)) return true;\n if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;\n if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;\n return false;\n}\n\nexport function hasLoadedNamespace(ns, i18n) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (!i18n.languages || !i18n.languages.length) {\n warnOnce('i18n.languages were undefined or empty', i18n.languages);\n return true;\n }\n\n var isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;\n\n if (!isNewerI18next) {\n return oldI18nextHasLoadedNamespace(ns, i18n, options);\n }\n\n return i18n.hasLoadedNamespace(ns, {\n lng: options.lng,\n precheck: function precheck(i18nInstance, loadNotPending) {\n if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;\n }\n });\n}\nexport function getDisplayName(Component) {\n return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');\n}","var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;\nvar htmlEntities = {\n '&': '&',\n '&': '&',\n '<': '<',\n '<': '<',\n '>': '>',\n '>': '>',\n ''': \"'\",\n ''': \"'\",\n '"': '\"',\n '"': '\"',\n ' ': ' ',\n ' ': ' ',\n '©': '©',\n '©': '©',\n '®': '®',\n '®': '®',\n '…': '…',\n '…': '…',\n '/': '/',\n '/': '/'\n};\n\nvar unescapeHtmlEntity = function unescapeHtmlEntity(m) {\n return htmlEntities[m];\n};\n\nexport var unescape = function unescape(text) {\n return text.replace(matchHtmlEntity, unescapeHtmlEntity);\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { unescape } from './unescape.js';\nvar defaultOptions = {\n bindI18n: 'languageChanged',\n bindI18nStore: '',\n transEmptyNodeValue: '',\n transSupportBasicHtmlNodes: true,\n transWrapTextNodes: '',\n transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],\n useSuspense: true,\n unescape: unescape\n};\nexport function setDefaults() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n defaultOptions = _objectSpread(_objectSpread({}, defaultOptions), options);\n}\nexport function getDefaults() {\n return defaultOptions;\n}","var i18nInstance;\nexport function setI18n(instance) {\n i18nInstance = instance;\n}\nexport function getI18n() {\n return i18nInstance;\n}","import _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nvar _excluded = [\"format\"],\n _excluded2 = [\"children\", \"count\", \"parent\", \"i18nKey\", \"context\", \"tOptions\", \"values\", \"defaults\", \"components\", \"ns\", \"i18n\", \"t\", \"shouldUnescape\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { isValidElement, cloneElement, createElement } from 'react';\nimport HTML from 'html-parse-stringify';\nimport { warn, warnOnce } from './utils.js';\nimport { getDefaults } from './defaults.js';\nimport { getI18n } from './i18nInstance.js';\n\nfunction hasChildren(node, checkLength) {\n if (!node) return false;\n var base = node.props ? node.props.children : node.children;\n if (checkLength) return base.length > 0;\n return !!base;\n}\n\nfunction getChildren(node) {\n if (!node) return [];\n return node.props ? node.props.children : node.children;\n}\n\nfunction hasValidReactChildren(children) {\n if (Object.prototype.toString.call(children) !== '[object Array]') return false;\n return children.every(function (child) {\n return isValidElement(child);\n });\n}\n\nfunction getAsArray(data) {\n return Array.isArray(data) ? data : [data];\n}\n\nfunction mergeProps(source, target) {\n var newTarget = _objectSpread({}, target);\n\n newTarget.props = Object.assign(source.props, target.props);\n return newTarget;\n}\n\nexport function nodesToString(children, i18nOptions) {\n if (!children) return '';\n var stringNode = '';\n var childrenArray = getAsArray(children);\n var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];\n childrenArray.forEach(function (child, childIndex) {\n if (typeof child === 'string') {\n stringNode += \"\".concat(child);\n } else if (isValidElement(child)) {\n var childPropsCount = Object.keys(child.props).length;\n var shouldKeepChild = keepArray.indexOf(child.type) > -1;\n var childChildren = child.props.children;\n\n if (!childChildren && shouldKeepChild && childPropsCount === 0) {\n stringNode += \"<\".concat(child.type, \"/>\");\n } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {\n stringNode += \"<\".concat(childIndex, \"></\").concat(childIndex, \">\");\n } else if (child.props.i18nIsDynamicList) {\n stringNode += \"<\".concat(childIndex, \"></\").concat(childIndex, \">\");\n } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {\n stringNode += \"<\".concat(child.type, \">\").concat(childChildren, \"</\").concat(child.type, \">\");\n } else {\n var content = nodesToString(childChildren, i18nOptions);\n stringNode += \"<\".concat(childIndex, \">\").concat(content, \"</\").concat(childIndex, \">\");\n }\n } else if (child === null) {\n warn(\"Trans: the passed in value is invalid - seems you passed in a null child.\");\n } else if (_typeof(child) === 'object') {\n var format = child.format,\n clone = _objectWithoutProperties(child, _excluded);\n\n var keys = Object.keys(clone);\n\n if (keys.length === 1) {\n var value = format ? \"\".concat(keys[0], \", \").concat(format) : keys[0];\n stringNode += \"{{\".concat(value, \"}}\");\n } else {\n warn(\"react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.\", child);\n }\n } else {\n warn(\"Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.\", child);\n }\n });\n return stringNode;\n}\n\nfunction renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {\n if (targetString === '') return [];\n var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];\n var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);\n if (!children && !emptyChildrenButNeedsHandling) return [targetString];\n var data = {};\n\n function getData(childs) {\n var childrenArray = getAsArray(childs);\n childrenArray.forEach(function (child) {\n if (typeof child === 'string') return;\n if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !isValidElement(child)) Object.assign(data, child);\n });\n }\n\n getData(children);\n var ast = HTML.parse(\"<0>\".concat(targetString, \"</0>\"));\n\n var opts = _objectSpread(_objectSpread({}, data), combinedTOpts);\n\n function renderInner(child, node, rootReactNode) {\n var childs = getChildren(child);\n var mappedChildren = mapAST(childs, node.children, rootReactNode);\n return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;\n }\n\n function pushTranslatedJSX(child, inner, mem, i, isVoid) {\n if (child.dummy) child.children = inner;\n mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {\n key: i\n }), isVoid ? undefined : inner));\n }\n\n function mapAST(reactNode, astNode, rootReactNode) {\n var reactNodes = getAsArray(reactNode);\n var astNodes = getAsArray(astNode);\n return astNodes.reduce(function (mem, node, i) {\n var translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);\n\n if (node.type === 'tag') {\n var tmp = reactNodes[parseInt(node.name, 10)];\n if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];\n if (!tmp) tmp = {};\n var child = Object.keys(node.attrs).length !== 0 ? mergeProps({\n props: node.attrs\n }, tmp) : tmp;\n var isElement = isValidElement(child);\n var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;\n var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof(child) === 'object' && child.dummy && !isElement;\n var isKnownComponent = _typeof(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);\n\n if (typeof child === 'string') {\n var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);\n mem.push(value);\n } else if (hasChildren(child) || isValidTranslationWithChildren) {\n var inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (isEmptyTransWithHTML) {\n var _inner = mapAST(reactNodes, node.children, rootReactNode);\n\n mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {\n key: i\n }), _inner));\n } else if (Number.isNaN(parseFloat(node.name))) {\n if (isKnownComponent) {\n var _inner2 = renderInner(child, node, rootReactNode);\n\n pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);\n } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {\n if (node.voidElement) {\n mem.push(createElement(node.name, {\n key: \"\".concat(node.name, \"-\").concat(i)\n }));\n } else {\n var _inner3 = mapAST(reactNodes, node.children, rootReactNode);\n\n mem.push(createElement(node.name, {\n key: \"\".concat(node.name, \"-\").concat(i)\n }, _inner3));\n }\n } else if (node.voidElement) {\n mem.push(\"<\".concat(node.name, \" />\"));\n } else {\n var _inner4 = mapAST(reactNodes, node.children, rootReactNode);\n\n mem.push(\"<\".concat(node.name, \">\").concat(_inner4, \"</\").concat(node.name, \">\"));\n }\n } else if (_typeof(child) === 'object' && !isElement) {\n var content = node.children[0] ? translationContent : null;\n if (content) mem.push(content);\n } else if (node.children.length === 1 && translationContent) {\n mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {\n key: i\n }), translationContent));\n } else {\n mem.push(cloneElement(child, _objectSpread(_objectSpread({}, child.props), {}, {\n key: i\n })));\n }\n } else if (node.type === 'text') {\n var wrapTextNodes = i18nOptions.transWrapTextNodes;\n\n var _content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);\n\n if (wrapTextNodes) {\n mem.push(createElement(wrapTextNodes, {\n key: \"\".concat(node.name, \"-\").concat(i)\n }, _content));\n } else {\n mem.push(_content);\n }\n }\n\n return mem;\n }, []);\n }\n\n var result = mapAST([{\n dummy: true,\n children: children || []\n }], ast, getAsArray(children || []));\n return getChildren(result[0]);\n}\n\nexport function Trans(_ref) {\n var children = _ref.children,\n count = _ref.count,\n parent = _ref.parent,\n i18nKey = _ref.i18nKey,\n context = _ref.context,\n _ref$tOptions = _ref.tOptions,\n tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,\n values = _ref.values,\n defaults = _ref.defaults,\n components = _ref.components,\n ns = _ref.ns,\n i18nFromProps = _ref.i18n,\n tFromProps = _ref.t,\n shouldUnescape = _ref.shouldUnescape,\n additionalProps = _objectWithoutProperties(_ref, _excluded2);\n\n var i18n = i18nFromProps || getI18n();\n\n if (!i18n) {\n warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');\n return children;\n }\n\n var t = tFromProps || i18n.t.bind(i18n) || function (k) {\n return k;\n };\n\n if (context) tOptions.context = context;\n\n var reactI18nextOptions = _objectSpread(_objectSpread({}, getDefaults()), i18n.options && i18n.options.react);\n\n var namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS;\n namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];\n var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;\n var hashTransKey = reactI18nextOptions.hashTransKey;\n var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);\n var interpolationOverride = values ? tOptions.interpolation : {\n interpolation: _objectSpread(_objectSpread({}, tOptions.interpolation), {}, {\n prefix: '#$?',\n suffix: '?$#'\n })\n };\n\n var combinedTOpts = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, tOptions), {}, {\n count: count\n }, values), interpolationOverride), {}, {\n defaultValue: defaultValue,\n ns: namespaces\n });\n\n var translation = key ? t(key, combinedTOpts) : defaultValue;\n var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);\n var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;\n return useAsParent ? createElement(useAsParent, additionalProps, content) : content;\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import { setDefaults } from './defaults.js';\nimport { setI18n } from './i18nInstance.js';\nexport var initReactI18next = {\n type: '3rdParty',\n init: function init(instance) {\n setDefaults(instance.options.react);\n setI18n(instance);\n }\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { createContext } from 'react';\nimport { getDefaults, setDefaults } from './defaults.js';\nimport { getI18n, setI18n } from './i18nInstance.js';\nimport { initReactI18next } from './initReactI18next.js';\nexport { getDefaults, setDefaults, getI18n, setI18n, initReactI18next };\nexport var I18nContext = createContext();\nexport var ReportNamespaces = function () {\n function ReportNamespaces() {\n _classCallCheck(this, ReportNamespaces);\n\n this.usedNamespaces = {};\n }\n\n _createClass(ReportNamespaces, [{\n key: \"addUsedNamespaces\",\n value: function addUsedNamespaces(namespaces) {\n var _this = this;\n\n namespaces.forEach(function (ns) {\n if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;\n });\n }\n }, {\n key: \"getUsedNamespaces\",\n value: function getUsedNamespaces() {\n return Object.keys(this.usedNamespaces);\n }\n }]);\n\n return ReportNamespaces;\n}();\nexport function composeInitialProps(ForComponent) {\n return function (ctx) {\n return new Promise(function (resolve) {\n var i18nInitialProps = getInitialProps();\n\n if (ForComponent.getInitialProps) {\n ForComponent.getInitialProps(ctx).then(function (componentsInitialProps) {\n resolve(_objectSpread(_objectSpread({}, componentsInitialProps), i18nInitialProps));\n });\n } else {\n resolve(i18nInitialProps);\n }\n });\n };\n}\nexport function getInitialProps() {\n var i18n = getI18n();\n var namespaces = i18n.reportNamespaces ? i18n.reportNamespaces.getUsedNamespaces() : [];\n var ret = {};\n var initialI18nStore = {};\n i18n.languages.forEach(function (l) {\n initialI18nStore[l] = {};\n namespaces.forEach(function (ns) {\n initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};\n });\n });\n ret.initialI18nStore = initialI18nStore;\n ret.initialLanguage = i18n.language;\n return ret;\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"children\", \"count\", \"parent\", \"i18nKey\", \"context\", \"tOptions\", \"values\", \"defaults\", \"components\", \"ns\", \"i18n\", \"t\", \"shouldUnescape\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { useContext } from 'react';\nimport { nodesToString, Trans as TransWithoutContext } from './TransWithoutContext.js';\nimport { getI18n, I18nContext } from './context.js';\nexport { nodesToString };\nexport function Trans(_ref) {\n var children = _ref.children,\n count = _ref.count,\n parent = _ref.parent,\n i18nKey = _ref.i18nKey,\n context = _ref.context,\n _ref$tOptions = _ref.tOptions,\n tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,\n values = _ref.values,\n defaults = _ref.defaults,\n components = _ref.components,\n ns = _ref.ns,\n i18nFromProps = _ref.i18n,\n tFromProps = _ref.t,\n shouldUnescape = _ref.shouldUnescape,\n additionalProps = _objectWithoutProperties(_ref, _excluded);\n\n var _ref2 = useContext(I18nContext) || {},\n i18nFromContext = _ref2.i18n,\n defaultNSFromContext = _ref2.defaultNS;\n\n var i18n = i18nFromProps || i18nFromContext || getI18n();\n var t = tFromProps || i18n && i18n.t.bind(i18n);\n return TransWithoutContext(_objectSpread({\n children: children,\n count: count,\n parent: parent,\n i18nKey: i18nKey,\n context: context,\n tOptions: tOptions,\n values: values,\n defaults: defaults,\n components: components,\n ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,\n i18n: i18n,\n t: tFromProps,\n shouldUnescape: shouldUnescape\n }, additionalProps));\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/typeof\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { useState, useEffect, useContext, useRef } from 'react';\nimport { getI18n, getDefaults, ReportNamespaces, I18nContext } from './context.js';\nimport { warnOnce, loadNamespaces, loadLanguages, hasLoadedNamespace } from './utils.js';\n\nvar usePrevious = function usePrevious(value, ignore) {\n var ref = useRef();\n useEffect(function () {\n ref.current = ignore ? ref.current : value;\n }, [value, ignore]);\n return ref.current;\n};\n\nexport function useTranslation(ns) {\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var i18nFromProps = props.i18n;\n\n var _ref = useContext(I18nContext) || {},\n i18nFromContext = _ref.i18n,\n defaultNSFromContext = _ref.defaultNS;\n\n var i18n = i18nFromProps || i18nFromContext || getI18n();\n if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();\n\n if (!i18n) {\n warnOnce('You will need to pass in an i18next instance by using initReactI18next');\n\n var notReadyT = function notReadyT(k, optsOrDefaultValue) {\n if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;\n if (optsOrDefaultValue && _typeof(optsOrDefaultValue) === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;\n return Array.isArray(k) ? k[k.length - 1] : k;\n };\n\n var retNotReady = [notReadyT, {}, false];\n retNotReady.t = notReadyT;\n retNotReady.i18n = {};\n retNotReady.ready = false;\n return retNotReady;\n }\n\n if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');\n\n var i18nOptions = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), i18n.options.react), props);\n\n var useSuspense = i18nOptions.useSuspense,\n keyPrefix = i18nOptions.keyPrefix;\n var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;\n namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];\n if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);\n var ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(function (n) {\n return hasLoadedNamespace(n, i18n, i18nOptions);\n });\n\n function getT() {\n return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);\n }\n\n var _useState = useState(getT),\n _useState2 = _slicedToArray(_useState, 2),\n t = _useState2[0],\n setT = _useState2[1];\n\n var joinedNS = namespaces.join();\n if (props.lng) joinedNS = \"\".concat(props.lng).concat(joinedNS);\n var previousJoinedNS = usePrevious(joinedNS);\n var isMounted = useRef(true);\n useEffect(function () {\n var bindI18n = i18nOptions.bindI18n,\n bindI18nStore = i18nOptions.bindI18nStore;\n isMounted.current = true;\n\n if (!ready && !useSuspense) {\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, function () {\n if (isMounted.current) setT(getT);\n });\n } else {\n loadNamespaces(i18n, namespaces, function () {\n if (isMounted.current) setT(getT);\n });\n }\n }\n\n if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {\n setT(getT);\n }\n\n function boundReset() {\n if (isMounted.current) setT(getT);\n }\n\n if (bindI18n && i18n) i18n.on(bindI18n, boundReset);\n if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);\n return function () {\n isMounted.current = false;\n if (bindI18n && i18n) bindI18n.split(' ').forEach(function (e) {\n return i18n.off(e, boundReset);\n });\n if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {\n return i18n.store.off(e, boundReset);\n });\n };\n }, [i18n, joinedNS]);\n var isInitial = useRef(true);\n useEffect(function () {\n if (isMounted.current && !isInitial.current) {\n setT(getT);\n }\n\n isInitial.current = false;\n }, [i18n, keyPrefix]);\n var ret = [t, i18n, ready];\n ret.t = t;\n ret.i18n = i18n;\n ret.ready = ready;\n if (ready) return ret;\n if (!ready && !useSuspense) return ret;\n throw new Promise(function (resolve) {\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, function () {\n return resolve();\n });\n } else {\n loadNamespaces(i18n, namespaces, function () {\n return resolve();\n });\n }\n });\n}","import { useTranslation } from 'react-i18next';\n\n/**\n * @param prefix 翻译时自动添加的前缀\n * @returns 翻译函数, 输入key时会自动添加前缀, \"$\" 开头则不填加. 输入多个 key 则会返回翻译数组.\n */\nexport default function useTrans(prefix?: string) {\n const { t } = useTranslation();\n const trans = (key: string) => t(key[0] === '$' ? key.slice(1) : prefix + key);\n\n function translation(key: string): string;\n function translation(key: string, ...keys: string[]): string[];\n function translation(key: string, ...keys: string[]) {\n if (keys.length) return [trans(key), ...keys.map((v) => trans(v))];\n return trans(key);\n }\n\n return translation;\n}\n","import { useSelector } from 'react-redux';\nimport { useEffect, useRef } from 'react';\n\n/**\n * 生成一个和redux自动同步的Ref对象\n */\nexport function useGenSyncRef<TState = unknown, Selected = unknown>(\n selector: (state: TState) => Selected,\n): { readonly current: Selected } {\n const Store = useSelector(selector);\n const Ref = useRef(Store);\n useEffect(() => {\n Ref.current = Store;\n }, [Store]);\n return Ref;\n}\n","import { useEffect } from 'react';\n\n// 挂载\nexport function useMounted(callback: Function) {\n useEffect(() => {\n callback();\n }, []);\n}\n\n// 卸载\nexport function useUnMounted(callback: Function) {\n useEffect(() => {\n return function () {\n callback();\n };\n }, []);\n}\n\n// 更新\nexport function useUpdated(callback: Function) {\n useEffect(() => {\n callback();\n });\n}\n","// import {logger} from '../../util/logger';\nimport styles from '@/UI/BottomControlPanel/bottomControlPanel.module.scss';\nimport { webgalStore } from '@/store/store';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\n/**\n * 设置 autoplay 按钮的激活与否\n * @param on\n */\nconst setButton = (on: boolean) => {\n const autoIcon = document.getElementById('Button_ControlPanel_auto');\n if (autoIcon) {\n if (on) {\n autoIcon.className = styles.button_on;\n } else autoIcon.className = styles.singleButton;\n }\n};\n\n/**\n * 停止自动播放\n */\nexport const stopAuto = () => {\n WebGAL.gameplay.isAuto = false;\n setButton(false);\n if (WebGAL.gameplay.autoInterval !== null) {\n clearInterval(WebGAL.gameplay.autoInterval);\n WebGAL.gameplay.autoInterval = null;\n }\n if (WebGAL.gameplay.autoTimeout !== null) {\n clearTimeout(WebGAL.gameplay.autoTimeout);\n WebGAL.gameplay.autoTimeout = null;\n }\n};\n\n/**\n * 切换自动播放状态\n */\nexport const switchAuto = () => {\n // 现在正在自动播放\n if (WebGAL.gameplay.isAuto) {\n stopAuto();\n } else {\n // 当前不在自动播放\n WebGAL.gameplay.isAuto = true;\n setButton(true);\n WebGAL.gameplay.autoInterval = setInterval(autoPlay, 100);\n }\n};\n\nexport const autoNextSentence = () => {\n nextSentence();\n WebGAL.gameplay.autoTimeout = null;\n};\n\n/**\n * 自动播放的执行函数\n */\nconst autoPlay = () => {\n const delay = webgalStore.getState().userData.optionData.autoSpeed;\n const autoPlayDelay = 750 - 250 * delay;\n let isBlockingAuto = false;\n WebGAL.gameplay.performController.performList.forEach((e) => {\n if (e.blockingAuto())\n // 阻塞且没有结束的演出\n isBlockingAuto = true;\n });\n if (isBlockingAuto) {\n // 有阻塞,提前结束\n return;\n }\n // nextSentence();\n if (WebGAL.gameplay.autoTimeout === null) {\n WebGAL.gameplay.autoTimeout = setTimeout(autoNextSentence, autoPlayDelay);\n }\n};\n","// 切换自动播放状态\nimport { stopAuto } from './autoPlay';\nimport styles from '@/UI/BottomControlPanel/bottomControlPanel.module.scss';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { SYSTEM_CONFIG } from '@/config';\n\n/**\n * 设置 fast 按钮的激活与否\n * @param on\n */\nconst setButton = (on: boolean) => {\n const autoIcon = document.getElementById('Button_ControlPanel_fast');\n if (autoIcon) {\n if (on) {\n autoIcon.className = styles.button_on;\n } else autoIcon.className = styles.singleButton;\n }\n};\n\n/**\n * 停止快进模式\n */\nexport const stopFast = () => {\n if (!isFast()) {\n return;\n }\n WebGAL.gameplay.isFast = false;\n setButton(false);\n if (WebGAL.gameplay.fastInterval !== null) {\n clearInterval(WebGAL.gameplay.fastInterval);\n WebGAL.gameplay.fastInterval = null;\n }\n};\n\n/**\n * 开启快进\n */\nexport const startFast = () => {\n if (isFast()) {\n return;\n }\n WebGAL.gameplay.isFast = true;\n setButton(true);\n WebGAL.gameplay.fastInterval = setInterval(() => {\n nextSentence();\n }, SYSTEM_CONFIG.fast_timeout);\n};\n\n// 判断是否是快进模式\nexport const isFast = function () {\n return WebGAL.gameplay.isFast;\n};\n\n/**\n * 停止快进模式与自动播放\n */\nexport const stopAll = () => {\n stopFast();\n stopAuto();\n};\n\n/**\n * 切换快进模式\n */\nexport const switchFast = () => {\n // 现在正在快进\n if (WebGAL.gameplay.isFast) {\n stopFast();\n } else {\n // 当前不在快进\n startFast();\n }\n};\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;\n","import { useGenSyncRef } from '@/hooks/useGenSyncRef';\nimport { RootState } from '@/store/store';\nimport { useMounted, useUnMounted, useUpdated } from '@/hooks/useLifeCycle';\nimport { useCallback, useEffect, useRef } from 'react';\nimport { componentsVisibility, MenuPanelTag } from '@/store/guiInterface';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { startFast, stopAll, stopFast } from '@/Core/controller/gamePlay/fastSkip';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport styles from '@/UI/Backlog/backlog.module.scss';\nimport throttle from 'lodash/throttle';\nimport { fastSaveGame } from '@/Core/controller/storage/fastSaveLoad';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { fullScreenOption } from '@/store/userDataInterface';\n\n// options备用\nexport interface HotKeyType {\n MouseRight: {} | boolean;\n MouseWheel: {} | boolean;\n Ctrl: boolean;\n Esc:\n | {\n href: string;\n nav: 'replace' | 'push';\n }\n | boolean;\n AutoSave: {} | boolean;\n}\n\nexport interface Keyboard {\n lock: (keys: string[]) => Promise<void>;\n unlock: () => Promise<void>;\n}\n\nexport const keyboard: Keyboard | undefined = 'keyboard' in navigator && (navigator.keyboard as any); // FireFox and Safari not support\n\n// export const fastSaveGameKey = `FastSaveKey`;\n// export const isFastSaveKey = `FastSaveActive`;\n\nexport function useHotkey(opt?: HotKeyType) {\n useMouseRightClickHotKey();\n useMouseWheel();\n useSkip();\n usePanic();\n useFastSaveBeforeUnloadPage();\n useSpaceAndEnter();\n useToggleFullScreen();\n}\n\n/**\n * 右键关闭 & 打开 菜单栏\n */\nexport function useMouseRightClickHotKey() {\n const GUIStore = useGenSyncRef((state: RootState) => state.GUI);\n const setComponentVisibility = useSetComponentVisibility();\n const isGameActive = useGameActive<typeof GUIStore>(GUIStore);\n const isInBackLog = useIsInBackLog<typeof GUIStore>(GUIStore);\n const isOpenedDialog = useIsOpenedDialog<typeof GUIStore>(GUIStore);\n const validMenuPanelTag = useValidMenuPanelTag<typeof GUIStore>(GUIStore);\n const isShowExtra = useIsOpenedExtra<typeof GUIStore>(GUIStore);\n const handleContextMenu = useCallback((ev: MouseEvent) => {\n if (isOpenedDialog()) {\n setComponentVisibility('showGlobalDialog', false);\n ev.preventDefault();\n return false;\n }\n if (isShowExtra()) {\n setComponentVisibility('showExtra', false);\n }\n if (isGameActive()) {\n setComponentVisibility('showTextBox', !GUIStore.current.showTextBox);\n }\n if (isInBackLog()) {\n setComponentVisibility('showBacklog', false);\n setComponentVisibility('showTextBox', true);\n }\n if (validMenuPanelTag()) {\n setComponentVisibility('showMenuPanel', false);\n }\n ev.preventDefault();\n return false;\n }, []);\n useMounted(() => {\n document.addEventListener('contextmenu', handleContextMenu);\n });\n useUnMounted(() => {\n document.removeEventListener('contextmenu', handleContextMenu);\n });\n}\n\nlet wheelTimeout = setTimeout(() => {\n // 初始化,什么也不干\n}, 0);\n\n/**\n * 滚轮向上打开历史记录\n * 滚轮向下关闭历史记录\n * 滚轮向下下一句\n */\nexport function useMouseWheel() {\n const GUIStore = useGenSyncRef((state: RootState) => state.GUI);\n const setComponentVisibility = useSetComponentVisibility();\n const isGameActive = useGameActive(GUIStore);\n const isInBackLog = useIsInBackLog(GUIStore);\n const isPanicOverlayOpen = useIsPanicOverlayOpen(GUIStore);\n const next = useCallback(\n throttle(() => {\n nextSentence();\n }, 100),\n [],\n );\n // 防止一直往下滚的时候顺着滚出历史记录\n // 问就是抄的999\n const prevDownWheelTimeRef = useRef(0);\n const handleMouseWheel = useCallback((ev) => {\n if (isPanicOverlayOpen()) return;\n const direction =\n (ev.wheelDelta && (ev.wheelDelta > 0 ? 'up' : 'down')) ||\n (ev.detail && (ev.detail < 0 ? 'up' : 'down')) ||\n 'down';\n const ctrlKey = ev.ctrlKey;\n const dom = document.querySelector(`.${styles.backlog_content}`);\n if (isGameActive() && direction === 'up' && !ctrlKey) {\n setComponentVisibility('showBacklog', true);\n setComponentVisibility('showTextBox', false);\n } else if (isInBackLog() && direction === 'down' && !ctrlKey) {\n if (dom) {\n let flag = hasScrollToBottom(dom);\n let curTime = new Date().getTime();\n // 滚动到底部 & 非连续滚动\n if (flag && curTime - prevDownWheelTimeRef.current > 100) {\n setComponentVisibility('showBacklog', false);\n setComponentVisibility('showTextBox', true);\n }\n prevDownWheelTimeRef.current = curTime;\n }\n // setComponentVisibility('showBacklog', false);\n } else if (isGameActive() && direction === 'down' && !ctrlKey) {\n clearTimeout(wheelTimeout);\n WebGAL.gameplay.isFast = true;\n // 滚轮视作快进\n setTimeout(() => {\n WebGAL.gameplay.isFast = false;\n }, 150);\n next();\n }\n }, []);\n useMounted(() => {\n document.addEventListener('wheel', handleMouseWheel);\n });\n useUnMounted(() => {\n document.removeEventListener('wheel', handleMouseWheel);\n });\n}\n\n/**\n * Panic Button, use Esc and Backquote\n */\nexport function usePanic() {\n const panicButtonList = ['Escape', 'Backquote'];\n const isPanicButton = (ev: KeyboardEvent) =>\n !ev.isComposing && !ev.defaultPrevented && panicButtonList.includes(ev.code);\n const GUIStore = useGenSyncRef((state: RootState) => state.GUI);\n const isTitleShown = useCallback(() => GUIStore.current.showTitle, [GUIStore]);\n const isPanicOverlayOpen = useIsPanicOverlayOpen(GUIStore);\n const setComponentVisibility = useSetComponentVisibility();\n const handlePressPanicButton = useCallback((ev: KeyboardEvent) => {\n if (!isPanicButton(ev) || isTitleShown()) return;\n if (isPanicOverlayOpen()) {\n setComponentVisibility('showPanicOverlay', false);\n // todo: resume\n } else {\n setComponentVisibility('showPanicOverlay', true);\n stopAll(); // despite the name, it only disables fast mode and auto mode\n // todo: pause music & animation for better performance\n }\n }, []);\n useMounted(() => {\n document.addEventListener('keyup', handlePressPanicButton);\n });\n useUnMounted(() => {\n document.removeEventListener('keyup', handlePressPanicButton);\n });\n}\n\n/**\n * ctrl控制快进\n */\nexport function useSkip() {\n // 因为document事件只绑定一次 为了防止之后更新GUIStore时取不到最新值\n // 使用Ref共享GUIStore\n const GUIStore = useGenSyncRef((state: RootState) => state.GUI);\n // 判断是否位于标题 & 存读档,选项 & 回想等页面\n const isGameActive = useGameActive(GUIStore);\n // 判断按键是否为ctrl\n const isCtrlKey = useCallback((e) => e.keyCode === 17, []);\n const handleCtrlKeydown = useCallback((e) => {\n if (isCtrlKey(e) && isGameActive()) {\n startFast();\n }\n }, []);\n const handleCtrlKeyup = useCallback((e) => {\n if (isCtrlKey(e) && isGameActive()) {\n stopFast();\n }\n }, []);\n const handleWindowBlur = useCallback((e) => {\n // 停止快进\n stopFast();\n }, []);\n // mounted时绑定事件\n useMounted(() => {\n document.addEventListener('keydown', handleCtrlKeydown);\n document.addEventListener('keyup', handleCtrlKeyup);\n window.addEventListener('blur', handleWindowBlur);\n });\n // unmounted解绑\n useUnMounted(() => {\n document.removeEventListener('keydown', handleCtrlKeydown);\n document.removeEventListener('keyup', handleCtrlKeyup);\n window.removeEventListener('blur', handleWindowBlur);\n });\n // updated时验证状态\n useUpdated(() => {\n if (!isGameActive()) {\n stopFast();\n }\n });\n}\n\n/**\n * F5刷新 & 其他情况下导致页面卸载时快速保存\n */\nexport function useFastSaveBeforeUnloadPage() {\n const validMenuGameStart = useValidMenuGameStart();\n const handleWindowUnload = useCallback(async (e: BeforeUnloadEvent) => {\n if (validMenuGameStart()) {\n // 游戏启动了才保存数据 防止无效数据覆盖现在的数据\n await fastSaveGame();\n }\n }, []);\n useMounted(() => {\n window.addEventListener('beforeunload', handleWindowUnload);\n });\n useUnMounted(() => {\n window.removeEventListener('beforeunload', handleWindowUnload);\n });\n}\n\n// 判断游戏是否激活\nfunction useGameActive<T = any>(GUIStore: T & any): () => boolean {\n return useCallback(() => {\n return (\n !GUIStore.current.showTitle &&\n !GUIStore.current.showMenuPanel &&\n !GUIStore.current.showBacklog &&\n !GUIStore.current.showPanicOverlay\n );\n }, [GUIStore]);\n}\n\n// 判断是否打开backlog\nfunction useIsInBackLog<T = any>(GUIStore: T & any): () => boolean {\n return useCallback(() => {\n return GUIStore.current.showBacklog;\n }, [GUIStore]);\n}\n\n// 判断是否打开了全局对话框\nfunction useIsOpenedDialog<T = any>(GUIStore: T & any): () => boolean {\n return useCallback(() => {\n return GUIStore.current.showGlobalDialog;\n }, [GUIStore]);\n}\n\n// 判断是否打开了鉴赏模式\nfunction useIsOpenedExtra<T = any>(GUIStore: T & any): () => boolean {\n return useCallback(() => {\n return GUIStore.current.showExtra;\n }, [GUIStore]);\n}\n\nfunction useIsPanicOverlayOpen<T = any>(GUIStore: T & any): () => boolean {\n return useCallback(() => {\n return GUIStore.current.showPanicOverlay;\n }, [GUIStore]);\n}\n\n// 验证是否在存档 / 读档 / 选项页面\nfunction useValidMenuPanelTag<T = any>(GUIStore: T & any): () => boolean {\n return useCallback(() => {\n return [MenuPanelTag.Save, MenuPanelTag.Load, MenuPanelTag.Option].includes(GUIStore.current.currentMenuTag);\n }, [GUIStore]);\n}\n\nfunction useValidMenuGameStart() {\n return useCallback(() => {\n // return !(runtime_currentSceneData.currentSentenceId === 0 &&\n // runtime_currentSceneData.currentScene.sceneName === 'start.txt');\n return !(WebGAL.sceneManager.sceneData.currentSentenceId === 0);\n }, [WebGAL.sceneManager.sceneData]);\n}\n\nfunction useSetComponentVisibility(): (component: keyof componentsVisibility, visibility: boolean) => void {\n const dispatch = useDispatch();\n return (component: keyof componentsVisibility, visibility: boolean) => {\n dispatch(setVisibility({ component, visibility }));\n };\n}\n\nfunction nextTick(callback: () => void) {\n // 具体实现根据浏览器的兼容实现微任务\n if (typeof Promise !== 'undefined') {\n const p = Promise.resolve();\n p.then(callback);\n } else {\n // 兼容IE\n setTimeout(callback, 0);\n }\n}\n\n/**\n * 空格 & 回车 跳转到下一条\n */\nexport function useSpaceAndEnter() {\n const GUIStore = useGenSyncRef((state: RootState) => state.GUI);\n const isGameActive = useGameActive(GUIStore);\n const setComponentVisibility = useSetComponentVisibility();\n // 防止一直触发keydown导致快进\n const lockRef = useRef(false);\n // 判断按键是否为空格 & 回车\n const isSpaceOrEnter = useCallback((e) => {\n return e.keyCode === 32 || e.keyCode === 13;\n }, []);\n const handleKeydown = useCallback((e) => {\n if (isSpaceOrEnter(e) && isGameActive() && !lockRef.current) {\n if (!GUIStore.current.showTextBox) {\n setComponentVisibility('showTextBox', true);\n return;\n }\n stopAll();\n nextSentence();\n lockRef.current = true;\n }\n }, []);\n const handleKeyup = useCallback((e) => {\n if (isSpaceOrEnter(e) && isGameActive()) {\n lockRef.current = false;\n }\n }, []);\n const handleWindowBlur = useCallback((e) => {\n lockRef.current = false;\n }, []);\n // mounted时绑定事件\n useMounted(() => {\n document.addEventListener('keydown', handleKeydown);\n document.addEventListener('keyup', handleKeyup);\n document.addEventListener('blur', handleWindowBlur);\n });\n // unmounted解绑\n useUnMounted(() => {\n document.removeEventListener('keydown', handleKeydown);\n document.removeEventListener('keyup', handleKeyup);\n document.removeEventListener('blur', handleWindowBlur);\n });\n}\n\n/**\n * 是否滚动到底部\n * @param dom\n */\nfunction hasScrollToBottom(dom: Element) {\n const { scrollTop, clientHeight, scrollHeight } = dom;\n return scrollTop === 0;\n}\n\n/**\n * F11 进入全屏\n */\nfunction useToggleFullScreen() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const dispatch = useDispatch();\n const fullScreen = userDataState.optionData.fullScreen;\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.code === 'F11') {\n e.preventDefault();\n if (fullScreen !== fullScreenOption.on) {\n dispatch(setOptionData({ key: 'fullScreen', value: fullScreenOption.on }));\n setStorage();\n } else {\n dispatch(setOptionData({ key: 'fullScreen', value: fullScreenOption.off }));\n setStorage();\n }\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [fullScreen]);\n}\n","import { getFastSaveFromStorage, getSavesFromStorage } from '@/Core/controller/storage/savesController';\nimport { getStorage } from '@/Core/controller/storage/storageController';\nimport { setEbg } from '@/Core/gameScripts/changeBg/setEbg';\nimport { assetSetter, fileType } from '@/Core/util/gameAssetsAccess/assetSetter';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { setGuiAsset, setLogoImage } from '@/store/GUIReducer';\nimport { RootState, webgalStore } from '@/store/store';\nimport { useEffect } from 'react';\nimport { useSelector } from 'react-redux';\n\nconst useConfigData = () => {\n const _map = ['Title_img', 'Game_Logo', 'Title_bgm', 'Game_name', 'Game_key'];\n const configData = useSelector((state: RootState) => state.userData.globalGameVar);\n return useEffect(() => {\n // configData发生变化\n for (let i in configData) {\n if (!_map.includes(i)) {\n continue;\n }\n const val = configData[i] as string;\n switch (i) {\n case 'Title_img': {\n const titleUrl = assetSetter(val, fileType.background);\n webgalStore.dispatch(setGuiAsset({ asset: 'titleBg', value: titleUrl }));\n setEbg(titleUrl);\n break;\n }\n\n case 'Game_Logo': {\n const logos = val.split('|');\n const logoUrlList = logos.map((val) => assetSetter(val, fileType.background));\n webgalStore.dispatch(setLogoImage(logoUrlList));\n break;\n }\n\n case 'Title_bgm': {\n const bgmUrl = assetSetter(val, fileType.bgm);\n webgalStore.dispatch(setGuiAsset({ asset: 'titleBgm', value: bgmUrl }));\n break;\n }\n\n case 'Game_name': {\n WebGAL.gameName = val;\n document.title = val;\n break;\n }\n\n case 'Game_key': {\n WebGAL.gameKey = val;\n getStorage();\n getFastSaveFromStorage();\n getSavesFromStorage(0, 0);\n break;\n }\n }\n }\n return () => {};\n }, [configData.Game_Logo, configData.Game_key, configData.Game_name, configData.Title_bgm, configData.Title_img]);\n};\nexport default useConfigData;\n","import { FC, useEffect } from 'react';\nimport styles from './title.module.scss';\nimport { playBgm } from '@/Core/controller/stage/playBgm';\nimport { continueGame, startGame } from '@/Core/controller/gamePlay/startContinueGame';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { setMenuPanelTag, setVisibility } from '@/store/GUIReducer';\nimport { MenuPanelTag } from '@/store/guiInterface';\nimport useTrans from '@/hooks/useTrans';\n// import { resize } from '@/Core/util/resize';\nimport { hasFastSaveRecord, loadFastSaveGame } from '@/Core/controller/storage/fastSaveLoad';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport useApplyStyle from '@/hooks/useApplyStyle';\nimport { fullScreenOption } from '@/store/userDataInterface';\nimport { keyboard } from '@/hooks/useHotkey';\nimport useConfigData from '@/hooks/useConfigData';\n/**\n * 标题页\n * @constructor\n */\nconst Title: FC = () => {\n const userDataState = useSelector((state: RootState) => state.userData);\n const GUIState = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n const fullScreen = userDataState.optionData.fullScreen;\n const background = GUIState.titleBg;\n const showBackground = background === '' ? 'rgba(0,0,0,1)' : `url(\"${background}\")`;\n const t = useTrans('title.');\n const { playSeEnter, playSeClick } = useSoundEffect();\n\n const applyStyle = useApplyStyle('UI/Title/title.scss');\n useConfigData(); // 监听基础ConfigData变化\n return (\n <>\n {GUIState.showTitle && <div className={applyStyle('Title_backup_background', styles.Title_backup_background)} />}\n <div\n id=\"enter_game_target\"\n onClick={() => {\n playBgm(GUIState.titleBgm);\n dispatch(setVisibility({ component: 'isEnterGame', visibility: true }));\n if (fullScreen === fullScreenOption.on) {\n document.documentElement.requestFullscreen();\n if (keyboard) keyboard.lock(['Escape', 'F11']);\n }\n }}\n onMouseEnter={playSeEnter}\n />\n {GUIState.showTitle && (\n <div\n className={applyStyle('Title_main', styles.Title_main)}\n style={{\n backgroundImage: showBackground,\n backgroundSize: 'cover',\n }}\n >\n <div className={applyStyle('Title_buttonList', styles.Title_buttonList)}>\n <div\n className={applyStyle('Title_button', styles.Title_button)}\n onClick={() => {\n startGame();\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <div className={applyStyle('Title_button_text', styles.Title_button_text)}>{t('start.title')}</div>\n </div>\n <div\n className={applyStyle('Title_button', styles.Title_button)}\n onClick={async () => {\n playSeClick();\n dispatch(setVisibility({ component: 'showTitle', visibility: false }));\n continueGame();\n }}\n onMouseEnter={playSeEnter}\n >\n <div className={applyStyle('Title_button_text', styles.Title_button_text)}>{t('continue.title')}</div>\n </div>\n <div\n className={applyStyle('Title_button', styles.Title_button)}\n onClick={() => {\n playSeClick();\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: true }));\n dispatch(setMenuPanelTag(MenuPanelTag.Option));\n }}\n onMouseEnter={playSeEnter}\n >\n <div className={applyStyle('Title_button_text', styles.Title_button_text)}>{t('options.title')}</div>\n </div>\n <div\n className={applyStyle('Title_button', styles.Title_button)}\n onClick={() => {\n playSeClick();\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: true }));\n dispatch(setMenuPanelTag(MenuPanelTag.Load));\n }}\n onMouseEnter={playSeEnter}\n >\n <div className={applyStyle('Title_button_text', styles.Title_button_text)}>{t('load.title')}</div>\n </div>\n <div\n className={applyStyle('Title_button', styles.Title_button)}\n onClick={() => {\n playSeClick();\n dispatch(setVisibility({ component: 'showExtra', visibility: true }));\n }}\n onMouseEnter={playSeEnter}\n >\n <div className={applyStyle('Title_button_text', styles.Title_button_text)}>{t('extra.title')}</div>\n </div>\n </div>\n </div>\n )}\n </>\n );\n};\n\nexport default Title;\n","import { FC, useEffect, useRef } from 'react';\nimport styles from './logo.module.scss';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useValue } from '@/hooks/useValue';\n\n/**\n * 标识\n * @constructor\n */\nconst Logo: FC = () => {\n const GUIState = useSelector((state: RootState) => state.GUI);\n const logoImage = GUIState.logoImage;\n const isEnterGame = GUIState.isEnterGame;\n const currentLogoIndex = useValue(-1);\n const currentTimeOutId = useValue<any>(-1);\n const animationDuration = 5000;\n\n const nextImg = () => {\n clearTimeout(currentTimeOutId.value);\n if (currentLogoIndex.value < logoImage.length - 1) {\n currentLogoIndex.set(currentLogoIndex.value + 1);\n currentTimeOutId.set(setTimeout(nextImg, animationDuration));\n } else {\n currentLogoIndex.set(-1);\n }\n };\n\n useEffect(() => {\n if (isEnterGame && logoImage.length > 0) {\n /**\n * 启动 Enter Logo\n */\n currentLogoIndex.set(0);\n currentTimeOutId.set(setTimeout(nextImg, animationDuration));\n }\n }, [isEnterGame]);\n\n const currentLogoUrl = currentLogoIndex.value === -1 ? '' : logoImage[currentLogoIndex.value];\n return (\n <>\n {currentLogoIndex.value !== -1 && (\n <div\n key={currentLogoIndex.value + 'wh'}\n className={\n styles.Logo_Back + ' ' + (currentLogoIndex.value === logoImage.length - 1 ? styles.animationActive : '')\n }\n style={{\n animationDuration: `${animationDuration}ms`,\n }}\n />\n )}\n {currentLogoUrl !== '' && (\n <div\n className={styles.Logo_main}\n key={currentLogoIndex.value + 'bg'}\n onClick={nextImg}\n style={{ backgroundImage: `url(\"${currentLogoUrl}\")`, animationDuration: `${animationDuration}ms` }}\n />\n )}\n </>\n );\n};\n\nexport default Logo;\n","import axios from 'axios';\nimport { logger } from '../logger';\nimport { getStorage, getStorageAsync, setStorage } from '../../controller/storage/storageController';\nimport { webgalStore } from '@/store/store';\nimport { initKey } from '@/Core/controller/storage/fastSaveLoad';\nimport { WebgalParser } from '@/Core/parser/sceneParser';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { getFastSaveFromStorage, getSavesFromStorage } from '@/Core/controller/storage/savesController';\nimport { setGlobalVar } from '@/store/userDataReducer';\n\ndeclare global {\n interface Window {\n renderPromise?: Function;\n }\n}\n/**\n * 获取游戏信息\n * @param url 游戏信息路径\n */\nexport const infoFetcher = (url: string) => {\n const dispatch = webgalStore.dispatch;\n axios.get(url).then(async (r) => {\n let gameConfigRaw: string = r.data;\n let gameConfig = WebgalParser.parseConfig(gameConfigRaw);\n logger.info('获取到游戏信息', gameConfig);\n // 先把 key 找到并设置了\n const keyItem = gameConfig.find((e) => e.command === 'Game_key');\n WebGAL.gameKey = (keyItem?.args?.[0] as string) ?? '';\n initKey();\n await getStorageAsync();\n getFastSaveFromStorage();\n getSavesFromStorage(0, 0);\n // 按照游戏的配置开始设置对应的状态\n gameConfig.forEach((e) => {\n const { command, args } = e;\n if (args.length > 0) {\n if (args.length > 1) {\n dispatch(\n setGlobalVar({\n key: command,\n value: args.join('|'),\n }),\n );\n } else {\n let res: any = args[0].trim();\n if (/^(true|false)$/g.test(args[0])) {\n res = !!res;\n } else if (/^[0-9]+\\.?[0-9]+$/g.test(args[0])) {\n res = Number(res);\n }\n\n dispatch(\n setGlobalVar({\n key: command,\n value: res,\n }),\n );\n }\n }\n });\n\n window?.renderPromise?.();\n delete window.renderPromise;\n setStorage();\n });\n};\n","import { resetStage } from '@/Core/controller/stage/resetStage';\nimport { assetSetter, fileType } from '@/Core/util/gameAssetsAccess/assetSetter';\nimport { sceneFetcher } from '@/Core/controller/scene/sceneFetcher';\nimport { sceneParser } from '@/Core/parser/sceneParser';\nimport { logger } from '../logger';\nimport { webgalStore } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { IScene } from '@/Core/controller/scene/sceneInterface';\nimport { jumpFromBacklog } from '@/Core/controller/storage/jumpFromBacklog';\n\nlet syncFastTimeout: ReturnType<typeof setTimeout> | undefined;\n\nexport const syncWithOrigine = (sceneName: string, sentenceId: number, expermental = false) => {\n logger.warn('正在跳转到' + sceneName + ':' + sentenceId);\n const dispatch = webgalStore.dispatch;\n dispatch(setVisibility({ component: 'showTitle', visibility: false }));\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: false }));\n dispatch(setVisibility({ component: 'isShowLogo', visibility: false }));\n const title = document.getElementById('Title_enter_page');\n if (title) {\n title.style.display = 'none';\n }\n const pastScene = cloneDeep(WebGAL.sceneManager.sceneData.currentScene);\n // 重新获取场景\n const sceneUrl: string = assetSetter(sceneName, fileType.scene);\n // 场景写入到运行时\n sceneFetcher(sceneUrl).then((rawScene) => {\n // 等等,先检查一下能不能恢复场景\n const lastSameSentence = findLastSameSentence(pastScene, WebGAL.sceneManager.sceneData.currentScene, sentenceId);\n const lastRecoverySentenceId = Math.min(sentenceId, lastSameSentence);\n const recId = findLastAvailableBacklog(lastRecoverySentenceId, sceneName);\n const isCanRec = recId >= 0 && expermental;\n resetStage(!isCanRec);\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, sceneName, sceneUrl);\n // 开始快进到指定语句\n const currentSceneName = WebGAL.sceneManager.sceneData.currentScene.sceneName;\n WebGAL.gameplay.isFast = true;\n if (isCanRec) {\n jumpFromBacklog(recId, false);\n }\n if (syncFastTimeout) {\n // 之前发生的跳转要清理掉\n clearTimeout(syncFastTimeout);\n }\n syncFast(sentenceId, currentSceneName);\n });\n};\n\nexport function syncFast(sentenceId: number, currentSceneName: string) {\n if (\n WebGAL.sceneManager.sceneData.currentSentenceId < sentenceId &&\n WebGAL.sceneManager.sceneData.currentScene.sceneName === currentSceneName\n ) {\n nextSentence();\n syncFastTimeout = setTimeout(() => syncFast(sentenceId, currentSceneName), 2);\n } else {\n WebGAL.gameplay.isFast = false;\n }\n}\n\nfunction findLastSameSentence(oldScene: IScene, newScene: IScene, sentenceId: number): number {\n let lastSameSentence = 0;\n for (let i = 0; i < sentenceId && i < oldScene.sentenceList.length; i++) {\n const oldSentenceStr = JSON.stringify(oldScene.sentenceList[i]);\n const newSentenceStr = JSON.stringify(newScene.sentenceList[i]);\n if (oldSentenceStr !== newSentenceStr) {\n break;\n }\n lastSameSentence = i;\n }\n return lastSameSentence;\n}\n\nfunction findLastAvailableBacklog(targetSentence: number, sceneName: string) {\n let lastAvailable = -1;\n WebGAL.backlogManager.getBacklog().forEach((e, i) => {\n const recSentenceId = e.saveScene.currentSentenceId;\n const recSceneName = e.saveScene.sceneName;\n if (recSentenceId <= targetSentence && recSceneName === sceneName) {\n lastAvailable = i;\n }\n });\n return lastAvailable;\n}\n","import { syncFast } from '@/Core/util/syncWithEditor/syncWithOrigine';\n\nexport const bindExtraFunc = () => {\n (window as any).JMP = syncFast;\n};\n","import { IStageState } from '@/store/stageInterface';\n\nexport enum DebugCommand {\n // 跳转\n JUMP,\n // 同步自客户端\n SYNCFC,\n // 同步自编辑器\n SYNCFE,\n // 执行指令\n EXE_COMMAND,\n // 重新拉取模板样式文件\n REFETCH_TEMPLATE_FILES,\n}\n\nexport interface IDebugMessage {\n event: string;\n data: {\n command: DebugCommand;\n sceneMsg: {\n sentence: number;\n scene: string;\n };\n message: string;\n stageSyncMsg: IStageState;\n };\n}\n","import { logger } from '../logger';\nimport { syncWithOrigine } from '@/Core/util/syncWithEditor/syncWithOrigine';\nimport { DebugCommand, IDebugMessage } from '@/types/debugProtocol';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { webgalStore } from '@/store/store';\nimport { WebgalParser } from '@/Core/parser/sceneParser';\nimport { runScript } from '@/Core/controller/gamePlay/runScript';\n\nexport const webSocketFunc = () => {\n const loc: string = window.location.hostname;\n const protocol: string = window.location.protocol;\n const port: string = window.location.port; // 获取端口号\n\n // 默认情况下,不需要在URL中明确指定标准HTTP(80)和HTTPS(443)端口\n let defaultPort = '';\n if (port && port !== '80' && port !== '443') {\n // 如果存在非标准端口号,将其包含在URL中\n defaultPort = `:${port}`;\n }\n\n if (protocol !== 'http:' && protocol !== 'https:') {\n return;\n }\n // 根据当前协议构建WebSocket URL,并包括端口号(如果有)\n let wsUrl = `ws://${loc}${defaultPort}/api/webgalsync`;\n if (protocol === 'https:') {\n wsUrl = `wss://${loc}${defaultPort}/api/webgalsync`;\n }\n logger.info('正在启动socket连接位于:' + wsUrl);\n const socket = new WebSocket(wsUrl);\n socket.onopen = () => {\n logger.info('socket已连接');\n function sendStageSyncMessage() {\n const message: IDebugMessage = {\n event: 'message',\n data: {\n command: DebugCommand.SYNCFC,\n sceneMsg: {\n scene: WebGAL.sceneManager.sceneData.currentScene.sceneName,\n sentence: WebGAL.sceneManager.sceneData.currentSentenceId,\n },\n stageSyncMsg: webgalStore.getState().stage,\n message: 'sync',\n },\n };\n socket.send(JSON.stringify(message));\n // logger.debug('传送信息', message);\n setTimeout(sendStageSyncMessage, 1000);\n }\n sendStageSyncMessage();\n };\n socket.onmessage = (e) => {\n // logger.info('收到信息', e.data);\n const str: string = e.data;\n const data: IDebugMessage = JSON.parse(str);\n const message = data.data;\n if (message.command === DebugCommand.JUMP) {\n syncWithOrigine(message.sceneMsg.scene, message.sceneMsg.sentence, message.message === 'exp');\n }\n if (message.command === DebugCommand.EXE_COMMAND) {\n const command = message.message;\n const scene = WebgalParser.parse(command, 'temp.txt', 'temp.txt');\n const sentence = scene.sentenceList[0];\n runScript(sentence);\n }\n if (message.command === DebugCommand.REFETCH_TEMPLATE_FILES) {\n const title = document.getElementById('Title_enter_page');\n if (title) {\n title.style.display = 'none';\n }\n WebGAL.events.styleUpdate.emit();\n }\n };\n socket.onerror = (e) => {\n logger.info('当前没有连接到 Terre 编辑器');\n };\n};\n","/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nexport default finallyConstructor;\n","function allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\nexport default allSettled;\n","/**\n * @constructor\n */\nfunction AggregateError(errors, message) {\n (this.name = 'AggregateError'), (this.errors = errors);\n this.message = message || '';\n}\nAggregateError.prototype = Error.prototype;\n\nfunction any(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(new TypeError('Promise.any accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return reject();\n\n var rejectionReasons = [];\n for (var i = 0; i < args.length; i++) {\n try {\n P.resolve(args[i])\n .then(resolve)\n .catch(function(error) {\n rejectionReasons.push(error);\n if (rejectionReasons.length === args.length) {\n reject(\n new AggregateError(\n rejectionReasons,\n 'All promises were rejected'\n )\n );\n }\n });\n } catch (ex) {\n reject(ex);\n }\n }\n });\n}\n\nexport default any;\n","import promiseFinally from './finally';\nimport allSettled from './allSettled';\nimport any from './any';\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array<!Function>} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = promiseFinally;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.any = any;\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nexport default Promise;\n","/*!\n * @pixi/polyfill - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/polyfill is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport Polyfill from 'promise-polyfill';\nimport objectAssign from 'object-assign';\n\nif (typeof globalThis === 'undefined') {\n if (typeof self !== 'undefined') {\n // covers browsers\n // @ts-expect-error not-writable ts(2540) error only on node\n self.globalThis = self;\n }\n else if (typeof global !== 'undefined') {\n // covers versions of Node < 12\n // @ts-expect-error not-writable ts(2540) error only on node\n global.globalThis = global;\n }\n}\n\n// Support for IE 9 - 11 which does not include Promises\nif (!globalThis.Promise) {\n globalThis.Promise = Polyfill;\n}\n\n// References:\nif (!Object.assign) {\n Object.assign = objectAssign;\n}\n\n// References:\n// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// https://gist.github.com/1579671\n// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision\n// https://gist.github.com/timhall/4078614\n// https://github.com/Financial-Times/polyfill-service/tree/master/polyfills/requestAnimationFrame\n// Expected to be used with Browserfiy\n// Browserify automatically detects the use of `global` and passes the\n// correct reference of `global`, `globalThis`, and finally `window`\nvar ONE_FRAME_TIME = 16;\n// Date.now\nif (!(Date.now && Date.prototype.getTime)) {\n Date.now = function now() {\n return new Date().getTime();\n };\n}\n// performance.now\nif (!(globalThis.performance && globalThis.performance.now)) {\n var startTime_1 = Date.now();\n if (!globalThis.performance) {\n globalThis.performance = {};\n }\n globalThis.performance.now = function () { return Date.now() - startTime_1; };\n}\n// requestAnimationFrame\nvar lastTime = Date.now();\nvar vendors = ['ms', 'moz', 'webkit', 'o'];\nfor (var x = 0; x < vendors.length && !globalThis.requestAnimationFrame; ++x) {\n var p = vendors[x];\n globalThis.requestAnimationFrame = globalThis[p + \"RequestAnimationFrame\"];\n globalThis.cancelAnimationFrame = globalThis[p + \"CancelAnimationFrame\"]\n || globalThis[p + \"CancelRequestAnimationFrame\"];\n}\nif (!globalThis.requestAnimationFrame) {\n globalThis.requestAnimationFrame = function (callback) {\n if (typeof callback !== 'function') {\n throw new TypeError(callback + \"is not a function\");\n }\n var currentTime = Date.now();\n var delay = ONE_FRAME_TIME + lastTime - currentTime;\n if (delay < 0) {\n delay = 0;\n }\n lastTime = currentTime;\n return globalThis.self.setTimeout(function () {\n lastTime = Date.now();\n callback(performance.now());\n }, delay);\n };\n}\nif (!globalThis.cancelAnimationFrame) {\n globalThis.cancelAnimationFrame = function (id) { return clearTimeout(id); };\n}\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\nif (!Math.sign) {\n Math.sign = function mathSign(x) {\n x = Number(x);\n if (x === 0 || isNaN(x)) {\n return x;\n }\n return x > 0 ? 1 : -1;\n };\n}\n\n// References:\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\nif (!Number.isInteger) {\n Number.isInteger = function numberIsInteger(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n };\n}\n\nif (!globalThis.ArrayBuffer) {\n globalThis.ArrayBuffer = Array;\n}\nif (!globalThis.Float32Array) {\n globalThis.Float32Array = Array;\n}\nif (!globalThis.Uint32Array) {\n globalThis.Uint32Array = Array;\n}\nif (!globalThis.Uint16Array) {\n globalThis.Uint16Array = Array;\n}\nif (!globalThis.Uint8Array) {\n globalThis.Uint8Array = Array;\n}\nif (!globalThis.Int32Array) {\n globalThis.Int32Array = Array;\n}\n//# sourceMappingURL=polyfill.mjs.map\n","/*!\n * @pixi/constants - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/constants is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\n/**\n * Different types of environments for WebGL.\n * @static\n * @memberof PIXI\n * @name ENV\n * @enum {number}\n * @property {number} WEBGL_LEGACY - Used for older v1 WebGL devices. PixiJS will aim to ensure compatibility\n * with older / less advanced devices. If you experience unexplained flickering prefer this environment.\n * @property {number} WEBGL - Version 1 of WebGL\n * @property {number} WEBGL2 - Version 2 of WebGL\n */\nvar ENV;\n(function (ENV) {\n ENV[ENV[\"WEBGL_LEGACY\"] = 0] = \"WEBGL_LEGACY\";\n ENV[ENV[\"WEBGL\"] = 1] = \"WEBGL\";\n ENV[ENV[\"WEBGL2\"] = 2] = \"WEBGL2\";\n})(ENV || (ENV = {}));\n/**\n * Constant to identify the Renderer Type.\n * @static\n * @memberof PIXI\n * @name RENDERER_TYPE\n * @enum {number}\n * @property {number} UNKNOWN - Unknown render type.\n * @property {number} WEBGL - WebGL render type.\n * @property {number} CANVAS - Canvas render type.\n */\nvar RENDERER_TYPE;\n(function (RENDERER_TYPE) {\n RENDERER_TYPE[RENDERER_TYPE[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n RENDERER_TYPE[RENDERER_TYPE[\"WEBGL\"] = 1] = \"WEBGL\";\n RENDERER_TYPE[RENDERER_TYPE[\"CANVAS\"] = 2] = \"CANVAS\";\n})(RENDERER_TYPE || (RENDERER_TYPE = {}));\n/**\n * Bitwise OR of masks that indicate the buffers to be cleared.\n * @static\n * @memberof PIXI\n * @name BUFFER_BITS\n * @enum {number}\n * @property {number} COLOR - Indicates the buffers currently enabled for color writing.\n * @property {number} DEPTH - Indicates the depth buffer.\n * @property {number} STENCIL - Indicates the stencil buffer.\n */\nvar BUFFER_BITS;\n(function (BUFFER_BITS) {\n BUFFER_BITS[BUFFER_BITS[\"COLOR\"] = 16384] = \"COLOR\";\n BUFFER_BITS[BUFFER_BITS[\"DEPTH\"] = 256] = \"DEPTH\";\n BUFFER_BITS[BUFFER_BITS[\"STENCIL\"] = 1024] = \"STENCIL\";\n})(BUFFER_BITS || (BUFFER_BITS = {}));\n/**\n * Various blend modes supported by PIXI.\n *\n * IMPORTANT - The WebGL renderer only supports the NORMAL, ADD, MULTIPLY and SCREEN blend modes.\n * Anything else will silently act like NORMAL.\n * @memberof PIXI\n * @name BLEND_MODES\n * @enum {number}\n * @property {number} NORMAL -\n * @property {number} ADD -\n * @property {number} MULTIPLY -\n * @property {number} SCREEN -\n * @property {number} OVERLAY -\n * @property {number} DARKEN -\n * @property {number} LIGHTEN -\n * @property {number} COLOR_DODGE -\n * @property {number} COLOR_BURN -\n * @property {number} HARD_LIGHT -\n * @property {number} SOFT_LIGHT -\n * @property {number} DIFFERENCE -\n * @property {number} EXCLUSION -\n * @property {number} HUE -\n * @property {number} SATURATION -\n * @property {number} COLOR -\n * @property {number} LUMINOSITY -\n * @property {number} NORMAL_NPM -\n * @property {number} ADD_NPM -\n * @property {number} SCREEN_NPM -\n * @property {number} NONE -\n * @property {number} SRC_IN -\n * @property {number} SRC_OUT -\n * @property {number} SRC_ATOP -\n * @property {number} DST_OVER -\n * @property {number} DST_IN -\n * @property {number} DST_OUT -\n * @property {number} DST_ATOP -\n * @property {number} SUBTRACT -\n * @property {number} SRC_OVER -\n * @property {number} ERASE -\n * @property {number} XOR -\n */\nvar BLEND_MODES;\n(function (BLEND_MODES) {\n BLEND_MODES[BLEND_MODES[\"NORMAL\"] = 0] = \"NORMAL\";\n BLEND_MODES[BLEND_MODES[\"ADD\"] = 1] = \"ADD\";\n BLEND_MODES[BLEND_MODES[\"MULTIPLY\"] = 2] = \"MULTIPLY\";\n BLEND_MODES[BLEND_MODES[\"SCREEN\"] = 3] = \"SCREEN\";\n BLEND_MODES[BLEND_MODES[\"OVERLAY\"] = 4] = \"OVERLAY\";\n BLEND_MODES[BLEND_MODES[\"DARKEN\"] = 5] = \"DARKEN\";\n BLEND_MODES[BLEND_MODES[\"LIGHTEN\"] = 6] = \"LIGHTEN\";\n BLEND_MODES[BLEND_MODES[\"COLOR_DODGE\"] = 7] = \"COLOR_DODGE\";\n BLEND_MODES[BLEND_MODES[\"COLOR_BURN\"] = 8] = \"COLOR_BURN\";\n BLEND_MODES[BLEND_MODES[\"HARD_LIGHT\"] = 9] = \"HARD_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"SOFT_LIGHT\"] = 10] = \"SOFT_LIGHT\";\n BLEND_MODES[BLEND_MODES[\"DIFFERENCE\"] = 11] = \"DIFFERENCE\";\n BLEND_MODES[BLEND_MODES[\"EXCLUSION\"] = 12] = \"EXCLUSION\";\n BLEND_MODES[BLEND_MODES[\"HUE\"] = 13] = \"HUE\";\n BLEND_MODES[BLEND_MODES[\"SATURATION\"] = 14] = \"SATURATION\";\n BLEND_MODES[BLEND_MODES[\"COLOR\"] = 15] = \"COLOR\";\n BLEND_MODES[BLEND_MODES[\"LUMINOSITY\"] = 16] = \"LUMINOSITY\";\n BLEND_MODES[BLEND_MODES[\"NORMAL_NPM\"] = 17] = \"NORMAL_NPM\";\n BLEND_MODES[BLEND_MODES[\"ADD_NPM\"] = 18] = \"ADD_NPM\";\n BLEND_MODES[BLEND_MODES[\"SCREEN_NPM\"] = 19] = \"SCREEN_NPM\";\n BLEND_MODES[BLEND_MODES[\"NONE\"] = 20] = \"NONE\";\n BLEND_MODES[BLEND_MODES[\"SRC_OVER\"] = 0] = \"SRC_OVER\";\n BLEND_MODES[BLEND_MODES[\"SRC_IN\"] = 21] = \"SRC_IN\";\n BLEND_MODES[BLEND_MODES[\"SRC_OUT\"] = 22] = \"SRC_OUT\";\n BLEND_MODES[BLEND_MODES[\"SRC_ATOP\"] = 23] = \"SRC_ATOP\";\n BLEND_MODES[BLEND_MODES[\"DST_OVER\"] = 24] = \"DST_OVER\";\n BLEND_MODES[BLEND_MODES[\"DST_IN\"] = 25] = \"DST_IN\";\n BLEND_MODES[BLEND_MODES[\"DST_OUT\"] = 26] = \"DST_OUT\";\n BLEND_MODES[BLEND_MODES[\"DST_ATOP\"] = 27] = \"DST_ATOP\";\n BLEND_MODES[BLEND_MODES[\"ERASE\"] = 26] = \"ERASE\";\n BLEND_MODES[BLEND_MODES[\"SUBTRACT\"] = 28] = \"SUBTRACT\";\n BLEND_MODES[BLEND_MODES[\"XOR\"] = 29] = \"XOR\";\n})(BLEND_MODES || (BLEND_MODES = {}));\n/**\n * Various webgl draw modes. These can be used to specify which GL drawMode to use\n * under certain situations and renderers.\n * @memberof PIXI\n * @static\n * @name DRAW_MODES\n * @enum {number}\n * @property {number} POINTS -\n * @property {number} LINES -\n * @property {number} LINE_LOOP -\n * @property {number} LINE_STRIP -\n * @property {number} TRIANGLES -\n * @property {number} TRIANGLE_STRIP -\n * @property {number} TRIANGLE_FAN -\n */\nvar DRAW_MODES;\n(function (DRAW_MODES) {\n DRAW_MODES[DRAW_MODES[\"POINTS\"] = 0] = \"POINTS\";\n DRAW_MODES[DRAW_MODES[\"LINES\"] = 1] = \"LINES\";\n DRAW_MODES[DRAW_MODES[\"LINE_LOOP\"] = 2] = \"LINE_LOOP\";\n DRAW_MODES[DRAW_MODES[\"LINE_STRIP\"] = 3] = \"LINE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLES\"] = 4] = \"TRIANGLES\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_STRIP\"] = 5] = \"TRIANGLE_STRIP\";\n DRAW_MODES[DRAW_MODES[\"TRIANGLE_FAN\"] = 6] = \"TRIANGLE_FAN\";\n})(DRAW_MODES || (DRAW_MODES = {}));\n/**\n * Various GL texture/resources formats.\n * @memberof PIXI\n * @static\n * @name FORMATS\n * @enum {number}\n * @property {number} [RGBA=6408] -\n * @property {number} [RGB=6407] -\n * @property {number} [RG=33319] -\n * @property {number} [RED=6403] -\n * @property {number} [RGBA_INTEGER=36249] -\n * @property {number} [RGB_INTEGER=36248] -\n * @property {number} [RG_INTEGER=33320] -\n * @property {number} [RED_INTEGER=36244] -\n * @property {number} [ALPHA=6406] -\n * @property {number} [LUMINANCE=6409] -\n * @property {number} [LUMINANCE_ALPHA=6410] -\n * @property {number} [DEPTH_COMPONENT=6402] -\n * @property {number} [DEPTH_STENCIL=34041] -\n */\nvar FORMATS;\n(function (FORMATS) {\n FORMATS[FORMATS[\"RGBA\"] = 6408] = \"RGBA\";\n FORMATS[FORMATS[\"RGB\"] = 6407] = \"RGB\";\n FORMATS[FORMATS[\"RG\"] = 33319] = \"RG\";\n FORMATS[FORMATS[\"RED\"] = 6403] = \"RED\";\n FORMATS[FORMATS[\"RGBA_INTEGER\"] = 36249] = \"RGBA_INTEGER\";\n FORMATS[FORMATS[\"RGB_INTEGER\"] = 36248] = \"RGB_INTEGER\";\n FORMATS[FORMATS[\"RG_INTEGER\"] = 33320] = \"RG_INTEGER\";\n FORMATS[FORMATS[\"RED_INTEGER\"] = 36244] = \"RED_INTEGER\";\n FORMATS[FORMATS[\"ALPHA\"] = 6406] = \"ALPHA\";\n FORMATS[FORMATS[\"LUMINANCE\"] = 6409] = \"LUMINANCE\";\n FORMATS[FORMATS[\"LUMINANCE_ALPHA\"] = 6410] = \"LUMINANCE_ALPHA\";\n FORMATS[FORMATS[\"DEPTH_COMPONENT\"] = 6402] = \"DEPTH_COMPONENT\";\n FORMATS[FORMATS[\"DEPTH_STENCIL\"] = 34041] = \"DEPTH_STENCIL\";\n})(FORMATS || (FORMATS = {}));\n/**\n * Various GL target types.\n * @memberof PIXI\n * @static\n * @name TARGETS\n * @enum {number}\n * @property {number} [TEXTURE_2D=3553] -\n * @property {number} [TEXTURE_CUBE_MAP=34067] -\n * @property {number} [TEXTURE_2D_ARRAY=35866] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_X=34069] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_X=34070] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Y=34071] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Y=34072] -\n * @property {number} [TEXTURE_CUBE_MAP_POSITIVE_Z=34073] -\n * @property {number} [TEXTURE_CUBE_MAP_NEGATIVE_Z=34074] -\n */\nvar TARGETS;\n(function (TARGETS) {\n TARGETS[TARGETS[\"TEXTURE_2D\"] = 3553] = \"TEXTURE_2D\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP\"] = 34067] = \"TEXTURE_CUBE_MAP\";\n TARGETS[TARGETS[\"TEXTURE_2D_ARRAY\"] = 35866] = \"TEXTURE_2D_ARRAY\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_X\"] = 34069] = \"TEXTURE_CUBE_MAP_POSITIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_X\"] = 34070] = \"TEXTURE_CUBE_MAP_NEGATIVE_X\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Y\"] = 34071] = \"TEXTURE_CUBE_MAP_POSITIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Y\"] = 34072] = \"TEXTURE_CUBE_MAP_NEGATIVE_Y\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_POSITIVE_Z\"] = 34073] = \"TEXTURE_CUBE_MAP_POSITIVE_Z\";\n TARGETS[TARGETS[\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"] = 34074] = \"TEXTURE_CUBE_MAP_NEGATIVE_Z\";\n})(TARGETS || (TARGETS = {}));\n/**\n * Various GL data format types.\n * @memberof PIXI\n * @static\n * @name TYPES\n * @enum {number}\n * @property {number} [UNSIGNED_BYTE=5121] -\n * @property {number} [UNSIGNED_SHORT=5123] -\n * @property {number} [UNSIGNED_SHORT_5_6_5=33635] -\n * @property {number} [UNSIGNED_SHORT_4_4_4_4=32819] -\n * @property {number} [UNSIGNED_SHORT_5_5_5_1=32820] -\n * @property {number} [UNSIGNED_INT=5125] -\n * @property {number} [UNSIGNED_INT_10F_11F_11F_REV=35899] -\n * @property {number} [UNSIGNED_INT_2_10_10_10_REV=33640] -\n * @property {number} [UNSIGNED_INT_24_8=34042] -\n * @property {number} [UNSIGNED_INT_5_9_9_9_REV=35902] -\n * @property {number} [BYTE=5120] -\n * @property {number} [SHORT=5122] -\n * @property {number} [INT=5124] -\n * @property {number} [FLOAT=5126] -\n * @property {number} [FLOAT_32_UNSIGNED_INT_24_8_REV=36269] -\n * @property {number} [HALF_FLOAT=36193] -\n */\nvar TYPES;\n(function (TYPES) {\n TYPES[TYPES[\"UNSIGNED_BYTE\"] = 5121] = \"UNSIGNED_BYTE\";\n TYPES[TYPES[\"UNSIGNED_SHORT\"] = 5123] = \"UNSIGNED_SHORT\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_6_5\"] = 33635] = \"UNSIGNED_SHORT_5_6_5\";\n TYPES[TYPES[\"UNSIGNED_SHORT_4_4_4_4\"] = 32819] = \"UNSIGNED_SHORT_4_4_4_4\";\n TYPES[TYPES[\"UNSIGNED_SHORT_5_5_5_1\"] = 32820] = \"UNSIGNED_SHORT_5_5_5_1\";\n TYPES[TYPES[\"UNSIGNED_INT\"] = 5125] = \"UNSIGNED_INT\";\n TYPES[TYPES[\"UNSIGNED_INT_10F_11F_11F_REV\"] = 35899] = \"UNSIGNED_INT_10F_11F_11F_REV\";\n TYPES[TYPES[\"UNSIGNED_INT_2_10_10_10_REV\"] = 33640] = \"UNSIGNED_INT_2_10_10_10_REV\";\n TYPES[TYPES[\"UNSIGNED_INT_24_8\"] = 34042] = \"UNSIGNED_INT_24_8\";\n TYPES[TYPES[\"UNSIGNED_INT_5_9_9_9_REV\"] = 35902] = \"UNSIGNED_INT_5_9_9_9_REV\";\n TYPES[TYPES[\"BYTE\"] = 5120] = \"BYTE\";\n TYPES[TYPES[\"SHORT\"] = 5122] = \"SHORT\";\n TYPES[TYPES[\"INT\"] = 5124] = \"INT\";\n TYPES[TYPES[\"FLOAT\"] = 5126] = \"FLOAT\";\n TYPES[TYPES[\"FLOAT_32_UNSIGNED_INT_24_8_REV\"] = 36269] = \"FLOAT_32_UNSIGNED_INT_24_8_REV\";\n TYPES[TYPES[\"HALF_FLOAT\"] = 36193] = \"HALF_FLOAT\";\n})(TYPES || (TYPES = {}));\n/**\n * Various sampler types. Correspond to `sampler`, `isampler`, `usampler` GLSL types respectively.\n * WebGL1 works only with FLOAT.\n * @memberof PIXI\n * @static\n * @name SAMPLER_TYPES\n * @enum {number}\n * @property {number} [FLOAT=0] -\n * @property {number} [INT=1] -\n * @property {number} [UINT=2] -\n */\nvar SAMPLER_TYPES;\n(function (SAMPLER_TYPES) {\n SAMPLER_TYPES[SAMPLER_TYPES[\"FLOAT\"] = 0] = \"FLOAT\";\n SAMPLER_TYPES[SAMPLER_TYPES[\"INT\"] = 1] = \"INT\";\n SAMPLER_TYPES[SAMPLER_TYPES[\"UINT\"] = 2] = \"UINT\";\n})(SAMPLER_TYPES || (SAMPLER_TYPES = {}));\n/**\n * The scale modes that are supported by pixi.\n *\n * The {@link PIXI.settings.SCALE_MODE} scale mode affects the default scaling mode of future operations.\n * It can be re-assigned to either LINEAR or NEAREST, depending upon suitability.\n * @memberof PIXI\n * @static\n * @name SCALE_MODES\n * @enum {number}\n * @property {number} LINEAR Smooth scaling\n * @property {number} NEAREST Pixelating scaling\n */\nvar SCALE_MODES;\n(function (SCALE_MODES) {\n SCALE_MODES[SCALE_MODES[\"NEAREST\"] = 0] = \"NEAREST\";\n SCALE_MODES[SCALE_MODES[\"LINEAR\"] = 1] = \"LINEAR\";\n})(SCALE_MODES || (SCALE_MODES = {}));\n/**\n * The wrap modes that are supported by pixi.\n *\n * The {@link PIXI.settings.WRAP_MODE} wrap mode affects the default wrapping mode of future operations.\n * It can be re-assigned to either CLAMP or REPEAT, depending upon suitability.\n * If the texture is non power of two then clamp will be used regardless as WebGL can\n * only use REPEAT if the texture is po2.\n *\n * This property only affects WebGL.\n * @name WRAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} CLAMP - The textures uvs are clamped\n * @property {number} REPEAT - The texture uvs tile and repeat\n * @property {number} MIRRORED_REPEAT - The texture uvs tile and repeat with mirroring\n */\nvar WRAP_MODES;\n(function (WRAP_MODES) {\n WRAP_MODES[WRAP_MODES[\"CLAMP\"] = 33071] = \"CLAMP\";\n WRAP_MODES[WRAP_MODES[\"REPEAT\"] = 10497] = \"REPEAT\";\n WRAP_MODES[WRAP_MODES[\"MIRRORED_REPEAT\"] = 33648] = \"MIRRORED_REPEAT\";\n})(WRAP_MODES || (WRAP_MODES = {}));\n/**\n * Mipmap filtering modes that are supported by pixi.\n *\n * The {@link PIXI.settings.MIPMAP_TEXTURES} affects default texture filtering.\n * Mipmaps are generated for a baseTexture if its `mipmap` field is `ON`,\n * or its `POW2` and texture dimensions are powers of 2.\n * Due to platform restriction, `ON` option will work like `POW2` for webgl-1.\n *\n * This property only affects WebGL.\n * @name MIPMAP_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} OFF - No mipmaps\n * @property {number} POW2 - Generate mipmaps if texture dimensions are pow2\n * @property {number} ON - Always generate mipmaps\n * @property {number} ON_MANUAL - Use mipmaps, but do not auto-generate them; this is used with a resource\n * that supports buffering each level-of-detail.\n */\nvar MIPMAP_MODES;\n(function (MIPMAP_MODES) {\n MIPMAP_MODES[MIPMAP_MODES[\"OFF\"] = 0] = \"OFF\";\n MIPMAP_MODES[MIPMAP_MODES[\"POW2\"] = 1] = \"POW2\";\n MIPMAP_MODES[MIPMAP_MODES[\"ON\"] = 2] = \"ON\";\n MIPMAP_MODES[MIPMAP_MODES[\"ON_MANUAL\"] = 3] = \"ON_MANUAL\";\n})(MIPMAP_MODES || (MIPMAP_MODES = {}));\n/**\n * How to treat textures with premultiplied alpha\n * @name ALPHA_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NO_PREMULTIPLIED_ALPHA - Source is not premultiplied, leave it like that.\n * Option for compressed and data textures that are created from typed arrays.\n * @property {number} PREMULTIPLY_ON_UPLOAD - Source is not premultiplied, premultiply on upload.\n * Default option, used for all loaded images.\n * @property {number} PREMULTIPLIED_ALPHA - Source is already premultiplied\n * Example: spine atlases with `_pma` suffix.\n * @property {number} NPM - Alias for NO_PREMULTIPLIED_ALPHA.\n * @property {number} UNPACK - Default option, alias for PREMULTIPLY_ON_UPLOAD.\n * @property {number} PMA - Alias for PREMULTIPLIED_ALPHA.\n */\nvar ALPHA_MODES;\n(function (ALPHA_MODES) {\n ALPHA_MODES[ALPHA_MODES[\"NPM\"] = 0] = \"NPM\";\n ALPHA_MODES[ALPHA_MODES[\"UNPACK\"] = 1] = \"UNPACK\";\n ALPHA_MODES[ALPHA_MODES[\"PMA\"] = 2] = \"PMA\";\n ALPHA_MODES[ALPHA_MODES[\"NO_PREMULTIPLIED_ALPHA\"] = 0] = \"NO_PREMULTIPLIED_ALPHA\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ON_UPLOAD\"] = 1] = \"PREMULTIPLY_ON_UPLOAD\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLY_ALPHA\"] = 2] = \"PREMULTIPLY_ALPHA\";\n ALPHA_MODES[ALPHA_MODES[\"PREMULTIPLIED_ALPHA\"] = 2] = \"PREMULTIPLIED_ALPHA\";\n})(ALPHA_MODES || (ALPHA_MODES = {}));\n/**\n * Configure whether filter textures are cleared after binding.\n *\n * Filter textures need not be cleared if the filter does not use pixel blending. {@link CLEAR_MODES.BLIT} will detect\n * this and skip clearing as an optimization.\n * @name CLEAR_MODES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} BLEND - Do not clear the filter texture. The filter's output will blend on top of the output texture.\n * @property {number} CLEAR - Always clear the filter texture.\n * @property {number} BLIT - Clear only if {@link FilterSystem.forceClear} is set or if the filter uses pixel blending.\n * @property {number} NO - Alias for BLEND, same as `false` in earlier versions\n * @property {number} YES - Alias for CLEAR, same as `true` in earlier versions\n * @property {number} AUTO - Alias for BLIT\n */\nvar CLEAR_MODES;\n(function (CLEAR_MODES) {\n CLEAR_MODES[CLEAR_MODES[\"NO\"] = 0] = \"NO\";\n CLEAR_MODES[CLEAR_MODES[\"YES\"] = 1] = \"YES\";\n CLEAR_MODES[CLEAR_MODES[\"AUTO\"] = 2] = \"AUTO\";\n CLEAR_MODES[CLEAR_MODES[\"BLEND\"] = 0] = \"BLEND\";\n CLEAR_MODES[CLEAR_MODES[\"CLEAR\"] = 1] = \"CLEAR\";\n CLEAR_MODES[CLEAR_MODES[\"BLIT\"] = 2] = \"BLIT\";\n})(CLEAR_MODES || (CLEAR_MODES = {}));\n/**\n * The gc modes that are supported by pixi.\n *\n * The {@link PIXI.settings.GC_MODE} Garbage Collection mode for PixiJS textures is AUTO\n * If set to GC_MODE, the renderer will occasionally check textures usage. If they are not\n * used for a specified period of time they will be removed from the GPU. They will of course\n * be uploaded again when they are required. This is a silent behind the scenes process that\n * should ensure that the GPU does not get filled up.\n *\n * Handy for mobile devices!\n * This property only affects WebGL.\n * @name GC_MODES\n * @enum {number}\n * @static\n * @memberof PIXI\n * @property {number} AUTO - Garbage collection will happen periodically automatically\n * @property {number} MANUAL - Garbage collection will need to be called manually\n */\nvar GC_MODES;\n(function (GC_MODES) {\n GC_MODES[GC_MODES[\"AUTO\"] = 0] = \"AUTO\";\n GC_MODES[GC_MODES[\"MANUAL\"] = 1] = \"MANUAL\";\n})(GC_MODES || (GC_MODES = {}));\n/**\n * Constants that specify float precision in shaders.\n * @name PRECISION\n * @memberof PIXI\n * @constant\n * @static\n * @enum {string}\n * @property {string} [LOW='lowp'] -\n * @property {string} [MEDIUM='mediump'] -\n * @property {string} [HIGH='highp'] -\n */\nvar PRECISION;\n(function (PRECISION) {\n PRECISION[\"LOW\"] = \"lowp\";\n PRECISION[\"MEDIUM\"] = \"mediump\";\n PRECISION[\"HIGH\"] = \"highp\";\n})(PRECISION || (PRECISION = {}));\n/**\n * Constants for mask implementations.\n * We use `type` suffix because it leads to very different behaviours\n * @name MASK_TYPES\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - Mask is ignored\n * @property {number} SCISSOR - Scissor mask, rectangle on screen, cheap\n * @property {number} STENCIL - Stencil mask, 1-bit, medium, works only if renderer supports stencil\n * @property {number} SPRITE - Mask that uses SpriteMaskFilter, uses temporary RenderTexture\n * @property {number} COLOR - Color mask (RGBA)\n */\nvar MASK_TYPES;\n(function (MASK_TYPES) {\n MASK_TYPES[MASK_TYPES[\"NONE\"] = 0] = \"NONE\";\n MASK_TYPES[MASK_TYPES[\"SCISSOR\"] = 1] = \"SCISSOR\";\n MASK_TYPES[MASK_TYPES[\"STENCIL\"] = 2] = \"STENCIL\";\n MASK_TYPES[MASK_TYPES[\"SPRITE\"] = 3] = \"SPRITE\";\n MASK_TYPES[MASK_TYPES[\"COLOR\"] = 4] = \"COLOR\";\n})(MASK_TYPES || (MASK_TYPES = {}));\n/**\n * Bitwise OR of masks that indicate the color channels that are rendered to.\n * @static\n * @memberof PIXI\n * @name COLOR_MASK_BITS\n * @enum {number}\n * @property {number} RED - Red channel.\n * @property {number} GREEN - Green channel\n * @property {number} BLUE - Blue channel.\n * @property {number} ALPHA - Alpha channel.\n */\nvar COLOR_MASK_BITS;\n(function (COLOR_MASK_BITS) {\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"RED\"] = 1] = \"RED\";\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"GREEN\"] = 2] = \"GREEN\";\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"BLUE\"] = 4] = \"BLUE\";\n COLOR_MASK_BITS[COLOR_MASK_BITS[\"ALPHA\"] = 8] = \"ALPHA\";\n})(COLOR_MASK_BITS || (COLOR_MASK_BITS = {}));\n/**\n * Constants for multi-sampling antialiasing.\n * @see PIXI.Framebuffer#multisample\n * @name MSAA_QUALITY\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} NONE - No multisampling for this renderTexture\n * @property {number} LOW - Try 2 samples\n * @property {number} MEDIUM - Try 4 samples\n * @property {number} HIGH - Try 8 samples\n */\nvar MSAA_QUALITY;\n(function (MSAA_QUALITY) {\n MSAA_QUALITY[MSAA_QUALITY[\"NONE\"] = 0] = \"NONE\";\n MSAA_QUALITY[MSAA_QUALITY[\"LOW\"] = 2] = \"LOW\";\n MSAA_QUALITY[MSAA_QUALITY[\"MEDIUM\"] = 4] = \"MEDIUM\";\n MSAA_QUALITY[MSAA_QUALITY[\"HIGH\"] = 8] = \"HIGH\";\n})(MSAA_QUALITY || (MSAA_QUALITY = {}));\n/**\n * Constants for various buffer types in Pixi\n * @see PIXI.BUFFER_TYPE\n * @name BUFFER_TYPE\n * @memberof PIXI\n * @static\n * @enum {number}\n * @property {number} ELEMENT_ARRAY_BUFFER - buffer type for using as an index buffer\n * @property {number} ARRAY_BUFFER - buffer type for using attribute data\n * @property {number} UNIFORM_BUFFER - the buffer type is for uniform buffer objects\n */\nvar BUFFER_TYPE;\n(function (BUFFER_TYPE) {\n BUFFER_TYPE[BUFFER_TYPE[\"ELEMENT_ARRAY_BUFFER\"] = 34963] = \"ELEMENT_ARRAY_BUFFER\";\n BUFFER_TYPE[BUFFER_TYPE[\"ARRAY_BUFFER\"] = 34962] = \"ARRAY_BUFFER\";\n // NOT YET SUPPORTED\n BUFFER_TYPE[BUFFER_TYPE[\"UNIFORM_BUFFER\"] = 35345] = \"UNIFORM_BUFFER\";\n})(BUFFER_TYPE || (BUFFER_TYPE = {}));\n\nexport { ALPHA_MODES, BLEND_MODES, BUFFER_BITS, BUFFER_TYPE, CLEAR_MODES, COLOR_MASK_BITS, DRAW_MODES, ENV, FORMATS, GC_MODES, MASK_TYPES, MIPMAP_MODES, MSAA_QUALITY, PRECISION, RENDERER_TYPE, SAMPLER_TYPES, SCALE_MODES, TARGETS, TYPES, WRAP_MODES };\n//# sourceMappingURL=constants.mjs.map\n","/*!\n * @pixi/settings - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/settings is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { MIPMAP_MODES, MSAA_QUALITY, GC_MODES, WRAP_MODES, SCALE_MODES, PRECISION } from '@pixi/constants';\n\nvar BrowserAdapter = {\n /**\n * Creates a canvas element of the given size.\n * This canvas is created using the browser's native canvas element.\n * @param width - width of the canvas\n * @param height - height of the canvas\n */\n createCanvas: function (width, height) {\n var canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n return canvas;\n },\n getWebGLRenderingContext: function () { return WebGLRenderingContext; },\n getNavigator: function () { return navigator; },\n getBaseUrl: function () { var _a; return ((_a = document.baseURI) !== null && _a !== void 0 ? _a : window.location.href); },\n fetch: function (url, options) { return fetch(url, options); },\n};\n\nvar appleIphone = /iPhone/i;\nvar appleIpod = /iPod/i;\nvar appleTablet = /iPad/i;\nvar appleUniversal = /\\biOS-universal(?:.+)Mac\\b/i;\nvar androidPhone = /\\bAndroid(?:.+)Mobile\\b/i;\nvar androidTablet = /Android/i;\nvar amazonPhone = /(?:SD4930UR|\\bSilk(?:.+)Mobile\\b)/i;\nvar amazonTablet = /Silk/i;\nvar windowsPhone = /Windows Phone/i;\nvar windowsTablet = /\\bWindows(?:.+)ARM\\b/i;\nvar otherBlackBerry = /BlackBerry/i;\nvar otherBlackBerry10 = /BB10/i;\nvar otherOpera = /Opera Mini/i;\nvar otherChrome = /\\b(CriOS|Chrome)(?:.+)Mobile/i;\nvar otherFirefox = /Mobile(?:.+)Firefox\\b/i;\nvar isAppleTabletOnIos13 = function (navigator) {\n return (typeof navigator !== 'undefined' &&\n navigator.platform === 'MacIntel' &&\n typeof navigator.maxTouchPoints === 'number' &&\n navigator.maxTouchPoints > 1 &&\n typeof MSStream === 'undefined');\n};\nfunction createMatch(userAgent) {\n return function (regex) { return regex.test(userAgent); };\n}\nfunction isMobile$1(param) {\n var nav = {\n userAgent: '',\n platform: '',\n maxTouchPoints: 0\n };\n if (!param && typeof navigator !== 'undefined') {\n nav = {\n userAgent: navigator.userAgent,\n platform: navigator.platform,\n maxTouchPoints: navigator.maxTouchPoints || 0\n };\n }\n else if (typeof param === 'string') {\n nav.userAgent = param;\n }\n else if (param && param.userAgent) {\n nav = {\n userAgent: param.userAgent,\n platform: param.platform,\n maxTouchPoints: param.maxTouchPoints || 0\n };\n }\n var userAgent = nav.userAgent;\n var tmp = userAgent.split('[FBAN');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n tmp = userAgent.split('Twitter');\n if (typeof tmp[1] !== 'undefined') {\n userAgent = tmp[0];\n }\n var match = createMatch(userAgent);\n var result = {\n apple: {\n phone: match(appleIphone) && !match(windowsPhone),\n ipod: match(appleIpod),\n tablet: !match(appleIphone) &&\n (match(appleTablet) || isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone),\n universal: match(appleUniversal),\n device: (match(appleIphone) ||\n match(appleIpod) ||\n match(appleTablet) ||\n match(appleUniversal) ||\n isAppleTabletOnIos13(nav)) &&\n !match(windowsPhone)\n },\n amazon: {\n phone: match(amazonPhone),\n tablet: !match(amazonPhone) && match(amazonTablet),\n device: match(amazonPhone) || match(amazonTablet)\n },\n android: {\n phone: (!match(windowsPhone) && match(amazonPhone)) ||\n (!match(windowsPhone) && match(androidPhone)),\n tablet: !match(windowsPhone) &&\n !match(amazonPhone) &&\n !match(androidPhone) &&\n (match(amazonTablet) || match(androidTablet)),\n device: (!match(windowsPhone) &&\n (match(amazonPhone) ||\n match(amazonTablet) ||\n match(androidPhone) ||\n match(androidTablet))) ||\n match(/\\bokhttp\\b/i)\n },\n windows: {\n phone: match(windowsPhone),\n tablet: match(windowsTablet),\n device: match(windowsPhone) || match(windowsTablet)\n },\n other: {\n blackberry: match(otherBlackBerry),\n blackberry10: match(otherBlackBerry10),\n opera: match(otherOpera),\n firefox: match(otherFirefox),\n chrome: match(otherChrome),\n device: match(otherBlackBerry) ||\n match(otherBlackBerry10) ||\n match(otherOpera) ||\n match(otherFirefox) ||\n match(otherChrome)\n },\n any: false,\n phone: false,\n tablet: false\n };\n result.any =\n result.apple.device ||\n result.android.device ||\n result.windows.device ||\n result.other.device;\n result.phone =\n result.apple.phone || result.android.phone || result.windows.phone;\n result.tablet =\n result.apple.tablet || result.android.tablet || result.windows.tablet;\n return result;\n}\n\nvar isMobile = isMobile$1(globalThis.navigator);\n\n/**\n * Uploading the same buffer multiple times in a single frame can cause performance issues.\n * Apparent on iOS so only check for that at the moment\n * This check may become more complex if this issue pops up elsewhere.\n * @private\n * @returns {boolean} `true` if the same buffer may be uploaded more than once.\n */\nfunction canUploadSameBuffer() {\n return !isMobile.apple.device;\n}\n\n/**\n * The maximum recommended texture units to use.\n * In theory the bigger the better, and for desktop we'll use as many as we can.\n * But some mobile devices slow down if there is to many branches in the shader.\n * So in practice there seems to be a sweet spot size that varies depending on the device.\n *\n * In v4, all mobile devices were limited to 4 texture units because for this.\n * In v5, we allow all texture units to be used on modern Apple or Android devices.\n * @private\n * @param {number} max\n * @returns {number} The maximum recommended texture units to use.\n */\nfunction maxRecommendedTextures(max) {\n var allowMax = true;\n if (isMobile.tablet || isMobile.phone) {\n if (isMobile.apple.device) {\n var match = (navigator.userAgent).match(/OS (\\d+)_(\\d+)?/);\n if (match) {\n var majorVersion = parseInt(match[1], 10);\n // Limit texture units on devices below iOS 11, which will be older hardware\n if (majorVersion < 11) {\n allowMax = false;\n }\n }\n }\n if (isMobile.android.device) {\n var match = (navigator.userAgent).match(/Android\\s([0-9.]*)/);\n if (match) {\n var majorVersion = parseInt(match[1], 10);\n // Limit texture units on devices below Android 7 (Nougat), which will be older hardware\n if (majorVersion < 7) {\n allowMax = false;\n }\n }\n }\n }\n return allowMax ? max : 4;\n}\n\n/**\n * User's customizable globals for overriding the default PIXI settings, such\n * as a renderer's default resolution, framerate, float precision, etc.\n * @example\n * // Use the native window resolution as the default resolution\n * // will support high-density displays when rendering\n * PIXI.settings.RESOLUTION = window.devicePixelRatio;\n *\n * // Disable interpolation when scaling, will make texture be pixelated\n * PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST;\n * @namespace PIXI.settings\n */\nvar settings = {\n /**\n * This adapter is used to call methods that are platform dependent.\n * For example `document.createElement` only runs on the web but fails in node environments.\n * This allows us to support more platforms by abstracting away specific implementations per platform.\n *\n * By default the adapter is set to work in the browser. However you can create your own\n * by implementing the `IAdapter` interface. See `IAdapter` for more information.\n * @name ADAPTER\n * @memberof PIXI.settings\n * @type {PIXI.IAdapter}\n * @default PIXI.BrowserAdapter\n */\n ADAPTER: BrowserAdapter,\n /**\n * If set to true WebGL will attempt make textures mimpaped by default.\n * Mipmapping will only succeed if the base texture uploaded has power of two dimensions.\n * @static\n * @name MIPMAP_TEXTURES\n * @memberof PIXI.settings\n * @type {PIXI.MIPMAP_MODES}\n * @default PIXI.MIPMAP_MODES.POW2\n */\n MIPMAP_TEXTURES: MIPMAP_MODES.POW2,\n /**\n * Default anisotropic filtering level of textures.\n * Usually from 0 to 16\n * @static\n * @name ANISOTROPIC_LEVEL\n * @memberof PIXI.settings\n * @type {number}\n * @default 0\n */\n ANISOTROPIC_LEVEL: 0,\n /**\n * Default resolution / device pixel ratio of the renderer.\n * @static\n * @name RESOLUTION\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n RESOLUTION: 1,\n /**\n * Default filter resolution.\n * @static\n * @name FILTER_RESOLUTION\n * @memberof PIXI.settings\n * @type {number}\n * @default 1\n */\n FILTER_RESOLUTION: 1,\n /**\n * Default filter samples.\n * @static\n * @name FILTER_MULTISAMPLE\n * @memberof PIXI.settings\n * @type {PIXI.MSAA_QUALITY}\n * @default PIXI.MSAA_QUALITY.NONE\n */\n FILTER_MULTISAMPLE: MSAA_QUALITY.NONE,\n /**\n * The maximum textures that this device supports.\n * @static\n * @name SPRITE_MAX_TEXTURES\n * @memberof PIXI.settings\n * @type {number}\n * @default 32\n */\n SPRITE_MAX_TEXTURES: maxRecommendedTextures(32),\n // TODO: maybe change to SPRITE.BATCH_SIZE: 2000\n // TODO: maybe add PARTICLE.BATCH_SIZE: 15000\n /**\n * The default sprite batch size.\n *\n * The default aims to balance desktop and mobile devices.\n * @static\n * @name SPRITE_BATCH_SIZE\n * @memberof PIXI.settings\n * @type {number}\n * @default 4096\n */\n SPRITE_BATCH_SIZE: 4096,\n /**\n * The default render options if none are supplied to {@link PIXI.Renderer}\n * or {@link PIXI.CanvasRenderer}.\n * @static\n * @name RENDER_OPTIONS\n * @memberof PIXI.settings\n * @type {object}\n * @property {boolean} [antialias=false] - {@link PIXI.IRendererOptions.antialias}\n * @property {boolean} [autoDensity=false] - {@link PIXI.IRendererOptions.autoDensity}\n * @property {number} [backgroundAlpha=1] - {@link PIXI.IRendererOptions.backgroundAlpha}\n * @property {number} [backgroundColor=0x000000] - {@link PIXI.IRendererOptions.backgroundColor}\n * @property {boolean} [clearBeforeRender=true] - {@link PIXI.IRendererOptions.clearBeforeRender}\n * @property {number} [height=600] - {@link PIXI.IRendererOptions.height}\n * @property {boolean} [preserveDrawingBuffer=false] - {@link PIXI.IRendererOptions.preserveDrawingBuffer}\n * @property {boolean|'notMultiplied'} [useContextAlpha=true] - {@link PIXI.IRendererOptions.useContextAlpha}\n * @property {HTMLCanvasElement} [view=null] - {@link PIXI.IRendererOptions.view}\n * @property {number} [width=800] - {@link PIXI.IRendererOptions.width}\n */\n RENDER_OPTIONS: {\n view: null,\n width: 800,\n height: 600,\n autoDensity: false,\n backgroundColor: 0x000000,\n backgroundAlpha: 1,\n useContextAlpha: true,\n clearBeforeRender: true,\n antialias: false,\n preserveDrawingBuffer: false,\n },\n /**\n * Default Garbage Collection mode.\n * @static\n * @name GC_MODE\n * @memberof PIXI.settings\n * @type {PIXI.GC_MODES}\n * @default PIXI.GC_MODES.AUTO\n */\n GC_MODE: GC_MODES.AUTO,\n /**\n * Default Garbage Collection max idle.\n * @static\n * @name GC_MAX_IDLE\n * @memberof PIXI.settings\n * @type {number}\n * @default 3600\n */\n GC_MAX_IDLE: 60 * 60,\n /**\n * Default Garbage Collection maximum check count.\n * @static\n * @name GC_MAX_CHECK_COUNT\n * @memberof PIXI.settings\n * @type {number}\n * @default 600\n */\n GC_MAX_CHECK_COUNT: 60 * 10,\n /**\n * Default wrap modes that are supported by pixi.\n * @static\n * @name WRAP_MODE\n * @memberof PIXI.settings\n * @type {PIXI.WRAP_MODES}\n * @default PIXI.WRAP_MODES.CLAMP\n */\n WRAP_MODE: WRAP_MODES.CLAMP,\n /**\n * Default scale mode for textures.\n * @static\n * @name SCALE_MODE\n * @memberof PIXI.settings\n * @type {PIXI.SCALE_MODES}\n * @default PIXI.SCALE_MODES.LINEAR\n */\n SCALE_MODE: SCALE_MODES.LINEAR,\n /**\n * Default specify float precision in vertex shader.\n * @static\n * @name PRECISION_VERTEX\n * @memberof PIXI.settings\n * @type {PIXI.PRECISION}\n * @default PIXI.PRECISION.HIGH\n */\n PRECISION_VERTEX: PRECISION.HIGH,\n /**\n * Default specify float precision in fragment shader.\n * iOS is best set at highp due to https://github.com/pixijs/pixi.js/issues/3742\n * @static\n * @name PRECISION_FRAGMENT\n * @memberof PIXI.settings\n * @type {PIXI.PRECISION}\n * @default PIXI.PRECISION.MEDIUM\n */\n PRECISION_FRAGMENT: isMobile.apple.device ? PRECISION.HIGH : PRECISION.MEDIUM,\n /**\n * Can we upload the same buffer in a single frame?\n * @static\n * @name CAN_UPLOAD_SAME_BUFFER\n * @memberof PIXI.settings\n * @type {boolean}\n */\n CAN_UPLOAD_SAME_BUFFER: canUploadSameBuffer(),\n /**\n * Enables bitmap creation before image load. This feature is experimental.\n * @static\n * @name CREATE_IMAGE_BITMAP\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n CREATE_IMAGE_BITMAP: false,\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * @static\n * @constant\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\n ROUND_PIXELS: false,\n};\n\nexport { BrowserAdapter, isMobile, settings };\n//# sourceMappingURL=settings.mjs.map\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 32767 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim | 0);\n triangles.push(ear.i / dim | 0);\n triangles.push(next.i / dim | 0);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n var p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim | 0);\n triangles.push(p.i / dim | 0);\n triangles.push(b.i / dim | 0);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n var bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n var bridgeReverse = splitPolygon(bridge, hole);\n\n // filter collinear points around the cuts\n filterPoints(bridgeReverse, bridgeReverse.next);\n return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n m = p.x < p.next.x ? p : p.next;\n if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = 0;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n","/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Error;\n","'use strict';\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n","'use strict';\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n","'use strict';\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n","'use strict';\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\nvar test = {\n\t__proto__: null,\n\tfoo: {}\n};\n\nvar $Object = Object;\n\n/** @type {import('.')} */\nmodule.exports = function hasProto() {\n\t// @ts-expect-error: TS errors on an inherited property for some reason\n\treturn { __proto__: test }.foo === test.foo\n\t\t&& !(test instanceof $Object);\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar undefined;\n\nvar $Error = require('es-errors');\nvar $EvalError = require('es-errors/eval');\nvar $RangeError = require('es-errors/range');\nvar $ReferenceError = require('es-errors/ref');\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\nvar $URIError = require('es-errors/uri');\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\n/** @type {import('.')} */\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\n\nvar gopd = require('gopd');\n\n/** @type {import('.')} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor<unknown>} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\treturn !!$defineProperty;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!$defineProperty) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = require('es-errors/type');\nvar $floor = GetIntrinsic('%Math.floor%');\n\n/** @type {import('.')} */\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(/** @type {Parameters<define>[0]} */ (fn), 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(/** @type {Parameters<define>[0]} */ (fn), 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\nvar setFunctionLength = require('set-function-length');\n\nvar $TypeError = require('es-errors/type');\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = require('es-define-property');\nvar $max = GetIntrinsic('%Math.max%');\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","export default {}","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (obj === global) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('.').listGetNode} */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\tfor (; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tcurr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('.').listGet} */\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('.').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('.').ListNode<typeof value>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('.').listHas} */\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @type {WeakMap<object, unknown>} */ var $wm;\n\t/** @type {Map<object, unknown>} */ var $m;\n\t/** @type {import('.').RootNode<unknown>} */ var $o;\n\n\t/** @type {import('.').Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n /* eslint operator-linebreak: [2, \"before\"] */\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? prefix.replace(/\\./g, '%2E') : prefix;\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\\./g, '%2E') : key;\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: true,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n var existing = has.call(obj, key);\n if (existing && options.duplicates === 'combine') {\n obj[key] = utils.combine(obj[key], val);\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = options.allowEmptyArrays && leaf === '' ? [] : [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","/*\n * Copyright Joyent, Inc. and other Node contributors.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to permit\n * persons to whom the Software is furnished to do so, subject to the\n * following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n * USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n'use strict';\n\nvar punycode = require('punycode');\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n/*\n * define these here so at least they only have to be\n * compiled once on the first module load.\n */\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^?\\s]*)(\\?[^\\s]*)?$/,\n\n /*\n * RFC 2396: characters reserved for delimiting URLs.\n * We actually just auto-escape these.\n */\n delims = [\n '<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'\n ],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = [\n '{', '}', '|', '\\\\', '^', '`'\n ].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n /*\n * Characters that are never ever allowed in a hostname.\n * Note that any invalid chars are also handled, but these\n * are the ones that are *expected* to be seen, so we fast-path\n * them.\n */\n nonHostChars = [\n '%', '/', '?', ';', '#'\n ].concat(autoEscape),\n hostEndingChars = [\n '/', '?', '#'\n ],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n javascript: true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n javascript: true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('qs');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === 'object' && url instanceof Url) { return url; }\n\n var u = new Url();\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function (url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== 'string') {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n /*\n * Copy chrome, IE, opera backslash-handling behavior.\n * Back slashes before the query string get converted to forward slashes\n * See: https://code.google.com/p/chromium/issues/detail?id=25916\n */\n var queryIndex = url.indexOf('?'),\n splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n /*\n * trim before proceeding.\n * This is to support parse stuff like \" http://foo.com \\n\"\n */\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n /*\n * figure out if it's got a host\n * user@server is *always* interpreted as a hostname, and url\n * resolution will treat //foo/bar as host=foo,path=bar because that's\n * how the browser resolves relative URLs.\n */\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) {\n\n /*\n * there's a hostname.\n * the first instance of /, ?, ;, or # ends the host.\n *\n * If there is an @ in the hostname, then non-host chars *are* allowed\n * to the left of the last @ sign, unless some host-ending character\n * comes *before* the @-sign.\n * URLs are obnoxious.\n *\n * ex:\n * http://a@b@c/ => user:a@b host:c\n * http://a@b?@c => user:a host:c path:/?@c\n */\n\n /*\n * v0.12 TODO(isaacs): This is not quite how Chrome does things.\n * Review our test case against browsers more comprehensively.\n */\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; }\n }\n\n /*\n * at this point, either we have an explicit point where the\n * auth portion cannot go past, or the last @ char is the decider.\n */\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n /*\n * atSign must be in auth portion.\n * http://a@b/c@d => host:b auth:a path:/c@d\n */\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n /*\n * Now we have a portion which is definitely the auth.\n * Pull that off.\n */\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) { hostEnd = rest.length; }\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n /*\n * we've indicated that there is a hostname,\n * so even if it's empty, it has to be present.\n */\n this.hostname = this.hostname || '';\n\n /*\n * if hostname begins with [ and ends with ]\n * assume that it's an IPv6 address.\n */\n var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) { continue; }\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n /*\n * we replace non-ASCII char with a temporary placeholder\n * we need this to make sure size of hostname is not\n * broken by replacing non-ASCII by nothing\n */\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n /*\n * IDNA Support: Returns a punycoded representation of \"domain\".\n * It only converts parts of the domain name that\n * have non-ASCII characters, i.e. it doesn't matter if\n * you call it with a domain that already is ASCII-only.\n */\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n /*\n * strip [ and ] from the hostname\n * the host field still retains them, though\n */\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n /*\n * now rest is set to the post-host stuff.\n * chop off any delim chars.\n */\n if (!unsafeProtocol[lowerProto]) {\n\n /*\n * First, make 100% sure that any \"autoEscape\" chars get\n * escaped, even if encodeURIComponent doesn't think they\n * need to be.\n */\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1) { continue; }\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) { this.pathname = rest; }\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n // to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n /*\n * ensure it's an object, and not a string url.\n * If it's an obj, this is a no-op.\n * this way, you can call url_format() on strings\n * to clean up potentially wonky urls.\n */\n if (typeof obj === 'string') { obj = urlParse(obj); }\n if (!(obj instanceof Url)) { return Url.prototype.format.call(obj); }\n return obj.format();\n}\n\nUrl.prototype.format = function () {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query && typeof this.query === 'object' && Object.keys(this.query).length) {\n query = querystring.stringify(this.query, {\n arrayFormat: 'repeat',\n addQueryPrefix: false\n });\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') { protocol += ':'; }\n\n /*\n * only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n * unless they had them to begin with.\n */\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') { pathname = '/' + pathname; }\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') { hash = '#' + hash; }\n if (search && search.charAt(0) !== '?') { search = '?' + search; }\n\n pathname = pathname.replace(/[?#]/g, function (match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function (relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) { return relative; }\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function (relative) {\n if (typeof relative === 'string') {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n /*\n * hash is always overridden, no matter what.\n * even href=\"\" will remove it.\n */\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol') { result[rkey] = relative[rkey]; }\n }\n\n // urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {\n result.pathname = '/';\n result.path = result.pathname;\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n /*\n * if it's a known url protocol, then changing\n * the protocol does weird things\n * first, if it's not file:, then we MUST have a host,\n * and if there was a path\n * to begin with, then we MUST have a path.\n * if it is file:, then the host is dropped,\n * because that's known to be hostless.\n * anything else is assumed to be absolute.\n */\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift())) { }\n if (!relative.host) { relative.host = ''; }\n if (!relative.hostname) { relative.hostname = ''; }\n if (relPath[0] !== '') { relPath.unshift(''); }\n if (relPath.length < 2) { relPath.unshift(''); }\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/',\n isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/',\n mustEndAbs = isRelAbs || isSourceAbs || (result.host && relative.pathname),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n /*\n * if the url is a non-slashed url, then relative\n * links like ../.. should be able\n * to crawl up to the hostname, as well. This is strange.\n * result.protocol has already been set by now.\n * Later on, put the first path part into the host field.\n */\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') { srcPath[0] = result.host; } else { srcPath.unshift(result.host); }\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') { relPath[0] = relative.host; } else { relPath.unshift(relative.host); }\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = relative.host || relative.host === '' ? relative.host : result.host;\n result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n /*\n * it's relative\n * throw away the existing file, and take the new path instead.\n */\n if (!srcPath) { srcPath = []; }\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (relative.search != null) {\n /*\n * just pull out the search.\n * like href='?foo'.\n * Put this after the other two cases because it simplifies the booleans\n */\n if (psychotic) {\n result.host = srcPath.shift();\n result.hostname = result.host;\n /*\n * occationaly the auth can get stuck only in host\n * this especially happens in cases like\n * url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n */\n var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.hostname = authInHost.shift();\n result.host = result.hostname;\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n // to support http.request\n if (result.pathname !== null || result.search !== null) {\n result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n /*\n * no path at all. easy.\n * we've already handled the other stuff above.\n */\n result.pathname = null;\n // to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n /*\n * if a url ENDs in . or .., then it must get a trailing slash.\n * however, if it ends in anything else non-slashy,\n * then it must NOT get a trailing slash.\n */\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === '';\n\n /*\n * strip single dots, resolve double dots to parent dir\n * if the path tries to go above the root, `up` ends up > 0\n */\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';\n result.host = result.hostname;\n /*\n * occationaly the auth can get stuck only in host\n * this especially happens in cases like\n * url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n */\n var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.hostname = authInHost.shift();\n result.host = result.hostname;\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (srcPath.length > 0) {\n result.pathname = srcPath.join('/');\n } else {\n result.pathname = null;\n result.path = null;\n }\n\n // to support request.http\n if (result.pathname !== null || result.search !== null) {\n result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function () {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) { this.hostname = host; }\n};\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n","/*!\n * @pixi/utils - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/utils is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nexport { isMobile } from '@pixi/settings';\nexport { default as EventEmitter } from 'eventemitter3';\nexport { default as earcut } from 'earcut';\nimport { parse, format, resolve } from 'url';\nimport { BLEND_MODES } from '@pixi/constants';\n\n/**\n * This file contains redeclared types for Node `url` and `querystring` modules. These modules\n * don't provide their own typings but instead are a part of the full Node typings. The purpose of\n * this file is to redeclare the required types to avoid having the whole Node types as a\n * dependency.\n */\nvar url = {\n parse: parse,\n format: format,\n resolve: resolve,\n};\n\nfunction assertPath(path) {\n if (typeof path !== 'string') {\n throw new TypeError(\"Path must be a string. Received \" + JSON.stringify(path));\n }\n}\nfunction removeUrlParams(url) {\n var re = url.split('?')[0];\n return re.split('#')[0];\n}\nfunction escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n}\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(escapeRegExp(find), 'g'), replace);\n}\n// Resolves . and .. elements in a path with directory names\nfunction normalizeStringPosix(path, allowAboveRoot) {\n var res = '';\n var lastSegmentLength = 0;\n var lastSlash = -1;\n var dots = 0;\n var code;\n for (var i = 0; i <= path.length; ++i) {\n if (i < path.length) {\n code = path.charCodeAt(i);\n }\n else if (code === 47) {\n break;\n }\n else {\n code = 47;\n }\n if (code === 47) {\n if (lastSlash === i - 1 || dots === 1) ;\n else if (lastSlash !== i - 1 && dots === 2) {\n if (res.length < 2\n || lastSegmentLength !== 2\n || res.charCodeAt(res.length - 1) !== 46\n || res.charCodeAt(res.length - 2) !== 46) {\n if (res.length > 2) {\n var lastSlashIndex = res.lastIndexOf('/');\n if (lastSlashIndex !== res.length - 1) {\n if (lastSlashIndex === -1) {\n res = '';\n lastSegmentLength = 0;\n }\n else {\n res = res.slice(0, lastSlashIndex);\n lastSegmentLength = res.length - 1 - res.lastIndexOf('/');\n }\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n else if (res.length === 2 || res.length === 1) {\n res = '';\n lastSegmentLength = 0;\n lastSlash = i;\n dots = 0;\n continue;\n }\n }\n if (allowAboveRoot) {\n if (res.length > 0) {\n res += '/..';\n }\n else {\n res = '..';\n }\n lastSegmentLength = 2;\n }\n }\n else {\n if (res.length > 0) {\n res += \"/\" + path.slice(lastSlash + 1, i);\n }\n else {\n res = path.slice(lastSlash + 1, i);\n }\n lastSegmentLength = i - lastSlash - 1;\n }\n lastSlash = i;\n dots = 0;\n }\n else if (code === 46 && dots !== -1) {\n ++dots;\n }\n else {\n dots = -1;\n }\n }\n return res;\n}\nvar path = {\n /**\n * Converts a path to posix format.\n * @param path - The path to convert to posix\n */\n toPosix: function (path) { return replaceAll(path, '\\\\', '/'); },\n /**\n * Checks if the path is a URL\n * @param path - The path to check\n */\n isUrl: function (path) { return (/^https?:/).test(this.toPosix(path)); },\n /**\n * Checks if the path is a data URL\n * @param path - The path to check\n */\n isDataUrl: function (path) {\n // eslint-disable-next-line max-len\n return (/^data:([a-z]+\\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\\-._~:@\\/?%\\s<>]*?)$/i)\n .test(path);\n },\n /**\n * Checks if the path has a protocol e.g. http://\n * This will return true for windows file paths\n * @param path - The path to check\n */\n hasProtocol: function (path) { return (/^[^/:]+:\\//).test(this.toPosix(path)); },\n /**\n * Returns the protocol of the path e.g. http://, C:/, file:///\n * @param path - The path to get the protocol from\n */\n getProtocol: function (path) {\n assertPath(path);\n path = this.toPosix(path);\n var protocol = '';\n var isFile = (/^file:\\/\\/\\//).exec(path);\n var isHttp = (/^[^/:]+:\\/\\//).exec(path);\n var isWindows = (/^[^/:]+:\\//).exec(path);\n if (isFile || isHttp || isWindows) {\n var arr = (isFile === null || isFile === void 0 ? void 0 : isFile[0]) || (isHttp === null || isHttp === void 0 ? void 0 : isHttp[0]) || (isWindows === null || isWindows === void 0 ? void 0 : isWindows[0]);\n protocol = arr;\n path = path.slice(arr.length);\n }\n return protocol;\n },\n /**\n * Converts URL to an absolute path.\n * When loading from a Web Worker, we must use absolute paths.\n * If the URL is already absolute we return it as is\n * If it's not, we convert it\n * @param url - The URL to test\n * @param customBaseUrl - The base URL to use\n * @param customRootUrl - The root URL to use\n */\n toAbsolute: function (url, customBaseUrl, customRootUrl) {\n if (this.isDataUrl(url))\n { return url; }\n var baseUrl = removeUrlParams(this.toPosix(customBaseUrl !== null && customBaseUrl !== void 0 ? customBaseUrl : settings.ADAPTER.getBaseUrl()));\n var rootUrl = removeUrlParams(this.toPosix(customRootUrl !== null && customRootUrl !== void 0 ? customRootUrl : this.rootname(baseUrl)));\n assertPath(url);\n url = this.toPosix(url);\n // root relative url\n if (url.startsWith('/')) {\n return path.join(rootUrl, url.slice(1));\n }\n var absolutePath = this.isAbsolute(url) ? url : this.join(baseUrl, url);\n return absolutePath;\n },\n /**\n * Normalizes the given path, resolving '..' and '.' segments\n * @param path - The path to normalize\n */\n normalize: function (path) {\n path = this.toPosix(path);\n assertPath(path);\n if (path.length === 0)\n { return '.'; }\n var protocol = '';\n var isAbsolute = path.startsWith('/');\n if (this.hasProtocol(path)) {\n protocol = this.rootname(path);\n path = path.slice(protocol.length);\n }\n var trailingSeparator = path.endsWith('/');\n // Normalize the path\n path = normalizeStringPosix(path, false);\n if (path.length > 0 && trailingSeparator)\n { path += '/'; }\n if (isAbsolute)\n { return \"/\" + path; }\n return protocol + path;\n },\n /**\n * Determines if path is an absolute path.\n * Absolute paths can be urls, data urls, or paths on disk\n * @param path - The path to test\n */\n isAbsolute: function (path) {\n assertPath(path);\n path = this.toPosix(path);\n if (this.hasProtocol(path))\n { return true; }\n return path.startsWith('/');\n },\n /**\n * Joins all given path segments together using the platform-specific separator as a delimiter,\n * then normalizes the resulting path\n * @param segments - The segments of the path to join\n */\n join: function () {\n var arguments$1 = arguments;\n\n var _a;\n var segments = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n segments[_i] = arguments$1[_i];\n }\n if (segments.length === 0) {\n return '.';\n }\n var joined;\n for (var i = 0; i < segments.length; ++i) {\n var arg = segments[i];\n assertPath(arg);\n if (arg.length > 0) {\n if (joined === undefined)\n { joined = arg; }\n else {\n var prevArg = (_a = segments[i - 1]) !== null && _a !== void 0 ? _a : '';\n if (this.extname(prevArg)) {\n joined += \"/../\" + arg;\n }\n else {\n joined += \"/\" + arg;\n }\n }\n }\n }\n if (joined === undefined) {\n return '.';\n }\n return this.normalize(joined);\n },\n /**\n * Returns the directory name of a path\n * @param path - The path to parse\n */\n dirname: function (path) {\n assertPath(path);\n if (path.length === 0)\n { return '.'; }\n path = this.toPosix(path);\n var code = path.charCodeAt(0);\n var hasRoot = code === 47;\n var end = -1;\n var matchedSlash = true;\n var proto = this.getProtocol(path);\n var origpath = path;\n path = path.slice(proto.length);\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n }\n else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n // if end is -1 and its a url then we need to add the path back\n // eslint-disable-next-line no-nested-ternary\n if (end === -1)\n { return hasRoot ? '/' : this.isUrl(origpath) ? proto + path : proto; }\n if (hasRoot && end === 1)\n { return '//'; }\n return proto + path.slice(0, end);\n },\n /**\n * Returns the root of the path e.g. /, C:/, file:///, http://domain.com/\n * @param path - The path to parse\n */\n rootname: function (path) {\n assertPath(path);\n path = this.toPosix(path);\n var root = '';\n if (path.startsWith('/'))\n { root = '/'; }\n else {\n root = this.getProtocol(path);\n }\n if (this.isUrl(path)) {\n // need to find the first path separator\n var index = path.indexOf('/', root.length);\n if (index !== -1) {\n root = path.slice(0, index);\n }\n else\n { root = path; }\n if (!root.endsWith('/'))\n { root += '/'; }\n }\n return root;\n },\n /**\n * Returns the last portion of a path\n * @param path - The path to test\n * @param ext - Optional extension to remove\n */\n basename: function (path, ext) {\n assertPath(path);\n if (ext)\n { assertPath(ext); }\n path = this.toPosix(path);\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {\n if (ext.length === path.length && ext === path)\n { return ''; }\n var extIdx = ext.length - 1;\n var firstNonSlashEnd = -1;\n for (i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else {\n if (firstNonSlashEnd === -1) {\n // We saw the first non-path separator, remember this index in case\n // we need it if the extension ends up not matching\n matchedSlash = false;\n firstNonSlashEnd = i + 1;\n }\n if (extIdx >= 0) {\n // Try to match the explicit extension\n if (code === ext.charCodeAt(extIdx)) {\n if (--extIdx === -1) {\n // We matched the extension, so mark this as the end of our path\n // component\n end = i;\n }\n }\n else {\n // Extension does not match, so our result is the entire path\n // component\n extIdx = -1;\n end = firstNonSlashEnd;\n }\n }\n }\n }\n if (start === end)\n { end = firstNonSlashEnd; }\n else if (end === -1)\n { end = path.length; }\n return path.slice(start, end);\n }\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n }\n else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n if (end === -1)\n { return ''; }\n return path.slice(start, end);\n },\n /**\n * Returns the extension of the path, from the last occurrence of the . (period) character to end of string in the last\n * portion of the path. If there is no . in the last portion of the path, or if there are no . characters other than\n * the first character of the basename of path, an empty string is returned.\n * @param path - The path to parse\n */\n extname: function (path) {\n assertPath(path);\n path = this.toPosix(path);\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n { startDot = i; }\n else if (preDotState !== 1)\n { preDotState = 1; }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 || end === -1\n // We saw a non-dot character immediately before the dot\n || preDotState === 0\n // The (right-most) trimmed path component is exactly '..'\n // eslint-disable-next-line no-mixed-operators\n || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n },\n /**\n * Parses a path into an object containing the 'root', `dir`, `base`, `ext`, and `name` properties.\n * @param path - The path to parse\n */\n parse: function (path) {\n assertPath(path);\n var ret = { root: '', dir: '', base: '', ext: '', name: '' };\n if (path.length === 0)\n { return ret; }\n path = this.toPosix(path);\n var code = path.charCodeAt(0);\n var isAbsolute = this.isAbsolute(path);\n var start;\n ret.root = this.rootname(path);\n if (isAbsolute || this.hasProtocol(path)) {\n start = 1;\n }\n else {\n start = 0;\n }\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n var i = path.length - 1;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n // Get non-dir info\n for (; i >= start; --i) {\n code = path.charCodeAt(i);\n if (code === 47) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n { startDot = i; }\n else if (preDotState !== 1)\n { preDotState = 1; }\n }\n else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n if (startDot === -1 || end === -1\n // We saw a non-dot character immediately before the dot\n || preDotState === 0\n // The (right-most) trimmed path component is exactly '..'\n // eslint-disable-next-line no-mixed-operators\n || preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n if (end !== -1) {\n if (startPart === 0 && isAbsolute)\n { ret.base = ret.name = path.slice(1, end); }\n else\n { ret.base = ret.name = path.slice(startPart, end); }\n }\n }\n else {\n if (startPart === 0 && isAbsolute) {\n ret.name = path.slice(1, startDot);\n ret.base = path.slice(1, end);\n }\n else {\n ret.name = path.slice(startPart, startDot);\n ret.base = path.slice(startPart, end);\n }\n ret.ext = path.slice(startDot, end);\n }\n ret.dir = this.dirname(path);\n return ret;\n },\n sep: '/',\n delimiter: ':'\n};\n\n/**\n * The prefix that denotes a URL is for a retina asset.\n * @static\n * @name RETINA_PREFIX\n * @memberof PIXI.settings\n * @type {RegExp}\n * @default /@([0-9\\.]+)x/\n * @example `@2x`\n */\nsettings.RETINA_PREFIX = /@([0-9\\.]+)x/;\n/**\n * Should the `failIfMajorPerformanceCaveat` flag be enabled as a context option used in the `isWebGLSupported` function.\n * If set to true, a WebGL renderer can fail to be created if the browser thinks there could be performance issues when\n * using WebGL.\n *\n * In PixiJS v6 this has changed from true to false by default, to allow WebGL to work in as many scenarios as possible.\n * However, some users may have a poor experience, for example, if a user has a gpu or driver version blacklisted by the\n * browser.\n *\n * If your application requires high performance rendering, you may wish to set this to false.\n * We recommend one of two options if you decide to set this flag to false:\n *\n * 1: Use the `pixi.js-legacy` package, which includes a Canvas renderer as a fallback in case high performance WebGL is\n * not supported.\n *\n * 2: Call `isWebGLSupported` (which if found in the PIXI.utils package) in your code before attempting to create a PixiJS\n * renderer, and show an error message to the user if the function returns false, explaining that their device & browser\n * combination does not support high performance WebGL.\n * This is a much better strategy than trying to create a PixiJS renderer and finding it then fails.\n * @static\n * @name FAIL_IF_MAJOR_PERFORMANCE_CAVEAT\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\nsettings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = false;\n\nvar saidHello = false;\nvar VERSION = '6.5.10';\n/**\n * Skips the hello message of renderers that are created after this is run.\n * @function skipHello\n * @memberof PIXI.utils\n */\nfunction skipHello() {\n saidHello = true;\n}\n/**\n * Logs out the version and renderer information for this running instance of PIXI.\n * If you don't want to see this message you can run `PIXI.utils.skipHello()` before\n * creating your renderer. Keep in mind that doing that will forever make you a jerk face.\n * @static\n * @function sayHello\n * @memberof PIXI.utils\n * @param {string} type - The string renderer type to log.\n */\nfunction sayHello(type) {\n var _a;\n if (saidHello) {\n return;\n }\n if (settings.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf('chrome') > -1) {\n var args = [\n \"\\n %c %c %c PixiJS \" + VERSION + \" - \\u2730 \" + type + \" \\u2730 %c %c http://www.pixijs.com/ %c %c \\u2665%c\\u2665%c\\u2665 \\n\\n\",\n 'background: #ff66a5; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'color: #ff66a5; background: #030307; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'background: #ffc3dc; padding:5px 0;',\n 'background: #ff66a5; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;',\n 'color: #ff2424; background: #fff; padding:5px 0;' ];\n (_a = globalThis.console).log.apply(_a, args);\n }\n else if (globalThis.console) {\n globalThis.console.log(\"PixiJS \" + VERSION + \" - \" + type + \" - http://www.pixijs.com/\");\n }\n saidHello = true;\n}\n\nvar supported;\n/**\n * Helper for checking for WebGL support.\n * @memberof PIXI.utils\n * @function isWebGLSupported\n * @returns {boolean} Is WebGL supported.\n */\nfunction isWebGLSupported() {\n if (typeof supported === 'undefined') {\n supported = (function supported() {\n var contextOptions = {\n stencil: true,\n failIfMajorPerformanceCaveat: settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT,\n };\n try {\n if (!settings.ADAPTER.getWebGLRenderingContext()) {\n return false;\n }\n var canvas = settings.ADAPTER.createCanvas();\n var gl = (canvas.getContext('webgl', contextOptions)\n || canvas.getContext('experimental-webgl', contextOptions));\n var success = !!(gl && gl.getContextAttributes().stencil);\n if (gl) {\n var loseContext = gl.getExtension('WEBGL_lose_context');\n if (loseContext) {\n loseContext.loseContext();\n }\n }\n gl = null;\n return success;\n }\n catch (e) {\n return false;\n }\n })();\n }\n return supported;\n}\n\nvar aliceblue = \"#f0f8ff\";\nvar antiquewhite = \"#faebd7\";\nvar aqua = \"#00ffff\";\nvar aquamarine = \"#7fffd4\";\nvar azure = \"#f0ffff\";\nvar beige = \"#f5f5dc\";\nvar bisque = \"#ffe4c4\";\nvar black = \"#000000\";\nvar blanchedalmond = \"#ffebcd\";\nvar blue = \"#0000ff\";\nvar blueviolet = \"#8a2be2\";\nvar brown = \"#a52a2a\";\nvar burlywood = \"#deb887\";\nvar cadetblue = \"#5f9ea0\";\nvar chartreuse = \"#7fff00\";\nvar chocolate = \"#d2691e\";\nvar coral = \"#ff7f50\";\nvar cornflowerblue = \"#6495ed\";\nvar cornsilk = \"#fff8dc\";\nvar crimson = \"#dc143c\";\nvar cyan = \"#00ffff\";\nvar darkblue = \"#00008b\";\nvar darkcyan = \"#008b8b\";\nvar darkgoldenrod = \"#b8860b\";\nvar darkgray = \"#a9a9a9\";\nvar darkgreen = \"#006400\";\nvar darkgrey = \"#a9a9a9\";\nvar darkkhaki = \"#bdb76b\";\nvar darkmagenta = \"#8b008b\";\nvar darkolivegreen = \"#556b2f\";\nvar darkorange = \"#ff8c00\";\nvar darkorchid = \"#9932cc\";\nvar darkred = \"#8b0000\";\nvar darksalmon = \"#e9967a\";\nvar darkseagreen = \"#8fbc8f\";\nvar darkslateblue = \"#483d8b\";\nvar darkslategray = \"#2f4f4f\";\nvar darkslategrey = \"#2f4f4f\";\nvar darkturquoise = \"#00ced1\";\nvar darkviolet = \"#9400d3\";\nvar deeppink = \"#ff1493\";\nvar deepskyblue = \"#00bfff\";\nvar dimgray = \"#696969\";\nvar dimgrey = \"#696969\";\nvar dodgerblue = \"#1e90ff\";\nvar firebrick = \"#b22222\";\nvar floralwhite = \"#fffaf0\";\nvar forestgreen = \"#228b22\";\nvar fuchsia = \"#ff00ff\";\nvar gainsboro = \"#dcdcdc\";\nvar ghostwhite = \"#f8f8ff\";\nvar goldenrod = \"#daa520\";\nvar gold = \"#ffd700\";\nvar gray = \"#808080\";\nvar green = \"#008000\";\nvar greenyellow = \"#adff2f\";\nvar grey = \"#808080\";\nvar honeydew = \"#f0fff0\";\nvar hotpink = \"#ff69b4\";\nvar indianred = \"#cd5c5c\";\nvar indigo = \"#4b0082\";\nvar ivory = \"#fffff0\";\nvar khaki = \"#f0e68c\";\nvar lavenderblush = \"#fff0f5\";\nvar lavender = \"#e6e6fa\";\nvar lawngreen = \"#7cfc00\";\nvar lemonchiffon = \"#fffacd\";\nvar lightblue = \"#add8e6\";\nvar lightcoral = \"#f08080\";\nvar lightcyan = \"#e0ffff\";\nvar lightgoldenrodyellow = \"#fafad2\";\nvar lightgray = \"#d3d3d3\";\nvar lightgreen = \"#90ee90\";\nvar lightgrey = \"#d3d3d3\";\nvar lightpink = \"#ffb6c1\";\nvar lightsalmon = \"#ffa07a\";\nvar lightseagreen = \"#20b2aa\";\nvar lightskyblue = \"#87cefa\";\nvar lightslategray = \"#778899\";\nvar lightslategrey = \"#778899\";\nvar lightsteelblue = \"#b0c4de\";\nvar lightyellow = \"#ffffe0\";\nvar lime = \"#00ff00\";\nvar limegreen = \"#32cd32\";\nvar linen = \"#faf0e6\";\nvar magenta = \"#ff00ff\";\nvar maroon = \"#800000\";\nvar mediumaquamarine = \"#66cdaa\";\nvar mediumblue = \"#0000cd\";\nvar mediumorchid = \"#ba55d3\";\nvar mediumpurple = \"#9370db\";\nvar mediumseagreen = \"#3cb371\";\nvar mediumslateblue = \"#7b68ee\";\nvar mediumspringgreen = \"#00fa9a\";\nvar mediumturquoise = \"#48d1cc\";\nvar mediumvioletred = \"#c71585\";\nvar midnightblue = \"#191970\";\nvar mintcream = \"#f5fffa\";\nvar mistyrose = \"#ffe4e1\";\nvar moccasin = \"#ffe4b5\";\nvar navajowhite = \"#ffdead\";\nvar navy = \"#000080\";\nvar oldlace = \"#fdf5e6\";\nvar olive = \"#808000\";\nvar olivedrab = \"#6b8e23\";\nvar orange = \"#ffa500\";\nvar orangered = \"#ff4500\";\nvar orchid = \"#da70d6\";\nvar palegoldenrod = \"#eee8aa\";\nvar palegreen = \"#98fb98\";\nvar paleturquoise = \"#afeeee\";\nvar palevioletred = \"#db7093\";\nvar papayawhip = \"#ffefd5\";\nvar peachpuff = \"#ffdab9\";\nvar peru = \"#cd853f\";\nvar pink = \"#ffc0cb\";\nvar plum = \"#dda0dd\";\nvar powderblue = \"#b0e0e6\";\nvar purple = \"#800080\";\nvar rebeccapurple = \"#663399\";\nvar red = \"#ff0000\";\nvar rosybrown = \"#bc8f8f\";\nvar royalblue = \"#4169e1\";\nvar saddlebrown = \"#8b4513\";\nvar salmon = \"#fa8072\";\nvar sandybrown = \"#f4a460\";\nvar seagreen = \"#2e8b57\";\nvar seashell = \"#fff5ee\";\nvar sienna = \"#a0522d\";\nvar silver = \"#c0c0c0\";\nvar skyblue = \"#87ceeb\";\nvar slateblue = \"#6a5acd\";\nvar slategray = \"#708090\";\nvar slategrey = \"#708090\";\nvar snow = \"#fffafa\";\nvar springgreen = \"#00ff7f\";\nvar steelblue = \"#4682b4\";\nvar tan = \"#d2b48c\";\nvar teal = \"#008080\";\nvar thistle = \"#d8bfd8\";\nvar tomato = \"#ff6347\";\nvar turquoise = \"#40e0d0\";\nvar violet = \"#ee82ee\";\nvar wheat = \"#f5deb3\";\nvar white = \"#ffffff\";\nvar whitesmoke = \"#f5f5f5\";\nvar yellow = \"#ffff00\";\nvar yellowgreen = \"#9acd32\";\nvar cssColorNames = {\n\taliceblue: aliceblue,\n\tantiquewhite: antiquewhite,\n\taqua: aqua,\n\taquamarine: aquamarine,\n\tazure: azure,\n\tbeige: beige,\n\tbisque: bisque,\n\tblack: black,\n\tblanchedalmond: blanchedalmond,\n\tblue: blue,\n\tblueviolet: blueviolet,\n\tbrown: brown,\n\tburlywood: burlywood,\n\tcadetblue: cadetblue,\n\tchartreuse: chartreuse,\n\tchocolate: chocolate,\n\tcoral: coral,\n\tcornflowerblue: cornflowerblue,\n\tcornsilk: cornsilk,\n\tcrimson: crimson,\n\tcyan: cyan,\n\tdarkblue: darkblue,\n\tdarkcyan: darkcyan,\n\tdarkgoldenrod: darkgoldenrod,\n\tdarkgray: darkgray,\n\tdarkgreen: darkgreen,\n\tdarkgrey: darkgrey,\n\tdarkkhaki: darkkhaki,\n\tdarkmagenta: darkmagenta,\n\tdarkolivegreen: darkolivegreen,\n\tdarkorange: darkorange,\n\tdarkorchid: darkorchid,\n\tdarkred: darkred,\n\tdarksalmon: darksalmon,\n\tdarkseagreen: darkseagreen,\n\tdarkslateblue: darkslateblue,\n\tdarkslategray: darkslategray,\n\tdarkslategrey: darkslategrey,\n\tdarkturquoise: darkturquoise,\n\tdarkviolet: darkviolet,\n\tdeeppink: deeppink,\n\tdeepskyblue: deepskyblue,\n\tdimgray: dimgray,\n\tdimgrey: dimgrey,\n\tdodgerblue: dodgerblue,\n\tfirebrick: firebrick,\n\tfloralwhite: floralwhite,\n\tforestgreen: forestgreen,\n\tfuchsia: fuchsia,\n\tgainsboro: gainsboro,\n\tghostwhite: ghostwhite,\n\tgoldenrod: goldenrod,\n\tgold: gold,\n\tgray: gray,\n\tgreen: green,\n\tgreenyellow: greenyellow,\n\tgrey: grey,\n\thoneydew: honeydew,\n\thotpink: hotpink,\n\tindianred: indianred,\n\tindigo: indigo,\n\tivory: ivory,\n\tkhaki: khaki,\n\tlavenderblush: lavenderblush,\n\tlavender: lavender,\n\tlawngreen: lawngreen,\n\tlemonchiffon: lemonchiffon,\n\tlightblue: lightblue,\n\tlightcoral: lightcoral,\n\tlightcyan: lightcyan,\n\tlightgoldenrodyellow: lightgoldenrodyellow,\n\tlightgray: lightgray,\n\tlightgreen: lightgreen,\n\tlightgrey: lightgrey,\n\tlightpink: lightpink,\n\tlightsalmon: lightsalmon,\n\tlightseagreen: lightseagreen,\n\tlightskyblue: lightskyblue,\n\tlightslategray: lightslategray,\n\tlightslategrey: lightslategrey,\n\tlightsteelblue: lightsteelblue,\n\tlightyellow: lightyellow,\n\tlime: lime,\n\tlimegreen: limegreen,\n\tlinen: linen,\n\tmagenta: magenta,\n\tmaroon: maroon,\n\tmediumaquamarine: mediumaquamarine,\n\tmediumblue: mediumblue,\n\tmediumorchid: mediumorchid,\n\tmediumpurple: mediumpurple,\n\tmediumseagreen: mediumseagreen,\n\tmediumslateblue: mediumslateblue,\n\tmediumspringgreen: mediumspringgreen,\n\tmediumturquoise: mediumturquoise,\n\tmediumvioletred: mediumvioletred,\n\tmidnightblue: midnightblue,\n\tmintcream: mintcream,\n\tmistyrose: mistyrose,\n\tmoccasin: moccasin,\n\tnavajowhite: navajowhite,\n\tnavy: navy,\n\toldlace: oldlace,\n\tolive: olive,\n\tolivedrab: olivedrab,\n\torange: orange,\n\torangered: orangered,\n\torchid: orchid,\n\tpalegoldenrod: palegoldenrod,\n\tpalegreen: palegreen,\n\tpaleturquoise: paleturquoise,\n\tpalevioletred: palevioletred,\n\tpapayawhip: papayawhip,\n\tpeachpuff: peachpuff,\n\tperu: peru,\n\tpink: pink,\n\tplum: plum,\n\tpowderblue: powderblue,\n\tpurple: purple,\n\trebeccapurple: rebeccapurple,\n\tred: red,\n\trosybrown: rosybrown,\n\troyalblue: royalblue,\n\tsaddlebrown: saddlebrown,\n\tsalmon: salmon,\n\tsandybrown: sandybrown,\n\tseagreen: seagreen,\n\tseashell: seashell,\n\tsienna: sienna,\n\tsilver: silver,\n\tskyblue: skyblue,\n\tslateblue: slateblue,\n\tslategray: slategray,\n\tslategrey: slategrey,\n\tsnow: snow,\n\tspringgreen: springgreen,\n\tsteelblue: steelblue,\n\ttan: tan,\n\tteal: teal,\n\tthistle: thistle,\n\ttomato: tomato,\n\tturquoise: turquoise,\n\tviolet: violet,\n\twheat: wheat,\n\twhite: white,\n\twhitesmoke: whitesmoke,\n\tyellow: yellow,\n\tyellowgreen: yellowgreen\n};\n\n/**\n * Converts a hexadecimal color number to an [R, G, B] array of normalized floats (numbers from 0.0 to 1.0).\n * @example\n * PIXI.utils.hex2rgb(0xffffff); // returns [1, 1, 1]\n * @memberof PIXI.utils\n * @function hex2rgb\n * @param {number} hex - The hexadecimal number to convert\n * @param {number[]} [out=[]] - If supplied, this array will be used rather than returning a new one\n * @returns {number[]} An array representing the [R, G, B] of the color where all values are floats.\n */\nfunction hex2rgb(hex, out) {\n if (out === void 0) { out = []; }\n out[0] = ((hex >> 16) & 0xFF) / 255;\n out[1] = ((hex >> 8) & 0xFF) / 255;\n out[2] = (hex & 0xFF) / 255;\n return out;\n}\n/**\n * Converts a hexadecimal color number to a string.\n * @example\n * PIXI.utils.hex2string(0xffffff); // returns \"#ffffff\"\n * @memberof PIXI.utils\n * @function hex2string\n * @param {number} hex - Number in hex (e.g., `0xffffff`)\n * @returns {string} The string color (e.g., `\"#ffffff\"`).\n */\nfunction hex2string(hex) {\n var hexString = hex.toString(16);\n hexString = '000000'.substring(0, 6 - hexString.length) + hexString;\n return \"#\" + hexString;\n}\n/**\n * Converts a string to a hexadecimal color number.\n * It can handle:\n * hex strings starting with #: \"#ffffff\"\n * hex strings starting with 0x: \"0xffffff\"\n * hex strings without prefix: \"ffffff\"\n * css colors: \"black\"\n * @example\n * PIXI.utils.string2hex(\"#ffffff\"); // returns 0xffffff, which is 16777215 as an integer\n * @memberof PIXI.utils\n * @function string2hex\n * @param {string} string - The string color (e.g., `\"#ffffff\"`)\n * @returns {number} Number in hexadecimal.\n */\nfunction string2hex(string) {\n if (typeof string === 'string') {\n string = cssColorNames[string.toLowerCase()] || string;\n if (string[0] === '#') {\n string = string.slice(1);\n }\n }\n return parseInt(string, 16);\n}\n/**\n * Converts a color as an [R, G, B] array of normalized floats to a hexadecimal number.\n * @example\n * PIXI.utils.rgb2hex([1, 1, 1]); // returns 0xffffff, which is 16777215 as an integer\n * @memberof PIXI.utils\n * @function rgb2hex\n * @param {number[]} rgb - Array of numbers where all values are normalized floats from 0.0 to 1.0.\n * @returns {number} Number in hexadecimal.\n */\nfunction rgb2hex(rgb) {\n return (((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + (rgb[2] * 255 | 0));\n}\n\n/**\n * Corrects PixiJS blend, takes premultiplied alpha into account\n * @memberof PIXI.utils\n * @function mapPremultipliedBlendModes\n * @private\n * @returns {Array<number[]>} Mapped modes.\n */\nfunction mapPremultipliedBlendModes() {\n var pm = [];\n var npm = [];\n for (var i = 0; i < 32; i++) {\n pm[i] = i;\n npm[i] = i;\n }\n pm[BLEND_MODES.NORMAL_NPM] = BLEND_MODES.NORMAL;\n pm[BLEND_MODES.ADD_NPM] = BLEND_MODES.ADD;\n pm[BLEND_MODES.SCREEN_NPM] = BLEND_MODES.SCREEN;\n npm[BLEND_MODES.NORMAL] = BLEND_MODES.NORMAL_NPM;\n npm[BLEND_MODES.ADD] = BLEND_MODES.ADD_NPM;\n npm[BLEND_MODES.SCREEN] = BLEND_MODES.SCREEN_NPM;\n var array = [];\n array.push(npm);\n array.push(pm);\n return array;\n}\n/**\n * maps premultiply flag and blendMode to adjusted blendMode\n * @memberof PIXI.utils\n * @constant premultiplyBlendMode\n * @type {Array<number[]>}\n */\nvar premultiplyBlendMode = mapPremultipliedBlendModes();\n/**\n * changes blendMode according to texture format\n * @memberof PIXI.utils\n * @function correctBlendMode\n * @param {number} blendMode - supposed blend mode\n * @param {boolean} premultiplied - whether source is premultiplied\n * @returns {number} true blend mode for this texture\n */\nfunction correctBlendMode(blendMode, premultiplied) {\n return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];\n}\n/**\n * combines rgb and alpha to out array\n * @memberof PIXI.utils\n * @function premultiplyRgba\n * @param {Float32Array|number[]} rgb - input rgb\n * @param {number} alpha - alpha param\n * @param {Float32Array} [out] - output\n * @param {boolean} [premultiply=true] - do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nfunction premultiplyRgba(rgb, alpha, out, premultiply) {\n out = out || new Float32Array(4);\n if (premultiply || premultiply === undefined) {\n out[0] = rgb[0] * alpha;\n out[1] = rgb[1] * alpha;\n out[2] = rgb[2] * alpha;\n }\n else {\n out[0] = rgb[0];\n out[1] = rgb[1];\n out[2] = rgb[2];\n }\n out[3] = alpha;\n return out;\n}\n/**\n * premultiplies tint\n * @memberof PIXI.utils\n * @function premultiplyTint\n * @param {number} tint - integer RGB\n * @param {number} alpha - floating point alpha (0.0-1.0)\n * @returns {number} tint multiplied by alpha\n */\nfunction premultiplyTint(tint, alpha) {\n if (alpha === 1.0) {\n return (alpha * 255 << 24) + tint;\n }\n if (alpha === 0.0) {\n return 0;\n }\n var R = ((tint >> 16) & 0xFF);\n var G = ((tint >> 8) & 0xFF);\n var B = (tint & 0xFF);\n R = ((R * alpha) + 0.5) | 0;\n G = ((G * alpha) + 0.5) | 0;\n B = ((B * alpha) + 0.5) | 0;\n return (alpha * 255 << 24) + (R << 16) + (G << 8) + B;\n}\n/**\n * converts integer tint and float alpha to vec4 form, premultiplies by default\n * @memberof PIXI.utils\n * @function premultiplyTintToRgba\n * @param {number} tint - input tint\n * @param {number} alpha - alpha param\n * @param {Float32Array} [out] - output\n * @param {boolean} [premultiply=true] - do premultiply it\n * @returns {Float32Array} vec4 rgba\n */\nfunction premultiplyTintToRgba(tint, alpha, out, premultiply) {\n out = out || new Float32Array(4);\n out[0] = ((tint >> 16) & 0xFF) / 255.0;\n out[1] = ((tint >> 8) & 0xFF) / 255.0;\n out[2] = (tint & 0xFF) / 255.0;\n if (premultiply || premultiply === undefined) {\n out[0] *= alpha;\n out[1] *= alpha;\n out[2] *= alpha;\n }\n out[3] = alpha;\n return out;\n}\n\n/**\n * Generic Mask Stack data structure\n * @memberof PIXI.utils\n * @function createIndicesForQuads\n * @param {number} size - Number of quads\n * @param {Uint16Array|Uint32Array} [outBuffer] - Buffer for output, length has to be `6 * size`\n * @returns {Uint16Array|Uint32Array} - Resulting index buffer\n */\nfunction createIndicesForQuads(size, outBuffer) {\n if (outBuffer === void 0) { outBuffer = null; }\n // the total number of indices in our array, there are 6 points per quad.\n var totalIndices = size * 6;\n outBuffer = outBuffer || new Uint16Array(totalIndices);\n if (outBuffer.length !== totalIndices) {\n throw new Error(\"Out buffer length is incorrect, got \" + outBuffer.length + \" and expected \" + totalIndices);\n }\n // fill the indices with the quads to draw\n for (var i = 0, j = 0; i < totalIndices; i += 6, j += 4) {\n outBuffer[i + 0] = j + 0;\n outBuffer[i + 1] = j + 1;\n outBuffer[i + 2] = j + 2;\n outBuffer[i + 3] = j + 0;\n outBuffer[i + 4] = j + 2;\n outBuffer[i + 5] = j + 3;\n }\n return outBuffer;\n}\n\nfunction getBufferType(array) {\n if (array.BYTES_PER_ELEMENT === 4) {\n if (array instanceof Float32Array) {\n return 'Float32Array';\n }\n else if (array instanceof Uint32Array) {\n return 'Uint32Array';\n }\n return 'Int32Array';\n }\n else if (array.BYTES_PER_ELEMENT === 2) {\n if (array instanceof Uint16Array) {\n return 'Uint16Array';\n }\n }\n else if (array.BYTES_PER_ELEMENT === 1) {\n if (array instanceof Uint8Array) {\n return 'Uint8Array';\n }\n }\n // TODO map out the rest of the array elements!\n return null;\n}\n\n/* eslint-disable object-shorthand */\nvar map = { Float32Array: Float32Array, Uint32Array: Uint32Array, Int32Array: Int32Array, Uint8Array: Uint8Array };\nfunction interleaveTypedArrays(arrays, sizes) {\n var outSize = 0;\n var stride = 0;\n var views = {};\n for (var i = 0; i < arrays.length; i++) {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n var buffer = new ArrayBuffer(outSize * 4);\n var out = null;\n var littleOffset = 0;\n for (var i = 0; i < arrays.length; i++) {\n var size = sizes[i];\n var array = arrays[i];\n /*\n @todo This is unsafe casting but consistent with how the code worked previously. Should it stay this way\n or should and `getBufferTypeUnsafe` function be exposed that throws an Error if unsupported type is passed?\n */\n var type = getBufferType(array);\n if (!views[type]) {\n views[type] = new map[type](buffer);\n }\n out = views[type];\n for (var j = 0; j < array.length; j++) {\n var indexStart = ((j / size | 0) * stride) + littleOffset;\n var index = j % size;\n out[indexStart + index] = array[j];\n }\n littleOffset += size;\n }\n return new Float32Array(buffer);\n}\n\n// Taken from the bit-twiddle package\n/**\n * Rounds to next power of two.\n * @function nextPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} - next rounded power of two\n */\nfunction nextPow2(v) {\n v += v === 0 ? 1 : 0;\n --v;\n v |= v >>> 1;\n v |= v >>> 2;\n v |= v >>> 4;\n v |= v >>> 8;\n v |= v >>> 16;\n return v + 1;\n}\n/**\n * Checks if a number is a power of two.\n * @function isPow2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {boolean} `true` if value is power of two\n */\nfunction isPow2(v) {\n return !(v & (v - 1)) && (!!v);\n}\n/**\n * Computes ceil of log base 2\n * @function log2\n * @memberof PIXI.utils\n * @param {number} v - input value\n * @returns {number} logarithm base 2\n */\nfunction log2(v) {\n var r = (v > 0xFFFF ? 1 : 0) << 4;\n v >>>= r;\n var shift = (v > 0xFF ? 1 : 0) << 3;\n v >>>= shift;\n r |= shift;\n shift = (v > 0xF ? 1 : 0) << 2;\n v >>>= shift;\n r |= shift;\n shift = (v > 0x3 ? 1 : 0) << 1;\n v >>>= shift;\n r |= shift;\n return r | (v >> 1);\n}\n\n/**\n * Remove items from a javascript array without generating garbage\n * @function removeItems\n * @memberof PIXI.utils\n * @param {Array<any>} arr - Array to remove elements from\n * @param {number} startIdx - starting index\n * @param {number} removeCount - how many to remove\n */\nfunction removeItems(arr, startIdx, removeCount) {\n var length = arr.length;\n var i;\n if (startIdx >= length || removeCount === 0) {\n return;\n }\n removeCount = (startIdx + removeCount > length ? length - startIdx : removeCount);\n var len = length - removeCount;\n for (i = startIdx; i < len; ++i) {\n arr[i] = arr[i + removeCount];\n }\n arr.length = len;\n}\n\n/**\n * Returns sign of number\n * @memberof PIXI.utils\n * @function sign\n * @param {number} n - the number to check the sign of\n * @returns {number} 0 if `n` is 0, -1 if `n` is negative, 1 if `n` is positive\n */\nfunction sign(n) {\n if (n === 0)\n { return 0; }\n return n < 0 ? -1 : 1;\n}\n\nvar nextUid = 0;\n/**\n * Gets the next unique identifier\n * @memberof PIXI.utils\n * @function uid\n * @returns {number} The next unique identifier to use.\n */\nfunction uid() {\n return ++nextUid;\n}\n\n// A map of warning messages already fired\nvar warnings = {};\n/**\n * Helper for warning developers about deprecated features & settings.\n * A stack track for warnings is given; useful for tracking-down where\n * deprecated methods/properties/classes are being used within the code.\n * @memberof PIXI.utils\n * @function deprecation\n * @param {string} version - The version where the feature became deprecated\n * @param {string} message - Message should include what is deprecated, where, and the new solution\n * @param {number} [ignoreDepth=3] - The number of steps to ignore at the top of the error stack\n * this is mostly to ignore internal deprecation calls.\n */\nfunction deprecation(version, message, ignoreDepth) {\n if (ignoreDepth === void 0) { ignoreDepth = 3; }\n // Ignore duplicat\n if (warnings[message]) {\n return;\n }\n /* eslint-disable no-console */\n var stack = new Error().stack;\n // Handle IE < 10 and Safari < 6\n if (typeof stack === 'undefined') {\n console.warn('PixiJS Deprecation Warning: ', message + \"\\nDeprecated since v\" + version);\n }\n else {\n // chop off the stack trace which includes PixiJS internal calls\n stack = stack.split('\\n').splice(ignoreDepth).join('\\n');\n if (console.groupCollapsed) {\n console.groupCollapsed('%cPixiJS Deprecation Warning: %c%s', 'color:#614108;background:#fffbe6', 'font-weight:normal;color:#614108;background:#fffbe6', message + \"\\nDeprecated since v\" + version);\n console.warn(stack);\n console.groupEnd();\n }\n else {\n console.warn('PixiJS Deprecation Warning: ', message + \"\\nDeprecated since v\" + version);\n console.warn(stack);\n }\n }\n /* eslint-enable no-console */\n warnings[message] = true;\n}\n\n/**\n * @todo Describe property usage\n * @static\n * @name ProgramCache\n * @memberof PIXI.utils\n * @type {object}\n */\nvar ProgramCache = {};\n/**\n * @todo Describe property usage\n * @static\n * @name TextureCache\n * @memberof PIXI.utils\n * @type {object}\n */\nvar TextureCache = Object.create(null);\n/**\n * @todo Describe property usage\n * @static\n * @name BaseTextureCache\n * @memberof PIXI.utils\n * @type {object}\n */\nvar BaseTextureCache = Object.create(null);\n/**\n * Destroys all texture in the cache\n * @memberof PIXI.utils\n * @function destroyTextureCache\n */\nfunction destroyTextureCache() {\n var key;\n for (key in TextureCache) {\n TextureCache[key].destroy();\n }\n for (key in BaseTextureCache) {\n BaseTextureCache[key].destroy();\n }\n}\n/**\n * Removes all textures from cache, but does not destroy them\n * @memberof PIXI.utils\n * @function clearTextureCache\n */\nfunction clearTextureCache() {\n var key;\n for (key in TextureCache) {\n delete TextureCache[key];\n }\n for (key in BaseTextureCache) {\n delete BaseTextureCache[key];\n }\n}\n\n/**\n * Creates a Canvas element of the given size to be used as a target for rendering to.\n * @class\n * @memberof PIXI.utils\n */\nvar CanvasRenderTarget = /** @class */ (function () {\n /**\n * @param width - the width for the newly created canvas\n * @param height - the height for the newly created canvas\n * @param {number} [resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio of the canvas\n */\n function CanvasRenderTarget(width, height, resolution) {\n this.canvas = settings.ADAPTER.createCanvas();\n this.context = this.canvas.getContext('2d');\n this.resolution = resolution || settings.RESOLUTION;\n this.resize(width, height);\n }\n /**\n * Clears the canvas that was created by the CanvasRenderTarget class.\n * @private\n */\n CanvasRenderTarget.prototype.clear = function () {\n this.context.setTransform(1, 0, 0, 1, 0, 0);\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n };\n /**\n * Resizes the canvas to the specified width and height.\n * @param desiredWidth - the desired width of the canvas\n * @param desiredHeight - the desired height of the canvas\n */\n CanvasRenderTarget.prototype.resize = function (desiredWidth, desiredHeight) {\n this.canvas.width = Math.round(desiredWidth * this.resolution);\n this.canvas.height = Math.round(desiredHeight * this.resolution);\n };\n /** Destroys this canvas. */\n CanvasRenderTarget.prototype.destroy = function () {\n this.context = null;\n this.canvas = null;\n };\n Object.defineProperty(CanvasRenderTarget.prototype, \"width\", {\n /**\n * The width of the canvas buffer in pixels.\n * @member {number}\n */\n get: function () {\n return this.canvas.width;\n },\n set: function (val) {\n this.canvas.width = Math.round(val);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CanvasRenderTarget.prototype, \"height\", {\n /**\n * The height of the canvas buffer in pixels.\n * @member {number}\n */\n get: function () {\n return this.canvas.height;\n },\n set: function (val) {\n this.canvas.height = Math.round(val);\n },\n enumerable: false,\n configurable: true\n });\n return CanvasRenderTarget;\n}());\n\n/**\n * Trim transparent borders from a canvas\n * @memberof PIXI.utils\n * @function trimCanvas\n * @param {HTMLCanvasElement} canvas - the canvas to trim\n * @returns {object} Trim data\n */\nfunction trimCanvas(canvas) {\n // https://gist.github.com/remy/784508\n var width = canvas.width;\n var height = canvas.height;\n var context = canvas.getContext('2d', {\n willReadFrequently: true,\n });\n var imageData = context.getImageData(0, 0, width, height);\n var pixels = imageData.data;\n var len = pixels.length;\n var bound = {\n top: null,\n left: null,\n right: null,\n bottom: null,\n };\n var data = null;\n var i;\n var x;\n var y;\n for (i = 0; i < len; i += 4) {\n if (pixels[i + 3] !== 0) {\n x = (i / 4) % width;\n y = ~~((i / 4) / width);\n if (bound.top === null) {\n bound.top = y;\n }\n if (bound.left === null) {\n bound.left = x;\n }\n else if (x < bound.left) {\n bound.left = x;\n }\n if (bound.right === null) {\n bound.right = x + 1;\n }\n else if (bound.right < x) {\n bound.right = x + 1;\n }\n if (bound.bottom === null) {\n bound.bottom = y;\n }\n else if (bound.bottom < y) {\n bound.bottom = y;\n }\n }\n }\n if (bound.top !== null) {\n width = bound.right - bound.left;\n height = bound.bottom - bound.top + 1;\n data = context.getImageData(bound.left, bound.top, width, height);\n }\n return {\n height: height,\n width: width,\n data: data,\n };\n}\n\n/**\n * Regexp for data URI.\n * Based on: {@link https://github.com/ragingwind/data-uri-regex}\n * @static\n * @constant {RegExp|string} DATA_URI\n * @memberof PIXI\n * @example data:image/png;base64\n */\nvar DATA_URI = /^\\s*data:(?:([\\w-]+)\\/([\\w+.-]+))?(?:;charset=([\\w-]+))?(?:;(base64))?,(.*)/i;\n\n/**\n * @memberof PIXI.utils\n * @interface DecomposedDataUri\n */\n/**\n * type, eg. `image`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} mediaType\n */\n/**\n * Sub type, eg. `png`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} subType\n */\n/**\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} charset\n */\n/**\n * Data encoding, eg. `base64`\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} encoding\n */\n/**\n * The actual data\n * @memberof PIXI.utils.DecomposedDataUri#\n * @member {string} data\n */\n/**\n * Split a data URI into components. Returns undefined if\n * parameter `dataUri` is not a valid data URI.\n * @memberof PIXI.utils\n * @function decomposeDataUri\n * @param {string} dataUri - the data URI to check\n * @returns {PIXI.utils.DecomposedDataUri|undefined} The decomposed data uri or undefined\n */\nfunction decomposeDataUri(dataUri) {\n var dataUriMatch = DATA_URI.exec(dataUri);\n if (dataUriMatch) {\n return {\n mediaType: dataUriMatch[1] ? dataUriMatch[1].toLowerCase() : undefined,\n subType: dataUriMatch[2] ? dataUriMatch[2].toLowerCase() : undefined,\n charset: dataUriMatch[3] ? dataUriMatch[3].toLowerCase() : undefined,\n encoding: dataUriMatch[4] ? dataUriMatch[4].toLowerCase() : undefined,\n data: dataUriMatch[5],\n };\n }\n return undefined;\n}\n\nvar tempAnchor;\n/**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * Nipped from the resource loader!\n * @ignore\n * @param {string} url - The url to test.\n * @param {object} [loc=window.location] - The location object to test against.\n * @returns {string} The crossOrigin value to use (or empty string for none).\n */\nfunction determineCrossOrigin(url$1, loc) {\n if (loc === void 0) { loc = globalThis.location; }\n // data: and javascript: urls are considered same-origin\n if (url$1.indexOf('data:') === 0) {\n return '';\n }\n // default is window.location\n loc = loc || globalThis.location;\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n }\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url$1;\n var parsedUrl = url.parse(tempAnchor.href);\n var samePort = (!parsedUrl.port && loc.port === '') || (parsedUrl.port === loc.port);\n // if cross origin\n if (parsedUrl.hostname !== loc.hostname || !samePort || parsedUrl.protocol !== loc.protocol) {\n return 'anonymous';\n }\n return '';\n}\n\n/**\n * get the resolution / device pixel ratio of an asset by looking for the prefix\n * used by spritesheets and image urls\n * @memberof PIXI.utils\n * @function getResolutionOfUrl\n * @param {string} url - the image path\n * @param {number} [defaultValue=1] - the defaultValue if no filename prefix is set.\n * @returns {number} resolution / device pixel ratio of an asset\n */\nfunction getResolutionOfUrl(url, defaultValue) {\n var resolution = settings.RETINA_PREFIX.exec(url);\n if (resolution) {\n return parseFloat(resolution[1]);\n }\n return defaultValue !== undefined ? defaultValue : 1;\n}\n\nexport { BaseTextureCache, CanvasRenderTarget, DATA_URI, ProgramCache, TextureCache, clearTextureCache, correctBlendMode, createIndicesForQuads, decomposeDataUri, deprecation, destroyTextureCache, determineCrossOrigin, getBufferType, getResolutionOfUrl, hex2rgb, hex2string, interleaveTypedArrays, isPow2, isWebGLSupported, log2, nextPow2, path, premultiplyBlendMode, premultiplyRgba, premultiplyTint, premultiplyTintToRgba, removeItems, rgb2hex, sayHello, sign, skipHello, string2hex, trimCanvas, uid, url };\n//# sourceMappingURL=utils.mjs.map\n","/*!\n * @pixi/math - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/math is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\n/**\n * Two Pi.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nvar PI_2 = Math.PI * 2;\n/**\n * Conversion factor for converting radians to degrees.\n * @static\n * @member {number} RAD_TO_DEG\n * @memberof PIXI\n */\nvar RAD_TO_DEG = 180 / Math.PI;\n/**\n * Conversion factor for converting degrees to radians.\n * @static\n * @member {number}\n * @memberof PIXI\n */\nvar DEG_TO_RAD = Math.PI / 180;\n/**\n * Constants that identify shapes, mainly to prevent `instanceof` calls.\n * @static\n * @memberof PIXI\n * @enum {number}\n * @property {number} POLY Polygon\n * @property {number} RECT Rectangle\n * @property {number} CIRC Circle\n * @property {number} ELIP Ellipse\n * @property {number} RREC Rounded Rectangle\n */\nvar SHAPES;\n(function (SHAPES) {\n SHAPES[SHAPES[\"POLY\"] = 0] = \"POLY\";\n SHAPES[SHAPES[\"RECT\"] = 1] = \"RECT\";\n SHAPES[SHAPES[\"CIRC\"] = 2] = \"CIRC\";\n SHAPES[SHAPES[\"ELIP\"] = 3] = \"ELIP\";\n SHAPES[SHAPES[\"RREC\"] = 4] = \"RREC\";\n})(SHAPES || (SHAPES = {}));\n\n/**\n * The Point object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis\n * @class\n * @memberof PIXI\n * @implements {IPoint}\n */\nvar Point = /** @class */ (function () {\n /**\n * Creates a new `Point`\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function Point(x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n /** Position of the point on the x axis */\n this.x = 0;\n /** Position of the point on the y axis */\n this.y = 0;\n this.x = x;\n this.y = y;\n }\n /**\n * Creates a clone of this point\n * @returns A clone of this point\n */\n Point.prototype.clone = function () {\n return new Point(this.x, this.y);\n };\n /**\n * Copies `x` and `y` from the given point into this point\n * @param p - The point to copy from\n * @returns The point instance itself\n */\n Point.prototype.copyFrom = function (p) {\n this.set(p.x, p.y);\n return this;\n };\n /**\n * Copies this point's x and y into the given point (`p`).\n * @param p - The point to copy to. Can be any of type that is or extends `IPointData`\n * @returns The point (`p`) with values updated\n */\n Point.prototype.copyTo = function (p) {\n p.set(this.x, this.y);\n return p;\n };\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n Point.prototype.equals = function (p) {\n return (p.x === this.x) && (p.y === this.y);\n };\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the `x` axis\n * @param {number} [y=x] - position of the point on the `y` axis\n * @returns The point instance itself\n */\n Point.prototype.set = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = x; }\n this.x = x;\n this.y = y;\n return this;\n };\n Point.prototype.toString = function () {\n return \"[@pixi/math:Point x=\" + this.x + \" y=\" + this.y + \"]\";\n };\n return Point;\n}());\n\nvar tempPoints = [new Point(), new Point(), new Point(), new Point()];\n/**\n * Size object, contains width and height\n * @memberof PIXI\n * @typedef {object} ISize\n * @property {number} width - Width component\n * @property {number} height - Height component\n */\n/**\n * Rectangle object is an area defined by its position, as indicated by its top-left corner\n * point (x, y) and by its width and its height.\n * @memberof PIXI\n */\nvar Rectangle = /** @class */ (function () {\n /**\n * @param x - The X coordinate of the upper-left corner of the rectangle\n * @param y - The Y coordinate of the upper-left corner of the rectangle\n * @param width - The overall width of the rectangle\n * @param height - The overall height of the rectangle\n */\n function Rectangle(x, y, width, height) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n this.x = Number(x);\n this.y = Number(y);\n this.width = Number(width);\n this.height = Number(height);\n this.type = SHAPES.RECT;\n }\n Object.defineProperty(Rectangle.prototype, \"left\", {\n /** Returns the left edge of the rectangle. */\n get: function () {\n return this.x;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"right\", {\n /** Returns the right edge of the rectangle. */\n get: function () {\n return this.x + this.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"top\", {\n /** Returns the top edge of the rectangle. */\n get: function () {\n return this.y;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle.prototype, \"bottom\", {\n /** Returns the bottom edge of the rectangle. */\n get: function () {\n return this.y + this.height;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Rectangle, \"EMPTY\", {\n /** A constant empty rectangle. */\n get: function () {\n return new Rectangle(0, 0, 0, 0);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates a clone of this Rectangle\n * @returns a copy of the rectangle\n */\n Rectangle.prototype.clone = function () {\n return new Rectangle(this.x, this.y, this.width, this.height);\n };\n /**\n * Copies another rectangle to this one.\n * @param rectangle - The rectangle to copy from.\n * @returns Returns itself.\n */\n Rectangle.prototype.copyFrom = function (rectangle) {\n this.x = rectangle.x;\n this.y = rectangle.y;\n this.width = rectangle.width;\n this.height = rectangle.height;\n return this;\n };\n /**\n * Copies this rectangle to another one.\n * @param rectangle - The rectangle to copy to.\n * @returns Returns given parameter.\n */\n Rectangle.prototype.copyTo = function (rectangle) {\n rectangle.x = this.x;\n rectangle.y = this.y;\n rectangle.width = this.width;\n rectangle.height = this.height;\n return rectangle;\n };\n /**\n * Checks whether the x and y coordinates given are contained within this Rectangle\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coordinates are within this Rectangle\n */\n Rectangle.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x < this.x + this.width) {\n if (y >= this.y && y < this.y + this.height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.\n * Returns true only if the area of the intersection is >0, this means that Rectangles\n * sharing a side are not overlapping. Another side effect is that an arealess rectangle\n * (width or height equal to zero) can't intersect any other rectangle.\n * @param {Rectangle} other - The Rectangle to intersect with `this`.\n * @param {Matrix} transform - The transformation matrix of `other`.\n * @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.\n */\n Rectangle.prototype.intersects = function (other, transform) {\n if (!transform) {\n var x0_1 = this.x < other.x ? other.x : this.x;\n var x1_1 = this.right > other.right ? other.right : this.right;\n if (x1_1 <= x0_1) {\n return false;\n }\n var y0_1 = this.y < other.y ? other.y : this.y;\n var y1_1 = this.bottom > other.bottom ? other.bottom : this.bottom;\n return y1_1 > y0_1;\n }\n var x0 = this.left;\n var x1 = this.right;\n var y0 = this.top;\n var y1 = this.bottom;\n if (x1 <= x0 || y1 <= y0) {\n return false;\n }\n var lt = tempPoints[0].set(other.left, other.top);\n var lb = tempPoints[1].set(other.left, other.bottom);\n var rt = tempPoints[2].set(other.right, other.top);\n var rb = tempPoints[3].set(other.right, other.bottom);\n if (rt.x <= lt.x || lb.y <= lt.y) {\n return false;\n }\n var s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));\n if (s === 0) {\n return false;\n }\n transform.apply(lt, lt);\n transform.apply(lb, lb);\n transform.apply(rt, rt);\n transform.apply(rb, rb);\n if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0\n || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1\n || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0\n || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1) {\n return false;\n }\n var nx = s * (lb.y - lt.y);\n var ny = s * (lt.x - lb.x);\n var n00 = (nx * x0) + (ny * y0);\n var n10 = (nx * x1) + (ny * y0);\n var n01 = (nx * x0) + (ny * y1);\n var n11 = (nx * x1) + (ny * y1);\n if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)\n || Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y)) {\n return false;\n }\n var mx = s * (lt.y - rt.y);\n var my = s * (rt.x - lt.x);\n var m00 = (mx * x0) + (my * y0);\n var m10 = (mx * x1) + (my * y0);\n var m01 = (mx * x0) + (my * y1);\n var m11 = (mx * x1) + (my * y1);\n if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)\n || Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y)) {\n return false;\n }\n return true;\n };\n /**\n * Pads the rectangle making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n * @param paddingX - The horizontal padding amount.\n * @param paddingY - The vertical padding amount.\n * @returns Returns itself.\n */\n Rectangle.prototype.pad = function (paddingX, paddingY) {\n if (paddingX === void 0) { paddingX = 0; }\n if (paddingY === void 0) { paddingY = paddingX; }\n this.x -= paddingX;\n this.y -= paddingY;\n this.width += paddingX * 2;\n this.height += paddingY * 2;\n return this;\n };\n /**\n * Fits this rectangle around the passed one.\n * @param rectangle - The rectangle to fit.\n * @returns Returns itself.\n */\n Rectangle.prototype.fit = function (rectangle) {\n var x1 = Math.max(this.x, rectangle.x);\n var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);\n var y1 = Math.max(this.y, rectangle.y);\n var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n this.x = x1;\n this.width = Math.max(x2 - x1, 0);\n this.y = y1;\n this.height = Math.max(y2 - y1, 0);\n return this;\n };\n /**\n * Enlarges rectangle that way its corners lie on grid\n * @param resolution - resolution\n * @param eps - precision\n * @returns Returns itself.\n */\n Rectangle.prototype.ceil = function (resolution, eps) {\n if (resolution === void 0) { resolution = 1; }\n if (eps === void 0) { eps = 0.001; }\n var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;\n var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;\n this.x = Math.floor((this.x + eps) * resolution) / resolution;\n this.y = Math.floor((this.y + eps) * resolution) / resolution;\n this.width = x2 - this.x;\n this.height = y2 - this.y;\n return this;\n };\n /**\n * Enlarges this rectangle to include the passed rectangle.\n * @param rectangle - The rectangle to include.\n * @returns Returns itself.\n */\n Rectangle.prototype.enlarge = function (rectangle) {\n var x1 = Math.min(this.x, rectangle.x);\n var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n var y1 = Math.min(this.y, rectangle.y);\n var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n this.x = x1;\n this.width = x2 - x1;\n this.y = y1;\n this.height = y2 - y1;\n return this;\n };\n Rectangle.prototype.toString = function () {\n return \"[@pixi/math:Rectangle x=\" + this.x + \" y=\" + this.y + \" width=\" + this.width + \" height=\" + this.height + \"]\";\n };\n return Rectangle;\n}());\n\n/**\n * The Circle object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nvar Circle = /** @class */ (function () {\n /**\n * @param x - The X coordinate of the center of this circle\n * @param y - The Y coordinate of the center of this circle\n * @param radius - The radius of the circle\n */\n function Circle(x, y, radius) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (radius === void 0) { radius = 0; }\n this.x = x;\n this.y = y;\n this.radius = radius;\n this.type = SHAPES.CIRC;\n }\n /**\n * Creates a clone of this Circle instance\n * @returns A copy of the Circle\n */\n Circle.prototype.clone = function () {\n return new Circle(this.x, this.y, this.radius);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this circle\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coordinates are within this Circle\n */\n Circle.prototype.contains = function (x, y) {\n if (this.radius <= 0) {\n return false;\n }\n var r2 = this.radius * this.radius;\n var dx = (this.x - x);\n var dy = (this.y - y);\n dx *= dx;\n dy *= dy;\n return (dx + dy <= r2);\n };\n /**\n * Returns the framing rectangle of the circle as a Rectangle object\n * @returns The framing rectangle\n */\n Circle.prototype.getBounds = function () {\n return new Rectangle(this.x - this.radius, this.y - this.radius, this.radius * 2, this.radius * 2);\n };\n Circle.prototype.toString = function () {\n return \"[@pixi/math:Circle x=\" + this.x + \" y=\" + this.y + \" radius=\" + this.radius + \"]\";\n };\n return Circle;\n}());\n\n/**\n * The Ellipse object is used to help draw graphics and can also be used to specify a hit area for displayObjects.\n * @memberof PIXI\n */\nvar Ellipse = /** @class */ (function () {\n /**\n * @param x - The X coordinate of the center of this ellipse\n * @param y - The Y coordinate of the center of this ellipse\n * @param halfWidth - The half width of this ellipse\n * @param halfHeight - The half height of this ellipse\n */\n function Ellipse(x, y, halfWidth, halfHeight) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (halfWidth === void 0) { halfWidth = 0; }\n if (halfHeight === void 0) { halfHeight = 0; }\n this.x = x;\n this.y = y;\n this.width = halfWidth;\n this.height = halfHeight;\n this.type = SHAPES.ELIP;\n }\n /**\n * Creates a clone of this Ellipse instance\n * @returns {PIXI.Ellipse} A copy of the ellipse\n */\n Ellipse.prototype.clone = function () {\n return new Ellipse(this.x, this.y, this.width, this.height);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this ellipse\n * @param x - The X coordinate of the point to test\n * @param y - The Y coordinate of the point to test\n * @returns Whether the x/y coords are within this ellipse\n */\n Ellipse.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n // normalize the coords to an ellipse with center 0,0\n var normx = ((x - this.x) / this.width);\n var normy = ((y - this.y) / this.height);\n normx *= normx;\n normy *= normy;\n return (normx + normy <= 1);\n };\n /**\n * Returns the framing rectangle of the ellipse as a Rectangle object\n * @returns The framing rectangle\n */\n Ellipse.prototype.getBounds = function () {\n return new Rectangle(this.x - this.width, this.y - this.height, this.width, this.height);\n };\n Ellipse.prototype.toString = function () {\n return \"[@pixi/math:Ellipse x=\" + this.x + \" y=\" + this.y + \" width=\" + this.width + \" height=\" + this.height + \"]\";\n };\n return Ellipse;\n}());\n\n/**\n * A class to define a shape via user defined coordinates.\n * @memberof PIXI\n */\nvar Polygon = /** @class */ (function () {\n /**\n * @param {PIXI.IPointData[]|number[]} points - This can be an array of Points\n * that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or\n * the arguments passed can be all the points of the polygon e.g.\n * `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat\n * x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.\n */\n function Polygon() {\n var arguments$1 = arguments;\n\n var points = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n points[_i] = arguments$1[_i];\n }\n var flat = Array.isArray(points[0]) ? points[0] : points;\n // if this is an array of points, convert it to a flat array of numbers\n if (typeof flat[0] !== 'number') {\n var p = [];\n for (var i = 0, il = flat.length; i < il; i++) {\n p.push(flat[i].x, flat[i].y);\n }\n flat = p;\n }\n this.points = flat;\n this.type = SHAPES.POLY;\n this.closeStroke = true;\n }\n /**\n * Creates a clone of this polygon.\n * @returns - A copy of the polygon.\n */\n Polygon.prototype.clone = function () {\n var points = this.points.slice();\n var polygon = new Polygon(points);\n polygon.closeStroke = this.closeStroke;\n return polygon;\n };\n /**\n * Checks whether the x and y coordinates passed to this function are contained within this polygon.\n * @param x - The X coordinate of the point to test.\n * @param y - The Y coordinate of the point to test.\n * @returns - Whether the x/y coordinates are within this polygon.\n */\n Polygon.prototype.contains = function (x, y) {\n var inside = false;\n // use some raycasting to test hits\n // https://github.com/substack/point-in-polygon/blob/master/index.js\n var length = this.points.length / 2;\n for (var i = 0, j = length - 1; i < length; j = i++) {\n var xi = this.points[i * 2];\n var yi = this.points[(i * 2) + 1];\n var xj = this.points[j * 2];\n var yj = this.points[(j * 2) + 1];\n var intersect = ((yi > y) !== (yj > y)) && (x < ((xj - xi) * ((y - yi) / (yj - yi))) + xi);\n if (intersect) {\n inside = !inside;\n }\n }\n return inside;\n };\n Polygon.prototype.toString = function () {\n return \"[@pixi/math:Polygon\"\n + (\"closeStroke=\" + this.closeStroke)\n + (\"points=\" + this.points.reduce(function (pointsDesc, currentPoint) { return pointsDesc + \", \" + currentPoint; }, '') + \"]\");\n };\n return Polygon;\n}());\n\n/**\n * The Rounded Rectangle object is an area that has nice rounded corners, as indicated by its\n * top-left corner point (x, y) and by its width and its height and its radius.\n * @memberof PIXI\n */\nvar RoundedRectangle = /** @class */ (function () {\n /**\n * @param x - The X coordinate of the upper-left corner of the rounded rectangle\n * @param y - The Y coordinate of the upper-left corner of the rounded rectangle\n * @param width - The overall width of this rounded rectangle\n * @param height - The overall height of this rounded rectangle\n * @param radius - Controls the radius of the rounded corners\n */\n function RoundedRectangle(x, y, width, height, radius) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n if (radius === void 0) { radius = 20; }\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.radius = radius;\n this.type = SHAPES.RREC;\n }\n /**\n * Creates a clone of this Rounded Rectangle.\n * @returns - A copy of the rounded rectangle.\n */\n RoundedRectangle.prototype.clone = function () {\n return new RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);\n };\n /**\n * Checks whether the x and y coordinates given are contained within this Rounded Rectangle\n * @param x - The X coordinate of the point to test.\n * @param y - The Y coordinate of the point to test.\n * @returns - Whether the x/y coordinates are within this Rounded Rectangle.\n */\n RoundedRectangle.prototype.contains = function (x, y) {\n if (this.width <= 0 || this.height <= 0) {\n return false;\n }\n if (x >= this.x && x <= this.x + this.width) {\n if (y >= this.y && y <= this.y + this.height) {\n var radius = Math.max(0, Math.min(this.radius, Math.min(this.width, this.height) / 2));\n if ((y >= this.y + radius && y <= this.y + this.height - radius)\n || (x >= this.x + radius && x <= this.x + this.width - radius)) {\n return true;\n }\n var dx = x - (this.x + radius);\n var dy = y - (this.y + radius);\n var radius2 = radius * radius;\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dx = x - (this.x + this.width - radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dy = y - (this.y + this.height - radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n dx = x - (this.x + radius);\n if ((dx * dx) + (dy * dy) <= radius2) {\n return true;\n }\n }\n }\n return false;\n };\n RoundedRectangle.prototype.toString = function () {\n return \"[@pixi/math:RoundedRectangle x=\" + this.x + \" y=\" + this.y\n + (\"width=\" + this.width + \" height=\" + this.height + \" radius=\" + this.radius + \"]\");\n };\n return RoundedRectangle;\n}());\n\n/**\n * The ObservablePoint object represents a location in a two-dimensional coordinate system, where `x` represents\n * the position on the horizontal axis and `y` represents the position on the vertical axis.\n *\n * An `ObservablePoint` is a point that triggers a callback when the point's position is changed.\n * @memberof PIXI\n */\nvar ObservablePoint = /** @class */ (function () {\n /**\n * Creates a new `ObservablePoint`\n * @param cb - callback function triggered when `x` and/or `y` are changed\n * @param scope - owner of callback\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=0] - position of the point on the y axis\n */\n function ObservablePoint(cb, scope, x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n this._x = x;\n this._y = y;\n this.cb = cb;\n this.scope = scope;\n }\n /**\n * Creates a clone of this point.\n * The callback and scope params can be overridden otherwise they will default\n * to the clone object's values.\n * @override\n * @param cb - The callback function triggered when `x` and/or `y` are changed\n * @param scope - The owner of the callback\n * @returns a copy of this observable point\n */\n ObservablePoint.prototype.clone = function (cb, scope) {\n if (cb === void 0) { cb = this.cb; }\n if (scope === void 0) { scope = this.scope; }\n return new ObservablePoint(cb, scope, this._x, this._y);\n };\n /**\n * Sets the point to a new `x` and `y` position.\n * If `y` is omitted, both `x` and `y` will be set to `x`.\n * @param {number} [x=0] - position of the point on the x axis\n * @param {number} [y=x] - position of the point on the y axis\n * @returns The observable point instance itself\n */\n ObservablePoint.prototype.set = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = x; }\n if (this._x !== x || this._y !== y) {\n this._x = x;\n this._y = y;\n this.cb.call(this.scope);\n }\n return this;\n };\n /**\n * Copies x and y from the given point (`p`)\n * @param p - The point to copy from. Can be any of type that is or extends `IPointData`\n * @returns The observable point instance itself\n */\n ObservablePoint.prototype.copyFrom = function (p) {\n if (this._x !== p.x || this._y !== p.y) {\n this._x = p.x;\n this._y = p.y;\n this.cb.call(this.scope);\n }\n return this;\n };\n /**\n * Copies this point's x and y into that of the given point (`p`)\n * @param p - The point to copy to. Can be any of type that is or extends `IPointData`\n * @returns The point (`p`) with values updated\n */\n ObservablePoint.prototype.copyTo = function (p) {\n p.set(this._x, this._y);\n return p;\n };\n /**\n * Accepts another point (`p`) and returns `true` if the given point is equal to this point\n * @param p - The point to check\n * @returns Returns `true` if both `x` and `y` are equal\n */\n ObservablePoint.prototype.equals = function (p) {\n return (p.x === this._x) && (p.y === this._y);\n };\n ObservablePoint.prototype.toString = function () {\n return \"[@pixi/math:ObservablePoint x=\" + 0 + \" y=\" + 0 + \" scope=\" + this.scope + \"]\";\n };\n Object.defineProperty(ObservablePoint.prototype, \"x\", {\n /** Position of the observable point on the x axis. */\n get: function () {\n return this._x;\n },\n set: function (value) {\n if (this._x !== value) {\n this._x = value;\n this.cb.call(this.scope);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ObservablePoint.prototype, \"y\", {\n /** Position of the observable point on the y axis. */\n get: function () {\n return this._y;\n },\n set: function (value) {\n if (this._y !== value) {\n this._y = value;\n this.cb.call(this.scope);\n }\n },\n enumerable: false,\n configurable: true\n });\n return ObservablePoint;\n}());\n\n/**\n * The PixiJS Matrix as a class makes it a lot faster.\n *\n * Here is a representation of it:\n * ```js\n * | a | c | tx|\n * | b | d | ty|\n * | 0 | 0 | 1 |\n * ```\n * @memberof PIXI\n */\nvar Matrix = /** @class */ (function () {\n /**\n * @param a - x scale\n * @param b - y skew\n * @param c - x skew\n * @param d - y scale\n * @param tx - x translation\n * @param ty - y translation\n */\n function Matrix(a, b, c, d, tx, ty) {\n if (a === void 0) { a = 1; }\n if (b === void 0) { b = 0; }\n if (c === void 0) { c = 0; }\n if (d === void 0) { d = 1; }\n if (tx === void 0) { tx = 0; }\n if (ty === void 0) { ty = 0; }\n this.array = null;\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n }\n /**\n * Creates a Matrix object based on the given array. The Element to Matrix mapping order is as follows:\n *\n * a = array[0]\n * b = array[1]\n * c = array[3]\n * d = array[4]\n * tx = array[2]\n * ty = array[5]\n * @param array - The array that the matrix will be populated from.\n */\n Matrix.prototype.fromArray = function (array) {\n this.a = array[0];\n this.b = array[1];\n this.c = array[3];\n this.d = array[4];\n this.tx = array[2];\n this.ty = array[5];\n };\n /**\n * Sets the matrix properties.\n * @param a - Matrix component\n * @param b - Matrix component\n * @param c - Matrix component\n * @param d - Matrix component\n * @param tx - Matrix component\n * @param ty - Matrix component\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.set = function (a, b, c, d, tx, ty) {\n this.a = a;\n this.b = b;\n this.c = c;\n this.d = d;\n this.tx = tx;\n this.ty = ty;\n return this;\n };\n /**\n * Creates an array from the current Matrix object.\n * @param transpose - Whether we need to transpose the matrix or not\n * @param [out=new Float32Array(9)] - If provided the array will be assigned to out\n * @returns The newly created array which contains the matrix\n */\n Matrix.prototype.toArray = function (transpose, out) {\n if (!this.array) {\n this.array = new Float32Array(9);\n }\n var array = out || this.array;\n if (transpose) {\n array[0] = this.a;\n array[1] = this.b;\n array[2] = 0;\n array[3] = this.c;\n array[4] = this.d;\n array[5] = 0;\n array[6] = this.tx;\n array[7] = this.ty;\n array[8] = 1;\n }\n else {\n array[0] = this.a;\n array[1] = this.c;\n array[2] = this.tx;\n array[3] = this.b;\n array[4] = this.d;\n array[5] = this.ty;\n array[6] = 0;\n array[7] = 0;\n array[8] = 1;\n }\n return array;\n };\n /**\n * Get a new position with the current transformation applied.\n * Can be used to go from a child's coordinate space to the world coordinate space. (e.g. rendering)\n * @param pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @returns {PIXI.Point} The new point, transformed through this matrix\n */\n Matrix.prototype.apply = function (pos, newPos) {\n newPos = (newPos || new Point());\n var x = pos.x;\n var y = pos.y;\n newPos.x = (this.a * x) + (this.c * y) + this.tx;\n newPos.y = (this.b * x) + (this.d * y) + this.ty;\n return newPos;\n };\n /**\n * Get a new position with the inverse of the current transformation applied.\n * Can be used to go from the world coordinate space to a child's coordinate space. (e.g. input)\n * @param pos - The origin\n * @param {PIXI.Point} [newPos] - The point that the new position is assigned to (allowed to be same as input)\n * @returns {PIXI.Point} The new point, inverse-transformed through this matrix\n */\n Matrix.prototype.applyInverse = function (pos, newPos) {\n newPos = (newPos || new Point());\n var id = 1 / ((this.a * this.d) + (this.c * -this.b));\n var x = pos.x;\n var y = pos.y;\n newPos.x = (this.d * id * x) + (-this.c * id * y) + (((this.ty * this.c) - (this.tx * this.d)) * id);\n newPos.y = (this.a * id * y) + (-this.b * id * x) + (((-this.ty * this.a) + (this.tx * this.b)) * id);\n return newPos;\n };\n /**\n * Translates the matrix on the x and y.\n * @param x - How much to translate x by\n * @param y - How much to translate y by\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.translate = function (x, y) {\n this.tx += x;\n this.ty += y;\n return this;\n };\n /**\n * Applies a scale transformation to the matrix.\n * @param x - The amount to scale horizontally\n * @param y - The amount to scale vertically\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.scale = function (x, y) {\n this.a *= x;\n this.d *= y;\n this.c *= x;\n this.b *= y;\n this.tx *= x;\n this.ty *= y;\n return this;\n };\n /**\n * Applies a rotation transformation to the matrix.\n * @param angle - The angle in radians.\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.rotate = function (angle) {\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n var a1 = this.a;\n var c1 = this.c;\n var tx1 = this.tx;\n this.a = (a1 * cos) - (this.b * sin);\n this.b = (a1 * sin) + (this.b * cos);\n this.c = (c1 * cos) - (this.d * sin);\n this.d = (c1 * sin) + (this.d * cos);\n this.tx = (tx1 * cos) - (this.ty * sin);\n this.ty = (tx1 * sin) + (this.ty * cos);\n return this;\n };\n /**\n * Appends the given Matrix to this Matrix.\n * @param matrix - The matrix to append.\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.append = function (matrix) {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n this.a = (matrix.a * a1) + (matrix.b * c1);\n this.b = (matrix.a * b1) + (matrix.b * d1);\n this.c = (matrix.c * a1) + (matrix.d * c1);\n this.d = (matrix.c * b1) + (matrix.d * d1);\n this.tx = (matrix.tx * a1) + (matrix.ty * c1) + this.tx;\n this.ty = (matrix.tx * b1) + (matrix.ty * d1) + this.ty;\n return this;\n };\n /**\n * Sets the matrix based on all the available properties\n * @param x - Position on the x axis\n * @param y - Position on the y axis\n * @param pivotX - Pivot on the x axis\n * @param pivotY - Pivot on the y axis\n * @param scaleX - Scale on the x axis\n * @param scaleY - Scale on the y axis\n * @param rotation - Rotation in radians\n * @param skewX - Skew on the x axis\n * @param skewY - Skew on the y axis\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.setTransform = function (x, y, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) {\n this.a = Math.cos(rotation + skewY) * scaleX;\n this.b = Math.sin(rotation + skewY) * scaleX;\n this.c = -Math.sin(rotation - skewX) * scaleY;\n this.d = Math.cos(rotation - skewX) * scaleY;\n this.tx = x - ((pivotX * this.a) + (pivotY * this.c));\n this.ty = y - ((pivotX * this.b) + (pivotY * this.d));\n return this;\n };\n /**\n * Prepends the given Matrix to this Matrix.\n * @param matrix - The matrix to prepend\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.prepend = function (matrix) {\n var tx1 = this.tx;\n if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) {\n var a1 = this.a;\n var c1 = this.c;\n this.a = (a1 * matrix.a) + (this.b * matrix.c);\n this.b = (a1 * matrix.b) + (this.b * matrix.d);\n this.c = (c1 * matrix.a) + (this.d * matrix.c);\n this.d = (c1 * matrix.b) + (this.d * matrix.d);\n }\n this.tx = (tx1 * matrix.a) + (this.ty * matrix.c) + matrix.tx;\n this.ty = (tx1 * matrix.b) + (this.ty * matrix.d) + matrix.ty;\n return this;\n };\n /**\n * Decomposes the matrix (x, y, scaleX, scaleY, and rotation) and sets the properties on to a transform.\n * @param transform - The transform to apply the properties to.\n * @returns The transform with the newly applied properties\n */\n Matrix.prototype.decompose = function (transform) {\n // sort out rotation / skew..\n var a = this.a;\n var b = this.b;\n var c = this.c;\n var d = this.d;\n var pivot = transform.pivot;\n var skewX = -Math.atan2(-c, d);\n var skewY = Math.atan2(b, a);\n var delta = Math.abs(skewX + skewY);\n if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001) {\n transform.rotation = skewY;\n transform.skew.x = transform.skew.y = 0;\n }\n else {\n transform.rotation = 0;\n transform.skew.x = skewX;\n transform.skew.y = skewY;\n }\n // next set scale\n transform.scale.x = Math.sqrt((a * a) + (b * b));\n transform.scale.y = Math.sqrt((c * c) + (d * d));\n // next set position\n transform.position.x = this.tx + ((pivot.x * a) + (pivot.y * c));\n transform.position.y = this.ty + ((pivot.x * b) + (pivot.y * d));\n return transform;\n };\n /**\n * Inverts this matrix\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.invert = function () {\n var a1 = this.a;\n var b1 = this.b;\n var c1 = this.c;\n var d1 = this.d;\n var tx1 = this.tx;\n var n = (a1 * d1) - (b1 * c1);\n this.a = d1 / n;\n this.b = -b1 / n;\n this.c = -c1 / n;\n this.d = a1 / n;\n this.tx = ((c1 * this.ty) - (d1 * tx1)) / n;\n this.ty = -((a1 * this.ty) - (b1 * tx1)) / n;\n return this;\n };\n /**\n * Resets this Matrix to an identity (default) matrix.\n * @returns This matrix. Good for chaining method calls.\n */\n Matrix.prototype.identity = function () {\n this.a = 1;\n this.b = 0;\n this.c = 0;\n this.d = 1;\n this.tx = 0;\n this.ty = 0;\n return this;\n };\n /**\n * Creates a new Matrix object with the same values as this one.\n * @returns A copy of this matrix. Good for chaining method calls.\n */\n Matrix.prototype.clone = function () {\n var matrix = new Matrix();\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n return matrix;\n };\n /**\n * Changes the values of the given matrix to be the same as the ones in this matrix\n * @param matrix - The matrix to copy to.\n * @returns The matrix given in parameter with its values updated.\n */\n Matrix.prototype.copyTo = function (matrix) {\n matrix.a = this.a;\n matrix.b = this.b;\n matrix.c = this.c;\n matrix.d = this.d;\n matrix.tx = this.tx;\n matrix.ty = this.ty;\n return matrix;\n };\n /**\n * Changes the values of the matrix to be the same as the ones in given matrix\n * @param {PIXI.Matrix} matrix - The matrix to copy from.\n * @returns {PIXI.Matrix} this\n */\n Matrix.prototype.copyFrom = function (matrix) {\n this.a = matrix.a;\n this.b = matrix.b;\n this.c = matrix.c;\n this.d = matrix.d;\n this.tx = matrix.tx;\n this.ty = matrix.ty;\n return this;\n };\n Matrix.prototype.toString = function () {\n return \"[@pixi/math:Matrix a=\" + this.a + \" b=\" + this.b + \" c=\" + this.c + \" d=\" + this.d + \" tx=\" + this.tx + \" ty=\" + this.ty + \"]\";\n };\n Object.defineProperty(Matrix, \"IDENTITY\", {\n /**\n * A default (identity) matrix\n * @readonly\n */\n get: function () {\n return new Matrix();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Matrix, \"TEMP_MATRIX\", {\n /**\n * A temp matrix\n * @readonly\n */\n get: function () {\n return new Matrix();\n },\n enumerable: false,\n configurable: true\n });\n return Matrix;\n}());\n\n// Your friendly neighbour https://en.wikipedia.org/wiki/Dihedral_group\n/*\n * Transform matrix for operation n is:\n * | ux | vx |\n * | uy | vy |\n */\nvar ux = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1];\nvar uy = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vx = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1];\nvar vy = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1];\n/**\n * [Cayley Table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * for the composition of each rotation in the dihederal group D8.\n * @type {number[][]}\n * @private\n */\nvar rotationCayley = [];\n/**\n * Matrices for each `GD8Symmetry` rotation.\n * @type {PIXI.Matrix[]}\n * @private\n */\nvar rotationMatrices = [];\n/*\n * Alias for {@code Math.sign}.\n */\nvar signum = Math.sign;\n/*\n * Initializes `rotationCayley` and `rotationMatrices`. It is called\n * only once below.\n */\nfunction init() {\n for (var i = 0; i < 16; i++) {\n var row = [];\n rotationCayley.push(row);\n for (var j = 0; j < 16; j++) {\n /* Multiplies rotation matrices i and j. */\n var _ux = signum((ux[i] * ux[j]) + (vx[i] * uy[j]));\n var _uy = signum((uy[i] * ux[j]) + (vy[i] * uy[j]));\n var _vx = signum((ux[i] * vx[j]) + (vx[i] * vy[j]));\n var _vy = signum((uy[i] * vx[j]) + (vy[i] * vy[j]));\n /* Finds rotation matrix matching the product and pushes it. */\n for (var k = 0; k < 16; k++) {\n if (ux[k] === _ux && uy[k] === _uy\n && vx[k] === _vx && vy[k] === _vy) {\n row.push(k);\n break;\n }\n }\n }\n }\n for (var i = 0; i < 16; i++) {\n var mat = new Matrix();\n mat.set(ux[i], uy[i], vx[i], vy[i], 0, 0);\n rotationMatrices.push(mat);\n }\n}\ninit();\n/**\n * @memberof PIXI\n * @typedef {number} GD8Symmetry\n * @see PIXI.groupD8\n */\n/**\n * Implements the dihedral group D8, which is similar to\n * [group D4]{@link http://mathworld.wolfram.com/DihedralGroupD4.html};\n * D8 is the same but with diagonals, and it is used for texture\n * rotations.\n *\n * The directions the U- and V- axes after rotation\n * of an angle of `a: GD8Constant` are the vectors `(uX(a), uY(a))`\n * and `(vX(a), vY(a))`. These aren't necessarily unit vectors.\n *\n * **Origin:**<br>\n * This is the small part of gameofbombs.com portal system. It works.\n * @see PIXI.groupD8.E\n * @see PIXI.groupD8.SE\n * @see PIXI.groupD8.S\n * @see PIXI.groupD8.SW\n * @see PIXI.groupD8.W\n * @see PIXI.groupD8.NW\n * @see PIXI.groupD8.N\n * @see PIXI.groupD8.NE\n * @author Ivan @ivanpopelyshev\n * @namespace PIXI.groupD8\n * @memberof PIXI\n */\nvar groupD8 = {\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 0° | East |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n E: 0,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 45°↻ | Southeast |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SE: 1,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 90°↻ | South |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n S: 2,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 135°↻ | Southwest |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n SW: 3,\n /**\n * | Rotation | Direction |\n * |----------|-----------|\n * | 180° | West |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n W: 4,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -135°/225°↻ | Northwest |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NW: 5,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -90°/270°↻ | North |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n N: 6,\n /**\n * | Rotation | Direction |\n * |-------------|--------------|\n * | -45°/315°↻ | Northeast |\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n NE: 7,\n /**\n * Reflection about Y-axis.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_VERTICAL: 8,\n /**\n * Reflection about the main diagonal.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MAIN_DIAGONAL: 10,\n /**\n * Reflection about X-axis.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n MIRROR_HORIZONTAL: 12,\n /**\n * Reflection about reverse diagonal.\n * @memberof PIXI.groupD8\n * @constant {PIXI.GD8Symmetry}\n */\n REVERSE_DIAGONAL: 14,\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The X-component of the U-axis\n * after rotating the axes.\n */\n uX: function (ind) { return ux[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The Y-component of the U-axis\n * after rotating the axes.\n */\n uY: function (ind) { return uy[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The X-component of the V-axis\n * after rotating the axes.\n */\n vX: function (ind) { return vx[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} ind - sprite rotation angle.\n * @returns {PIXI.GD8Symmetry} The Y-component of the V-axis\n * after rotating the axes.\n */\n vY: function (ind) { return vy[ind]; },\n /**\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - symmetry whose opposite\n * is needed. Only rotations have opposite symmetries while\n * reflections don't.\n * @returns {PIXI.GD8Symmetry} The opposite symmetry of `rotation`\n */\n inv: function (rotation) {\n if (rotation & 8) // true only if between 8 & 15 (reflections)\n {\n return rotation & 15; // or rotation % 16\n }\n return (-rotation) & 7; // or (8 - rotation) % 8\n },\n /**\n * Composes the two D8 operations.\n *\n * Taking `^` as reflection:\n *\n * | | E=0 | S=2 | W=4 | N=6 | E^=8 | S^=10 | W^=12 | N^=14 |\n * |-------|-----|-----|-----|-----|------|-------|-------|-------|\n * | E=0 | E | S | W | N | E^ | S^ | W^ | N^ |\n * | S=2 | S | W | N | E | S^ | W^ | N^ | E^ |\n * | W=4 | W | N | E | S | W^ | N^ | E^ | S^ |\n * | N=6 | N | E | S | W | N^ | E^ | S^ | W^ |\n * | E^=8 | E^ | N^ | W^ | S^ | E | N | W | S |\n * | S^=10 | S^ | E^ | N^ | W^ | S | E | N | W |\n * | W^=12 | W^ | S^ | E^ | N^ | W | S | E | N |\n * | N^=14 | N^ | W^ | S^ | E^ | N | W | S | E |\n *\n * [This is a Cayley table]{@link https://en.wikipedia.org/wiki/Cayley_table}\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation, which\n * is the row in the above cayley table.\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation, which\n * is the column in the above cayley table.\n * @returns {PIXI.GD8Symmetry} Composed operation\n */\n add: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][rotationFirst]); },\n /**\n * Reverse of `add`.\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotationSecond - Second operation\n * @param {PIXI.GD8Symmetry} rotationFirst - First operation\n * @returns {PIXI.GD8Symmetry} Result\n */\n sub: function (rotationSecond, rotationFirst) { return (rotationCayley[rotationSecond][groupD8.inv(rotationFirst)]); },\n /**\n * Adds 180 degrees to rotation, which is a commutative\n * operation.\n * @memberof PIXI.groupD8\n * @param {number} rotation - The number to rotate.\n * @returns {number} Rotated number\n */\n rotate180: function (rotation) { return rotation ^ 4; },\n /**\n * Checks if the rotation angle is vertical, i.e. south\n * or north. It doesn't work for reflections.\n * @memberof PIXI.groupD8\n * @param {PIXI.GD8Symmetry} rotation - The number to check.\n * @returns {boolean} Whether or not the direction is vertical\n */\n isVertical: function (rotation) { return (rotation & 3) === 2; },\n /**\n * Approximates the vector `V(dx,dy)` into one of the\n * eight directions provided by `groupD8`.\n * @memberof PIXI.groupD8\n * @param {number} dx - X-component of the vector\n * @param {number} dy - Y-component of the vector\n * @returns {PIXI.GD8Symmetry} Approximation of the vector into\n * one of the eight symmetries.\n */\n byDirection: function (dx, dy) {\n if (Math.abs(dx) * 2 <= Math.abs(dy)) {\n if (dy >= 0) {\n return groupD8.S;\n }\n return groupD8.N;\n }\n else if (Math.abs(dy) * 2 <= Math.abs(dx)) {\n if (dx > 0) {\n return groupD8.E;\n }\n return groupD8.W;\n }\n else if (dy > 0) {\n if (dx > 0) {\n return groupD8.SE;\n }\n return groupD8.SW;\n }\n else if (dx > 0) {\n return groupD8.NE;\n }\n return groupD8.NW;\n },\n /**\n * Helps sprite to compensate texture packer rotation.\n * @memberof PIXI.groupD8\n * @param {PIXI.Matrix} matrix - sprite world matrix\n * @param {PIXI.GD8Symmetry} rotation - The rotation factor to use.\n * @param {number} tx - sprite anchoring\n * @param {number} ty - sprite anchoring\n */\n matrixAppendRotationInv: function (matrix, rotation, tx, ty) {\n if (tx === void 0) { tx = 0; }\n if (ty === void 0) { ty = 0; }\n // Packer used \"rotation\", we use \"inv(rotation)\"\n var mat = rotationMatrices[groupD8.inv(rotation)];\n mat.tx = tx;\n mat.ty = ty;\n matrix.append(mat);\n },\n};\n\n/**\n * Transform that takes care about its versions.\n * @memberof PIXI\n */\nvar Transform = /** @class */ (function () {\n function Transform() {\n this.worldTransform = new Matrix();\n this.localTransform = new Matrix();\n this.position = new ObservablePoint(this.onChange, this, 0, 0);\n this.scale = new ObservablePoint(this.onChange, this, 1, 1);\n this.pivot = new ObservablePoint(this.onChange, this, 0, 0);\n this.skew = new ObservablePoint(this.updateSkew, this, 0, 0);\n this._rotation = 0;\n this._cx = 1;\n this._sx = 0;\n this._cy = 0;\n this._sy = 1;\n this._localID = 0;\n this._currentLocalID = 0;\n this._worldID = 0;\n this._parentID = 0;\n }\n /** Called when a value changes. */\n Transform.prototype.onChange = function () {\n this._localID++;\n };\n /** Called when the skew or the rotation changes. */\n Transform.prototype.updateSkew = function () {\n this._cx = Math.cos(this._rotation + this.skew.y);\n this._sx = Math.sin(this._rotation + this.skew.y);\n this._cy = -Math.sin(this._rotation - this.skew.x); // cos, added PI/2\n this._sy = Math.cos(this._rotation - this.skew.x); // sin, added PI/2\n this._localID++;\n };\n Transform.prototype.toString = function () {\n return \"[@pixi/math:Transform \"\n + (\"position=(\" + this.position.x + \", \" + this.position.y + \") \")\n + (\"rotation=\" + this.rotation + \" \")\n + (\"scale=(\" + this.scale.x + \", \" + this.scale.y + \") \")\n + (\"skew=(\" + this.skew.x + \", \" + this.skew.y + \") \")\n + \"]\";\n };\n /** Updates the local transformation matrix. */\n Transform.prototype.updateLocalTransform = function () {\n var lt = this.localTransform;\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n // force an update..\n this._parentID = -1;\n }\n };\n /**\n * Updates the local and the world transformation matrices.\n * @param parentTransform - The parent transform\n */\n Transform.prototype.updateTransform = function (parentTransform) {\n var lt = this.localTransform;\n if (this._localID !== this._currentLocalID) {\n // get the matrix values of the displayobject based on its transform properties..\n lt.a = this._cx * this.scale.x;\n lt.b = this._sx * this.scale.x;\n lt.c = this._cy * this.scale.y;\n lt.d = this._sy * this.scale.y;\n lt.tx = this.position.x - ((this.pivot.x * lt.a) + (this.pivot.y * lt.c));\n lt.ty = this.position.y - ((this.pivot.x * lt.b) + (this.pivot.y * lt.d));\n this._currentLocalID = this._localID;\n // force an update..\n this._parentID = -1;\n }\n if (this._parentID !== parentTransform._worldID) {\n // concat the parent matrix with the objects transform.\n var pt = parentTransform.worldTransform;\n var wt = this.worldTransform;\n wt.a = (lt.a * pt.a) + (lt.b * pt.c);\n wt.b = (lt.a * pt.b) + (lt.b * pt.d);\n wt.c = (lt.c * pt.a) + (lt.d * pt.c);\n wt.d = (lt.c * pt.b) + (lt.d * pt.d);\n wt.tx = (lt.tx * pt.a) + (lt.ty * pt.c) + pt.tx;\n wt.ty = (lt.tx * pt.b) + (lt.ty * pt.d) + pt.ty;\n this._parentID = parentTransform._worldID;\n // update the id of the transform..\n this._worldID++;\n }\n };\n /**\n * Decomposes a matrix and sets the transforms properties based on it.\n * @param matrix - The matrix to decompose\n */\n Transform.prototype.setFromMatrix = function (matrix) {\n matrix.decompose(this);\n this._localID++;\n };\n Object.defineProperty(Transform.prototype, \"rotation\", {\n /** The rotation of the object in radians. */\n get: function () {\n return this._rotation;\n },\n set: function (value) {\n if (this._rotation !== value) {\n this._rotation = value;\n this.updateSkew();\n }\n },\n enumerable: false,\n configurable: true\n });\n /** A default (identity) transform. */\n Transform.IDENTITY = new Transform();\n return Transform;\n}());\n\nexport { Circle, DEG_TO_RAD, Ellipse, Matrix, ObservablePoint, PI_2, Point, Polygon, RAD_TO_DEG, Rectangle, RoundedRectangle, SHAPES, Transform, groupD8 };\n//# sourceMappingURL=math.mjs.map\n","/*!\n * @pixi/display - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/display is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nimport { Rectangle, RAD_TO_DEG, DEG_TO_RAD, Transform } from '@pixi/math';\nimport { EventEmitter, removeItems } from '@pixi/utils';\nimport { MASK_TYPES } from '@pixi/constants';\n\n/**\n * Sets the default value for the container property 'sortableChildren'.\n * If set to true, the container will sort its children by zIndex value\n * when updateTransform() is called, or manually if sortChildren() is called.\n *\n * This actually changes the order of elements in the array, so should be treated\n * as a basic solution that is not performant compared to other solutions,\n * such as @link https://github.com/pixijs/pixi-display\n *\n * Also be aware of that this may not work nicely with the addChildAt() function,\n * as the zIndex sorting may cause the child to automatically sorted to another position.\n * @static\n * @constant\n * @name SORTABLE_CHILDREN\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\nsettings.SORTABLE_CHILDREN = false;\n\n/**\n * 'Builder' pattern for bounds rectangles.\n *\n * This could be called an Axis-Aligned Bounding Box.\n * It is not an actual shape. It is a mutable thing; no 'EMPTY' or those kind of problems.\n * @memberof PIXI\n */\nvar Bounds = /** @class */ (function () {\n function Bounds() {\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n this.rect = null;\n this.updateID = -1;\n }\n /**\n * Checks if bounds are empty.\n * @returns - True if empty.\n */\n Bounds.prototype.isEmpty = function () {\n return this.minX > this.maxX || this.minY > this.maxY;\n };\n /** Clears the bounds and resets. */\n Bounds.prototype.clear = function () {\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = -Infinity;\n this.maxY = -Infinity;\n };\n /**\n * Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle\n * It is not guaranteed that it will return tempRect\n * @param rect - Temporary object will be used if AABB is not empty\n * @returns - A rectangle of the bounds\n */\n Bounds.prototype.getRectangle = function (rect) {\n if (this.minX > this.maxX || this.minY > this.maxY) {\n return Rectangle.EMPTY;\n }\n rect = rect || new Rectangle(0, 0, 1, 1);\n rect.x = this.minX;\n rect.y = this.minY;\n rect.width = this.maxX - this.minX;\n rect.height = this.maxY - this.minY;\n return rect;\n };\n /**\n * This function should be inlined when its possible.\n * @param point - The point to add.\n */\n Bounds.prototype.addPoint = function (point) {\n this.minX = Math.min(this.minX, point.x);\n this.maxX = Math.max(this.maxX, point.x);\n this.minY = Math.min(this.minY, point.y);\n this.maxY = Math.max(this.maxY, point.y);\n };\n /**\n * Adds a point, after transformed. This should be inlined when its possible.\n * @param matrix\n * @param point\n */\n Bounds.prototype.addPointMatrix = function (matrix, point) {\n var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d, tx = matrix.tx, ty = matrix.ty;\n var x = (a * point.x) + (c * point.y) + tx;\n var y = (b * point.x) + (d * point.y) + ty;\n this.minX = Math.min(this.minX, x);\n this.maxX = Math.max(this.maxX, x);\n this.minY = Math.min(this.minY, y);\n this.maxY = Math.max(this.maxY, y);\n };\n /**\n * Adds a quad, not transformed\n * @param vertices - The verts to add.\n */\n Bounds.prototype.addQuad = function (vertices) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n var x = vertices[0];\n var y = vertices[1];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n x = vertices[2];\n y = vertices[3];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n x = vertices[4];\n y = vertices[5];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n x = vertices[6];\n y = vertices[7];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n /**\n * Adds sprite frame, transformed.\n * @param transform - transform to apply\n * @param x0 - left X of frame\n * @param y0 - top Y of frame\n * @param x1 - right X of frame\n * @param y1 - bottom Y of frame\n */\n Bounds.prototype.addFrame = function (transform, x0, y0, x1, y1) {\n this.addFrameMatrix(transform.worldTransform, x0, y0, x1, y1);\n };\n /**\n * Adds sprite frame, multiplied by matrix\n * @param matrix - matrix to apply\n * @param x0 - left X of frame\n * @param y0 - top Y of frame\n * @param x1 - right X of frame\n * @param y1 - bottom Y of frame\n */\n Bounds.prototype.addFrameMatrix = function (matrix, x0, y0, x1, y1) {\n var a = matrix.a;\n var b = matrix.b;\n var c = matrix.c;\n var d = matrix.d;\n var tx = matrix.tx;\n var ty = matrix.ty;\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n var x = (a * x0) + (c * y0) + tx;\n var y = (b * x0) + (d * y0) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n x = (a * x1) + (c * y0) + tx;\n y = (b * x1) + (d * y0) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n x = (a * x0) + (c * y1) + tx;\n y = (b * x0) + (d * y1) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n x = (a * x1) + (c * y1) + tx;\n y = (b * x1) + (d * y1) + ty;\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n /**\n * Adds screen vertices from array\n * @param vertexData - calculated vertices\n * @param beginOffset - begin offset\n * @param endOffset - end offset, excluded\n */\n Bounds.prototype.addVertexData = function (vertexData, beginOffset, endOffset) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n for (var i = beginOffset; i < endOffset; i += 2) {\n var x = vertexData[i];\n var y = vertexData[i + 1];\n minX = x < minX ? x : minX;\n minY = y < minY ? y : minY;\n maxX = x > maxX ? x : maxX;\n maxY = y > maxY ? y : maxY;\n }\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n /**\n * Add an array of mesh vertices\n * @param transform - mesh transform\n * @param vertices - mesh coordinates in array\n * @param beginOffset - begin offset\n * @param endOffset - end offset, excluded\n */\n Bounds.prototype.addVertices = function (transform, vertices, beginOffset, endOffset) {\n this.addVerticesMatrix(transform.worldTransform, vertices, beginOffset, endOffset);\n };\n /**\n * Add an array of mesh vertices.\n * @param matrix - mesh matrix\n * @param vertices - mesh coordinates in array\n * @param beginOffset - begin offset\n * @param endOffset - end offset, excluded\n * @param padX - x padding\n * @param padY - y padding\n */\n Bounds.prototype.addVerticesMatrix = function (matrix, vertices, beginOffset, endOffset, padX, padY) {\n if (padX === void 0) { padX = 0; }\n if (padY === void 0) { padY = padX; }\n var a = matrix.a;\n var b = matrix.b;\n var c = matrix.c;\n var d = matrix.d;\n var tx = matrix.tx;\n var ty = matrix.ty;\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n for (var i = beginOffset; i < endOffset; i += 2) {\n var rawX = vertices[i];\n var rawY = vertices[i + 1];\n var x = (a * rawX) + (c * rawY) + tx;\n var y = (d * rawY) + (b * rawX) + ty;\n minX = Math.min(minX, x - padX);\n maxX = Math.max(maxX, x + padX);\n minY = Math.min(minY, y - padY);\n maxY = Math.max(maxY, y + padY);\n }\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n /**\n * Adds other {@link Bounds}.\n * @param bounds - The Bounds to be added\n */\n Bounds.prototype.addBounds = function (bounds) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n this.minX = bounds.minX < minX ? bounds.minX : minX;\n this.minY = bounds.minY < minY ? bounds.minY : minY;\n this.maxX = bounds.maxX > maxX ? bounds.maxX : maxX;\n this.maxY = bounds.maxY > maxY ? bounds.maxY : maxY;\n };\n /**\n * Adds other Bounds, masked with Bounds.\n * @param bounds - The Bounds to be added.\n * @param mask - TODO\n */\n Bounds.prototype.addBoundsMask = function (bounds, mask) {\n var _minX = bounds.minX > mask.minX ? bounds.minX : mask.minX;\n var _minY = bounds.minY > mask.minY ? bounds.minY : mask.minY;\n var _maxX = bounds.maxX < mask.maxX ? bounds.maxX : mask.maxX;\n var _maxY = bounds.maxY < mask.maxY ? bounds.maxY : mask.maxY;\n if (_minX <= _maxX && _minY <= _maxY) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n };\n /**\n * Adds other Bounds, multiplied by matrix. Bounds shouldn't be empty.\n * @param bounds - other bounds\n * @param matrix - multiplicator\n */\n Bounds.prototype.addBoundsMatrix = function (bounds, matrix) {\n this.addFrameMatrix(matrix, bounds.minX, bounds.minY, bounds.maxX, bounds.maxY);\n };\n /**\n * Adds other Bounds, masked with Rectangle.\n * @param bounds - TODO\n * @param area - TODO\n */\n Bounds.prototype.addBoundsArea = function (bounds, area) {\n var _minX = bounds.minX > area.x ? bounds.minX : area.x;\n var _minY = bounds.minY > area.y ? bounds.minY : area.y;\n var _maxX = bounds.maxX < area.x + area.width ? bounds.maxX : (area.x + area.width);\n var _maxY = bounds.maxY < area.y + area.height ? bounds.maxY : (area.y + area.height);\n if (_minX <= _maxX && _minY <= _maxY) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n this.minX = _minX < minX ? _minX : minX;\n this.minY = _minY < minY ? _minY : minY;\n this.maxX = _maxX > maxX ? _maxX : maxX;\n this.maxY = _maxY > maxY ? _maxY : maxY;\n }\n };\n /**\n * Pads bounds object, making it grow in all directions.\n * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n * @param paddingX - The horizontal padding amount.\n * @param paddingY - The vertical padding amount.\n */\n Bounds.prototype.pad = function (paddingX, paddingY) {\n if (paddingX === void 0) { paddingX = 0; }\n if (paddingY === void 0) { paddingY = paddingX; }\n if (!this.isEmpty()) {\n this.minX -= paddingX;\n this.maxX += paddingX;\n this.minY -= paddingY;\n this.maxY += paddingY;\n }\n };\n /**\n * Adds padded frame. (x0, y0) should be strictly less than (x1, y1)\n * @param x0 - left X of frame\n * @param y0 - top Y of frame\n * @param x1 - right X of frame\n * @param y1 - bottom Y of frame\n * @param padX - padding X\n * @param padY - padding Y\n */\n Bounds.prototype.addFramePad = function (x0, y0, x1, y1, padX, padY) {\n x0 -= padX;\n y0 -= padY;\n x1 += padX;\n y1 += padY;\n this.minX = this.minX < x0 ? this.minX : x0;\n this.maxX = this.maxX > x1 ? this.maxX : x1;\n this.minY = this.minY < y0 ? this.minY : y0;\n this.maxY = this.maxY > y1 ? this.maxY : y1;\n };\n return Bounds;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * The base class for all objects that are rendered on the screen.\n *\n * This is an abstract class and can not be used on its own; rather it should be extended.\n *\n * ## Display objects implemented in PixiJS\n *\n * | Display Object | Description |\n * | ------------------------------- | --------------------------------------------------------------------- |\n * | {@link PIXI.Container} | Adds support for `children` to DisplayObject |\n * | {@link PIXI.Graphics} | Shape-drawing display object similar to the Canvas API |\n * | {@link PIXI.Sprite} | Draws textures (i.e. images) |\n * | {@link PIXI.Text} | Draws text using the Canvas API internally |\n * | {@link PIXI.BitmapText} | More scaleable solution for text rendering, reusing glyph textures |\n * | {@link PIXI.TilingSprite} | Draws textures/images in a tiled fashion |\n * | {@link PIXI.AnimatedSprite} | Draws an animation of multiple images |\n * | {@link PIXI.Mesh} | Provides a lower-level API for drawing meshes with custom data |\n * | {@link PIXI.NineSlicePlane} | Mesh-related |\n * | {@link PIXI.SimpleMesh} | v4-compatible mesh |\n * | {@link PIXI.SimplePlane} | Mesh-related |\n * | {@link PIXI.SimpleRope} | Mesh-related |\n *\n * ## Transforms\n *\n * The [transform]{@link DisplayObject#transform} of a display object describes the projection from its\n * local coordinate space to its parent's local coordinate space. The following properties are derived\n * from the transform:\n *\n * <table>\n * <thead>\n * <tr>\n * <th>Property</th>\n * <th>Description</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>[pivot]{@link PIXI.DisplayObject#pivot}</td>\n * <td>\n * Invariant under rotation, scaling, and skewing. The projection of into the parent's space of the pivot\n * is equal to position, regardless of the other three transformations. In other words, It is the center of\n * rotation, scaling, and skewing.\n * </td>\n * </tr>\n * <tr>\n * <td>[position]{@link PIXI.DisplayObject#position}</td>\n * <td>\n * Translation. This is the position of the [pivot]{@link PIXI.DisplayObject#pivot} in the parent's local\n * space. The default value of the pivot is the origin (0,0). If the top-left corner of your display object\n * is (0,0) in its local space, then the position will be its top-left corner in the parent's local space.\n * </td>\n * </tr>\n * <tr>\n * <td>[scale]{@link PIXI.DisplayObject#scale}</td>\n * <td>\n * Scaling. This will stretch (or compress) the display object's projection. The scale factors are along the\n * local coordinate axes. In other words, the display object is scaled before rotated or skewed. The center\n * of scaling is the [pivot]{@link PIXI.DisplayObject#pivot}.\n * </td>\n * </tr>\n * <tr>\n * <td>[rotation]{@link PIXI.DisplayObject#rotation}</td>\n * <td>\n * Rotation. This will rotate the display object's projection by this angle (in radians).\n * </td>\n * </tr>\n * <tr>\n * <td>[skew]{@link PIXI.DisplayObject#skew}</td>\n * <td>\n * <p>Skewing. This can be used to deform a rectangular display object into a parallelogram.</p>\n * <p>\n * In PixiJS, skew has a slightly different behaviour than the conventional meaning. It can be\n * thought of the net rotation applied to the coordinate axes (separately). For example, if \"skew.x\" is\n * ⍺ and \"skew.y\" is β, then the line x = 0 will be rotated by ⍺ (y = -x*cot⍺) and the line y = 0 will be\n * rotated by β (y = x*tanβ). A line y = x*tanϴ (i.e. a line at angle ϴ to the x-axis in local-space) will\n * be rotated by an angle between ⍺ and β.\n * </p>\n * <p>\n * It can be observed that if skew is applied equally to both axes, then it will be equivalent to applying\n * a rotation. Indeed, if \"skew.x\" = -ϴ and \"skew.y\" = ϴ, it will produce an equivalent of \"rotation\" = ϴ.\n * </p>\n * <p>\n * Another quite interesting observation is that \"skew.x\", \"skew.y\", rotation are communtative operations. Indeed,\n * because rotation is essentially a careful combination of the two.\n * </p>\n * </td>\n * </tr>\n * <tr>\n * <td>angle</td>\n * <td>Rotation. This is an alias for [rotation]{@link PIXI.DisplayObject#rotation}, but in degrees.</td>\n * </tr>\n * <tr>\n * <td>x</td>\n * <td>Translation. This is an alias for position.x!</td>\n * </tr>\n * <tr>\n * <td>y</td>\n * <td>Translation. This is an alias for position.y!</td>\n * </tr>\n * <tr>\n * <td>width</td>\n * <td>\n * Implemented in [Container]{@link PIXI.Container}. Scaling. The width property calculates scale.x by dividing\n * the \"requested\" width by the local bounding box width. It is indirectly an abstraction over scale.x, and there\n * is no concept of user-defined width.\n * </td>\n * </tr>\n * <tr>\n * <td>height</td>\n * <td>\n * Implemented in [Container]{@link PIXI.Container}. Scaling. The height property calculates scale.y by dividing\n * the \"requested\" height by the local bounding box height. It is indirectly an abstraction over scale.y, and there\n * is no concept of user-defined height.\n * </td>\n * </tr>\n * </tbody>\n * </table>\n *\n * ## Bounds\n *\n * The bounds of a display object is defined by the minimum axis-aligned rectangle in world space that can fit\n * around it. The abstract `calculateBounds` method is responsible for providing it (and it should use the\n * `worldTransform` to calculate in world space).\n *\n * There are a few additional types of bounding boxes:\n *\n * | Bounds | Description |\n * | --------------------- | ---------------------------------------------------------------------------------------- |\n * | World Bounds | This is synonymous is the regular bounds described above. See `getBounds()`. |\n * | Local Bounds | This the axis-aligned bounding box in the parent's local space. See `getLocalBounds()`. |\n * | Render Bounds | The bounds, but including extra rendering effects like filter padding. |\n * | Projected Bounds | The bounds of the projected display object onto the screen. Usually equals world bounds. |\n * | Relative Bounds | The bounds of a display object when projected onto a ancestor's (or parent's) space. |\n * | Natural Bounds | The bounds of an object in its own local space (not parent's space, like in local bounds)|\n * | Content Bounds | The natural bounds when excluding all children of a `Container`. |\n *\n * ### calculateBounds\n *\n * [Container]{@link Container} already implements `calculateBounds` in a manner that includes children.\n *\n * But for a non-Container display object, the `calculateBounds` method must be overridden in order for `getBounds` and\n * `getLocalBounds` to work. This method must write the bounds into `this._bounds`.\n *\n * Generally, the following technique works for most simple cases: take the list of points\n * forming the \"hull\" of the object (i.e. outline of the object's shape), and then add them\n * using {@link PIXI.Bounds#addPointMatrix}.\n *\n * ```js\n * calculateBounds(): void\n * {\n * const points = [...];\n *\n * for (let i = 0, j = points.length; i < j; i++)\n * {\n * this._bounds.addPointMatrix(this.worldTransform, points[i]);\n * }\n * }\n * ```\n *\n * You can optimize this for a large number of points by using {@link PIXI.Bounds#addVerticesMatrix} to pass them\n * in one array together.\n *\n * ## Alpha\n *\n * This alpha sets a display object's **relative opacity** w.r.t its parent. For example, if the alpha of a display\n * object is 0.5 and its parent's alpha is 0.5, then it will be rendered with 25% opacity (assuming alpha is not\n * applied on any ancestor further up the chain).\n *\n * The alpha with which the display object will be rendered is called the [worldAlpha]{@link PIXI.DisplayObject#worldAlpha}.\n *\n * ## Renderable vs Visible\n *\n * The `renderable` and `visible` properties can be used to prevent a display object from being rendered to the\n * screen. However, there is a subtle difference between the two. When using `renderable`, the transforms of the display\n * object (and its children subtree) will continue to be calculated. When using `visible`, the transforms will not\n * be calculated.\n *\n * It is recommended that applications use the `renderable` property for culling. See\n * [@pixi-essentials/cull]{@link https://www.npmjs.com/package/@pixi-essentials/cull} or\n * [pixi-cull]{@link https://www.npmjs.com/package/pixi-cull} for more details.\n *\n * Otherwise, to prevent an object from rendering in the general-purpose sense - `visible` is the property to use. This\n * one is also better in terms of performance.\n * @memberof PIXI\n */\nvar DisplayObject = /** @class */ (function (_super) {\n __extends(DisplayObject, _super);\n function DisplayObject() {\n var _this = _super.call(this) || this;\n _this.tempDisplayObjectParent = null;\n // TODO: need to create Transform from factory\n _this.transform = new Transform();\n _this.alpha = 1;\n _this.visible = true;\n _this.renderable = true;\n _this.cullable = false;\n _this.cullArea = null;\n _this.parent = null;\n _this.worldAlpha = 1;\n _this._lastSortedIndex = 0;\n _this._zIndex = 0;\n _this.filterArea = null;\n _this.filters = null;\n _this._enabledFilters = null;\n _this._bounds = new Bounds();\n _this._localBounds = null;\n _this._boundsID = 0;\n _this._boundsRect = null;\n _this._localBoundsRect = null;\n _this._mask = null;\n _this._maskRefCount = 0;\n _this._destroyed = false;\n _this.isSprite = false;\n _this.isMask = false;\n return _this;\n }\n /**\n * Mixes all enumerable properties and methods from a source object to DisplayObject.\n * @param source - The source of properties and methods to mix in.\n */\n DisplayObject.mixin = function (source) {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(DisplayObject.prototype, Object.getOwnPropertyDescriptors(source));\n // get all the enumerable property keys\n var keys = Object.keys(source);\n // loop through properties\n for (var i = 0; i < keys.length; ++i) {\n var propertyName = keys[i];\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(DisplayObject.prototype, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));\n }\n };\n Object.defineProperty(DisplayObject.prototype, \"destroyed\", {\n /**\n * Fired when this DisplayObject is added to a Container.\n * @instance\n * @event added\n * @param {PIXI.Container} container - The container added to.\n */\n /**\n * Fired when this DisplayObject is removed from a Container.\n * @instance\n * @event removed\n * @param {PIXI.Container} container - The container removed from.\n */\n /**\n * Fired when this DisplayObject is destroyed. This event is emitted once\n * destroy is finished.\n * @instance\n * @event destroyed\n */\n /** Readonly flag for destroyed display objects. */\n get: function () {\n return this._destroyed;\n },\n enumerable: false,\n configurable: true\n });\n /** Recursively updates transform of all objects from the root to this one internal function for toLocal() */\n DisplayObject.prototype._recursivePostUpdateTransform = function () {\n if (this.parent) {\n this.parent._recursivePostUpdateTransform();\n this.transform.updateTransform(this.parent.transform);\n }\n else {\n this.transform.updateTransform(this._tempDisplayObjectParent.transform);\n }\n };\n /** Updates the object transform for rendering. TODO - Optimization pass! */\n DisplayObject.prototype.updateTransform = function () {\n this._boundsID++;\n this.transform.updateTransform(this.parent.transform);\n // multiply the alphas..\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n };\n /**\n * Calculates and returns the (world) bounds of the display object as a [Rectangle]{@link PIXI.Rectangle}.\n *\n * This method is expensive on containers with a large subtree (like the stage). This is because the bounds\n * of a container depend on its children's bounds, which recursively causes all bounds in the subtree to\n * be recalculated. The upside, however, is that calling `getBounds` once on a container will indeed update\n * the bounds of all children (the whole subtree, in fact). This side effect should be exploited by using\n * `displayObject._bounds.getRectangle()` when traversing through all the bounds in a scene graph. Otherwise,\n * calling `getBounds` on each object in a subtree will cause the total cost to increase quadratically as\n * its height increases.\n *\n * The transforms of all objects in a container's **subtree** and of all **ancestors** are updated.\n * The world bounds of all display objects in a container's **subtree** will also be recalculated.\n *\n * The `_bounds` object stores the last calculation of the bounds. You can use to entirely skip bounds\n * calculation if needed.\n *\n * ```js\n * const lastCalculatedBounds = displayObject._bounds.getRectangle(optionalRect);\n * ```\n *\n * Do know that usage of `getLocalBounds` can corrupt the `_bounds` of children (the whole subtree, actually). This\n * is a known issue that has not been solved. See [getLocalBounds]{@link PIXI.DisplayObject#getLocalBounds} for more\n * details.\n *\n * `getBounds` should be called with `skipUpdate` equal to `true` in a render() call. This is because the transforms\n * are guaranteed to be update-to-date. In fact, recalculating inside a render() call may cause corruption in certain\n * cases.\n * @param skipUpdate - Setting to `true` will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @param rect - Optional rectangle to store the result of the bounds calculation.\n * @returns - The minimum axis-aligned rectangle in world space that fits around this object.\n */\n DisplayObject.prototype.getBounds = function (skipUpdate, rect) {\n if (!skipUpdate) {\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n }\n else {\n this._recursivePostUpdateTransform();\n this.updateTransform();\n }\n }\n if (this._bounds.updateID !== this._boundsID) {\n this.calculateBounds();\n this._bounds.updateID = this._boundsID;\n }\n if (!rect) {\n if (!this._boundsRect) {\n this._boundsRect = new Rectangle();\n }\n rect = this._boundsRect;\n }\n return this._bounds.getRectangle(rect);\n };\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object.\n * @param rect - Optional rectangle to store the result of the bounds calculation.\n * @returns - The rectangular bounding area.\n */\n DisplayObject.prototype.getLocalBounds = function (rect) {\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n if (!this._localBounds) {\n this._localBounds = new Bounds();\n }\n var transformRef = this.transform;\n var parentRef = this.parent;\n this.parent = null;\n this.transform = this._tempDisplayObjectParent.transform;\n var worldBounds = this._bounds;\n var worldBoundsID = this._boundsID;\n this._bounds = this._localBounds;\n var bounds = this.getBounds(false, rect);\n this.parent = parentRef;\n this.transform = transformRef;\n this._bounds = worldBounds;\n this._bounds.updateID += this._boundsID - worldBoundsID; // reflect side-effects\n return bounds;\n };\n /**\n * Calculates the global position of the display object.\n * @param position - The world origin to calculate from.\n * @param point - A Point object in which to store the value, optional\n * (otherwise will create a new Point).\n * @param skipUpdate - Should we skip the update transform.\n * @returns - A point object representing the position of this object.\n */\n DisplayObject.prototype.toGlobal = function (position, point, skipUpdate) {\n if (skipUpdate === void 0) { skipUpdate = false; }\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n }\n else {\n this.displayObjectUpdateTransform();\n }\n }\n // don't need to update the lot\n return this.worldTransform.apply(position, point);\n };\n /**\n * Calculates the local position of the display object relative to another point.\n * @param position - The world origin to calculate from.\n * @param from - The DisplayObject to calculate the global position from.\n * @param point - A Point object in which to store the value, optional\n * (otherwise will create a new Point).\n * @param skipUpdate - Should we skip the update transform\n * @returns - A point object representing the position of this object\n */\n DisplayObject.prototype.toLocal = function (position, from, point, skipUpdate) {\n if (from) {\n position = from.toGlobal(position, point, skipUpdate);\n }\n if (!skipUpdate) {\n this._recursivePostUpdateTransform();\n // this parent check is for just in case the item is a root object.\n // If it is we need to give it a temporary parent so that displayObjectUpdateTransform works correctly\n // this is mainly to avoid a parent check in the main loop. Every little helps for performance :)\n if (!this.parent) {\n this.parent = this._tempDisplayObjectParent;\n this.displayObjectUpdateTransform();\n this.parent = null;\n }\n else {\n this.displayObjectUpdateTransform();\n }\n }\n // simply apply the matrix..\n return this.worldTransform.applyInverse(position, point);\n };\n /**\n * Set the parent Container of this DisplayObject.\n * @param container - The Container to add this DisplayObject to.\n * @returns - The Container that this DisplayObject was added to.\n */\n DisplayObject.prototype.setParent = function (container) {\n if (!container || !container.addChild) {\n throw new Error('setParent: Argument must be a Container');\n }\n container.addChild(this);\n return container;\n };\n /**\n * Convenience function to set the position, scale, skew and pivot at once.\n * @param x - The X position\n * @param y - The Y position\n * @param scaleX - The X scale value\n * @param scaleY - The Y scale value\n * @param rotation - The rotation\n * @param skewX - The X skew value\n * @param skewY - The Y skew value\n * @param pivotX - The X pivot value\n * @param pivotY - The Y pivot value\n * @returns - The DisplayObject instance\n */\n DisplayObject.prototype.setTransform = function (x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (scaleX === void 0) { scaleX = 1; }\n if (scaleY === void 0) { scaleY = 1; }\n if (rotation === void 0) { rotation = 0; }\n if (skewX === void 0) { skewX = 0; }\n if (skewY === void 0) { skewY = 0; }\n if (pivotX === void 0) { pivotX = 0; }\n if (pivotY === void 0) { pivotY = 0; }\n this.position.x = x;\n this.position.y = y;\n this.scale.x = !scaleX ? 1 : scaleX;\n this.scale.y = !scaleY ? 1 : scaleY;\n this.rotation = rotation;\n this.skew.x = skewX;\n this.skew.y = skewY;\n this.pivot.x = pivotX;\n this.pivot.y = pivotY;\n return this;\n };\n /**\n * Base destroy method for generic display objects. This will automatically\n * remove the display object from its parent Container as well as remove\n * all current event listeners and internal references. Do not use a DisplayObject\n * after calling `destroy()`.\n * @param _options\n */\n DisplayObject.prototype.destroy = function (_options) {\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this._destroyed = true;\n this.transform = null;\n this.parent = null;\n this._bounds = null;\n this.mask = null;\n this.cullArea = null;\n this.filters = null;\n this.filterArea = null;\n this.hitArea = null;\n this.interactive = false;\n this.interactiveChildren = false;\n this.emit('destroyed');\n this.removeAllListeners();\n };\n Object.defineProperty(DisplayObject.prototype, \"_tempDisplayObjectParent\", {\n /**\n * @protected\n * @member {PIXI.Container}\n */\n get: function () {\n if (this.tempDisplayObjectParent === null) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n this.tempDisplayObjectParent = new TemporaryDisplayObject();\n }\n return this.tempDisplayObjectParent;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Used in Renderer, cacheAsBitmap and other places where you call an `updateTransform` on root\n *\n * ```\n * const cacheParent = elem.enableTempParent();\n * elem.updateTransform();\n * elem.disableTempParent(cacheParent);\n * ```\n * @returns - current parent\n */\n DisplayObject.prototype.enableTempParent = function () {\n var myParent = this.parent;\n this.parent = this._tempDisplayObjectParent;\n return myParent;\n };\n /**\n * Pair method for `enableTempParent`\n * @param cacheParent - Actual parent of element\n */\n DisplayObject.prototype.disableTempParent = function (cacheParent) {\n this.parent = cacheParent;\n };\n Object.defineProperty(DisplayObject.prototype, \"x\", {\n /**\n * The position of the displayObject on the x axis relative to the local coordinates of the parent.\n * An alias to position.x\n */\n get: function () {\n return this.position.x;\n },\n set: function (value) {\n this.transform.position.x = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"y\", {\n /**\n * The position of the displayObject on the y axis relative to the local coordinates of the parent.\n * An alias to position.y\n */\n get: function () {\n return this.position.y;\n },\n set: function (value) {\n this.transform.position.y = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"worldTransform\", {\n /**\n * Current transform of the object based on world (parent) factors.\n * @readonly\n */\n get: function () {\n return this.transform.worldTransform;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"localTransform\", {\n /**\n * Current transform of the object based on local factors: position, scale, other stuff.\n * @readonly\n */\n get: function () {\n return this.transform.localTransform;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"position\", {\n /**\n * The coordinate of the object relative to the local coordinates of the parent.\n * @since 4.0.0\n */\n get: function () {\n return this.transform.position;\n },\n set: function (value) {\n this.transform.position.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"scale\", {\n /**\n * The scale factors of this object along the local coordinate axes.\n *\n * The default scale is (1, 1).\n * @since 4.0.0\n */\n get: function () {\n return this.transform.scale;\n },\n set: function (value) {\n this.transform.scale.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"pivot\", {\n /**\n * The center of rotation, scaling, and skewing for this display object in its local space. The `position`\n * is the projection of `pivot` in the parent's local space.\n *\n * By default, the pivot is the origin (0, 0).\n * @since 4.0.0\n */\n get: function () {\n return this.transform.pivot;\n },\n set: function (value) {\n this.transform.pivot.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"skew\", {\n /**\n * The skew factor for the object in radians.\n * @since 4.0.0\n */\n get: function () {\n return this.transform.skew;\n },\n set: function (value) {\n this.transform.skew.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"rotation\", {\n /**\n * The rotation of the object in radians.\n * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.\n */\n get: function () {\n return this.transform.rotation;\n },\n set: function (value) {\n this.transform.rotation = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"angle\", {\n /**\n * The angle of the object in degrees.\n * 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.\n */\n get: function () {\n return this.transform.rotation * RAD_TO_DEG;\n },\n set: function (value) {\n this.transform.rotation = value * DEG_TO_RAD;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"zIndex\", {\n /**\n * The zIndex of the displayObject.\n *\n * If a container has the sortableChildren property set to true, children will be automatically\n * sorted by zIndex value; a higher value will mean it will be moved towards the end of the array,\n * and thus rendered on top of other display objects within the same container.\n * @see PIXI.Container#sortableChildren\n */\n get: function () {\n return this._zIndex;\n },\n set: function (value) {\n this._zIndex = value;\n if (this.parent) {\n this.parent.sortDirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"worldVisible\", {\n /**\n * Indicates if the object is globally visible.\n * @readonly\n */\n get: function () {\n var item = this;\n do {\n if (!item.visible) {\n return false;\n }\n item = item.parent;\n } while (item);\n return true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DisplayObject.prototype, \"mask\", {\n /**\n * Sets a mask for the displayObject. A mask is an object that limits the visibility of an\n * object to the shape of the mask applied to it. In PixiJS a regular mask must be a\n * {@link PIXI.Graphics} or a {@link PIXI.Sprite} object. This allows for much faster masking in canvas as it\n * utilities shape clipping. Furthermore, a mask of an object must be in the subtree of its parent.\n * Otherwise, `getLocalBounds` may calculate incorrect bounds, which makes the container's width and height wrong.\n * To remove a mask, set this property to `null`.\n *\n * For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.\n * @example\n * const graphics = new PIXI.Graphics();\n * graphics.beginFill(0xFF3300);\n * graphics.drawRect(50, 250, 100, 100);\n * graphics.endFill();\n *\n * const sprite = new PIXI.Sprite(texture);\n * sprite.mask = graphics;\n * @todo At the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask.\n */\n get: function () {\n return this._mask;\n },\n set: function (value) {\n if (this._mask === value) {\n return;\n }\n if (this._mask) {\n var maskObject = (this._mask.isMaskData\n ? this._mask.maskObject : this._mask);\n if (maskObject) {\n maskObject._maskRefCount--;\n if (maskObject._maskRefCount === 0) {\n maskObject.renderable = true;\n maskObject.isMask = false;\n }\n }\n }\n this._mask = value;\n if (this._mask) {\n var maskObject = (this._mask.isMaskData\n ? this._mask.maskObject : this._mask);\n if (maskObject) {\n if (maskObject._maskRefCount === 0) {\n maskObject.renderable = false;\n maskObject.isMask = true;\n }\n maskObject._maskRefCount++;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return DisplayObject;\n}(EventEmitter));\n/**\n * @private\n */\nvar TemporaryDisplayObject = /** @class */ (function (_super) {\n __extends(TemporaryDisplayObject, _super);\n function TemporaryDisplayObject() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.sortDirty = null;\n return _this;\n }\n return TemporaryDisplayObject;\n}(DisplayObject));\n/**\n * DisplayObject default updateTransform, does not update children of container.\n * Will crash if there's no parent element.\n * @memberof PIXI.DisplayObject#\n * @method displayObjectUpdateTransform\n */\nDisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform;\n\nfunction sortChildren(a, b) {\n if (a.zIndex === b.zIndex) {\n return a._lastSortedIndex - b._lastSortedIndex;\n }\n return a.zIndex - b.zIndex;\n}\n/**\n * Container is a general-purpose display object that holds children. It also adds built-in support for advanced\n * rendering features like masking and filtering.\n *\n * It is the base class of all display objects that act as a container for other objects, including Graphics\n * and Sprite.\n *\n * ```js\n * import { BlurFilter } from '@pixi/filter-blur';\n * import { Container } from '@pixi/display';\n * import { Graphics } from '@pixi/graphics';\n * import { Sprite } from '@pixi/sprite';\n *\n * let container = new Container();\n * let sprite = Sprite.from(\"https://s3-us-west-2.amazonaws.com/s.cdpn.io/693612/IaUrttj.png\");\n *\n * sprite.width = 512;\n * sprite.height = 512;\n *\n * // Adds a sprite as a child to this container. As a result, the sprite will be rendered whenever the container\n * // is rendered.\n * container.addChild(sprite);\n *\n * // Blurs whatever is rendered by the container\n * container.filters = [new BlurFilter()];\n *\n * // Only the contents within a circle at the center should be rendered onto the screen.\n * container.mask = new Graphics()\n * .beginFill(0xffffff)\n * .drawCircle(sprite.width / 2, sprite.height / 2, Math.min(sprite.width, sprite.height) / 2)\n * .endFill();\n * ```\n * @memberof PIXI\n */\nvar Container = /** @class */ (function (_super) {\n __extends(Container, _super);\n function Container() {\n var _this = _super.call(this) || this;\n _this.children = [];\n _this.sortableChildren = settings.SORTABLE_CHILDREN;\n _this.sortDirty = false;\n return _this;\n /**\n * Fired when a DisplayObject is added to this Container.\n * @event PIXI.Container#childAdded\n * @param {PIXI.DisplayObject} child - The child added to the Container.\n * @param {PIXI.Container} container - The container that added the child.\n * @param {number} index - The children's index of the added child.\n */\n /**\n * Fired when a DisplayObject is removed from this Container.\n * @event PIXI.DisplayObject#childRemoved\n * @param {PIXI.DisplayObject} child - The child removed from the Container.\n * @param {PIXI.Container} container - The container that removed the child.\n * @param {number} index - The former children's index of the removed child\n */\n }\n /**\n * Overridable method that can be used by Container subclasses whenever the children array is modified.\n * @param _length\n */\n Container.prototype.onChildrenChange = function (_length) {\n /* empty */\n };\n /**\n * Adds one or more children to the container.\n *\n * Multiple items can be added like so: `myContainer.addChild(thingOne, thingTwo, thingThree)`\n * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to add to the container\n * @returns {PIXI.DisplayObject} - The first child that was added.\n */\n Container.prototype.addChild = function () {\n var arguments$1 = arguments;\n\n var children = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n children[_i] = arguments$1[_i];\n }\n // if there is only one argument we can bypass looping through the them\n if (children.length > 1) {\n // loop through the array and add all children\n for (var i = 0; i < children.length; i++) {\n // eslint-disable-next-line prefer-rest-params\n this.addChild(children[i]);\n }\n }\n else {\n var child = children[0];\n // if the child has a parent then lets remove it as PixiJS objects can only exist in one place\n if (child.parent) {\n child.parent.removeChild(child);\n }\n child.parent = this;\n this.sortDirty = true;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n this.children.push(child);\n // ensure bounds will be recalculated\n this._boundsID++;\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(this.children.length - 1);\n this.emit('childAdded', child, this, this.children.length - 1);\n child.emit('added', this);\n }\n return children[0];\n };\n /**\n * Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown\n * @param {PIXI.DisplayObject} child - The child to add\n * @param {number} index - The index to place the child in\n * @returns {PIXI.DisplayObject} The child that was added.\n */\n Container.prototype.addChildAt = function (child, index) {\n if (index < 0 || index > this.children.length) {\n throw new Error(child + \"addChildAt: The index \" + index + \" supplied is out of bounds \" + this.children.length);\n }\n if (child.parent) {\n child.parent.removeChild(child);\n }\n child.parent = this;\n this.sortDirty = true;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n this.children.splice(index, 0, child);\n // ensure bounds will be recalculated\n this._boundsID++;\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('added', this);\n this.emit('childAdded', child, this, index);\n return child;\n };\n /**\n * Swaps the position of 2 Display Objects within this container.\n * @param child - First display object to swap\n * @param child2 - Second display object to swap\n */\n Container.prototype.swapChildren = function (child, child2) {\n if (child === child2) {\n return;\n }\n var index1 = this.getChildIndex(child);\n var index2 = this.getChildIndex(child2);\n this.children[index1] = child2;\n this.children[index2] = child;\n this.onChildrenChange(index1 < index2 ? index1 : index2);\n };\n /**\n * Returns the index position of a child DisplayObject instance\n * @param child - The DisplayObject instance to identify\n * @returns - The index position of the child display object to identify\n */\n Container.prototype.getChildIndex = function (child) {\n var index = this.children.indexOf(child);\n if (index === -1) {\n throw new Error('The supplied DisplayObject must be a child of the caller');\n }\n return index;\n };\n /**\n * Changes the position of an existing child in the display object container\n * @param child - The child DisplayObject instance for which you want to change the index number\n * @param index - The resulting index number for the child display object\n */\n Container.prototype.setChildIndex = function (child, index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error(\"The index \" + index + \" supplied is out of bounds \" + this.children.length);\n }\n var currentIndex = this.getChildIndex(child);\n removeItems(this.children, currentIndex, 1); // remove from old position\n this.children.splice(index, 0, child); // add at new position\n this.onChildrenChange(index);\n };\n /**\n * Returns the child at the specified index\n * @param index - The index to get the child at\n * @returns - The child at the given index, if any.\n */\n Container.prototype.getChildAt = function (index) {\n if (index < 0 || index >= this.children.length) {\n throw new Error(\"getChildAt: Index (\" + index + \") does not exist.\");\n }\n return this.children[index];\n };\n /**\n * Removes one or more children from the container.\n * @param {...PIXI.DisplayObject} children - The DisplayObject(s) to remove\n * @returns {PIXI.DisplayObject} The first child that was removed.\n */\n Container.prototype.removeChild = function () {\n var arguments$1 = arguments;\n\n var children = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n children[_i] = arguments$1[_i];\n }\n // if there is only one argument we can bypass looping through the them\n if (children.length > 1) {\n // loop through the arguments property and remove all children\n for (var i = 0; i < children.length; i++) {\n this.removeChild(children[i]);\n }\n }\n else {\n var child = children[0];\n var index = this.children.indexOf(child);\n if (index === -1)\n { return null; }\n child.parent = null;\n // ensure child transform will be recalculated\n child.transform._parentID = -1;\n removeItems(this.children, index, 1);\n // ensure bounds will be recalculated\n this._boundsID++;\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n this.emit('childRemoved', child, this, index);\n }\n return children[0];\n };\n /**\n * Removes a child from the specified index position.\n * @param index - The index to get the child from\n * @returns The child that was removed.\n */\n Container.prototype.removeChildAt = function (index) {\n var child = this.getChildAt(index);\n // ensure child transform will be recalculated..\n child.parent = null;\n child.transform._parentID = -1;\n removeItems(this.children, index, 1);\n // ensure bounds will be recalculated\n this._boundsID++;\n // TODO - lets either do all callbacks or all events.. not both!\n this.onChildrenChange(index);\n child.emit('removed', this);\n this.emit('childRemoved', child, this, index);\n return child;\n };\n /**\n * Removes all children from this container that are within the begin and end indexes.\n * @param beginIndex - The beginning position.\n * @param endIndex - The ending position. Default value is size of the container.\n * @returns - List of removed children\n */\n Container.prototype.removeChildren = function (beginIndex, endIndex) {\n if (beginIndex === void 0) { beginIndex = 0; }\n if (endIndex === void 0) { endIndex = this.children.length; }\n var begin = beginIndex;\n var end = endIndex;\n var range = end - begin;\n var removed;\n if (range > 0 && range <= end) {\n removed = this.children.splice(begin, range);\n for (var i = 0; i < removed.length; ++i) {\n removed[i].parent = null;\n if (removed[i].transform) {\n removed[i].transform._parentID = -1;\n }\n }\n this._boundsID++;\n this.onChildrenChange(beginIndex);\n for (var i = 0; i < removed.length; ++i) {\n removed[i].emit('removed', this);\n this.emit('childRemoved', removed[i], this, i);\n }\n return removed;\n }\n else if (range === 0 && this.children.length === 0) {\n return [];\n }\n throw new RangeError('removeChildren: numeric values are outside the acceptable range.');\n };\n /** Sorts children by zIndex. Previous order is maintained for 2 children with the same zIndex. */\n Container.prototype.sortChildren = function () {\n var sortRequired = false;\n for (var i = 0, j = this.children.length; i < j; ++i) {\n var child = this.children[i];\n child._lastSortedIndex = i;\n if (!sortRequired && child.zIndex !== 0) {\n sortRequired = true;\n }\n }\n if (sortRequired && this.children.length > 1) {\n this.children.sort(sortChildren);\n }\n this.sortDirty = false;\n };\n /** Updates the transform on all children of this container for rendering. */\n Container.prototype.updateTransform = function () {\n if (this.sortableChildren && this.sortDirty) {\n this.sortChildren();\n }\n this._boundsID++;\n this.transform.updateTransform(this.parent.transform);\n // TODO: check render flags, how to process stuff here\n this.worldAlpha = this.alpha * this.parent.worldAlpha;\n for (var i = 0, j = this.children.length; i < j; ++i) {\n var child = this.children[i];\n if (child.visible) {\n child.updateTransform();\n }\n }\n };\n /**\n * Recalculates the bounds of the container.\n *\n * This implementation will automatically fit the children's bounds into the calculation. Each child's bounds\n * is limited to its mask's bounds or filterArea, if any is applied.\n */\n Container.prototype.calculateBounds = function () {\n this._bounds.clear();\n this._calculateBounds();\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (!child.visible || !child.renderable) {\n continue;\n }\n child.calculateBounds();\n // TODO: filter+mask, need to mask both somehow\n if (child._mask) {\n var maskObject = (child._mask.isMaskData\n ? child._mask.maskObject : child._mask);\n if (maskObject) {\n maskObject.calculateBounds();\n this._bounds.addBoundsMask(child._bounds, maskObject._bounds);\n }\n else {\n this._bounds.addBounds(child._bounds);\n }\n }\n else if (child.filterArea) {\n this._bounds.addBoundsArea(child._bounds, child.filterArea);\n }\n else {\n this._bounds.addBounds(child._bounds);\n }\n }\n this._bounds.updateID = this._boundsID;\n };\n /**\n * Retrieves the local bounds of the displayObject as a rectangle object.\n *\n * Calling `getLocalBounds` may invalidate the `_bounds` of the whole subtree below. If using it inside a render()\n * call, it is advised to call `getBounds()` immediately after to recalculate the world bounds of the subtree.\n * @param rect - Optional rectangle to store the result of the bounds calculation.\n * @param skipChildrenUpdate - Setting to `true` will stop re-calculation of children transforms,\n * it was default behaviour of pixi 4.0-5.2 and caused many problems to users.\n * @returns - The rectangular bounding area.\n */\n Container.prototype.getLocalBounds = function (rect, skipChildrenUpdate) {\n if (skipChildrenUpdate === void 0) { skipChildrenUpdate = false; }\n var result = _super.prototype.getLocalBounds.call(this, rect);\n if (!skipChildrenUpdate) {\n for (var i = 0, j = this.children.length; i < j; ++i) {\n var child = this.children[i];\n if (child.visible) {\n child.updateTransform();\n }\n }\n }\n return result;\n };\n /**\n * Recalculates the content bounds of this object. This should be overriden to\n * calculate the bounds of this specific object (not including children).\n * @protected\n */\n Container.prototype._calculateBounds = function () {\n // FILL IN//\n };\n /**\n * Renders this object and its children with culling.\n * @protected\n * @param {PIXI.Renderer} renderer - The renderer\n */\n Container.prototype._renderWithCulling = function (renderer) {\n var sourceFrame = renderer.renderTexture.sourceFrame;\n // If the source frame is empty, stop rendering.\n if (!(sourceFrame.width > 0 && sourceFrame.height > 0)) {\n return;\n }\n // Render the content of the container only if its bounds intersect with the source frame.\n // All filters are on the stack at this point, and the filter source frame is bound:\n // therefore, even if the bounds to non intersect the filter frame, the filter\n // is still applied and any filter padding that is in the frame is rendered correctly.\n var bounds;\n var transform;\n // If cullArea is set, we use this rectangle instead of the bounds of the object. The cullArea\n // rectangle must completely contain the container and its children including filter padding.\n if (this.cullArea) {\n bounds = this.cullArea;\n transform = this.worldTransform;\n }\n // If the container doesn't override _render, we can skip the bounds calculation and intersection test.\n else if (this._render !== Container.prototype._render) {\n bounds = this.getBounds(true);\n }\n // Render the container if the source frame intersects the bounds.\n if (bounds && sourceFrame.intersects(bounds, transform)) {\n this._render(renderer);\n }\n // If the bounds are defined by cullArea and do not intersect with the source frame, stop rendering.\n else if (this.cullArea) {\n return;\n }\n // Unless cullArea is set, we cannot skip the children if the bounds of the container do not intersect\n // the source frame, because the children might have filters with nonzero padding, which may intersect\n // with the source frame while the bounds do not: filter padding is not included in the bounds.\n // If cullArea is not set, render the children with culling temporarily enabled so that they are not rendered\n // if they are out of frame; otherwise, render the children normally.\n for (var i = 0, j = this.children.length; i < j; ++i) {\n var child = this.children[i];\n var childCullable = child.cullable;\n child.cullable = childCullable || !this.cullArea;\n child.render(renderer);\n child.cullable = childCullable;\n }\n };\n /**\n * Renders the object using the WebGL renderer.\n *\n * The [_render]{@link PIXI.Container#_render} method is be overriden for rendering the contents of the\n * container itself. This `render` method will invoke it, and also invoke the `render` methods of all\n * children afterward.\n *\n * If `renderable` or `visible` is false or if `worldAlpha` is not positive or if `cullable` is true and\n * the bounds of this object are out of frame, this implementation will entirely skip rendering.\n * See {@link PIXI.DisplayObject} for choosing between `renderable` or `visible`. Generally,\n * setting alpha to zero is not recommended for purely skipping rendering.\n *\n * When your scene becomes large (especially when it is larger than can be viewed in a single screen), it is\n * advised to employ **culling** to automatically skip rendering objects outside of the current screen.\n * See [cullable]{@link PIXI.DisplayObject#cullable} and [cullArea]{@link PIXI.DisplayObject#cullArea}.\n * Other culling methods might be better suited for a large number static objects; see\n * [@pixi-essentials/cull]{@link https://www.npmjs.com/package/@pixi-essentials/cull} and\n * [pixi-cull]{@link https://www.npmjs.com/package/pixi-cull}.\n *\n * The [renderAdvanced]{@link PIXI.Container#renderAdvanced} method is internally used when when masking or\n * filtering is applied on a container. This does, however, break batching and can affect performance when\n * masking and filtering is applied extensively throughout the scene graph.\n * @param renderer - The renderer\n */\n Container.prototype.render = function (renderer) {\n // if the object is not visible or the alpha is 0 then no need to render this element\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n // do a quick check to see if this element has a mask or a filter.\n if (this._mask || (this.filters && this.filters.length)) {\n this.renderAdvanced(renderer);\n }\n else if (this.cullable) {\n this._renderWithCulling(renderer);\n }\n else {\n this._render(renderer);\n for (var i = 0, j = this.children.length; i < j; ++i) {\n this.children[i].render(renderer);\n }\n }\n };\n /**\n * Render the object using the WebGL renderer and advanced features.\n * @param renderer - The renderer\n */\n Container.prototype.renderAdvanced = function (renderer) {\n var filters = this.filters;\n var mask = this._mask;\n // push filter first as we need to ensure the stencil buffer is correct for any masking\n if (filters) {\n if (!this._enabledFilters) {\n this._enabledFilters = [];\n }\n this._enabledFilters.length = 0;\n for (var i = 0; i < filters.length; i++) {\n if (filters[i].enabled) {\n this._enabledFilters.push(filters[i]);\n }\n }\n }\n var flush = (filters && this._enabledFilters && this._enabledFilters.length)\n || (mask && (!mask.isMaskData\n || (mask.enabled && (mask.autoDetect || mask.type !== MASK_TYPES.NONE))));\n if (flush) {\n renderer.batch.flush();\n }\n if (filters && this._enabledFilters && this._enabledFilters.length) {\n renderer.filter.push(this, this._enabledFilters);\n }\n if (mask) {\n renderer.mask.push(this, this._mask);\n }\n if (this.cullable) {\n this._renderWithCulling(renderer);\n }\n else {\n this._render(renderer);\n for (var i = 0, j = this.children.length; i < j; ++i) {\n this.children[i].render(renderer);\n }\n }\n if (flush) {\n renderer.batch.flush();\n }\n if (mask) {\n renderer.mask.pop(this);\n }\n if (filters && this._enabledFilters && this._enabledFilters.length) {\n renderer.filter.pop();\n }\n };\n /**\n * To be overridden by the subclasses.\n * @param _renderer - The renderer\n */\n Container.prototype._render = function (_renderer) {\n // this is where content itself gets rendered...\n };\n /**\n * Removes all internal references and listeners as well as removes children from the display list.\n * Do not use a Container after calling `destroy`.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n Container.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this);\n this.sortDirty = false;\n var destroyChildren = typeof options === 'boolean' ? options : options && options.children;\n var oldChildren = this.removeChildren(0, this.children.length);\n if (destroyChildren) {\n for (var i = 0; i < oldChildren.length; ++i) {\n oldChildren[i].destroy(options);\n }\n }\n };\n Object.defineProperty(Container.prototype, \"width\", {\n /** The width of the Container, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return this.scale.x * this.getLocalBounds().width;\n },\n set: function (value) {\n var width = this.getLocalBounds().width;\n if (width !== 0) {\n this.scale.x = value / width;\n }\n else {\n this.scale.x = 1;\n }\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Container.prototype, \"height\", {\n /** The height of the Container, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return this.scale.y * this.getLocalBounds().height;\n },\n set: function (value) {\n var height = this.getLocalBounds().height;\n if (height !== 0) {\n this.scale.y = value / height;\n }\n else {\n this.scale.y = 1;\n }\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n return Container;\n}(DisplayObject));\n/**\n * Container default updateTransform, does update children of container.\n * Will crash if there's no parent element.\n * @memberof PIXI.Container#\n * @method containerUpdateTransform\n */\nContainer.prototype.containerUpdateTransform = Container.prototype.updateTransform;\n\nexport { Bounds, Container, DisplayObject, TemporaryDisplayObject };\n//# sourceMappingURL=display.mjs.map\n","/*!\n * @pixi/extensions - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/extensions is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\n var arguments$1 = arguments;\n\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments$1[i];\r\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) { t[p] = s[p]; } }\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\n/**\n * Collection of valid extension types.\n * @memberof PIXI\n * @property {string} Application - Application plugins\n * @property {string} RendererPlugin - Plugins for Renderer\n * @property {string} CanvasRendererPlugin - Plugins for CanvasRenderer\n * @property {string} Loader - Plugins to use with Loader\n * @property {string} LoadParser - Parsers for Assets loader.\n * @property {string} ResolveParser - Parsers for Assets resolvers.\n * @property {string} CacheParser - Parsers for Assets cache.\n */\nvar ExtensionType;\n(function (ExtensionType) {\n ExtensionType[\"Application\"] = \"application\";\n ExtensionType[\"RendererPlugin\"] = \"renderer-webgl-plugin\";\n ExtensionType[\"CanvasRendererPlugin\"] = \"renderer-canvas-plugin\";\n ExtensionType[\"Loader\"] = \"loader\";\n ExtensionType[\"LoadParser\"] = \"load-parser\";\n ExtensionType[\"ResolveParser\"] = \"resolve-parser\";\n ExtensionType[\"CacheParser\"] = \"cache-parser\";\n ExtensionType[\"DetectionParser\"] = \"detection-parser\";\n})(ExtensionType || (ExtensionType = {}));\n/**\n * Convert input into extension format data.\n * @ignore\n */\nvar normalizeExtension = function (ext) {\n // Class/Object submission, use extension object\n if (typeof ext === 'function' || (typeof ext === 'object' && ext.extension)) {\n if (!ext.extension) {\n throw new Error('Extension class must have an extension object');\n }\n var metadata = (typeof ext.extension !== 'object')\n ? { type: ext.extension }\n : ext.extension;\n ext = __assign(__assign({}, metadata), { ref: ext });\n }\n if (typeof ext === 'object') {\n ext = __assign({}, ext);\n }\n else {\n throw new Error('Invalid extension type');\n }\n if (typeof ext.type === 'string') {\n ext.type = [ext.type];\n }\n return ext;\n};\n/**\n * Global registration of all PixiJS extensions. One-stop-shop for extensibility.\n * @memberof PIXI\n * @namespace extensions\n */\nvar extensions = {\n /** @ignore */\n _addHandlers: null,\n /** @ignore */\n _removeHandlers: null,\n /** @ignore */\n _queue: {},\n /**\n * Remove extensions from PixiJS.\n * @param extensions - Extensions to be removed.\n * @returns {PIXI.extensions} For chaining.\n */\n remove: function () {\n var arguments$1 = arguments;\n\n var _this = this;\n var extensions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n extensions[_i] = arguments$1[_i];\n }\n extensions.map(normalizeExtension).forEach(function (ext) {\n ext.type.forEach(function (type) { var _a, _b; return (_b = (_a = _this._removeHandlers)[type]) === null || _b === void 0 ? void 0 : _b.call(_a, ext); });\n });\n return this;\n },\n /**\n * Register new extensions with PixiJS.\n * @param extensions - The spread of extensions to add to PixiJS.\n * @returns {PIXI.extensions} For chaining.\n */\n add: function () {\n var arguments$1 = arguments;\n\n var _this = this;\n var extensions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n extensions[_i] = arguments$1[_i];\n }\n // Handle any extensions either passed as class w/ data or as data\n extensions.map(normalizeExtension).forEach(function (ext) {\n ext.type.forEach(function (type) {\n var handlers = _this._addHandlers;\n var queue = _this._queue;\n if (!handlers[type]) {\n queue[type] = queue[type] || [];\n queue[type].push(ext);\n }\n else {\n handlers[type](ext);\n }\n });\n });\n return this;\n },\n /**\n * Internal method to handle extensions by name.\n * @param type - The extension type.\n * @param onAdd - Function for handling when extensions are added/registered passes {@link PIXI.ExtensionFormat}.\n * @param onRemove - Function for handling when extensions are removed/unregistered passes {@link PIXI.ExtensionFormat}.\n * @returns {PIXI.extensions} For chaining.\n */\n handle: function (type, onAdd, onRemove) {\n var addHandlers = this._addHandlers = this._addHandlers || {};\n var removeHandlers = this._removeHandlers = this._removeHandlers || {};\n if (addHandlers[type] || removeHandlers[type]) {\n throw new Error(\"Extension type \" + type + \" already has a handler\");\n }\n addHandlers[type] = onAdd;\n removeHandlers[type] = onRemove;\n // Process the queue\n var queue = this._queue;\n // Process any plugins that have been registered before the handler\n if (queue[type]) {\n queue[type].forEach(function (ext) { return onAdd(ext); });\n delete queue[type];\n }\n return this;\n },\n /**\n * Handle a type, but using a map by `name` property.\n * @param type - Type of extension to handle.\n * @param map - The object map of named extensions.\n * @returns {PIXI.extensions} For chaining.\n */\n handleByMap: function (type, map) {\n return this.handle(type, function (extension) {\n map[extension.name] = extension.ref;\n }, function (extension) {\n delete map[extension.name];\n });\n },\n /**\n * Handle a type, but using a list of extensions.\n * @param type - Type of extension to handle.\n * @param list - The list of extensions.\n * @returns {PIXI.extensions} For chaining.\n */\n handleByList: function (type, list) {\n return this.handle(type, function (extension) {\n var _a, _b;\n if (list.includes(extension.ref)) {\n return;\n }\n list.push(extension.ref);\n // TODO: remove me later, only added for @pixi/loaders\n if (type === ExtensionType.Loader) {\n (_b = (_a = extension.ref).add) === null || _b === void 0 ? void 0 : _b.call(_a);\n }\n }, function (extension) {\n var index = list.indexOf(extension.ref);\n if (index !== -1) {\n list.splice(index, 1);\n }\n });\n },\n};\n\nexport { ExtensionType, extensions };\n//# sourceMappingURL=extensions.mjs.map\n","/*!\n * @pixi/runner - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/runner is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\n/**\n * A Runner is a highly performant and simple alternative to signals. Best used in situations\n * where events are dispatched to many objects at high frequency (say every frame!)\n *\n *\n * like a signal..\n * ```\n * import { Runner } from '@pixi/runner';\n *\n * const myObject = {\n * loaded: new Runner('loaded')\n * }\n *\n * const listener = {\n * loaded: function(){\n * // thin\n * }\n * }\n *\n * myObject.loaded.add(listener);\n *\n * myObject.loaded.emit();\n * ```\n *\n * Or for handling calling the same function on many items\n * ```\n * import { Runner } from '@pixi/runner';\n *\n * const myGame = {\n * update: new Runner('update')\n * }\n *\n * const gameObject = {\n * update: function(time){\n * // update my gamey state\n * }\n * }\n *\n * myGame.update.add(gameObject);\n *\n * myGame.update.emit(time);\n * ```\n * @memberof PIXI\n */\nvar Runner = /** @class */ (function () {\n /**\n * @param name - The function name that will be executed on the listeners added to this Runner.\n */\n function Runner(name) {\n this.items = [];\n this._name = name;\n this._aliasCount = 0;\n }\n /* eslint-disable jsdoc/require-param, jsdoc/check-param-names */\n /**\n * Dispatch/Broadcast Runner to all listeners added to the queue.\n * @param {...any} params - (optional) parameters to pass to each listener\n */\n /* eslint-enable jsdoc/require-param, jsdoc/check-param-names */\n Runner.prototype.emit = function (a0, a1, a2, a3, a4, a5, a6, a7) {\n if (arguments.length > 8) {\n throw new Error('max arguments reached');\n }\n var _a = this, name = _a.name, items = _a.items;\n this._aliasCount++;\n for (var i = 0, len = items.length; i < len; i++) {\n items[i][name](a0, a1, a2, a3, a4, a5, a6, a7);\n }\n if (items === this.items) {\n this._aliasCount--;\n }\n return this;\n };\n Runner.prototype.ensureNonAliasedItems = function () {\n if (this._aliasCount > 0 && this.items.length > 1) {\n this._aliasCount = 0;\n this.items = this.items.slice(0);\n }\n };\n /**\n * Add a listener to the Runner\n *\n * Runners do not need to have scope or functions passed to them.\n * All that is required is to pass the listening object and ensure that it has contains a function that has the same name\n * as the name provided to the Runner when it was created.\n *\n * Eg A listener passed to this Runner will require a 'complete' function.\n *\n * ```\n * import { Runner } from '@pixi/runner';\n *\n * const complete = new Runner('complete');\n * ```\n *\n * The scope used will be the object itself.\n * @param {any} item - The object that will be listening.\n */\n Runner.prototype.add = function (item) {\n if (item[this._name]) {\n this.ensureNonAliasedItems();\n this.remove(item);\n this.items.push(item);\n }\n return this;\n };\n /**\n * Remove a single listener from the dispatch queue.\n * @param {any} item - The listener that you would like to remove.\n */\n Runner.prototype.remove = function (item) {\n var index = this.items.indexOf(item);\n if (index !== -1) {\n this.ensureNonAliasedItems();\n this.items.splice(index, 1);\n }\n return this;\n };\n /**\n * Check to see if the listener is already in the Runner\n * @param {any} item - The listener that you would like to check.\n */\n Runner.prototype.contains = function (item) {\n return this.items.indexOf(item) !== -1;\n };\n /** Remove all listeners from the Runner */\n Runner.prototype.removeAll = function () {\n this.ensureNonAliasedItems();\n this.items.length = 0;\n return this;\n };\n /** Remove all references, don't use after this. */\n Runner.prototype.destroy = function () {\n this.removeAll();\n this.items = null;\n this._name = null;\n };\n Object.defineProperty(Runner.prototype, \"empty\", {\n /**\n * `true` if there are no this Runner contains no listeners\n * @readonly\n */\n get: function () {\n return this.items.length === 0;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Runner.prototype, \"name\", {\n /**\n * The name of the runner.\n * @readonly\n */\n get: function () {\n return this._name;\n },\n enumerable: false,\n configurable: true\n });\n return Runner;\n}());\nObject.defineProperties(Runner.prototype, {\n /**\n * Alias for `emit`\n * @memberof PIXI.Runner#\n * @method dispatch\n * @see PIXI.Runner#emit\n */\n dispatch: { value: Runner.prototype.emit },\n /**\n * Alias for `emit`\n * @memberof PIXI.Runner#\n * @method run\n * @see PIXI.Runner#emit\n */\n run: { value: Runner.prototype.emit },\n});\n\nexport { Runner };\n//# sourceMappingURL=runner.mjs.map\n","/*!\n * @pixi/ticker - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/ticker is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nimport { ExtensionType } from '@pixi/extensions';\n\n/**\n * Target frames per millisecond.\n * @static\n * @name TARGET_FPMS\n * @memberof PIXI.settings\n * @type {number}\n * @default 0.06\n */\nsettings.TARGET_FPMS = 0.06;\n\n/**\n * Represents the update priorities used by internal PIXI classes when registered with\n * the {@link PIXI.Ticker} object. Higher priority items are updated first and lower\n * priority items, such as render, should go later.\n * @static\n * @constant\n * @name UPDATE_PRIORITY\n * @memberof PIXI\n * @enum {number}\n * @property {number} [INTERACTION=50] Highest priority, used for {@link PIXI.InteractionManager}\n * @property {number} [HIGH=25] High priority updating, {@link PIXI.VideoBaseTexture} and {@link PIXI.AnimatedSprite}\n * @property {number} [NORMAL=0] Default priority for ticker events, see {@link PIXI.Ticker#add}.\n * @property {number} [LOW=-25] Low priority used for {@link PIXI.Application} rendering.\n * @property {number} [UTILITY=-50] Lowest priority used for {@link PIXI.BasePrepare} utility.\n */\nvar UPDATE_PRIORITY;\n(function (UPDATE_PRIORITY) {\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"INTERACTION\"] = 50] = \"INTERACTION\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"HIGH\"] = 25] = \"HIGH\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"NORMAL\"] = 0] = \"NORMAL\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"LOW\"] = -25] = \"LOW\";\n UPDATE_PRIORITY[UPDATE_PRIORITY[\"UTILITY\"] = -50] = \"UTILITY\";\n})(UPDATE_PRIORITY || (UPDATE_PRIORITY = {}));\n\n/**\n * Internal class for handling the priority sorting of ticker handlers.\n * @private\n * @class\n * @memberof PIXI\n */\nvar TickerListener = /** @class */ (function () {\n /**\n * Constructor\n * @private\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @param priority - The priority for emitting\n * @param once - If the handler should fire once\n */\n function TickerListener(fn, context, priority, once) {\n if (context === void 0) { context = null; }\n if (priority === void 0) { priority = 0; }\n if (once === void 0) { once = false; }\n /** The next item in chain. */\n this.next = null;\n /** The previous item in chain. */\n this.previous = null;\n /** `true` if this listener has been destroyed already. */\n this._destroyed = false;\n this.fn = fn;\n this.context = context;\n this.priority = priority;\n this.once = once;\n }\n /**\n * Simple compare function to figure out if a function and context match.\n * @private\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @returns `true` if the listener match the arguments\n */\n TickerListener.prototype.match = function (fn, context) {\n if (context === void 0) { context = null; }\n return this.fn === fn && this.context === context;\n };\n /**\n * Emit by calling the current function.\n * @private\n * @param deltaTime - time since the last emit.\n * @returns Next ticker\n */\n TickerListener.prototype.emit = function (deltaTime) {\n if (this.fn) {\n if (this.context) {\n this.fn.call(this.context, deltaTime);\n }\n else {\n this.fn(deltaTime);\n }\n }\n var redirect = this.next;\n if (this.once) {\n this.destroy(true);\n }\n // Soft-destroying should remove\n // the next reference\n if (this._destroyed) {\n this.next = null;\n }\n return redirect;\n };\n /**\n * Connect to the list.\n * @private\n * @param previous - Input node, previous listener\n */\n TickerListener.prototype.connect = function (previous) {\n this.previous = previous;\n if (previous.next) {\n previous.next.previous = this;\n }\n this.next = previous.next;\n previous.next = this;\n };\n /**\n * Destroy and don't use after this.\n * @private\n * @param hard - `true` to remove the `next` reference, this\n * is considered a hard destroy. Soft destroy maintains the next reference.\n * @returns The listener to redirect while emitting or removing.\n */\n TickerListener.prototype.destroy = function (hard) {\n if (hard === void 0) { hard = false; }\n this._destroyed = true;\n this.fn = null;\n this.context = null;\n // Disconnect, hook up next and previous\n if (this.previous) {\n this.previous.next = this.next;\n }\n if (this.next) {\n this.next.previous = this.previous;\n }\n // Redirect to the next item\n var redirect = this.next;\n // Remove references\n this.next = hard ? null : redirect;\n this.previous = null;\n return redirect;\n };\n return TickerListener;\n}());\n\n/**\n * A Ticker class that runs an update loop that other objects listen to.\n *\n * This class is composed around listeners meant for execution on the next requested animation frame.\n * Animation frames are requested only when necessary, e.g. When the ticker is started and the emitter has listeners.\n * @class\n * @memberof PIXI\n */\nvar Ticker = /** @class */ (function () {\n function Ticker() {\n var _this = this;\n /**\n * Whether or not this ticker should invoke the method\n * {@link PIXI.Ticker#start} automatically\n * when a listener is added.\n */\n this.autoStart = false;\n /**\n * Scalar time value from last frame to this frame.\n * This value is capped by setting {@link PIXI.Ticker#minFPS}\n * and is scaled with {@link PIXI.Ticker#speed}.\n * **Note:** The cap may be exceeded by scaling.\n */\n this.deltaTime = 1;\n /**\n * The last time {@link PIXI.Ticker#update} was invoked.\n * This value is also reset internally outside of invoking\n * update, but only when a new animation frame is requested.\n * If the platform supports DOMHighResTimeStamp,\n * this value will have a precision of 1 µs.\n */\n this.lastTime = -1;\n /**\n * Factor of current {@link PIXI.Ticker#deltaTime}.\n * @example\n * // Scales ticker.deltaTime to what would be\n * // the equivalent of approximately 120 FPS\n * ticker.speed = 2;\n */\n this.speed = 1;\n /**\n * Whether or not this ticker has been started.\n * `true` if {@link PIXI.Ticker#start} has been called.\n * `false` if {@link PIXI.Ticker#stop} has been called.\n * While `false`, this value may change to `true` in the\n * event of {@link PIXI.Ticker#autoStart} being `true`\n * and a listener is added.\n */\n this.started = false;\n /** Internal current frame request ID */\n this._requestId = null;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the maximum allowed milliseconds between updates.\n */\n this._maxElapsedMS = 100;\n /**\n * Internal value managed by minFPS property setter and getter.\n * This is the minimum allowed milliseconds between updates.\n */\n this._minElapsedMS = 0;\n /** If enabled, deleting is disabled.*/\n this._protected = false;\n /** The last time keyframe was executed. Maintains a relatively fixed interval with the previous value. */\n this._lastFrame = -1;\n this._head = new TickerListener(null, null, Infinity);\n this.deltaMS = 1 / settings.TARGET_FPMS;\n this.elapsedMS = 1 / settings.TARGET_FPMS;\n this._tick = function (time) {\n _this._requestId = null;\n if (_this.started) {\n // Invoke listeners now\n _this.update(time);\n // Listener side effects may have modified ticker state.\n if (_this.started && _this._requestId === null && _this._head.next) {\n _this._requestId = requestAnimationFrame(_this._tick);\n }\n }\n };\n }\n /**\n * Conditionally requests a new animation frame.\n * If a frame has not already been requested, and if the internal\n * emitter has listeners, a new frame is requested.\n * @private\n */\n Ticker.prototype._requestIfNeeded = function () {\n if (this._requestId === null && this._head.next) {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._lastFrame = this.lastTime;\n this._requestId = requestAnimationFrame(this._tick);\n }\n };\n /**\n * Conditionally cancels a pending animation frame.\n * @private\n */\n Ticker.prototype._cancelIfNeeded = function () {\n if (this._requestId !== null) {\n cancelAnimationFrame(this._requestId);\n this._requestId = null;\n }\n };\n /**\n * Conditionally requests a new animation frame.\n * If the ticker has been started it checks if a frame has not already\n * been requested, and if the internal emitter has listeners. If these\n * conditions are met, a new frame is requested. If the ticker has not\n * been started, but autoStart is `true`, then the ticker starts now,\n * and continues with the previous conditions to request a new frame.\n * @private\n */\n Ticker.prototype._startIfPossible = function () {\n if (this.started) {\n this._requestIfNeeded();\n }\n else if (this.autoStart) {\n this.start();\n }\n };\n /**\n * Register a handler for tick events. Calls continuously unless\n * it is removed or the ticker is stopped.\n * @param fn - The listener function to be added for updates\n * @param context - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns This instance of a ticker\n */\n Ticker.prototype.add = function (fn, context, priority) {\n if (priority === void 0) { priority = UPDATE_PRIORITY.NORMAL; }\n return this._addListener(new TickerListener(fn, context, priority));\n };\n /**\n * Add a handler for the tick event which is only execute once.\n * @param fn - The listener function to be added for one update\n * @param context - The listener context\n * @param {number} [priority=PIXI.UPDATE_PRIORITY.NORMAL] - The priority for emitting\n * @returns This instance of a ticker\n */\n Ticker.prototype.addOnce = function (fn, context, priority) {\n if (priority === void 0) { priority = UPDATE_PRIORITY.NORMAL; }\n return this._addListener(new TickerListener(fn, context, priority, true));\n };\n /**\n * Internally adds the event handler so that it can be sorted by priority.\n * Priority allows certain handler (user, AnimatedSprite, Interaction) to be run\n * before the rendering.\n * @private\n * @param listener - Current listener being added.\n * @returns This instance of a ticker\n */\n Ticker.prototype._addListener = function (listener) {\n // For attaching to head\n var current = this._head.next;\n var previous = this._head;\n // Add the first item\n if (!current) {\n listener.connect(previous);\n }\n else {\n // Go from highest to lowest priority\n while (current) {\n if (listener.priority > current.priority) {\n listener.connect(previous);\n break;\n }\n previous = current;\n current = current.next;\n }\n // Not yet connected\n if (!listener.previous) {\n listener.connect(previous);\n }\n }\n this._startIfPossible();\n return this;\n };\n /**\n * Removes any handlers matching the function and context parameters.\n * If no handlers are left after removing, then it cancels the animation frame.\n * @param fn - The listener function to be removed\n * @param context - The listener context to be removed\n * @returns This instance of a ticker\n */\n Ticker.prototype.remove = function (fn, context) {\n var listener = this._head.next;\n while (listener) {\n // We found a match, lets remove it\n // no break to delete all possible matches\n // incase a listener was added 2+ times\n if (listener.match(fn, context)) {\n listener = listener.destroy();\n }\n else {\n listener = listener.next;\n }\n }\n if (!this._head.next) {\n this._cancelIfNeeded();\n }\n return this;\n };\n Object.defineProperty(Ticker.prototype, \"count\", {\n /**\n * The number of listeners on this ticker, calculated by walking through linked list\n * @readonly\n * @member {number}\n */\n get: function () {\n if (!this._head) {\n return 0;\n }\n var count = 0;\n var current = this._head;\n while ((current = current.next)) {\n count++;\n }\n return count;\n },\n enumerable: false,\n configurable: true\n });\n /** Starts the ticker. If the ticker has listeners a new animation frame is requested at this point. */\n Ticker.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this._requestIfNeeded();\n }\n };\n /** Stops the ticker. If the ticker has requested an animation frame it is canceled at this point. */\n Ticker.prototype.stop = function () {\n if (this.started) {\n this.started = false;\n this._cancelIfNeeded();\n }\n };\n /** Destroy the ticker and don't use after this. Calling this method removes all references to internal events. */\n Ticker.prototype.destroy = function () {\n if (!this._protected) {\n this.stop();\n var listener = this._head.next;\n while (listener) {\n listener = listener.destroy(true);\n }\n this._head.destroy();\n this._head = null;\n }\n };\n /**\n * Triggers an update. An update entails setting the\n * current {@link PIXI.Ticker#elapsedMS},\n * the current {@link PIXI.Ticker#deltaTime},\n * invoking all listeners with current deltaTime,\n * and then finally setting {@link PIXI.Ticker#lastTime}\n * with the value of currentTime that was provided.\n * This method will be called automatically by animation\n * frame callbacks if the ticker instance has been started\n * and listeners are added.\n * @param {number} [currentTime=performance.now()] - the current time of execution\n */\n Ticker.prototype.update = function (currentTime) {\n if (currentTime === void 0) { currentTime = performance.now(); }\n var elapsedMS;\n // If the difference in time is zero or negative, we ignore most of the work done here.\n // If there is no valid difference, then should be no reason to let anyone know about it.\n // A zero delta, is exactly that, nothing should update.\n //\n // The difference in time can be negative, and no this does not mean time traveling.\n // This can be the result of a race condition between when an animation frame is requested\n // on the current JavaScript engine event loop, and when the ticker's start method is invoked\n // (which invokes the internal _requestIfNeeded method). If a frame is requested before\n // _requestIfNeeded is invoked, then the callback for the animation frame the ticker requests,\n // can receive a time argument that can be less than the lastTime value that was set within\n // _requestIfNeeded. This difference is in microseconds, but this is enough to cause problems.\n //\n // This check covers this browser engine timing issue, as well as if consumers pass an invalid\n // currentTime value. This may happen if consumers opt-out of the autoStart, and update themselves.\n if (currentTime > this.lastTime) {\n // Save uncapped elapsedMS for measurement\n elapsedMS = this.elapsedMS = currentTime - this.lastTime;\n // cap the milliseconds elapsed used for deltaTime\n if (elapsedMS > this._maxElapsedMS) {\n elapsedMS = this._maxElapsedMS;\n }\n elapsedMS *= this.speed;\n // If not enough time has passed, exit the function.\n // Get ready for next frame by setting _lastFrame, but based on _minElapsedMS\n // adjustment to ensure a relatively stable interval.\n if (this._minElapsedMS) {\n var delta = currentTime - this._lastFrame | 0;\n if (delta < this._minElapsedMS) {\n return;\n }\n this._lastFrame = currentTime - (delta % this._minElapsedMS);\n }\n this.deltaMS = elapsedMS;\n this.deltaTime = this.deltaMS * settings.TARGET_FPMS;\n // Cache a local reference, in-case ticker is destroyed\n // during the emit, we can still check for head.next\n var head = this._head;\n // Invoke listeners added to internal emitter\n var listener = head.next;\n while (listener) {\n listener = listener.emit(this.deltaTime);\n }\n if (!head.next) {\n this._cancelIfNeeded();\n }\n }\n else {\n this.deltaTime = this.deltaMS = this.elapsedMS = 0;\n }\n this.lastTime = currentTime;\n };\n Object.defineProperty(Ticker.prototype, \"FPS\", {\n /**\n * The frames per second at which this ticker is running.\n * The default is approximately 60 in most modern browsers.\n * **Note:** This does not factor in the value of\n * {@link PIXI.Ticker#speed}, which is specific\n * to scaling {@link PIXI.Ticker#deltaTime}.\n * @member {number}\n * @readonly\n */\n get: function () {\n return 1000 / this.elapsedMS;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker.prototype, \"minFPS\", {\n /**\n * Manages the maximum amount of milliseconds allowed to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This value is used to cap {@link PIXI.Ticker#deltaTime},\n * but does not effect the measured value of {@link PIXI.Ticker#FPS}.\n * When setting this property it is clamped to a value between\n * `0` and `PIXI.settings.TARGET_FPMS * 1000`.\n * @member {number}\n * @default 10\n */\n get: function () {\n return 1000 / this._maxElapsedMS;\n },\n set: function (fps) {\n // Minimum must be below the maxFPS\n var minFPS = Math.min(this.maxFPS, fps);\n // Must be at least 0, but below 1 / settings.TARGET_FPMS\n var minFPMS = Math.min(Math.max(0, minFPS) / 1000, settings.TARGET_FPMS);\n this._maxElapsedMS = 1 / minFPMS;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker.prototype, \"maxFPS\", {\n /**\n * Manages the minimum amount of milliseconds required to\n * elapse between invoking {@link PIXI.Ticker#update}.\n * This will effect the measured value of {@link PIXI.Ticker#FPS}.\n * If it is set to `0`, then there is no limit; PixiJS will render as many frames as it can.\n * Otherwise it will be at least `minFPS`\n * @member {number}\n * @default 0\n */\n get: function () {\n if (this._minElapsedMS) {\n return Math.round(1000 / this._minElapsedMS);\n }\n return 0;\n },\n set: function (fps) {\n if (fps === 0) {\n this._minElapsedMS = 0;\n }\n else {\n // Max must be at least the minFPS\n var maxFPS = Math.max(this.minFPS, fps);\n this._minElapsedMS = 1 / (maxFPS / 1000);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker, \"shared\", {\n /**\n * The shared ticker instance used by {@link PIXI.AnimatedSprite} and by\n * {@link PIXI.VideoResource} to update animation frames / video textures.\n *\n * It may also be used by {@link PIXI.Application} if created with the `sharedTicker` option property set to true.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n * Please follow the examples for usage, including how to opt-out of auto-starting the shared ticker.\n * @example\n * let ticker = PIXI.Ticker.shared;\n * // Set this to prevent starting this ticker when listeners are added.\n * // By default this is true only for the PIXI.Ticker.shared instance.\n * ticker.autoStart = false;\n * // FYI, call this to ensure the ticker is stopped. It should be stopped\n * // if you have not attempted to render anything yet.\n * ticker.stop();\n * // Call this when you are ready for a running shared ticker.\n * ticker.start();\n * @example\n * // You may use the shared ticker to render...\n * let renderer = PIXI.autoDetectRenderer();\n * let stage = new PIXI.Container();\n * document.body.appendChild(renderer.view);\n * ticker.add(function (time) {\n * renderer.render(stage);\n * });\n * @example\n * // Or you can just update it manually.\n * ticker.autoStart = false;\n * ticker.stop();\n * function animate(time) {\n * ticker.update(time);\n * renderer.render(stage);\n * requestAnimationFrame(animate);\n * }\n * animate(performance.now());\n * @member {PIXI.Ticker}\n * @static\n */\n get: function () {\n if (!Ticker._shared) {\n var shared = Ticker._shared = new Ticker();\n shared.autoStart = true;\n shared._protected = true;\n }\n return Ticker._shared;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Ticker, \"system\", {\n /**\n * The system ticker instance used by {@link PIXI.InteractionManager} and by\n * {@link PIXI.BasePrepare} for core timing functionality that shouldn't usually need to be paused,\n * unlike the `shared` ticker which drives visual animations and rendering which may want to be paused.\n *\n * The property {@link PIXI.Ticker#autoStart} is set to `true` for this instance.\n * @member {PIXI.Ticker}\n * @static\n */\n get: function () {\n if (!Ticker._system) {\n var system = Ticker._system = new Ticker();\n system.autoStart = true;\n system._protected = true;\n }\n return Ticker._system;\n },\n enumerable: false,\n configurable: true\n });\n return Ticker;\n}());\n\n/**\n * Middleware for for Application Ticker.\n * @example\n * import {TickerPlugin} from '@pixi/ticker';\n * import {Application} from '@pixi/app';\n * import {extensions} from '@pixi/extensions';\n * extensions.add(TickerPlugin);\n * @class\n * @memberof PIXI\n */\nvar TickerPlugin = /** @class */ (function () {\n function TickerPlugin() {\n }\n /**\n * Initialize the plugin with scope of application instance\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n TickerPlugin.init = function (options) {\n var _this = this;\n // Set default\n options = Object.assign({\n autoStart: true,\n sharedTicker: false,\n }, options);\n // Create ticker setter\n Object.defineProperty(this, 'ticker', {\n set: function (ticker) {\n if (this._ticker) {\n this._ticker.remove(this.render, this);\n }\n this._ticker = ticker;\n if (ticker) {\n ticker.add(this.render, this, UPDATE_PRIORITY.LOW);\n }\n },\n get: function () {\n return this._ticker;\n },\n });\n /**\n * Convenience method for stopping the render.\n * @method\n * @memberof PIXI.Application\n * @instance\n */\n this.stop = function () {\n _this._ticker.stop();\n };\n /**\n * Convenience method for starting the render.\n * @method\n * @memberof PIXI.Application\n * @instance\n */\n this.start = function () {\n _this._ticker.start();\n };\n /**\n * Internal reference to the ticker.\n * @type {PIXI.Ticker}\n * @name _ticker\n * @memberof PIXI.Application#\n * @private\n */\n this._ticker = null;\n /**\n * Ticker for doing render updates.\n * @type {PIXI.Ticker}\n * @name ticker\n * @memberof PIXI.Application#\n * @default PIXI.Ticker.shared\n */\n this.ticker = options.sharedTicker ? Ticker.shared : new Ticker();\n // Start the rendering\n if (options.autoStart) {\n this.start();\n }\n };\n /**\n * Clean up the ticker, scoped to application.\n * @static\n * @private\n */\n TickerPlugin.destroy = function () {\n if (this._ticker) {\n var oldTicker = this._ticker;\n this.ticker = null;\n oldTicker.destroy();\n }\n };\n /** @ignore */\n TickerPlugin.extension = ExtensionType.Application;\n return TickerPlugin;\n}());\n\nexport { Ticker, TickerPlugin, UPDATE_PRIORITY };\n//# sourceMappingURL=ticker.mjs.map\n","/*!\n * @pixi/core - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/core is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nimport { ENV, ALPHA_MODES, SCALE_MODES, FORMATS, TYPES, TARGETS, MIPMAP_MODES, MSAA_QUALITY, BUFFER_TYPE, CLEAR_MODES, DRAW_MODES, BUFFER_BITS, MASK_TYPES, PRECISION, BLEND_MODES, GC_MODES, SAMPLER_TYPES, WRAP_MODES, RENDERER_TYPE } from '@pixi/constants';\nimport { isMobile, isPow2, BaseTextureCache, TextureCache, uid, EventEmitter, determineCrossOrigin, getResolutionOfUrl, deprecation, nextPow2, getBufferType, ProgramCache, removeItems, hex2string, hex2rgb, sayHello, isWebGLSupported, premultiplyBlendMode, log2, premultiplyTint } from '@pixi/utils';\nimport { extensions as extensions$1, ExtensionType } from '@pixi/extensions';\nexport * from '@pixi/extensions';\nimport { Runner } from '@pixi/runner';\nimport { Ticker } from '@pixi/ticker';\nimport { groupD8, Rectangle, Point, Matrix } from '@pixi/math';\n\n/**\n * The maximum support for using WebGL. If a device does not\n * support WebGL version, for instance WebGL 2, it will still\n * attempt to fallback support to WebGL 1. If you want to\n * explicitly remove feature support to target a more stable\n * baseline, prefer a lower environment.\n *\n * Due to {@link https://bugs.chromium.org/p/chromium/issues/detail?id=934823|bug in chromium}\n * we disable webgl2 by default for all non-apple mobile devices.\n * @static\n * @name PREFER_ENV\n * @memberof PIXI.settings\n * @type {number}\n * @default PIXI.ENV.WEBGL2\n */\nsettings.PREFER_ENV = isMobile.any ? ENV.WEBGL : ENV.WEBGL2;\n/**\n * If set to `true`, *only* Textures and BaseTexture objects stored\n * in the caches ({@link PIXI.utils.TextureCache TextureCache} and\n * {@link PIXI.utils.BaseTextureCache BaseTextureCache}) can be\n * used when calling {@link PIXI.Texture.from Texture.from} or\n * {@link PIXI.BaseTexture.from BaseTexture.from}.\n * Otherwise, these `from` calls throw an exception. Using this property\n * can be useful if you want to enforce preloading all assets with\n * {@link PIXI.Loader Loader}.\n * @static\n * @name STRICT_TEXTURE_CACHE\n * @memberof PIXI.settings\n * @type {boolean}\n * @default false\n */\nsettings.STRICT_TEXTURE_CACHE = false;\n\n/**\n * Collection of installed resource types, class must extend {@link PIXI.Resource}.\n * @example\n * class CustomResource extends PIXI.Resource {\n * // MUST have source, options constructor signature\n * // for auto-detected resources to be created.\n * constructor(source, options) {\n * super();\n * }\n * upload(renderer, baseTexture, glTexture) {\n * // upload with GL\n * return true;\n * }\n * // used to auto-detect resource\n * static test(source, extension) {\n * return extension === 'xyz'|| source instanceof SomeClass;\n * }\n * }\n * // Install the new resource type\n * PIXI.INSTALLED.push(CustomResource);\n * @memberof PIXI\n * @type {Array<PIXI.IResourcePlugin>}\n * @static\n * @readonly\n */\nvar INSTALLED = [];\n/**\n * Create a resource element from a single source element. This\n * auto-detects which type of resource to create. All resources that\n * are auto-detectable must have a static `test` method and a constructor\n * with the arguments `(source, options?)`. Currently, the supported\n * resources for auto-detection include:\n * - {@link PIXI.ImageResource}\n * - {@link PIXI.CanvasResource}\n * - {@link PIXI.VideoResource}\n * - {@link PIXI.SVGResource}\n * - {@link PIXI.BufferResource}\n * @static\n * @memberof PIXI\n * @function autoDetectResource\n * @param {string|*} source - Resource source, this can be the URL to the resource,\n * a typed-array (for BufferResource), HTMLVideoElement, SVG data-uri\n * or any other resource that can be auto-detected. If not resource is\n * detected, it's assumed to be an ImageResource.\n * @param {object} [options] - Pass-through options to use for Resource\n * @param {number} [options.width] - Width of BufferResource or SVG rasterization\n * @param {number} [options.height] - Height of BufferResource or SVG rasterization\n * @param {boolean} [options.autoLoad=true] - Image, SVG and Video flag to start loading\n * @param {number} [options.scale=1] - SVG source scale. Overridden by width, height\n * @param {boolean} [options.createBitmap=PIXI.settings.CREATE_IMAGE_BITMAP] - Image option to create Bitmap object\n * @param {boolean} [options.crossorigin=true] - Image and Video option to set crossOrigin\n * @param {boolean} [options.autoPlay=true] - Video option to start playing video immediately\n * @param {number} [options.updateFPS=0] - Video option to update how many times a second the\n * texture should be updated from the video. Leave at 0 to update at every render\n * @returns {PIXI.Resource} The created resource.\n */\nfunction autoDetectResource(source, options) {\n if (!source) {\n return null;\n }\n var extension = '';\n if (typeof source === 'string') {\n // search for file extension: period, 3-4 chars, then ?, # or EOL\n var result = (/\\.(\\w{3,4})(?:$|\\?|#)/i).exec(source);\n if (result) {\n extension = result[1].toLowerCase();\n }\n }\n for (var i = INSTALLED.length - 1; i >= 0; --i) {\n var ResourcePlugin = INSTALLED[i];\n if (ResourcePlugin.test && ResourcePlugin.test(source, extension)) {\n return new ResourcePlugin(source, options);\n }\n }\n throw new Error('Unrecognized source type to auto-detect Resource');\n}\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\n var arguments$1 = arguments;\n\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments$1[i];\r\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) { t[p] = s[p]; } }\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n { t[p] = s[p]; } }\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n { t[p[i]] = s[p[i]]; }\r\n } }\r\n return t;\r\n}\n\n/**\n * Base resource class for textures that manages validation and uploading, depending on its type.\n *\n * Uploading of a base texture to the GPU is required.\n * @memberof PIXI\n */\nvar Resource = /** @class */ (function () {\n /**\n * @param width - Width of the resource\n * @param height - Height of the resource\n */\n function Resource(width, height) {\n if (width === void 0) { width = 0; }\n if (height === void 0) { height = 0; }\n this._width = width;\n this._height = height;\n this.destroyed = false;\n this.internal = false;\n this.onResize = new Runner('setRealSize');\n this.onUpdate = new Runner('update');\n this.onError = new Runner('onError');\n }\n /**\n * Bind to a parent BaseTexture\n * @param baseTexture - Parent texture\n */\n Resource.prototype.bind = function (baseTexture) {\n this.onResize.add(baseTexture);\n this.onUpdate.add(baseTexture);\n this.onError.add(baseTexture);\n // Call a resize immediate if we already\n // have the width and height of the resource\n if (this._width || this._height) {\n this.onResize.emit(this._width, this._height);\n }\n };\n /**\n * Unbind to a parent BaseTexture\n * @param baseTexture - Parent texture\n */\n Resource.prototype.unbind = function (baseTexture) {\n this.onResize.remove(baseTexture);\n this.onUpdate.remove(baseTexture);\n this.onError.remove(baseTexture);\n };\n /**\n * Trigger a resize event\n * @param width - X dimension\n * @param height - Y dimension\n */\n Resource.prototype.resize = function (width, height) {\n if (width !== this._width || height !== this._height) {\n this._width = width;\n this._height = height;\n this.onResize.emit(width, height);\n }\n };\n Object.defineProperty(Resource.prototype, \"valid\", {\n /**\n * Has been validated\n * @readonly\n */\n get: function () {\n return !!this._width && !!this._height;\n },\n enumerable: false,\n configurable: true\n });\n /** Has been updated trigger event. */\n Resource.prototype.update = function () {\n if (!this.destroyed) {\n this.onUpdate.emit();\n }\n };\n /**\n * This can be overridden to start preloading a resource\n * or do any other prepare step.\n * @protected\n * @returns Handle the validate event\n */\n Resource.prototype.load = function () {\n return Promise.resolve(this);\n };\n Object.defineProperty(Resource.prototype, \"width\", {\n /**\n * The width of the resource.\n * @readonly\n */\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Resource.prototype, \"height\", {\n /**\n * The height of the resource.\n * @readonly\n */\n get: function () {\n return this._height;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Set the style, optional to override\n * @param _renderer - yeah, renderer!\n * @param _baseTexture - the texture\n * @param _glTexture - texture instance for this webgl context\n * @returns - `true` is success\n */\n Resource.prototype.style = function (_renderer, _baseTexture, _glTexture) {\n return false;\n };\n /** Clean up anything, this happens when destroying is ready. */\n Resource.prototype.dispose = function () {\n // override\n };\n /**\n * Call when destroying resource, unbind any BaseTexture object\n * before calling this method, as reference counts are maintained\n * internally.\n */\n Resource.prototype.destroy = function () {\n if (!this.destroyed) {\n this.destroyed = true;\n this.dispose();\n this.onError.removeAll();\n this.onError = null;\n this.onResize.removeAll();\n this.onResize = null;\n this.onUpdate.removeAll();\n this.onUpdate = null;\n }\n };\n /**\n * Abstract, used to auto-detect resource type.\n * @param {*} _source - The source object\n * @param {string} _extension - The extension of source, if set\n */\n Resource.test = function (_source, _extension) {\n return false;\n };\n return Resource;\n}());\n\n/**\n * @interface SharedArrayBuffer\n */\n/**\n * Buffer resource with data of typed array.\n * @memberof PIXI\n */\nvar BufferResource = /** @class */ (function (_super) {\n __extends(BufferResource, _super);\n /**\n * @param source - Source buffer\n * @param options - Options\n * @param {number} options.width - Width of the texture\n * @param {number} options.height - Height of the texture\n */\n function BufferResource(source, options) {\n var _this = this;\n var _a = options || {}, width = _a.width, height = _a.height;\n if (!width || !height) {\n throw new Error('BufferResource width or height invalid');\n }\n _this = _super.call(this, width, height) || this;\n _this.data = source;\n return _this;\n }\n /**\n * Upload the texture to the GPU.\n * @param renderer - Upload to the renderer\n * @param baseTexture - Reference to parent texture\n * @param glTexture - glTexture\n * @returns - true is success\n */\n BufferResource.prototype.upload = function (renderer, baseTexture, glTexture) {\n var gl = renderer.gl;\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === ALPHA_MODES.UNPACK);\n var width = baseTexture.realWidth;\n var height = baseTexture.realHeight;\n if (glTexture.width === width && glTexture.height === height) {\n gl.texSubImage2D(baseTexture.target, 0, 0, 0, width, height, baseTexture.format, glTexture.type, this.data);\n }\n else {\n glTexture.width = width;\n glTexture.height = height;\n gl.texImage2D(baseTexture.target, 0, glTexture.internalFormat, width, height, 0, baseTexture.format, glTexture.type, this.data);\n }\n return true;\n };\n /** Destroy and don't use after this. */\n BufferResource.prototype.dispose = function () {\n this.data = null;\n };\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if <canvas>\n */\n BufferResource.test = function (source) {\n return source instanceof Float32Array\n || source instanceof Uint8Array\n || source instanceof Uint32Array;\n };\n return BufferResource;\n}(Resource));\n\nvar defaultBufferOptions = {\n scaleMode: SCALE_MODES.NEAREST,\n format: FORMATS.RGBA,\n alphaMode: ALPHA_MODES.NPM,\n};\n/**\n * A Texture stores the information that represents an image.\n * All textures have a base texture, which contains information about the source.\n * Therefore you can have many textures all using a single BaseTexture\n * @memberof PIXI\n * @typeParam R - The BaseTexture's Resource type.\n * @typeParam RO - The options for constructing resource.\n */\nvar BaseTexture = /** @class */ (function (_super) {\n __extends(BaseTexture, _super);\n /**\n * @param {PIXI.Resource|string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} [resource=null] -\n * The current resource to use, for things that aren't Resource objects, will be converted\n * into a Resource.\n * @param options - Collection of options\n * @param {PIXI.MIPMAP_MODES} [options.mipmap=PIXI.settings.MIPMAP_TEXTURES] - If mipmapping is enabled for texture\n * @param {number} [options.anisotropicLevel=PIXI.settings.ANISOTROPIC_LEVEL] - Anisotropic filtering level of texture\n * @param {PIXI.WRAP_MODES} [options.wrapMode=PIXI.settings.WRAP_MODE] - Wrap mode for textures\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - Default scale mode, linear, nearest\n * @param {PIXI.FORMATS} [options.format=PIXI.FORMATS.RGBA] - GL format type\n * @param {PIXI.TYPES} [options.type=PIXI.TYPES.UNSIGNED_BYTE] - GL data type\n * @param {PIXI.TARGETS} [options.target=PIXI.TARGETS.TEXTURE_2D] - GL texture target\n * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.UNPACK] - Pre multiply the image alpha\n * @param {number} [options.width=0] - Width of the texture\n * @param {number} [options.height=0] - Height of the texture\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - Resolution of the base texture\n * @param {object} [options.resourceOptions] - Optional resource options,\n * see {@link PIXI.autoDetectResource autoDetectResource}\n */\n function BaseTexture(resource, options) {\n if (resource === void 0) { resource = null; }\n if (options === void 0) { options = null; }\n var _this = _super.call(this) || this;\n options = options || {};\n var alphaMode = options.alphaMode, mipmap = options.mipmap, anisotropicLevel = options.anisotropicLevel, scaleMode = options.scaleMode, width = options.width, height = options.height, wrapMode = options.wrapMode, format = options.format, type = options.type, target = options.target, resolution = options.resolution, resourceOptions = options.resourceOptions;\n // Convert the resource to a Resource object\n if (resource && !(resource instanceof Resource)) {\n resource = autoDetectResource(resource, resourceOptions);\n resource.internal = true;\n }\n _this.resolution = resolution || settings.RESOLUTION;\n _this.width = Math.round((width || 0) * _this.resolution) / _this.resolution;\n _this.height = Math.round((height || 0) * _this.resolution) / _this.resolution;\n _this._mipmap = mipmap !== undefined ? mipmap : settings.MIPMAP_TEXTURES;\n _this.anisotropicLevel = anisotropicLevel !== undefined ? anisotropicLevel : settings.ANISOTROPIC_LEVEL;\n _this._wrapMode = wrapMode || settings.WRAP_MODE;\n _this._scaleMode = scaleMode !== undefined ? scaleMode : settings.SCALE_MODE;\n _this.format = format || FORMATS.RGBA;\n _this.type = type || TYPES.UNSIGNED_BYTE;\n _this.target = target || TARGETS.TEXTURE_2D;\n _this.alphaMode = alphaMode !== undefined ? alphaMode : ALPHA_MODES.UNPACK;\n _this.uid = uid();\n _this.touched = 0;\n _this.isPowerOfTwo = false;\n _this._refreshPOT();\n _this._glTextures = {};\n _this.dirtyId = 0;\n _this.dirtyStyleId = 0;\n _this.cacheId = null;\n _this.valid = width > 0 && height > 0;\n _this.textureCacheIds = [];\n _this.destroyed = false;\n _this.resource = null;\n _this._batchEnabled = 0;\n _this._batchLocation = 0;\n _this.parentTextureArray = null;\n /**\n * Fired when a not-immediately-available source finishes loading.\n * @protected\n * @event PIXI.BaseTexture#loaded\n * @param {PIXI.BaseTexture} baseTexture - Resource loaded.\n */\n /**\n * Fired when a not-immediately-available source fails to load.\n * @protected\n * @event PIXI.BaseTexture#error\n * @param {PIXI.BaseTexture} baseTexture - Resource errored.\n * @param {ErrorEvent} event - Load error event.\n */\n /**\n * Fired when BaseTexture is updated.\n * @protected\n * @event PIXI.BaseTexture#loaded\n * @param {PIXI.BaseTexture} baseTexture - Resource loaded.\n */\n /**\n * Fired when BaseTexture is updated.\n * @protected\n * @event PIXI.BaseTexture#update\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being updated.\n */\n /**\n * Fired when BaseTexture is destroyed.\n * @protected\n * @event PIXI.BaseTexture#dispose\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being destroyed.\n */\n // Set the resource\n _this.setResource(resource);\n return _this;\n }\n Object.defineProperty(BaseTexture.prototype, \"realWidth\", {\n /**\n * Pixel width of the source of this texture\n * @readonly\n */\n get: function () {\n return Math.round(this.width * this.resolution);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTexture.prototype, \"realHeight\", {\n /**\n * Pixel height of the source of this texture\n * @readonly\n */\n get: function () {\n return Math.round(this.height * this.resolution);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTexture.prototype, \"mipmap\", {\n /**\n * Mipmap mode of the texture, affects downscaled images\n * @default PIXI.settings.MIPMAP_TEXTURES\n */\n get: function () {\n return this._mipmap;\n },\n set: function (value) {\n if (this._mipmap !== value) {\n this._mipmap = value;\n this.dirtyStyleId++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTexture.prototype, \"scaleMode\", {\n /**\n * The scale mode to apply when scaling this texture\n * @default PIXI.settings.SCALE_MODE\n */\n get: function () {\n return this._scaleMode;\n },\n set: function (value) {\n if (this._scaleMode !== value) {\n this._scaleMode = value;\n this.dirtyStyleId++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BaseTexture.prototype, \"wrapMode\", {\n /**\n * How the texture wraps\n * @default PIXI.settings.WRAP_MODE\n */\n get: function () {\n return this._wrapMode;\n },\n set: function (value) {\n if (this._wrapMode !== value) {\n this._wrapMode = value;\n this.dirtyStyleId++;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Changes style options of BaseTexture\n * @param scaleMode - Pixi scalemode\n * @param mipmap - enable mipmaps\n * @returns - this\n */\n BaseTexture.prototype.setStyle = function (scaleMode, mipmap) {\n var dirty;\n if (scaleMode !== undefined && scaleMode !== this.scaleMode) {\n this.scaleMode = scaleMode;\n dirty = true;\n }\n if (mipmap !== undefined && mipmap !== this.mipmap) {\n this.mipmap = mipmap;\n dirty = true;\n }\n if (dirty) {\n this.dirtyStyleId++;\n }\n return this;\n };\n /**\n * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.\n * @param desiredWidth - Desired visual width\n * @param desiredHeight - Desired visual height\n * @param resolution - Optionally set resolution\n * @returns - this\n */\n BaseTexture.prototype.setSize = function (desiredWidth, desiredHeight, resolution) {\n resolution = resolution || this.resolution;\n return this.setRealSize(desiredWidth * resolution, desiredHeight * resolution, resolution);\n };\n /**\n * Sets real size of baseTexture, preserves current resolution.\n * @param realWidth - Full rendered width\n * @param realHeight - Full rendered height\n * @param resolution - Optionally set resolution\n * @returns - this\n */\n BaseTexture.prototype.setRealSize = function (realWidth, realHeight, resolution) {\n this.resolution = resolution || this.resolution;\n this.width = Math.round(realWidth) / this.resolution;\n this.height = Math.round(realHeight) / this.resolution;\n this._refreshPOT();\n this.update();\n return this;\n };\n /**\n * Refresh check for isPowerOfTwo texture based on size\n * @private\n */\n BaseTexture.prototype._refreshPOT = function () {\n this.isPowerOfTwo = isPow2(this.realWidth) && isPow2(this.realHeight);\n };\n /**\n * Changes resolution\n * @param resolution - res\n * @returns - this\n */\n BaseTexture.prototype.setResolution = function (resolution) {\n var oldResolution = this.resolution;\n if (oldResolution === resolution) {\n return this;\n }\n this.resolution = resolution;\n if (this.valid) {\n this.width = Math.round(this.width * oldResolution) / resolution;\n this.height = Math.round(this.height * oldResolution) / resolution;\n this.emit('update', this);\n }\n this._refreshPOT();\n return this;\n };\n /**\n * Sets the resource if it wasn't set. Throws error if resource already present\n * @param resource - that is managing this BaseTexture\n * @returns - this\n */\n BaseTexture.prototype.setResource = function (resource) {\n if (this.resource === resource) {\n return this;\n }\n if (this.resource) {\n throw new Error('Resource can be set only once');\n }\n resource.bind(this);\n this.resource = resource;\n return this;\n };\n /** Invalidates the object. Texture becomes valid if width and height are greater than zero. */\n BaseTexture.prototype.update = function () {\n if (!this.valid) {\n if (this.width > 0 && this.height > 0) {\n this.valid = true;\n this.emit('loaded', this);\n this.emit('update', this);\n }\n }\n else {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.emit('update', this);\n }\n };\n /**\n * Handle errors with resources.\n * @private\n * @param event - Error event emitted.\n */\n BaseTexture.prototype.onError = function (event) {\n this.emit('error', this, event);\n };\n /**\n * Destroys this base texture.\n * The method stops if resource doesn't want this texture to be destroyed.\n * Removes texture from all caches.\n */\n BaseTexture.prototype.destroy = function () {\n // remove and destroy the resource\n if (this.resource) {\n this.resource.unbind(this);\n // only destroy resourced created internally\n if (this.resource.internal) {\n this.resource.destroy();\n }\n this.resource = null;\n }\n if (this.cacheId) {\n delete BaseTextureCache[this.cacheId];\n delete TextureCache[this.cacheId];\n this.cacheId = null;\n }\n // finally let the WebGL renderer know..\n this.dispose();\n BaseTexture.removeFromCache(this);\n this.textureCacheIds = null;\n this.destroyed = true;\n };\n /**\n * Frees the texture from WebGL memory without destroying this texture object.\n * This means you can still use the texture later which will upload it to GPU\n * memory again.\n * @fires PIXI.BaseTexture#dispose\n */\n BaseTexture.prototype.dispose = function () {\n this.emit('dispose', this);\n };\n /** Utility function for BaseTexture|Texture cast. */\n BaseTexture.prototype.castToBaseTexture = function () {\n return this;\n };\n /**\n * Helper function that creates a base texture based on the source you provide.\n * The source can be - image url, image element, canvas element. If the\n * source is an image url or an image element and not in the base texture\n * cache, it will be created and loaded.\n * @static\n * @param {string|string[]|HTMLImageElement|HTMLCanvasElement|SVGElement|HTMLVideoElement} source - The\n * source to create base texture from.\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {string} [options.pixiIdPrefix=pixiid] - If a source has no id, this is the prefix of the generated id\n * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.\n * @returns {PIXI.BaseTexture} The new base texture.\n */\n BaseTexture.from = function (source, options, strict) {\n if (strict === void 0) { strict = settings.STRICT_TEXTURE_CACHE; }\n var isFrame = typeof source === 'string';\n var cacheId = null;\n if (isFrame) {\n cacheId = source;\n }\n else {\n if (!source._pixiId) {\n var prefix = (options && options.pixiIdPrefix) || 'pixiid';\n source._pixiId = prefix + \"_\" + uid();\n }\n cacheId = source._pixiId;\n }\n var baseTexture = BaseTextureCache[cacheId];\n // Strict-mode rejects invalid cacheIds\n if (isFrame && strict && !baseTexture) {\n throw new Error(\"The cacheId \\\"\" + cacheId + \"\\\" does not exist in BaseTextureCache.\");\n }\n if (!baseTexture) {\n baseTexture = new BaseTexture(source, options);\n baseTexture.cacheId = cacheId;\n BaseTexture.addToCache(baseTexture, cacheId);\n }\n return baseTexture;\n };\n /**\n * Create a new BaseTexture with a BufferResource from a Float32Array.\n * RGBA values are floats from 0 to 1.\n * @param {Float32Array|Uint8Array} buffer - The optional array to use, if no data\n * is provided, a new Float32Array is created.\n * @param width - Width of the resource\n * @param height - Height of the resource\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * Default properties are different from the constructor's defaults.\n * @param {PIXI.FORMATS} [options.format=PIXI.FORMATS.RGBA] - GL format type\n * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.NPM] - Image alpha, not premultiplied by default\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.SCALE_MODES.NEAREST] - Scale mode, pixelating by default\n * @returns - The resulting new BaseTexture\n */\n BaseTexture.fromBuffer = function (buffer, width, height, options) {\n buffer = buffer || new Float32Array(width * height * 4);\n var resource = new BufferResource(buffer, { width: width, height: height });\n var type = buffer instanceof Float32Array ? TYPES.FLOAT : TYPES.UNSIGNED_BYTE;\n return new BaseTexture(resource, Object.assign({}, defaultBufferOptions, options || { width: width, height: height, type: type }));\n };\n /**\n * Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.\n * @param {PIXI.BaseTexture} baseTexture - The BaseTexture to add to the cache.\n * @param {string} id - The id that the BaseTexture will be stored against.\n */\n BaseTexture.addToCache = function (baseTexture, id) {\n if (id) {\n if (baseTexture.textureCacheIds.indexOf(id) === -1) {\n baseTexture.textureCacheIds.push(id);\n }\n if (BaseTextureCache[id]) {\n // eslint-disable-next-line no-console\n console.warn(\"BaseTexture added to the cache with an id [\" + id + \"] that already had an entry\");\n }\n BaseTextureCache[id] = baseTexture;\n }\n };\n /**\n * Remove a BaseTexture from the global BaseTextureCache.\n * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself.\n * @returns {PIXI.BaseTexture|null} The BaseTexture that was removed.\n */\n BaseTexture.removeFromCache = function (baseTexture) {\n if (typeof baseTexture === 'string') {\n var baseTextureFromCache = BaseTextureCache[baseTexture];\n if (baseTextureFromCache) {\n var index = baseTextureFromCache.textureCacheIds.indexOf(baseTexture);\n if (index > -1) {\n baseTextureFromCache.textureCacheIds.splice(index, 1);\n }\n delete BaseTextureCache[baseTexture];\n return baseTextureFromCache;\n }\n }\n else if (baseTexture && baseTexture.textureCacheIds) {\n for (var i = 0; i < baseTexture.textureCacheIds.length; ++i) {\n delete BaseTextureCache[baseTexture.textureCacheIds[i]];\n }\n baseTexture.textureCacheIds.length = 0;\n return baseTexture;\n }\n return null;\n };\n /** Global number of the texture batch, used by multi-texture renderers. */\n BaseTexture._globalBatch = 0;\n return BaseTexture;\n}(EventEmitter));\n\n/**\n * Resource that can manage several resource (items) inside.\n * All resources need to have the same pixel size.\n * Parent class for CubeResource and ArrayResource\n * @memberof PIXI\n */\nvar AbstractMultiResource = /** @class */ (function (_super) {\n __extends(AbstractMultiResource, _super);\n /**\n * @param length\n * @param options - Options to for Resource constructor\n * @param {number} [options.width] - Width of the resource\n * @param {number} [options.height] - Height of the resource\n */\n function AbstractMultiResource(length, options) {\n var _this = this;\n var _a = options || {}, width = _a.width, height = _a.height;\n _this = _super.call(this, width, height) || this;\n _this.items = [];\n _this.itemDirtyIds = [];\n for (var i = 0; i < length; i++) {\n var partTexture = new BaseTexture();\n _this.items.push(partTexture);\n // -2 - first run of texture array upload\n // -1 - texture item was allocated\n // >=0 - texture item uploaded , in sync with items[i].dirtyId\n _this.itemDirtyIds.push(-2);\n }\n _this.length = length;\n _this._load = null;\n _this.baseTexture = null;\n return _this;\n }\n /**\n * Used from ArrayResource and CubeResource constructors.\n * @param resources - Can be resources, image elements, canvas, etc. ,\n * length should be same as constructor length\n * @param options - Detect options for resources\n */\n AbstractMultiResource.prototype.initFromArray = function (resources, options) {\n for (var i = 0; i < this.length; i++) {\n if (!resources[i]) {\n continue;\n }\n if (resources[i].castToBaseTexture) {\n this.addBaseTextureAt(resources[i].castToBaseTexture(), i);\n }\n else if (resources[i] instanceof Resource) {\n this.addResourceAt(resources[i], i);\n }\n else {\n this.addResourceAt(autoDetectResource(resources[i], options), i);\n }\n }\n };\n /** Destroy this BaseImageResource. */\n AbstractMultiResource.prototype.dispose = function () {\n for (var i = 0, len = this.length; i < len; i++) {\n this.items[i].destroy();\n }\n this.items = null;\n this.itemDirtyIds = null;\n this._load = null;\n };\n /**\n * Set a resource by ID\n * @param resource\n * @param index - Zero-based index of resource to set\n * @returns - Instance for chaining\n */\n AbstractMultiResource.prototype.addResourceAt = function (resource, index) {\n if (!this.items[index]) {\n throw new Error(\"Index \" + index + \" is out of bounds\");\n }\n // Inherit the first resource dimensions\n if (resource.valid && !this.valid) {\n this.resize(resource.width, resource.height);\n }\n this.items[index].setResource(resource);\n return this;\n };\n /**\n * Set the parent base texture.\n * @param baseTexture\n */\n AbstractMultiResource.prototype.bind = function (baseTexture) {\n if (this.baseTexture !== null) {\n throw new Error('Only one base texture per TextureArray is allowed');\n }\n _super.prototype.bind.call(this, baseTexture);\n for (var i = 0; i < this.length; i++) {\n this.items[i].parentTextureArray = baseTexture;\n this.items[i].on('update', baseTexture.update, baseTexture);\n }\n };\n /**\n * Unset the parent base texture.\n * @param baseTexture\n */\n AbstractMultiResource.prototype.unbind = function (baseTexture) {\n _super.prototype.unbind.call(this, baseTexture);\n for (var i = 0; i < this.length; i++) {\n this.items[i].parentTextureArray = null;\n this.items[i].off('update', baseTexture.update, baseTexture);\n }\n };\n /**\n * Load all the resources simultaneously\n * @returns - When load is resolved\n */\n AbstractMultiResource.prototype.load = function () {\n var _this = this;\n if (this._load) {\n return this._load;\n }\n var resources = this.items.map(function (item) { return item.resource; }).filter(function (item) { return item; });\n // TODO: also implement load part-by-part strategy\n var promises = resources.map(function (item) { return item.load(); });\n this._load = Promise.all(promises)\n .then(function () {\n var _a = _this.items[0], realWidth = _a.realWidth, realHeight = _a.realHeight;\n _this.resize(realWidth, realHeight);\n return Promise.resolve(_this);\n });\n return this._load;\n };\n return AbstractMultiResource;\n}(Resource));\n\n/**\n * A resource that contains a number of sources.\n * @memberof PIXI\n */\nvar ArrayResource = /** @class */ (function (_super) {\n __extends(ArrayResource, _super);\n /**\n * @param source - Number of items in array or the collection\n * of image URLs to use. Can also be resources, image elements, canvas, etc.\n * @param options - Options to apply to {@link PIXI.autoDetectResource}\n * @param {number} [options.width] - Width of the resource\n * @param {number} [options.height] - Height of the resource\n */\n function ArrayResource(source, options) {\n var _this = this;\n var _a = options || {}, width = _a.width, height = _a.height;\n var urls;\n var length;\n if (Array.isArray(source)) {\n urls = source;\n length = source.length;\n }\n else {\n length = source;\n }\n _this = _super.call(this, length, { width: width, height: height }) || this;\n if (urls) {\n _this.initFromArray(urls, options);\n }\n return _this;\n }\n /**\n * Set a baseTexture by ID,\n * ArrayResource just takes resource from it, nothing more\n * @param baseTexture\n * @param index - Zero-based index of resource to set\n * @returns - Instance for chaining\n */\n ArrayResource.prototype.addBaseTextureAt = function (baseTexture, index) {\n if (baseTexture.resource) {\n this.addResourceAt(baseTexture.resource, index);\n }\n else {\n throw new Error('ArrayResource does not support RenderTexture');\n }\n return this;\n };\n /**\n * Add binding\n * @param baseTexture\n */\n ArrayResource.prototype.bind = function (baseTexture) {\n _super.prototype.bind.call(this, baseTexture);\n baseTexture.target = TARGETS.TEXTURE_2D_ARRAY;\n };\n /**\n * Upload the resources to the GPU.\n * @param renderer\n * @param texture\n * @param glTexture\n * @returns - whether texture was uploaded\n */\n ArrayResource.prototype.upload = function (renderer, texture, glTexture) {\n var _a = this, length = _a.length, itemDirtyIds = _a.itemDirtyIds, items = _a.items;\n var gl = renderer.gl;\n if (glTexture.dirtyId < 0) {\n gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, glTexture.internalFormat, this._width, this._height, length, 0, texture.format, glTexture.type, null);\n }\n for (var i = 0; i < length; i++) {\n var item = items[i];\n if (itemDirtyIds[i] < item.dirtyId) {\n itemDirtyIds[i] = item.dirtyId;\n if (item.valid) {\n gl.texSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, // xoffset\n 0, // yoffset\n i, // zoffset\n item.resource.width, item.resource.height, 1, texture.format, glTexture.type, item.resource.source);\n }\n }\n }\n return true;\n };\n return ArrayResource;\n}(AbstractMultiResource));\n\n/**\n * Base for all the image/canvas resources.\n * @memberof PIXI\n */\nvar BaseImageResource = /** @class */ (function (_super) {\n __extends(BaseImageResource, _super);\n /**\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} source\n */\n function BaseImageResource(source) {\n var _this = this;\n var sourceAny = source;\n var width = sourceAny.naturalWidth || sourceAny.videoWidth || sourceAny.width;\n var height = sourceAny.naturalHeight || sourceAny.videoHeight || sourceAny.height;\n _this = _super.call(this, width, height) || this;\n _this.source = source;\n _this.noSubImage = false;\n return _this;\n }\n /**\n * Set cross origin based detecting the url and the crossorigin\n * @param element - Element to apply crossOrigin\n * @param url - URL to check\n * @param crossorigin - Cross origin value to use\n */\n BaseImageResource.crossOrigin = function (element, url, crossorigin) {\n if (crossorigin === undefined && url.indexOf('data:') !== 0) {\n element.crossOrigin = determineCrossOrigin(url);\n }\n else if (crossorigin !== false) {\n element.crossOrigin = typeof crossorigin === 'string' ? crossorigin : 'anonymous';\n }\n };\n /**\n * Upload the texture to the GPU.\n * @param renderer - Upload to the renderer\n * @param baseTexture - Reference to parent texture\n * @param glTexture\n * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|SVGElement} [source] - (optional)\n * @returns - true is success\n */\n BaseImageResource.prototype.upload = function (renderer, baseTexture, glTexture, source) {\n var gl = renderer.gl;\n var width = baseTexture.realWidth;\n var height = baseTexture.realHeight;\n source = source || this.source;\n if (source instanceof HTMLImageElement) {\n if (!source.complete || source.naturalWidth === 0) {\n return false;\n }\n }\n else if (source instanceof HTMLVideoElement) {\n if (source.readyState <= 1) {\n return false;\n }\n }\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === ALPHA_MODES.UNPACK);\n if (!this.noSubImage\n && baseTexture.target === gl.TEXTURE_2D\n && glTexture.width === width\n && glTexture.height === height) {\n gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, baseTexture.format, glTexture.type, source);\n }\n else {\n glTexture.width = width;\n glTexture.height = height;\n gl.texImage2D(baseTexture.target, 0, glTexture.internalFormat, baseTexture.format, glTexture.type, source);\n }\n return true;\n };\n /**\n * Checks if source width/height was changed, resize can cause extra baseTexture update.\n * Triggers one update in any case.\n */\n BaseImageResource.prototype.update = function () {\n if (this.destroyed) {\n return;\n }\n var source = this.source;\n var width = source.naturalWidth || source.videoWidth || source.width;\n var height = source.naturalHeight || source.videoHeight || source.height;\n this.resize(width, height);\n _super.prototype.update.call(this);\n };\n /** Destroy this {@link BaseImageResource} */\n BaseImageResource.prototype.dispose = function () {\n this.source = null;\n };\n return BaseImageResource;\n}(Resource));\n\n/**\n * @interface OffscreenCanvas\n */\n/**\n * Resource type for HTMLCanvasElement.\n * @memberof PIXI\n */\nvar CanvasResource = /** @class */ (function (_super) {\n __extends(CanvasResource, _super);\n /**\n * @param source - Canvas element to use\n */\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n function CanvasResource(source) {\n return _super.call(this, source) || this;\n }\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is HTMLCanvasElement or OffscreenCanvas\n */\n CanvasResource.test = function (source) {\n var OffscreenCanvas = globalThis.OffscreenCanvas;\n // Check for browsers that don't yet support OffscreenCanvas\n if (OffscreenCanvas && source instanceof OffscreenCanvas) {\n return true;\n }\n return globalThis.HTMLCanvasElement && source instanceof HTMLCanvasElement;\n };\n return CanvasResource;\n}(BaseImageResource));\n\n/**\n * Resource for a CubeTexture which contains six resources.\n * @memberof PIXI\n */\nvar CubeResource = /** @class */ (function (_super) {\n __extends(CubeResource, _super);\n /**\n * @param {Array<string|PIXI.Resource>} [source] - Collection of URLs or resources\n * to use as the sides of the cube.\n * @param options - ImageResource options\n * @param {number} [options.width] - Width of resource\n * @param {number} [options.height] - Height of resource\n * @param {number} [options.autoLoad=true] - Whether to auto-load resources\n * @param {number} [options.linkBaseTexture=true] - In case BaseTextures are supplied,\n * whether to copy them or use\n */\n function CubeResource(source, options) {\n var _this = this;\n var _a = options || {}, width = _a.width, height = _a.height, autoLoad = _a.autoLoad, linkBaseTexture = _a.linkBaseTexture;\n if (source && source.length !== CubeResource.SIDES) {\n throw new Error(\"Invalid length. Got \" + source.length + \", expected 6\");\n }\n _this = _super.call(this, 6, { width: width, height: height }) || this;\n for (var i = 0; i < CubeResource.SIDES; i++) {\n _this.items[i].target = TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + i;\n }\n _this.linkBaseTexture = linkBaseTexture !== false;\n if (source) {\n _this.initFromArray(source, options);\n }\n if (autoLoad !== false) {\n _this.load();\n }\n return _this;\n }\n /**\n * Add binding.\n * @param baseTexture - parent base texture\n */\n CubeResource.prototype.bind = function (baseTexture) {\n _super.prototype.bind.call(this, baseTexture);\n baseTexture.target = TARGETS.TEXTURE_CUBE_MAP;\n };\n CubeResource.prototype.addBaseTextureAt = function (baseTexture, index, linkBaseTexture) {\n if (!this.items[index]) {\n throw new Error(\"Index \" + index + \" is out of bounds\");\n }\n if (!this.linkBaseTexture\n || baseTexture.parentTextureArray\n || Object.keys(baseTexture._glTextures).length > 0) {\n // copy mode\n if (baseTexture.resource) {\n this.addResourceAt(baseTexture.resource, index);\n }\n else {\n throw new Error(\"CubeResource does not support copying of renderTexture.\");\n }\n }\n else {\n // link mode, the difficult one!\n baseTexture.target = TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X + index;\n baseTexture.parentTextureArray = this.baseTexture;\n this.items[index] = baseTexture;\n }\n if (baseTexture.valid && !this.valid) {\n this.resize(baseTexture.realWidth, baseTexture.realHeight);\n }\n this.items[index] = baseTexture;\n return this;\n };\n /**\n * Upload the resource\n * @param renderer\n * @param _baseTexture\n * @param glTexture\n * @returns {boolean} true is success\n */\n CubeResource.prototype.upload = function (renderer, _baseTexture, glTexture) {\n var dirty = this.itemDirtyIds;\n for (var i = 0; i < CubeResource.SIDES; i++) {\n var side = this.items[i];\n if (dirty[i] < side.dirtyId || glTexture.dirtyId < _baseTexture.dirtyId) {\n if (side.valid && side.resource) {\n side.resource.upload(renderer, side, glTexture);\n dirty[i] = side.dirtyId;\n }\n else if (dirty[i] < -1) {\n // either item is not valid yet, either its a renderTexture\n // allocate the memory\n renderer.gl.texImage2D(side.target, 0, glTexture.internalFormat, _baseTexture.realWidth, _baseTexture.realHeight, 0, _baseTexture.format, glTexture.type, null);\n dirty[i] = -1;\n }\n }\n }\n return true;\n };\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is an array of 6 elements\n */\n CubeResource.test = function (source) {\n return Array.isArray(source) && source.length === CubeResource.SIDES;\n };\n /** Number of texture sides to store for CubeResources. */\n CubeResource.SIDES = 6;\n return CubeResource;\n}(AbstractMultiResource));\n\n/**\n * Resource type for HTMLImageElement.\n * @memberof PIXI\n */\nvar ImageResource = /** @class */ (function (_super) {\n __extends(ImageResource, _super);\n /**\n * @param source - image source or URL\n * @param options\n * @param {boolean} [options.autoLoad=true] - start loading process\n * @param {boolean} [options.createBitmap=PIXI.settings.CREATE_IMAGE_BITMAP] - whether its required to create\n * a bitmap before upload\n * @param {boolean} [options.crossorigin=true] - Load image using cross origin\n * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.UNPACK] - Premultiply image alpha in bitmap\n */\n function ImageResource(source, options) {\n var _this = this;\n options = options || {};\n if (!(source instanceof HTMLImageElement)) {\n var imageElement = new Image();\n BaseImageResource.crossOrigin(imageElement, source, options.crossorigin);\n imageElement.src = source;\n source = imageElement;\n }\n _this = _super.call(this, source) || this;\n // FireFox 68, and possibly other versions, seems like setting the HTMLImageElement#width and #height\n // to non-zero values before its loading completes if images are in a cache.\n // Because of this, need to set the `_width` and the `_height` to zero to avoid uploading incomplete images.\n // Please refer to the issue #5968 (https://github.com/pixijs/pixi.js/issues/5968).\n if (!source.complete && !!_this._width && !!_this._height) {\n _this._width = 0;\n _this._height = 0;\n }\n _this.url = source.src;\n _this._process = null;\n _this.preserveBitmap = false;\n _this.createBitmap = (options.createBitmap !== undefined\n ? options.createBitmap : settings.CREATE_IMAGE_BITMAP) && !!globalThis.createImageBitmap;\n _this.alphaMode = typeof options.alphaMode === 'number' ? options.alphaMode : null;\n _this.bitmap = null;\n _this._load = null;\n if (options.autoLoad !== false) {\n _this.load();\n }\n return _this;\n }\n /**\n * Returns a promise when image will be loaded and processed.\n * @param createBitmap - whether process image into bitmap\n */\n ImageResource.prototype.load = function (createBitmap) {\n var _this = this;\n if (this._load) {\n return this._load;\n }\n if (createBitmap !== undefined) {\n this.createBitmap = createBitmap;\n }\n this._load = new Promise(function (resolve, reject) {\n var source = _this.source;\n _this.url = source.src;\n var completed = function () {\n if (_this.destroyed) {\n return;\n }\n source.onload = null;\n source.onerror = null;\n _this.resize(source.width, source.height);\n _this._load = null;\n if (_this.createBitmap) {\n resolve(_this.process());\n }\n else {\n resolve(_this);\n }\n };\n if (source.complete && source.src) {\n completed();\n }\n else {\n source.onload = completed;\n source.onerror = function (event) {\n // Avoids Promise freezing when resource broken\n reject(event);\n _this.onError.emit(event);\n };\n }\n });\n return this._load;\n };\n /**\n * Called when we need to convert image into BitmapImage.\n * Can be called multiple times, real promise is cached inside.\n * @returns - Cached promise to fill that bitmap\n */\n ImageResource.prototype.process = function () {\n var _this = this;\n var source = this.source;\n if (this._process !== null) {\n return this._process;\n }\n if (this.bitmap !== null || !globalThis.createImageBitmap) {\n return Promise.resolve(this);\n }\n var createImageBitmap = globalThis.createImageBitmap;\n var cors = !source.crossOrigin || source.crossOrigin === 'anonymous';\n this._process = fetch(source.src, {\n mode: cors ? 'cors' : 'no-cors'\n })\n .then(function (r) { return r.blob(); })\n .then(function (blob) { return createImageBitmap(blob, 0, 0, source.width, source.height, {\n premultiplyAlpha: _this.alphaMode === null || _this.alphaMode === ALPHA_MODES.UNPACK\n ? 'premultiply' : 'none',\n }); })\n .then(function (bitmap) {\n if (_this.destroyed) {\n return Promise.reject();\n }\n _this.bitmap = bitmap;\n _this.update();\n _this._process = null;\n return Promise.resolve(_this);\n });\n return this._process;\n };\n /**\n * Upload the image resource to GPU.\n * @param renderer - Renderer to upload to\n * @param baseTexture - BaseTexture for this resource\n * @param glTexture - GLTexture to use\n * @returns {boolean} true is success\n */\n ImageResource.prototype.upload = function (renderer, baseTexture, glTexture) {\n if (typeof this.alphaMode === 'number') {\n // bitmap stores unpack premultiply flag, we dont have to notify texImage2D about it\n baseTexture.alphaMode = this.alphaMode;\n }\n if (!this.createBitmap) {\n return _super.prototype.upload.call(this, renderer, baseTexture, glTexture);\n }\n if (!this.bitmap) {\n // yeah, ignore the output\n this.process();\n if (!this.bitmap) {\n return false;\n }\n }\n _super.prototype.upload.call(this, renderer, baseTexture, glTexture, this.bitmap);\n if (!this.preserveBitmap) {\n // checks if there are other renderers that possibly need this bitmap\n var flag = true;\n var glTextures = baseTexture._glTextures;\n for (var key in glTextures) {\n var otherTex = glTextures[key];\n if (otherTex !== glTexture && otherTex.dirtyId !== baseTexture.dirtyId) {\n flag = false;\n break;\n }\n }\n if (flag) {\n if (this.bitmap.close) {\n this.bitmap.close();\n }\n this.bitmap = null;\n }\n }\n return true;\n };\n /** Destroys this resource. */\n ImageResource.prototype.dispose = function () {\n this.source.onload = null;\n this.source.onerror = null;\n _super.prototype.dispose.call(this);\n if (this.bitmap) {\n this.bitmap.close();\n this.bitmap = null;\n }\n this._process = null;\n this._load = null;\n };\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is string or HTMLImageElement\n */\n ImageResource.test = function (source) {\n return typeof source === 'string' || source instanceof HTMLImageElement;\n };\n return ImageResource;\n}(BaseImageResource));\n\n/**\n * Resource type for SVG elements and graphics.\n * @memberof PIXI\n */\nvar SVGResource = /** @class */ (function (_super) {\n __extends(SVGResource, _super);\n /**\n * @param sourceBase64 - Base64 encoded SVG element or URL for SVG file.\n * @param {object} [options] - Options to use\n * @param {number} [options.scale=1] - Scale to apply to SVG. Overridden by...\n * @param {number} [options.width] - Rasterize SVG this wide. Aspect ratio preserved if height not specified.\n * @param {number} [options.height] - Rasterize SVG this high. Aspect ratio preserved if width not specified.\n * @param {boolean} [options.autoLoad=true] - Start loading right away.\n */\n function SVGResource(sourceBase64, options) {\n var _this = this;\n options = options || {};\n _this = _super.call(this, settings.ADAPTER.createCanvas()) || this;\n _this._width = 0;\n _this._height = 0;\n _this.svg = sourceBase64;\n _this.scale = options.scale || 1;\n _this._overrideWidth = options.width;\n _this._overrideHeight = options.height;\n _this._resolve = null;\n _this._crossorigin = options.crossorigin;\n _this._load = null;\n if (options.autoLoad !== false) {\n _this.load();\n }\n return _this;\n }\n SVGResource.prototype.load = function () {\n var _this = this;\n if (this._load) {\n return this._load;\n }\n this._load = new Promise(function (resolve) {\n // Save this until after load is finished\n _this._resolve = function () {\n _this.resize(_this.source.width, _this.source.height);\n resolve(_this);\n };\n // Convert SVG inline string to data-uri\n if (SVGResource.SVG_XML.test(_this.svg.trim())) {\n if (!btoa) {\n throw new Error('Your browser doesn\\'t support base64 conversions.');\n }\n _this.svg = \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(_this.svg)));\n }\n _this._loadSvg();\n });\n return this._load;\n };\n /** Loads an SVG image from `imageUrl` or `data URL`. */\n SVGResource.prototype._loadSvg = function () {\n var _this = this;\n var tempImage = new Image();\n BaseImageResource.crossOrigin(tempImage, this.svg, this._crossorigin);\n tempImage.src = this.svg;\n tempImage.onerror = function (event) {\n if (!_this._resolve) {\n return;\n }\n tempImage.onerror = null;\n _this.onError.emit(event);\n };\n tempImage.onload = function () {\n if (!_this._resolve) {\n return;\n }\n var svgWidth = tempImage.width;\n var svgHeight = tempImage.height;\n if (!svgWidth || !svgHeight) {\n throw new Error('The SVG image must have width and height defined (in pixels), canvas API needs them.');\n }\n // Set render size\n var width = svgWidth * _this.scale;\n var height = svgHeight * _this.scale;\n if (_this._overrideWidth || _this._overrideHeight) {\n width = _this._overrideWidth || _this._overrideHeight / svgHeight * svgWidth;\n height = _this._overrideHeight || _this._overrideWidth / svgWidth * svgHeight;\n }\n width = Math.round(width);\n height = Math.round(height);\n // Create a canvas element\n var canvas = _this.source;\n canvas.width = width;\n canvas.height = height;\n canvas._pixiId = \"canvas_\" + uid();\n // Draw the Svg to the canvas\n canvas\n .getContext('2d')\n .drawImage(tempImage, 0, 0, svgWidth, svgHeight, 0, 0, width, height);\n _this._resolve();\n _this._resolve = null;\n };\n };\n /**\n * Get size from an svg string using a regular expression.\n * @param svgString - a serialized svg element\n * @returns - image extension\n */\n SVGResource.getSize = function (svgString) {\n var sizeMatch = SVGResource.SVG_SIZE.exec(svgString);\n var size = {};\n if (sizeMatch) {\n size[sizeMatch[1]] = Math.round(parseFloat(sizeMatch[3]));\n size[sizeMatch[5]] = Math.round(parseFloat(sizeMatch[7]));\n }\n return size;\n };\n /** Destroys this texture. */\n SVGResource.prototype.dispose = function () {\n _super.prototype.dispose.call(this);\n this._resolve = null;\n this._crossorigin = null;\n };\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @param {string} extension - The extension of source, if set\n * @returns {boolean} - If the source is a SVG source or data file\n */\n SVGResource.test = function (source, extension) {\n // url file extension is SVG\n return extension === 'svg'\n // source is SVG data-uri\n || (typeof source === 'string' && source.startsWith('data:image/svg+xml'))\n // source is SVG inline\n || (typeof source === 'string' && SVGResource.SVG_XML.test(source));\n };\n /**\n * Regular expression for SVG XML document.\n * @example <?xml version=\"1.0\" encoding=\"utf-8\" ?><!-- image/svg --><svg\n * @readonly\n */\n SVGResource.SVG_XML = /^(<\\?xml[^?]+\\?>)?\\s*(<!--[^(-->)]*-->)?\\s*\\<svg/m;\n /**\n * Regular expression for SVG size.\n * @example <svg width=\"100\" height=\"100\"></svg>\n * @readonly\n */\n SVGResource.SVG_SIZE = /<svg[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*(?:\\s(width|height)=('|\")(\\d*(?:\\.\\d+)?)(?:px)?('|\"))[^>]*>/i; // eslint-disable-line max-len\n return SVGResource;\n}(BaseImageResource));\n\n/**\n * Resource type for {@code HTMLVideoElement}.\n * @memberof PIXI\n */\nvar VideoResource = /** @class */ (function (_super) {\n __extends(VideoResource, _super);\n /**\n * @param {HTMLVideoElement|object|string|Array<string|object>} source - Video element to use.\n * @param {object} [options] - Options to use\n * @param {boolean} [options.autoLoad=true] - Start loading the video immediately\n * @param {boolean} [options.autoPlay=true] - Start playing video immediately\n * @param {number} [options.updateFPS=0] - How many times a second to update the texture from the video.\n * Leave at 0 to update at every render.\n * @param {boolean} [options.crossorigin=true] - Load image using cross origin\n */\n function VideoResource(source, options) {\n var _this = this;\n options = options || {};\n if (!(source instanceof HTMLVideoElement)) {\n var videoElement = document.createElement('video');\n // workaround for https://github.com/pixijs/pixi.js/issues/5996\n videoElement.setAttribute('preload', 'auto');\n videoElement.setAttribute('webkit-playsinline', '');\n videoElement.setAttribute('playsinline', '');\n if (typeof source === 'string') {\n source = [source];\n }\n var firstSrc = source[0].src || source[0];\n BaseImageResource.crossOrigin(videoElement, firstSrc, options.crossorigin);\n // array of objects or strings\n for (var i = 0; i < source.length; ++i) {\n var sourceElement = document.createElement('source');\n var _a = source[i], src = _a.src, mime = _a.mime;\n src = src || source[i];\n var baseSrc = src.split('?').shift().toLowerCase();\n var ext = baseSrc.slice(baseSrc.lastIndexOf('.') + 1);\n mime = mime || VideoResource.MIME_TYPES[ext] || \"video/\" + ext;\n sourceElement.src = src;\n sourceElement.type = mime;\n videoElement.appendChild(sourceElement);\n }\n // Override the source\n source = videoElement;\n }\n _this = _super.call(this, source) || this;\n _this.noSubImage = true;\n _this._autoUpdate = true;\n _this._isConnectedToTicker = false;\n _this._updateFPS = options.updateFPS || 0;\n _this._msToNextUpdate = 0;\n _this.autoPlay = options.autoPlay !== false;\n _this._load = null;\n _this._resolve = null;\n // Bind for listeners\n _this._onCanPlay = _this._onCanPlay.bind(_this);\n _this._onError = _this._onError.bind(_this);\n if (options.autoLoad !== false) {\n _this.load();\n }\n return _this;\n }\n /**\n * Trigger updating of the texture.\n * @param _deltaTime - time delta since last tick\n */\n VideoResource.prototype.update = function (_deltaTime) {\n if (!this.destroyed) {\n // account for if video has had its playbackRate changed\n var elapsedMS = Ticker.shared.elapsedMS * this.source.playbackRate;\n this._msToNextUpdate = Math.floor(this._msToNextUpdate - elapsedMS);\n if (!this._updateFPS || this._msToNextUpdate <= 0) {\n _super.prototype.update.call(this);\n this._msToNextUpdate = this._updateFPS ? Math.floor(1000 / this._updateFPS) : 0;\n }\n }\n };\n /**\n * Start preloading the video resource.\n * @returns {Promise<void>} Handle the validate event\n */\n VideoResource.prototype.load = function () {\n var _this = this;\n if (this._load) {\n return this._load;\n }\n var source = this.source;\n if ((source.readyState === source.HAVE_ENOUGH_DATA || source.readyState === source.HAVE_FUTURE_DATA)\n && source.width && source.height) {\n source.complete = true;\n }\n source.addEventListener('play', this._onPlayStart.bind(this));\n source.addEventListener('pause', this._onPlayStop.bind(this));\n if (!this._isSourceReady()) {\n source.addEventListener('canplay', this._onCanPlay);\n source.addEventListener('canplaythrough', this._onCanPlay);\n source.addEventListener('error', this._onError, true);\n }\n else {\n this._onCanPlay();\n }\n this._load = new Promise(function (resolve) {\n if (_this.valid) {\n resolve(_this);\n }\n else {\n _this._resolve = resolve;\n source.load();\n }\n });\n return this._load;\n };\n /**\n * Handle video error events.\n * @param event\n */\n VideoResource.prototype._onError = function (event) {\n this.source.removeEventListener('error', this._onError, true);\n this.onError.emit(event);\n };\n /**\n * Returns true if the underlying source is playing.\n * @returns - True if playing.\n */\n VideoResource.prototype._isSourcePlaying = function () {\n var source = this.source;\n return (!source.paused && !source.ended && this._isSourceReady());\n };\n /**\n * Returns true if the underlying source is ready for playing.\n * @returns - True if ready.\n */\n VideoResource.prototype._isSourceReady = function () {\n var source = this.source;\n return source.readyState > 2;\n };\n /** Runs the update loop when the video is ready to play. */\n VideoResource.prototype._onPlayStart = function () {\n // Just in case the video has not received its can play even yet..\n if (!this.valid) {\n this._onCanPlay();\n }\n if (this.autoUpdate && !this._isConnectedToTicker) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n };\n /** Fired when a pause event is triggered, stops the update loop. */\n VideoResource.prototype._onPlayStop = function () {\n if (this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n };\n /** Fired when the video is loaded and ready to play. */\n VideoResource.prototype._onCanPlay = function () {\n var source = this.source;\n source.removeEventListener('canplay', this._onCanPlay);\n source.removeEventListener('canplaythrough', this._onCanPlay);\n var valid = this.valid;\n this.resize(source.videoWidth, source.videoHeight);\n // prevent multiple loaded dispatches..\n if (!valid && this._resolve) {\n this._resolve(this);\n this._resolve = null;\n }\n if (this._isSourcePlaying()) {\n this._onPlayStart();\n }\n else if (this.autoPlay) {\n source.play();\n }\n };\n /** Destroys this texture. */\n VideoResource.prototype.dispose = function () {\n if (this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n var source = this.source;\n if (source) {\n source.removeEventListener('error', this._onError, true);\n source.pause();\n source.src = '';\n source.load();\n }\n _super.prototype.dispose.call(this);\n };\n Object.defineProperty(VideoResource.prototype, \"autoUpdate\", {\n /** Should the base texture automatically update itself, set to true by default. */\n get: function () {\n return this._autoUpdate;\n },\n set: function (value) {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n if (!this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n else if (this._autoUpdate && !this._isConnectedToTicker && this._isSourcePlaying()) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(VideoResource.prototype, \"updateFPS\", {\n /**\n * How many times a second to update the texture from the video. Leave at 0 to update at every render.\n * A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient.\n */\n get: function () {\n return this._updateFPS;\n },\n set: function (value) {\n if (value !== this._updateFPS) {\n this._updateFPS = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @param {string} extension - The extension of source, if set\n * @returns {boolean} `true` if video source\n */\n VideoResource.test = function (source, extension) {\n return (globalThis.HTMLVideoElement && source instanceof HTMLVideoElement)\n || VideoResource.TYPES.indexOf(extension) > -1;\n };\n /**\n * List of common video file extensions supported by VideoResource.\n * @readonly\n */\n VideoResource.TYPES = ['mp4', 'm4v', 'webm', 'ogg', 'ogv', 'h264', 'avi', 'mov'];\n /**\n * Map of video MIME types that can't be directly derived from file extensions.\n * @readonly\n */\n VideoResource.MIME_TYPES = {\n ogv: 'video/ogg',\n mov: 'video/quicktime',\n m4v: 'video/mp4',\n };\n return VideoResource;\n}(BaseImageResource));\n\n/**\n * Resource type for ImageBitmap.\n * @memberof PIXI\n */\nvar ImageBitmapResource = /** @class */ (function (_super) {\n __extends(ImageBitmapResource, _super);\n /**\n * @param source - Image element to use\n */\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n function ImageBitmapResource(source) {\n return _super.call(this, source) || this;\n }\n /**\n * Used to auto-detect the type of resource.\n * @param {*} source - The source object\n * @returns {boolean} `true` if source is an ImageBitmap\n */\n ImageBitmapResource.test = function (source) {\n return !!globalThis.createImageBitmap && typeof ImageBitmap !== 'undefined' && source instanceof ImageBitmap;\n };\n return ImageBitmapResource;\n}(BaseImageResource));\n\nINSTALLED.push(ImageResource, ImageBitmapResource, CanvasResource, VideoResource, SVGResource, BufferResource, CubeResource, ArrayResource);\n\nvar _resources = {\n __proto__: null,\n Resource: Resource,\n BaseImageResource: BaseImageResource,\n INSTALLED: INSTALLED,\n autoDetectResource: autoDetectResource,\n AbstractMultiResource: AbstractMultiResource,\n ArrayResource: ArrayResource,\n BufferResource: BufferResource,\n CanvasResource: CanvasResource,\n CubeResource: CubeResource,\n ImageResource: ImageResource,\n SVGResource: SVGResource,\n VideoResource: VideoResource,\n ImageBitmapResource: ImageBitmapResource\n};\n\n/**\n * Resource type for DepthTexture.\n * @memberof PIXI\n */\nvar DepthResource = /** @class */ (function (_super) {\n __extends(DepthResource, _super);\n function DepthResource() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Upload the texture to the GPU.\n * @param renderer - Upload to the renderer\n * @param baseTexture - Reference to parent texture\n * @param glTexture - glTexture\n * @returns - true is success\n */\n DepthResource.prototype.upload = function (renderer, baseTexture, glTexture) {\n var gl = renderer.gl;\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, baseTexture.alphaMode === ALPHA_MODES.UNPACK);\n var width = baseTexture.realWidth;\n var height = baseTexture.realHeight;\n if (glTexture.width === width && glTexture.height === height) {\n gl.texSubImage2D(baseTexture.target, 0, 0, 0, width, height, baseTexture.format, glTexture.type, this.data);\n }\n else {\n glTexture.width = width;\n glTexture.height = height;\n gl.texImage2D(baseTexture.target, 0, glTexture.internalFormat, width, height, 0, baseTexture.format, glTexture.type, this.data);\n }\n return true;\n };\n return DepthResource;\n}(BufferResource));\n\n/**\n * A framebuffer can be used to render contents off of the screen. {@link PIXI.BaseRenderTexture} uses\n * one internally to render into itself. You can attach a depth or stencil buffer to a framebuffer.\n *\n * On WebGL 2 machines, shaders can output to multiple textures simultaneously with GLSL 300 ES.\n * @memberof PIXI\n */\nvar Framebuffer = /** @class */ (function () {\n /**\n * @param width - Width of the frame buffer\n * @param height - Height of the frame buffer\n */\n function Framebuffer(width, height) {\n this.width = Math.round(width || 100);\n this.height = Math.round(height || 100);\n this.stencil = false;\n this.depth = false;\n this.dirtyId = 0;\n this.dirtyFormat = 0;\n this.dirtySize = 0;\n this.depthTexture = null;\n this.colorTextures = [];\n this.glFramebuffers = {};\n this.disposeRunner = new Runner('disposeFramebuffer');\n this.multisample = MSAA_QUALITY.NONE;\n }\n Object.defineProperty(Framebuffer.prototype, \"colorTexture\", {\n /**\n * Reference to the colorTexture.\n * @readonly\n */\n get: function () {\n return this.colorTextures[0];\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Add texture to the colorTexture array.\n * @param index - Index of the array to add the texture to\n * @param texture - Texture to add to the array\n */\n Framebuffer.prototype.addColorTexture = function (index, texture) {\n if (index === void 0) { index = 0; }\n // TODO add some validation to the texture - same width / height etc?\n this.colorTextures[index] = texture || new BaseTexture(null, {\n scaleMode: SCALE_MODES.NEAREST,\n resolution: 1,\n mipmap: MIPMAP_MODES.OFF,\n width: this.width,\n height: this.height,\n });\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /**\n * Add a depth texture to the frame buffer.\n * @param texture - Texture to add.\n */\n Framebuffer.prototype.addDepthTexture = function (texture) {\n /* eslint-disable max-len */\n this.depthTexture = texture || new BaseTexture(new DepthResource(null, { width: this.width, height: this.height }), {\n scaleMode: SCALE_MODES.NEAREST,\n resolution: 1,\n width: this.width,\n height: this.height,\n mipmap: MIPMAP_MODES.OFF,\n format: FORMATS.DEPTH_COMPONENT,\n type: TYPES.UNSIGNED_SHORT,\n });\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /** Enable depth on the frame buffer. */\n Framebuffer.prototype.enableDepth = function () {\n this.depth = true;\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /** Enable stencil on the frame buffer. */\n Framebuffer.prototype.enableStencil = function () {\n this.stencil = true;\n this.dirtyId++;\n this.dirtyFormat++;\n return this;\n };\n /**\n * Resize the frame buffer\n * @param width - Width of the frame buffer to resize to\n * @param height - Height of the frame buffer to resize to\n */\n Framebuffer.prototype.resize = function (width, height) {\n width = Math.round(width);\n height = Math.round(height);\n if (width === this.width && height === this.height)\n { return; }\n this.width = width;\n this.height = height;\n this.dirtyId++;\n this.dirtySize++;\n for (var i = 0; i < this.colorTextures.length; i++) {\n var texture = this.colorTextures[i];\n var resolution = texture.resolution;\n // take into account the fact the texture may have a different resolution..\n texture.setSize(width / resolution, height / resolution);\n }\n if (this.depthTexture) {\n var resolution = this.depthTexture.resolution;\n this.depthTexture.setSize(width / resolution, height / resolution);\n }\n };\n /** Disposes WebGL resources that are connected to this geometry. */\n Framebuffer.prototype.dispose = function () {\n this.disposeRunner.emit(this, false);\n };\n /** Destroys and removes the depth texture added to this framebuffer. */\n Framebuffer.prototype.destroyDepthTexture = function () {\n if (this.depthTexture) {\n this.depthTexture.destroy();\n this.depthTexture = null;\n ++this.dirtyId;\n ++this.dirtyFormat;\n }\n };\n return Framebuffer;\n}());\n\n/**\n * A BaseRenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a BaseRenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position\n * and rotation of the given Display Objects is ignored. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer();\n * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 800, height: 600 });\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n * let sprite = PIXI.Sprite.from(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, {renderTexture});\n * ```\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let baseRenderTexture = new PIXI.BaseRenderTexture({ width: 100, height: 100 });\n * let renderTexture = new PIXI.RenderTexture(baseRenderTexture);\n *\n * renderer.render(sprite, {renderTexture}); // Renders to center of RenderTexture\n * ```\n * @memberof PIXI\n */\nvar BaseRenderTexture = /** @class */ (function (_super) {\n __extends(BaseRenderTexture, _super);\n /**\n * @param options\n * @param {number} [options.width=100] - The width of the base render texture.\n * @param {number} [options.height=100] - The height of the base render texture.\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.settings.SCALE_MODE] - See {@link PIXI.SCALE_MODES}\n * for possible values.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - The resolution / device pixel ratio\n * of the texture being generated.\n * @param {PIXI.MSAA_QUALITY} [options.multisample=PIXI.MSAA_QUALITY.NONE] - The number of samples of the frame buffer.\n */\n function BaseRenderTexture(options) {\n if (options === void 0) { options = {}; }\n var _this = this;\n if (typeof options === 'number') {\n /* eslint-disable prefer-rest-params */\n // Backward compatibility of signature\n var width = arguments[0];\n var height = arguments[1];\n var scaleMode = arguments[2];\n var resolution = arguments[3];\n options = { width: width, height: height, scaleMode: scaleMode, resolution: resolution };\n /* eslint-enable prefer-rest-params */\n }\n options.width = options.width || 100;\n options.height = options.height || 100;\n options.multisample = options.multisample !== undefined ? options.multisample : MSAA_QUALITY.NONE;\n _this = _super.call(this, null, options) || this;\n // Set defaults\n _this.mipmap = MIPMAP_MODES.OFF;\n _this.valid = true;\n _this.clearColor = [0, 0, 0, 0];\n _this.framebuffer = new Framebuffer(_this.realWidth, _this.realHeight)\n .addColorTexture(0, _this);\n _this.framebuffer.multisample = options.multisample;\n // TODO - could this be added the systems?\n _this.maskStack = [];\n _this.filterStack = [{}];\n return _this;\n }\n /**\n * Resizes the BaseRenderTexture.\n * @param desiredWidth - The desired width to resize to.\n * @param desiredHeight - The desired height to resize to.\n */\n BaseRenderTexture.prototype.resize = function (desiredWidth, desiredHeight) {\n this.framebuffer.resize(desiredWidth * this.resolution, desiredHeight * this.resolution);\n this.setRealSize(this.framebuffer.width, this.framebuffer.height);\n };\n /**\n * Frees the texture and framebuffer from WebGL memory without destroying this texture object.\n * This means you can still use the texture later which will upload it to GPU\n * memory again.\n * @fires PIXI.BaseTexture#dispose\n */\n BaseRenderTexture.prototype.dispose = function () {\n this.framebuffer.dispose();\n _super.prototype.dispose.call(this);\n };\n /** Destroys this texture. */\n BaseRenderTexture.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.framebuffer.destroyDepthTexture();\n this.framebuffer = null;\n };\n return BaseRenderTexture;\n}(BaseTexture));\n\n/**\n * Stores a texture's frame in UV coordinates, in\n * which everything lies in the rectangle `[(0,0), (1,0),\n * (1,1), (0,1)]`.\n *\n * | Corner | Coordinates |\n * |--------------|-------------|\n * | Top-Left | `(x0,y0)` |\n * | Top-Right | `(x1,y1)` |\n * | Bottom-Right | `(x2,y2)` |\n * | Bottom-Left | `(x3,y3)` |\n * @protected\n * @memberof PIXI\n */\nvar TextureUvs = /** @class */ (function () {\n function TextureUvs() {\n this.x0 = 0;\n this.y0 = 0;\n this.x1 = 1;\n this.y1 = 0;\n this.x2 = 1;\n this.y2 = 1;\n this.x3 = 0;\n this.y3 = 1;\n this.uvsFloat32 = new Float32Array(8);\n }\n /**\n * Sets the texture Uvs based on the given frame information.\n * @protected\n * @param frame - The frame of the texture\n * @param baseFrame - The base frame of the texture\n * @param rotate - Rotation of frame, see {@link PIXI.groupD8}\n */\n TextureUvs.prototype.set = function (frame, baseFrame, rotate) {\n var tw = baseFrame.width;\n var th = baseFrame.height;\n if (rotate) {\n // width and height div 2 div baseFrame size\n var w2 = frame.width / 2 / tw;\n var h2 = frame.height / 2 / th;\n // coordinates of center\n var cX = (frame.x / tw) + w2;\n var cY = (frame.y / th) + h2;\n rotate = groupD8.add(rotate, groupD8.NW); // NW is top-left corner\n this.x0 = cX + (w2 * groupD8.uX(rotate));\n this.y0 = cY + (h2 * groupD8.uY(rotate));\n rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise\n this.x1 = cX + (w2 * groupD8.uX(rotate));\n this.y1 = cY + (h2 * groupD8.uY(rotate));\n rotate = groupD8.add(rotate, 2);\n this.x2 = cX + (w2 * groupD8.uX(rotate));\n this.y2 = cY + (h2 * groupD8.uY(rotate));\n rotate = groupD8.add(rotate, 2);\n this.x3 = cX + (w2 * groupD8.uX(rotate));\n this.y3 = cY + (h2 * groupD8.uY(rotate));\n }\n else {\n this.x0 = frame.x / tw;\n this.y0 = frame.y / th;\n this.x1 = (frame.x + frame.width) / tw;\n this.y1 = frame.y / th;\n this.x2 = (frame.x + frame.width) / tw;\n this.y2 = (frame.y + frame.height) / th;\n this.x3 = frame.x / tw;\n this.y3 = (frame.y + frame.height) / th;\n }\n this.uvsFloat32[0] = this.x0;\n this.uvsFloat32[1] = this.y0;\n this.uvsFloat32[2] = this.x1;\n this.uvsFloat32[3] = this.y1;\n this.uvsFloat32[4] = this.x2;\n this.uvsFloat32[5] = this.y2;\n this.uvsFloat32[6] = this.x3;\n this.uvsFloat32[7] = this.y3;\n };\n TextureUvs.prototype.toString = function () {\n return \"[@pixi/core:TextureUvs \"\n + (\"x0=\" + this.x0 + \" y0=\" + this.y0 + \" \")\n + (\"x1=\" + this.x1 + \" y1=\" + this.y1 + \" x2=\" + this.x2 + \" \")\n + (\"y2=\" + this.y2 + \" x3=\" + this.x3 + \" y3=\" + this.y3)\n + \"]\";\n };\n return TextureUvs;\n}());\n\nvar DEFAULT_UVS = new TextureUvs();\n/**\n * Used to remove listeners from WHITE and EMPTY Textures\n * @ignore\n */\nfunction removeAllHandlers(tex) {\n tex.destroy = function _emptyDestroy() { };\n tex.on = function _emptyOn() { };\n tex.once = function _emptyOnce() { };\n tex.emit = function _emptyEmit() { };\n}\n/**\n * A texture stores the information that represents an image or part of an image.\n *\n * It cannot be added to the display list directly; instead use it as the texture for a Sprite.\n * If no frame is provided for a texture, then the whole image is used.\n *\n * You can directly create a texture from an image and then reuse it multiple times like this :\n *\n * ```js\n * let texture = PIXI.Texture.from('assets/image.png');\n * let sprite1 = new PIXI.Sprite(texture);\n * let sprite2 = new PIXI.Sprite(texture);\n * ```\n *\n * If you didnt pass the texture frame to constructor, it enables `noFrame` mode:\n * it subscribes on baseTexture events, it automatically resizes at the same time as baseTexture.\n *\n * Textures made from SVGs, loaded or not, cannot be used before the file finishes processing.\n * You can check for this by checking the sprite's _textureID property.\n * ```js\n * var texture = PIXI.Texture.from('assets/image.svg');\n * var sprite1 = new PIXI.Sprite(texture);\n * //sprite1._textureID should not be undefined if the texture has finished processing the SVG file\n * ```\n * You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.\n * @memberof PIXI\n * @typeParam R - The BaseTexture's Resource type.\n */\nvar Texture = /** @class */ (function (_super) {\n __extends(Texture, _super);\n /**\n * @param baseTexture - The base texture source to create the texture from\n * @param frame - The rectangle frame of the texture to show\n * @param orig - The area of original texture\n * @param trim - Trimmed rectangle of original texture\n * @param rotate - indicates how the texture was rotated by texture packer. See {@link PIXI.groupD8}\n * @param anchor - Default anchor point used for sprite placement / rotation\n */\n function Texture(baseTexture, frame, orig, trim, rotate, anchor) {\n var _this = _super.call(this) || this;\n _this.noFrame = false;\n if (!frame) {\n _this.noFrame = true;\n frame = new Rectangle(0, 0, 1, 1);\n }\n if (baseTexture instanceof Texture) {\n baseTexture = baseTexture.baseTexture;\n }\n _this.baseTexture = baseTexture;\n _this._frame = frame;\n _this.trim = trim;\n _this.valid = false;\n _this._uvs = DEFAULT_UVS;\n _this.uvMatrix = null;\n _this.orig = orig || frame; // new Rectangle(0, 0, 1, 1);\n _this._rotate = Number(rotate || 0);\n if (rotate === true) {\n // this is old texturepacker legacy, some games/libraries are passing \"true\" for rotated textures\n _this._rotate = 2;\n }\n else if (_this._rotate % 2 !== 0) {\n throw new Error('attempt to use diamond-shaped UVs. If you are sure, set rotation manually');\n }\n _this.defaultAnchor = anchor ? new Point(anchor.x, anchor.y) : new Point(0, 0);\n _this._updateID = 0;\n _this.textureCacheIds = [];\n if (!baseTexture.valid) {\n baseTexture.once('loaded', _this.onBaseTextureUpdated, _this);\n }\n else if (_this.noFrame) {\n // if there is no frame we should monitor for any base texture changes..\n if (baseTexture.valid) {\n _this.onBaseTextureUpdated(baseTexture);\n }\n }\n else {\n _this.frame = frame;\n }\n if (_this.noFrame) {\n baseTexture.on('update', _this.onBaseTextureUpdated, _this);\n }\n return _this;\n }\n /**\n * Updates this texture on the gpu.\n *\n * Calls the TextureResource update.\n *\n * If you adjusted `frame` manually, please call `updateUvs()` instead.\n */\n Texture.prototype.update = function () {\n if (this.baseTexture.resource) {\n this.baseTexture.resource.update();\n }\n };\n /**\n * Called when the base texture is updated\n * @protected\n * @param baseTexture - The base texture.\n */\n Texture.prototype.onBaseTextureUpdated = function (baseTexture) {\n if (this.noFrame) {\n if (!this.baseTexture.valid) {\n return;\n }\n this._frame.width = baseTexture.width;\n this._frame.height = baseTexture.height;\n this.valid = true;\n this.updateUvs();\n }\n else {\n // TODO this code looks confusing.. boo to abusing getters and setters!\n // if user gave us frame that has bigger size than resized texture it can be a problem\n this.frame = this._frame;\n }\n this.emit('update', this);\n };\n /**\n * Destroys this texture\n * @param [destroyBase=false] - Whether to destroy the base texture as well\n */\n Texture.prototype.destroy = function (destroyBase) {\n if (this.baseTexture) {\n if (destroyBase) {\n var resource = this.baseTexture.resource;\n // delete the texture if it exists in the texture cache..\n // this only needs to be removed if the base texture is actually destroyed too..\n if (resource && resource.url && TextureCache[resource.url]) {\n Texture.removeFromCache(resource.url);\n }\n this.baseTexture.destroy();\n }\n this.baseTexture.off('loaded', this.onBaseTextureUpdated, this);\n this.baseTexture.off('update', this.onBaseTextureUpdated, this);\n this.baseTexture = null;\n }\n this._frame = null;\n this._uvs = null;\n this.trim = null;\n this.orig = null;\n this.valid = false;\n Texture.removeFromCache(this);\n this.textureCacheIds = null;\n };\n /**\n * Creates a new texture object that acts the same as this one.\n * @returns - The new texture\n */\n Texture.prototype.clone = function () {\n var clonedFrame = this._frame.clone();\n var clonedOrig = this._frame === this.orig ? clonedFrame : this.orig.clone();\n var clonedTexture = new Texture(this.baseTexture, !this.noFrame && clonedFrame, clonedOrig, this.trim && this.trim.clone(), this.rotate, this.defaultAnchor);\n if (this.noFrame) {\n clonedTexture._frame = clonedFrame;\n }\n return clonedTexture;\n };\n /**\n * Updates the internal WebGL UV cache. Use it after you change `frame` or `trim` of the texture.\n * Call it after changing the frame\n */\n Texture.prototype.updateUvs = function () {\n if (this._uvs === DEFAULT_UVS) {\n this._uvs = new TextureUvs();\n }\n this._uvs.set(this._frame, this.baseTexture, this.rotate);\n this._updateID++;\n };\n /**\n * Helper function that creates a new Texture based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @param {string|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|PIXI.BaseTexture} source -\n * Source or array of sources to create texture from\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {string} [options.pixiIdPrefix=pixiid] - If a source has no id, this is the prefix of the generated id\n * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.\n * @returns {PIXI.Texture} The newly created texture\n */\n Texture.from = function (source, options, strict) {\n if (options === void 0) { options = {}; }\n if (strict === void 0) { strict = settings.STRICT_TEXTURE_CACHE; }\n var isFrame = typeof source === 'string';\n var cacheId = null;\n if (isFrame) {\n cacheId = source;\n }\n else if (source instanceof BaseTexture) {\n if (!source.cacheId) {\n var prefix = (options && options.pixiIdPrefix) || 'pixiid';\n source.cacheId = prefix + \"-\" + uid();\n BaseTexture.addToCache(source, source.cacheId);\n }\n cacheId = source.cacheId;\n }\n else {\n if (!source._pixiId) {\n var prefix = (options && options.pixiIdPrefix) || 'pixiid';\n source._pixiId = prefix + \"_\" + uid();\n }\n cacheId = source._pixiId;\n }\n var texture = TextureCache[cacheId];\n // Strict-mode rejects invalid cacheIds\n if (isFrame && strict && !texture) {\n throw new Error(\"The cacheId \\\"\" + cacheId + \"\\\" does not exist in TextureCache.\");\n }\n if (!texture && !(source instanceof BaseTexture)) {\n if (!options.resolution) {\n options.resolution = getResolutionOfUrl(source);\n }\n texture = new Texture(new BaseTexture(source, options));\n texture.baseTexture.cacheId = cacheId;\n BaseTexture.addToCache(texture.baseTexture, cacheId);\n Texture.addToCache(texture, cacheId);\n }\n else if (!texture && (source instanceof BaseTexture)) {\n texture = new Texture(source);\n Texture.addToCache(texture, cacheId);\n }\n // lets assume its a base texture!\n return texture;\n };\n /**\n * Useful for loading textures via URLs. Use instead of `Texture.from` because\n * it does a better job of handling failed URLs more effectively. This also ignores\n * `PIXI.settings.STRICT_TEXTURE_CACHE`. Works for Videos, SVGs, Images.\n * @param url - The remote URL or array of URLs to load.\n * @param options - Optional options to include\n * @returns - A Promise that resolves to a Texture.\n */\n Texture.fromURL = function (url, options) {\n var resourceOptions = Object.assign({ autoLoad: false }, options === null || options === void 0 ? void 0 : options.resourceOptions);\n var texture = Texture.from(url, Object.assign({ resourceOptions: resourceOptions }, options), false);\n var resource = texture.baseTexture.resource;\n // The texture was already loaded\n if (texture.baseTexture.valid) {\n return Promise.resolve(texture);\n }\n // Manually load the texture, this should allow users to handle load errors\n return resource.load().then(function () { return Promise.resolve(texture); });\n };\n /**\n * Create a new Texture with a BufferResource from a Float32Array.\n * RGBA values are floats from 0 to 1.\n * @param {Float32Array|Uint8Array} buffer - The optional array to use, if no data\n * is provided, a new Float32Array is created.\n * @param width - Width of the resource\n * @param height - Height of the resource\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @returns - The resulting new BaseTexture\n */\n Texture.fromBuffer = function (buffer, width, height, options) {\n return new Texture(BaseTexture.fromBuffer(buffer, width, height, options));\n };\n /**\n * Create a texture from a source and add to the cache.\n * @param {HTMLImageElement|HTMLCanvasElement|string} source - The input source.\n * @param imageUrl - File name of texture, for cache and resolving resolution.\n * @param name - Human readable name for the texture cache. If no name is\n * specified, only `imageUrl` will be used as the cache ID.\n * @param options\n * @returns - Output texture\n */\n Texture.fromLoader = function (source, imageUrl, name, options) {\n var baseTexture = new BaseTexture(source, Object.assign({\n scaleMode: settings.SCALE_MODE,\n resolution: getResolutionOfUrl(imageUrl),\n }, options));\n var resource = baseTexture.resource;\n if (resource instanceof ImageResource) {\n resource.url = imageUrl;\n }\n var texture = new Texture(baseTexture);\n // No name, use imageUrl instead\n if (!name) {\n name = imageUrl;\n }\n // lets also add the frame to pixi's global cache for 'fromLoader' function\n BaseTexture.addToCache(texture.baseTexture, name);\n Texture.addToCache(texture, name);\n // also add references by url if they are different.\n if (name !== imageUrl) {\n BaseTexture.addToCache(texture.baseTexture, imageUrl);\n Texture.addToCache(texture, imageUrl);\n }\n // Generally images are valid right away\n if (texture.baseTexture.valid) {\n return Promise.resolve(texture);\n }\n // SVG assets need to be parsed async, let's wait\n return new Promise(function (resolve) {\n texture.baseTexture.once('loaded', function () { return resolve(texture); });\n });\n };\n /**\n * Adds a Texture to the global TextureCache. This cache is shared across the whole PIXI object.\n * @param texture - The Texture to add to the cache.\n * @param id - The id that the Texture will be stored against.\n */\n Texture.addToCache = function (texture, id) {\n if (id) {\n if (texture.textureCacheIds.indexOf(id) === -1) {\n texture.textureCacheIds.push(id);\n }\n if (TextureCache[id]) {\n // eslint-disable-next-line no-console\n console.warn(\"Texture added to the cache with an id [\" + id + \"] that already had an entry\");\n }\n TextureCache[id] = texture;\n }\n };\n /**\n * Remove a Texture from the global TextureCache.\n * @param texture - id of a Texture to be removed, or a Texture instance itself\n * @returns - The Texture that was removed\n */\n Texture.removeFromCache = function (texture) {\n if (typeof texture === 'string') {\n var textureFromCache = TextureCache[texture];\n if (textureFromCache) {\n var index = textureFromCache.textureCacheIds.indexOf(texture);\n if (index > -1) {\n textureFromCache.textureCacheIds.splice(index, 1);\n }\n delete TextureCache[texture];\n return textureFromCache;\n }\n }\n else if (texture && texture.textureCacheIds) {\n for (var i = 0; i < texture.textureCacheIds.length; ++i) {\n // Check that texture matches the one being passed in before deleting it from the cache.\n if (TextureCache[texture.textureCacheIds[i]] === texture) {\n delete TextureCache[texture.textureCacheIds[i]];\n }\n }\n texture.textureCacheIds.length = 0;\n return texture;\n }\n return null;\n };\n Object.defineProperty(Texture.prototype, \"resolution\", {\n /**\n * Returns resolution of baseTexture\n * @readonly\n */\n get: function () {\n return this.baseTexture.resolution;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"frame\", {\n /**\n * The frame specifies the region of the base texture that this texture uses.\n * Please call `updateUvs()` after you change coordinates of `frame` manually.\n */\n get: function () {\n return this._frame;\n },\n set: function (frame) {\n this._frame = frame;\n this.noFrame = false;\n var x = frame.x, y = frame.y, width = frame.width, height = frame.height;\n var xNotFit = x + width > this.baseTexture.width;\n var yNotFit = y + height > this.baseTexture.height;\n if (xNotFit || yNotFit) {\n var relationship = xNotFit && yNotFit ? 'and' : 'or';\n var errorX = \"X: \" + x + \" + \" + width + \" = \" + (x + width) + \" > \" + this.baseTexture.width;\n var errorY = \"Y: \" + y + \" + \" + height + \" = \" + (y + height) + \" > \" + this.baseTexture.height;\n throw new Error('Texture Error: frame does not fit inside the base Texture dimensions: '\n + (errorX + \" \" + relationship + \" \" + errorY));\n }\n this.valid = width && height && this.baseTexture.valid;\n if (!this.trim && !this.rotate) {\n this.orig = frame;\n }\n if (this.valid) {\n this.updateUvs();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"rotate\", {\n /**\n * Indicates whether the texture is rotated inside the atlas\n * set to 2 to compensate for texture packer rotation\n * set to 6 to compensate for spine packer rotation\n * can be used to rotate or mirror sprites\n * See {@link PIXI.groupD8} for explanation\n */\n get: function () {\n return this._rotate;\n },\n set: function (rotate) {\n this._rotate = rotate;\n if (this.valid) {\n this.updateUvs();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"width\", {\n /** The width of the Texture in pixels. */\n get: function () {\n return this.orig.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture.prototype, \"height\", {\n /** The height of the Texture in pixels. */\n get: function () {\n return this.orig.height;\n },\n enumerable: false,\n configurable: true\n });\n /** Utility function for BaseTexture|Texture cast. */\n Texture.prototype.castToBaseTexture = function () {\n return this.baseTexture;\n };\n Object.defineProperty(Texture, \"EMPTY\", {\n /** An empty texture, used often to not have to create multiple empty textures. Can not be destroyed. */\n get: function () {\n if (!Texture._EMPTY) {\n Texture._EMPTY = new Texture(new BaseTexture());\n removeAllHandlers(Texture._EMPTY);\n removeAllHandlers(Texture._EMPTY.baseTexture);\n }\n return Texture._EMPTY;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Texture, \"WHITE\", {\n /** A white texture of 16x16 size, used for graphics and other things Can not be destroyed. */\n get: function () {\n if (!Texture._WHITE) {\n var canvas = settings.ADAPTER.createCanvas(16, 16);\n var context = canvas.getContext('2d');\n canvas.width = 16;\n canvas.height = 16;\n context.fillStyle = 'white';\n context.fillRect(0, 0, 16, 16);\n Texture._WHITE = new Texture(BaseTexture.from(canvas));\n removeAllHandlers(Texture._WHITE);\n removeAllHandlers(Texture._WHITE.baseTexture);\n }\n return Texture._WHITE;\n },\n enumerable: false,\n configurable: true\n });\n return Texture;\n}(EventEmitter));\n\n/**\n * A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it.\n *\n * __Hint__: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded\n * otherwise black rectangles will be drawn instead.\n *\n * __Hint-2__: The actual memory allocation will happen on first render.\n * You shouldn't create renderTextures each frame just to delete them after, try to reuse them.\n *\n * A RenderTexture takes a snapshot of any Display Object given to its render method. For example:\n *\n * ```js\n * let renderer = PIXI.autoDetectRenderer();\n * let renderTexture = PIXI.RenderTexture.create({ width: 800, height: 600 });\n * let sprite = PIXI.Sprite.from(\"spinObj_01.png\");\n *\n * sprite.position.x = 800/2;\n * sprite.position.y = 600/2;\n * sprite.anchor.x = 0.5;\n * sprite.anchor.y = 0.5;\n *\n * renderer.render(sprite, {renderTexture});\n * ```\n * Note that you should not create a new renderer, but reuse the same one as the rest of the application.\n *\n * The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0\n * you can clear the transform\n *\n * ```js\n *\n * sprite.setTransform()\n *\n * let renderTexture = new PIXI.RenderTexture.create({ width: 100, height: 100 });\n *\n * renderer.render(sprite, {renderTexture}); // Renders to center of RenderTexture\n * ```\n * @memberof PIXI\n */\nvar RenderTexture = /** @class */ (function (_super) {\n __extends(RenderTexture, _super);\n /**\n * @param baseRenderTexture - The base texture object that this texture uses.\n * @param frame - The rectangle frame of the texture to show.\n */\n function RenderTexture(baseRenderTexture, frame) {\n var _this = _super.call(this, baseRenderTexture, frame) || this;\n _this.valid = true;\n _this.filterFrame = null;\n _this.filterPoolKey = null;\n _this.updateUvs();\n return _this;\n }\n Object.defineProperty(RenderTexture.prototype, \"framebuffer\", {\n /**\n * Shortcut to `this.baseTexture.framebuffer`, saves baseTexture cast.\n * @readonly\n */\n get: function () {\n return this.baseTexture.framebuffer;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RenderTexture.prototype, \"multisample\", {\n /**\n * Shortcut to `this.framebuffer.multisample`.\n * @default PIXI.MSAA_QUALITY.NONE\n */\n get: function () {\n return this.framebuffer.multisample;\n },\n set: function (value) {\n this.framebuffer.multisample = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Resizes the RenderTexture.\n * @param desiredWidth - The desired width to resize to.\n * @param desiredHeight - The desired height to resize to.\n * @param resizeBaseTexture - Should the baseTexture.width and height values be resized as well?\n */\n RenderTexture.prototype.resize = function (desiredWidth, desiredHeight, resizeBaseTexture) {\n if (resizeBaseTexture === void 0) { resizeBaseTexture = true; }\n var resolution = this.baseTexture.resolution;\n var width = Math.round(desiredWidth * resolution) / resolution;\n var height = Math.round(desiredHeight * resolution) / resolution;\n // TODO - could be not required..\n this.valid = (width > 0 && height > 0);\n this._frame.width = this.orig.width = width;\n this._frame.height = this.orig.height = height;\n if (resizeBaseTexture) {\n this.baseTexture.resize(width, height);\n }\n this.updateUvs();\n };\n /**\n * Changes the resolution of baseTexture, but does not change framebuffer size.\n * @param resolution - The new resolution to apply to RenderTexture\n */\n RenderTexture.prototype.setResolution = function (resolution) {\n var baseTexture = this.baseTexture;\n if (baseTexture.resolution === resolution) {\n return;\n }\n baseTexture.setResolution(resolution);\n this.resize(baseTexture.width, baseTexture.height, false);\n };\n RenderTexture.create = function (options) {\n var arguments$1 = arguments;\n\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments$1[_i];\n }\n // @deprecated fallback, old-style: create(width, height, scaleMode, resolution)\n if (typeof options === 'number') {\n deprecation('6.0.0', 'Arguments (width, height, scaleMode, resolution) have been deprecated.');\n /* eslint-disable prefer-rest-params */\n options = {\n width: options,\n height: rest[0],\n scaleMode: rest[1],\n resolution: rest[2],\n };\n /* eslint-enable prefer-rest-params */\n }\n return new RenderTexture(new BaseRenderTexture(options));\n };\n return RenderTexture;\n}(Texture));\n\n/**\n * Texture pool, used by FilterSystem and plugins.\n *\n * Stores collection of temporary pow2 or screen-sized renderTextures\n *\n * If you use custom RenderTexturePool for your filters, you can use methods\n * `getFilterTexture` and `returnFilterTexture` same as in\n * @memberof PIXI\n */\nvar RenderTexturePool = /** @class */ (function () {\n /**\n * @param textureOptions - options that will be passed to BaseRenderTexture constructor\n * @param {PIXI.SCALE_MODES} [textureOptions.scaleMode] - See {@link PIXI.SCALE_MODES} for possible values.\n */\n function RenderTexturePool(textureOptions) {\n this.texturePool = {};\n this.textureOptions = textureOptions || {};\n this.enableFullScreen = false;\n this._pixelsWidth = 0;\n this._pixelsHeight = 0;\n }\n /**\n * Creates texture with params that were specified in pool constructor.\n * @param realWidth - Width of texture in pixels.\n * @param realHeight - Height of texture in pixels.\n * @param multisample - Number of samples of the framebuffer.\n */\n RenderTexturePool.prototype.createTexture = function (realWidth, realHeight, multisample) {\n if (multisample === void 0) { multisample = MSAA_QUALITY.NONE; }\n var baseRenderTexture = new BaseRenderTexture(Object.assign({\n width: realWidth,\n height: realHeight,\n resolution: 1,\n multisample: multisample,\n }, this.textureOptions));\n return new RenderTexture(baseRenderTexture);\n };\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param minWidth - The minimum width of the render texture.\n * @param minHeight - The minimum height of the render texture.\n * @param resolution - The resolution of the render texture.\n * @param multisample - Number of samples of the render texture.\n * @returns The new render texture.\n */\n RenderTexturePool.prototype.getOptimalTexture = function (minWidth, minHeight, resolution, multisample) {\n if (resolution === void 0) { resolution = 1; }\n if (multisample === void 0) { multisample = MSAA_QUALITY.NONE; }\n var key;\n minWidth = Math.ceil((minWidth * resolution) - 1e-6);\n minHeight = Math.ceil((minHeight * resolution) - 1e-6);\n if (!this.enableFullScreen || minWidth !== this._pixelsWidth || minHeight !== this._pixelsHeight) {\n minWidth = nextPow2(minWidth);\n minHeight = nextPow2(minHeight);\n key = (((minWidth & 0xFFFF) << 16) | (minHeight & 0xFFFF)) >>> 0;\n if (multisample > 1) {\n key += multisample * 0x100000000;\n }\n }\n else {\n key = multisample > 1 ? -multisample : -1;\n }\n if (!this.texturePool[key]) {\n this.texturePool[key] = [];\n }\n var renderTexture = this.texturePool[key].pop();\n if (!renderTexture) {\n renderTexture = this.createTexture(minWidth, minHeight, multisample);\n }\n renderTexture.filterPoolKey = key;\n renderTexture.setResolution(resolution);\n return renderTexture;\n };\n /**\n * Gets extra texture of the same size as input renderTexture\n *\n * `getFilterTexture(input, 0.5)` or `getFilterTexture(0.5, input)`\n * @param input - renderTexture from which size and resolution will be copied\n * @param resolution - override resolution of the renderTexture\n * It overrides, it does not multiply\n * @param multisample - number of samples of the renderTexture\n */\n RenderTexturePool.prototype.getFilterTexture = function (input, resolution, multisample) {\n var filterTexture = this.getOptimalTexture(input.width, input.height, resolution || input.resolution, multisample || MSAA_QUALITY.NONE);\n filterTexture.filterFrame = input.filterFrame;\n return filterTexture;\n };\n /**\n * Place a render texture back into the pool.\n * @param renderTexture - The renderTexture to free\n */\n RenderTexturePool.prototype.returnTexture = function (renderTexture) {\n var key = renderTexture.filterPoolKey;\n renderTexture.filterFrame = null;\n this.texturePool[key].push(renderTexture);\n };\n /**\n * Alias for returnTexture, to be compliant with FilterSystem interface.\n * @param renderTexture - The renderTexture to free\n */\n RenderTexturePool.prototype.returnFilterTexture = function (renderTexture) {\n this.returnTexture(renderTexture);\n };\n /**\n * Clears the pool.\n * @param destroyTextures - Destroy all stored textures.\n */\n RenderTexturePool.prototype.clear = function (destroyTextures) {\n destroyTextures = destroyTextures !== false;\n if (destroyTextures) {\n for (var i in this.texturePool) {\n var textures = this.texturePool[i];\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n }\n }\n this.texturePool = {};\n };\n /**\n * If screen size was changed, drops all screen-sized textures,\n * sets new screen size, sets `enableFullScreen` to true\n *\n * Size is measured in pixels, `renderer.view` can be passed here, not `renderer.screen`\n * @param size - Initial size of screen.\n */\n RenderTexturePool.prototype.setScreenSize = function (size) {\n if (size.width === this._pixelsWidth\n && size.height === this._pixelsHeight) {\n return;\n }\n this.enableFullScreen = size.width > 0 && size.height > 0;\n for (var i in this.texturePool) {\n if (!(Number(i) < 0)) {\n continue;\n }\n var textures = this.texturePool[i];\n if (textures) {\n for (var j = 0; j < textures.length; j++) {\n textures[j].destroy(true);\n }\n }\n this.texturePool[i] = [];\n }\n this._pixelsWidth = size.width;\n this._pixelsHeight = size.height;\n };\n /**\n * Key that is used to store fullscreen renderTextures in a pool\n * @constant\n */\n RenderTexturePool.SCREEN_KEY = -1;\n return RenderTexturePool;\n}());\n\n/* eslint-disable max-len */\n/**\n * Holds the information for a single attribute structure required to render geometry.\n *\n * This does not contain the actual data, but instead has a buffer id that maps to a {@link PIXI.Buffer}\n * This can include anything from positions, uvs, normals, colors etc.\n * @memberof PIXI\n */\nvar Attribute = /** @class */ (function () {\n /**\n * @param buffer - the id of the buffer that this attribute will look for\n * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2.\n * @param normalized - should the data be normalized.\n * @param {PIXI.TYPES} [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @param [start=0] - How far into the array to start reading values (used for interleaving data)\n * @param [instance=false] - Whether the geometry is instanced.\n */\n function Attribute(buffer, size, normalized, type, stride, start, instance) {\n if (size === void 0) { size = 0; }\n if (normalized === void 0) { normalized = false; }\n if (type === void 0) { type = TYPES.FLOAT; }\n this.buffer = buffer;\n this.size = size;\n this.normalized = normalized;\n this.type = type;\n this.stride = stride;\n this.start = start;\n this.instance = instance;\n }\n /** Destroys the Attribute. */\n Attribute.prototype.destroy = function () {\n this.buffer = null;\n };\n /**\n * Helper function that creates an Attribute based on the information provided\n * @param buffer - the id of the buffer that this attribute will look for\n * @param [size=0] - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2\n * @param [normalized=false] - should the data be normalized.\n * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @returns - A new {@link PIXI.Attribute} based on the information provided\n */\n Attribute.from = function (buffer, size, normalized, type, stride) {\n return new Attribute(buffer, size, normalized, type, stride);\n };\n return Attribute;\n}());\n\nvar UID$4 = 0;\n/**\n * A wrapper for data so that it can be used and uploaded by WebGL\n * @memberof PIXI\n */\nvar Buffer = /** @class */ (function () {\n /**\n * @param {PIXI.IArrayBuffer} data - the data to store in the buffer.\n * @param _static - `true` for static buffer\n * @param index - `true` for index buffer\n */\n function Buffer(data, _static, index) {\n if (_static === void 0) { _static = true; }\n if (index === void 0) { index = false; }\n this.data = (data || new Float32Array(1));\n this._glBuffers = {};\n this._updateID = 0;\n this.index = index;\n this.static = _static;\n this.id = UID$4++;\n this.disposeRunner = new Runner('disposeBuffer');\n }\n // TODO could explore flagging only a partial upload?\n /**\n * Flags this buffer as requiring an upload to the GPU.\n * @param {PIXI.IArrayBuffer|number[]} [data] - the data to update in the buffer.\n */\n Buffer.prototype.update = function (data) {\n if (data instanceof Array) {\n data = new Float32Array(data);\n }\n this.data = data || this.data;\n this._updateID++;\n };\n /** Disposes WebGL resources that are connected to this geometry. */\n Buffer.prototype.dispose = function () {\n this.disposeRunner.emit(this, false);\n };\n /** Destroys the buffer. */\n Buffer.prototype.destroy = function () {\n this.dispose();\n this.data = null;\n };\n Object.defineProperty(Buffer.prototype, \"index\", {\n get: function () {\n return this.type === BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n },\n /**\n * Flags whether this is an index buffer.\n *\n * Index buffers are of type `ELEMENT_ARRAY_BUFFER`. Note that setting this property to false will make\n * the buffer of type `ARRAY_BUFFER`.\n *\n * For backwards compatibility.\n */\n set: function (value) {\n this.type = value ? BUFFER_TYPE.ELEMENT_ARRAY_BUFFER : BUFFER_TYPE.ARRAY_BUFFER;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Helper function that creates a buffer based on an array or TypedArray\n * @param {ArrayBufferView | number[]} data - the TypedArray that the buffer will store. If this is a regular Array it will be converted to a Float32Array.\n * @returns - A new Buffer based on the data provided.\n */\n Buffer.from = function (data) {\n if (data instanceof Array) {\n data = new Float32Array(data);\n }\n return new Buffer(data);\n };\n return Buffer;\n}());\n\n/* eslint-disable object-shorthand */\nvar map$1 = {\n Float32Array: Float32Array,\n Uint32Array: Uint32Array,\n Int32Array: Int32Array,\n Uint8Array: Uint8Array,\n};\nfunction interleaveTypedArrays(arrays, sizes) {\n var outSize = 0;\n var stride = 0;\n var views = {};\n for (var i = 0; i < arrays.length; i++) {\n stride += sizes[i];\n outSize += arrays[i].length;\n }\n var buffer = new ArrayBuffer(outSize * 4);\n var out = null;\n var littleOffset = 0;\n for (var i = 0; i < arrays.length; i++) {\n var size = sizes[i];\n var array = arrays[i];\n var type = getBufferType(array);\n if (!views[type]) {\n views[type] = new map$1[type](buffer);\n }\n out = views[type];\n for (var j = 0; j < array.length; j++) {\n var indexStart = ((j / size | 0) * stride) + littleOffset;\n var index = j % size;\n out[indexStart + index] = array[j];\n }\n littleOffset += size;\n }\n return new Float32Array(buffer);\n}\n\nvar byteSizeMap$1 = { 5126: 4, 5123: 2, 5121: 1 };\nvar UID$3 = 0;\n/* eslint-disable object-shorthand */\nvar map = {\n Float32Array: Float32Array,\n Uint32Array: Uint32Array,\n Int32Array: Int32Array,\n Uint8Array: Uint8Array,\n Uint16Array: Uint16Array,\n};\n/* eslint-disable max-len */\n/**\n * The Geometry represents a model. It consists of two components:\n * - GeometryStyle - The structure of the model such as the attributes layout\n * - GeometryData - the data of the model - this consists of buffers.\n * This can include anything from positions, uvs, normals, colors etc.\n *\n * Geometry can be defined without passing in a style or data if required (thats how I prefer!)\n *\n * ```js\n * let geometry = new PIXI.Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1],2)\n * geometry.addIndex([0,1,2,1,3,2])\n * ```\n * @memberof PIXI\n */\nvar Geometry = /** @class */ (function () {\n /**\n * @param buffers - An array of buffers. optional.\n * @param attributes - Of the geometry, optional structure of the attributes layout\n */\n function Geometry(buffers, attributes) {\n if (buffers === void 0) { buffers = []; }\n if (attributes === void 0) { attributes = {}; }\n this.buffers = buffers;\n this.indexBuffer = null;\n this.attributes = attributes;\n this.glVertexArrayObjects = {};\n this.id = UID$3++;\n this.instanced = false;\n this.instanceCount = 1;\n this.disposeRunner = new Runner('disposeGeometry');\n this.refCount = 0;\n }\n /**\n *\n * Adds an attribute to the geometry\n * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!\n * @param id - the name of the attribute (matching up to a shader)\n * @param {PIXI.Buffer|number[]} buffer - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.\n * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2\n * @param normalized - should the data be normalized.\n * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @param [start=0] - How far into the array to start reading values (used for interleaving data)\n * @param instance - Instancing flag\n * @returns - Returns self, useful for chaining.\n */\n Geometry.prototype.addAttribute = function (id, buffer, size, normalized, type, stride, start, instance) {\n if (size === void 0) { size = 0; }\n if (normalized === void 0) { normalized = false; }\n if (instance === void 0) { instance = false; }\n if (!buffer) {\n throw new Error('You must pass a buffer when creating an attribute');\n }\n // check if this is a buffer!\n if (!(buffer instanceof Buffer)) {\n // its an array!\n if (buffer instanceof Array) {\n buffer = new Float32Array(buffer);\n }\n buffer = new Buffer(buffer);\n }\n var ids = id.split('|');\n if (ids.length > 1) {\n for (var i = 0; i < ids.length; i++) {\n this.addAttribute(ids[i], buffer, size, normalized, type);\n }\n return this;\n }\n var bufferIndex = this.buffers.indexOf(buffer);\n if (bufferIndex === -1) {\n this.buffers.push(buffer);\n bufferIndex = this.buffers.length - 1;\n }\n this.attributes[id] = new Attribute(bufferIndex, size, normalized, type, stride, start, instance);\n // assuming that if there is instanced data then this will be drawn with instancing!\n this.instanced = this.instanced || instance;\n return this;\n };\n /**\n * Returns the requested attribute.\n * @param id - The name of the attribute required\n * @returns - The attribute requested.\n */\n Geometry.prototype.getAttribute = function (id) {\n return this.attributes[id];\n };\n /**\n * Returns the requested buffer.\n * @param id - The name of the buffer required.\n * @returns - The buffer requested.\n */\n Geometry.prototype.getBuffer = function (id) {\n return this.buffers[this.getAttribute(id).buffer];\n };\n /**\n *\n * Adds an index buffer to the geometry\n * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.\n * @param {PIXI.Buffer|number[]} [buffer] - The buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.\n * @returns - Returns self, useful for chaining.\n */\n Geometry.prototype.addIndex = function (buffer) {\n if (!(buffer instanceof Buffer)) {\n // its an array!\n if (buffer instanceof Array) {\n buffer = new Uint16Array(buffer);\n }\n buffer = new Buffer(buffer);\n }\n buffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n this.indexBuffer = buffer;\n if (this.buffers.indexOf(buffer) === -1) {\n this.buffers.push(buffer);\n }\n return this;\n };\n /**\n * Returns the index buffer\n * @returns - The index buffer.\n */\n Geometry.prototype.getIndex = function () {\n return this.indexBuffer;\n };\n /**\n * This function modifies the structure so that all current attributes become interleaved into a single buffer\n * This can be useful if your model remains static as it offers a little performance boost\n * @returns - Returns self, useful for chaining.\n */\n Geometry.prototype.interleave = function () {\n // a simple check to see if buffers are already interleaved..\n if (this.buffers.length === 1 || (this.buffers.length === 2 && this.indexBuffer))\n { return this; }\n // assume already that no buffers are interleaved\n var arrays = [];\n var sizes = [];\n var interleavedBuffer = new Buffer();\n var i;\n for (i in this.attributes) {\n var attribute = this.attributes[i];\n var buffer = this.buffers[attribute.buffer];\n arrays.push(buffer.data);\n sizes.push((attribute.size * byteSizeMap$1[attribute.type]) / 4);\n attribute.buffer = 0;\n }\n interleavedBuffer.data = interleaveTypedArrays(arrays, sizes);\n for (i = 0; i < this.buffers.length; i++) {\n if (this.buffers[i] !== this.indexBuffer) {\n this.buffers[i].destroy();\n }\n }\n this.buffers = [interleavedBuffer];\n if (this.indexBuffer) {\n this.buffers.push(this.indexBuffer);\n }\n return this;\n };\n /** Get the size of the geometries, in vertices. */\n Geometry.prototype.getSize = function () {\n for (var i in this.attributes) {\n var attribute = this.attributes[i];\n var buffer = this.buffers[attribute.buffer];\n return buffer.data.length / ((attribute.stride / 4) || attribute.size);\n }\n return 0;\n };\n /** Disposes WebGL resources that are connected to this geometry. */\n Geometry.prototype.dispose = function () {\n this.disposeRunner.emit(this, false);\n };\n /** Destroys the geometry. */\n Geometry.prototype.destroy = function () {\n this.dispose();\n this.buffers = null;\n this.indexBuffer = null;\n this.attributes = null;\n };\n /**\n * Returns a clone of the geometry.\n * @returns - A new clone of this geometry.\n */\n Geometry.prototype.clone = function () {\n var geometry = new Geometry();\n for (var i = 0; i < this.buffers.length; i++) {\n geometry.buffers[i] = new Buffer(this.buffers[i].data.slice(0));\n }\n for (var i in this.attributes) {\n var attrib = this.attributes[i];\n geometry.attributes[i] = new Attribute(attrib.buffer, attrib.size, attrib.normalized, attrib.type, attrib.stride, attrib.start, attrib.instance);\n }\n if (this.indexBuffer) {\n geometry.indexBuffer = geometry.buffers[this.buffers.indexOf(this.indexBuffer)];\n geometry.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n }\n return geometry;\n };\n /**\n * Merges an array of geometries into a new single one.\n *\n * Geometry attribute styles must match for this operation to work.\n * @param geometries - array of geometries to merge\n * @returns - Shiny new geometry!\n */\n Geometry.merge = function (geometries) {\n // todo add a geometry check!\n // also a size check.. cant be too big!]\n var geometryOut = new Geometry();\n var arrays = [];\n var sizes = [];\n var offsets = [];\n var geometry;\n // pass one.. get sizes..\n for (var i = 0; i < geometries.length; i++) {\n geometry = geometries[i];\n for (var j = 0; j < geometry.buffers.length; j++) {\n sizes[j] = sizes[j] || 0;\n sizes[j] += geometry.buffers[j].data.length;\n offsets[j] = 0;\n }\n }\n // build the correct size arrays..\n for (var i = 0; i < geometry.buffers.length; i++) {\n // TODO types!\n arrays[i] = new map[getBufferType(geometry.buffers[i].data)](sizes[i]);\n geometryOut.buffers[i] = new Buffer(arrays[i]);\n }\n // pass to set data..\n for (var i = 0; i < geometries.length; i++) {\n geometry = geometries[i];\n for (var j = 0; j < geometry.buffers.length; j++) {\n arrays[j].set(geometry.buffers[j].data, offsets[j]);\n offsets[j] += geometry.buffers[j].data.length;\n }\n }\n geometryOut.attributes = geometry.attributes;\n if (geometry.indexBuffer) {\n geometryOut.indexBuffer = geometryOut.buffers[geometry.buffers.indexOf(geometry.indexBuffer)];\n geometryOut.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n var offset = 0;\n var stride = 0;\n var offset2 = 0;\n var bufferIndexToCount = 0;\n // get a buffer\n for (var i = 0; i < geometry.buffers.length; i++) {\n if (geometry.buffers[i] !== geometry.indexBuffer) {\n bufferIndexToCount = i;\n break;\n }\n }\n // figure out the stride of one buffer..\n for (var i in geometry.attributes) {\n var attribute = geometry.attributes[i];\n if ((attribute.buffer | 0) === bufferIndexToCount) {\n stride += ((attribute.size * byteSizeMap$1[attribute.type]) / 4);\n }\n }\n // time to off set all indexes..\n for (var i = 0; i < geometries.length; i++) {\n var indexBufferData = geometries[i].indexBuffer.data;\n for (var j = 0; j < indexBufferData.length; j++) {\n geometryOut.indexBuffer.data[j + offset2] += offset;\n }\n offset += geometries[i].buffers[bufferIndexToCount].data.length / (stride);\n offset2 += indexBufferData.length;\n }\n }\n return geometryOut;\n };\n return Geometry;\n}());\n\n/**\n * Helper class to create a quad\n * @memberof PIXI\n */\nvar Quad = /** @class */ (function (_super) {\n __extends(Quad, _super);\n function Quad() {\n var _this = _super.call(this) || this;\n _this.addAttribute('aVertexPosition', new Float32Array([\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 1 ]))\n .addIndex([0, 1, 3, 2]);\n return _this;\n }\n return Quad;\n}(Geometry));\n\n/**\n * Helper class to create a quad with uvs like in v4\n * @memberof PIXI\n */\nvar QuadUv = /** @class */ (function (_super) {\n __extends(QuadUv, _super);\n function QuadUv() {\n var _this = _super.call(this) || this;\n _this.vertices = new Float32Array([\n -1, -1,\n 1, -1,\n 1, 1,\n -1, 1 ]);\n _this.uvs = new Float32Array([\n 0, 0,\n 1, 0,\n 1, 1,\n 0, 1 ]);\n _this.vertexBuffer = new Buffer(_this.vertices);\n _this.uvBuffer = new Buffer(_this.uvs);\n _this.addAttribute('aVertexPosition', _this.vertexBuffer)\n .addAttribute('aTextureCoord', _this.uvBuffer)\n .addIndex([0, 1, 2, 0, 2, 3]);\n return _this;\n }\n /**\n * Maps two Rectangle to the quad.\n * @param targetTextureFrame - The first rectangle\n * @param destinationFrame - The second rectangle\n * @returns - Returns itself.\n */\n QuadUv.prototype.map = function (targetTextureFrame, destinationFrame) {\n var x = 0; // destinationFrame.x / targetTextureFrame.width;\n var y = 0; // destinationFrame.y / targetTextureFrame.height;\n this.uvs[0] = x;\n this.uvs[1] = y;\n this.uvs[2] = x + (destinationFrame.width / targetTextureFrame.width);\n this.uvs[3] = y;\n this.uvs[4] = x + (destinationFrame.width / targetTextureFrame.width);\n this.uvs[5] = y + (destinationFrame.height / targetTextureFrame.height);\n this.uvs[6] = x;\n this.uvs[7] = y + (destinationFrame.height / targetTextureFrame.height);\n x = destinationFrame.x;\n y = destinationFrame.y;\n this.vertices[0] = x;\n this.vertices[1] = y;\n this.vertices[2] = x + destinationFrame.width;\n this.vertices[3] = y;\n this.vertices[4] = x + destinationFrame.width;\n this.vertices[5] = y + destinationFrame.height;\n this.vertices[6] = x;\n this.vertices[7] = y + destinationFrame.height;\n this.invalidate();\n return this;\n };\n /**\n * Legacy upload method, just marks buffers dirty.\n * @returns - Returns itself.\n */\n QuadUv.prototype.invalidate = function () {\n this.vertexBuffer._updateID++;\n this.uvBuffer._updateID++;\n return this;\n };\n return QuadUv;\n}(Geometry));\n\nvar UID$2 = 0;\n/**\n * Uniform group holds uniform map and some ID's for work\n *\n * `UniformGroup` has two modes:\n *\n * 1: Normal mode\n * Normal mode will upload the uniforms with individual function calls as required\n *\n * 2: Uniform buffer mode\n * This mode will treat the uniforms as a uniform buffer. You can pass in either a buffer that you manually handle, or\n * or a generic object that PixiJS will automatically map to a buffer for you.\n * For maximum benefits, make Ubo UniformGroups static, and only update them each frame.\n *\n * Rules of UBOs:\n * - UBOs only work with WebGL2, so make sure you have a fallback!\n * - Only floats are supported (including vec[2,3,4], mat[2,3,4])\n * - Samplers cannot be used in ubo's (a GPU limitation)\n * - You must ensure that the object you pass in exactly matches in the shader ubo structure.\n * Otherwise, weirdness will ensue!\n * - The name of the ubo object added to the group must match exactly the name of the ubo in the shader.\n *\n * ```\n * // ubo in shader:\n * uniform myCoolData { // declaring a ubo..\n * mat4 uCoolMatrix;\n * float uFloatyMcFloatFace\n *\n *\n * // a new uniform buffer object..\n * const myCoolData = new UniformBufferGroup({\n * uCoolMatrix: new Matrix(),\n * uFloatyMcFloatFace: 23,\n * }}\n *\n * // build a shader...\n * const shader = Shader.from(srcVert, srcFrag, {\n * myCoolData // name matches the ubo name in the shader. will be processed accordingly.\n * })\n *\n * ```\n * @memberof PIXI\n */\nvar UniformGroup = /** @class */ (function () {\n /**\n * @param {object | Buffer} [uniforms] - Custom uniforms to use to augment the built-in ones. Or a pixi buffer.\n * @param isStatic - Uniforms wont be changed after creation.\n * @param isUbo - If true, will treat this uniform group as a uniform buffer object.\n */\n function UniformGroup(uniforms, isStatic, isUbo) {\n this.group = true;\n // lets generate this when the shader ?\n this.syncUniforms = {};\n this.dirtyId = 0;\n this.id = UID$2++;\n this.static = !!isStatic;\n this.ubo = !!isUbo;\n if (uniforms instanceof Buffer) {\n this.buffer = uniforms;\n this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER;\n this.autoManage = false;\n this.ubo = true;\n }\n else {\n this.uniforms = uniforms;\n if (this.ubo) {\n this.buffer = new Buffer(new Float32Array(1));\n this.buffer.type = BUFFER_TYPE.UNIFORM_BUFFER;\n this.autoManage = true;\n }\n }\n }\n UniformGroup.prototype.update = function () {\n this.dirtyId++;\n if (!this.autoManage && this.buffer) {\n this.buffer.update();\n }\n };\n UniformGroup.prototype.add = function (name, uniforms, _static) {\n if (!this.ubo) {\n this.uniforms[name] = new UniformGroup(uniforms, _static);\n }\n else {\n // eslint-disable-next-line max-len\n throw new Error('[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them');\n }\n };\n UniformGroup.from = function (uniforms, _static, _ubo) {\n return new UniformGroup(uniforms, _static, _ubo);\n };\n /**\n * A short hand function for creating a static UBO UniformGroup.\n * @param uniforms - the ubo item\n * @param _static - should this be updated each time it is used? defaults to true here!\n */\n UniformGroup.uboFrom = function (uniforms, _static) {\n return new UniformGroup(uniforms, _static !== null && _static !== void 0 ? _static : true, true);\n };\n return UniformGroup;\n}());\n\n/**\n * System plugin to the renderer to manage filter states.\n * @ignore\n */\nvar FilterState = /** @class */ (function () {\n function FilterState() {\n this.renderTexture = null;\n this.target = null;\n this.legacy = false;\n this.resolution = 1;\n this.multisample = MSAA_QUALITY.NONE;\n // next three fields are created only for root\n // re-assigned for everything else\n this.sourceFrame = new Rectangle();\n this.destinationFrame = new Rectangle();\n this.bindingSourceFrame = new Rectangle();\n this.bindingDestinationFrame = new Rectangle();\n this.filters = [];\n this.transform = null;\n }\n /** Clears the state */\n FilterState.prototype.clear = function () {\n this.target = null;\n this.filters = null;\n this.renderTexture = null;\n };\n return FilterState;\n}());\n\nvar tempPoints = [new Point(), new Point(), new Point(), new Point()];\nvar tempMatrix$2 = new Matrix();\n/**\n * System plugin to the renderer to manage filters.\n *\n * ## Pipeline\n *\n * The FilterSystem executes the filtering pipeline by rendering the display-object into a texture, applying its\n * [filters]{@link PIXI.Filter} in series, and the last filter outputs into the final render-target.\n *\n * The filter-frame is the rectangle in world space being filtered, and those contents are mapped into\n * `(0, 0, filterFrame.width, filterFrame.height)` into the filter render-texture. The filter-frame is also called\n * the source-frame, as it is used to bind the filter render-textures. The last filter outputs to the `filterFrame`\n * in the final render-target.\n *\n * ## Usage\n *\n * {@link PIXI.Container#renderAdvanced} is an example of how to use the filter system. It is a 3 step process:\n *\n * **push**: Use {@link PIXI.FilterSystem#push} to push the set of filters to be applied on a filter-target.\n * **render**: Render the contents to be filtered using the renderer. The filter-system will only capture the contents\n * inside the bounds of the filter-target. NOTE: Using {@link PIXI.Renderer#render} is\n * illegal during an existing render cycle, and it may reset the filter system.\n * **pop**: Use {@link PIXI.FilterSystem#pop} to pop & execute the filters you initially pushed. It will apply them\n * serially and output to the bounds of the filter-target.\n * @memberof PIXI\n */\nvar FilterSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function FilterSystem(renderer) {\n this.renderer = renderer;\n this.defaultFilterStack = [{}];\n this.texturePool = new RenderTexturePool();\n this.texturePool.setScreenSize(renderer.view);\n this.statePool = [];\n this.quad = new Quad();\n this.quadUv = new QuadUv();\n this.tempRect = new Rectangle();\n this.activeState = {};\n this.globalUniforms = new UniformGroup({\n outputFrame: new Rectangle(),\n inputSize: new Float32Array(4),\n inputPixel: new Float32Array(4),\n inputClamp: new Float32Array(4),\n resolution: 1,\n // legacy variables\n filterArea: new Float32Array(4),\n filterClamp: new Float32Array(4),\n }, true);\n this.forceClear = false;\n this.useMaxPadding = false;\n }\n /**\n * Pushes a set of filters to be applied later to the system. This will redirect further rendering into an\n * input render-texture for the rest of the filtering pipeline.\n * @param {PIXI.DisplayObject} target - The target of the filter to render.\n * @param filters - The filters to apply.\n */\n FilterSystem.prototype.push = function (target, filters) {\n var _a, _b;\n var renderer = this.renderer;\n var filterStack = this.defaultFilterStack;\n var state = this.statePool.pop() || new FilterState();\n var renderTextureSystem = this.renderer.renderTexture;\n var resolution = filters[0].resolution;\n var multisample = filters[0].multisample;\n var padding = filters[0].padding;\n var autoFit = filters[0].autoFit;\n // We don't know whether it's a legacy filter until it was bound for the first time,\n // therefore we have to assume that it is if legacy is undefined.\n var legacy = (_a = filters[0].legacy) !== null && _a !== void 0 ? _a : true;\n for (var i = 1; i < filters.length; i++) {\n var filter = filters[i];\n // let's use the lowest resolution\n resolution = Math.min(resolution, filter.resolution);\n // let's use the lowest number of samples\n multisample = Math.min(multisample, filter.multisample);\n // figure out the padding required for filters\n padding = this.useMaxPadding\n // old behavior: use largest amount of padding!\n ? Math.max(padding, filter.padding)\n // new behavior: sum the padding\n : padding + filter.padding;\n // only auto fit if all filters are autofit\n autoFit = autoFit && filter.autoFit;\n legacy = legacy || ((_b = filter.legacy) !== null && _b !== void 0 ? _b : true);\n }\n if (filterStack.length === 1) {\n this.defaultFilterStack[0].renderTexture = renderTextureSystem.current;\n }\n filterStack.push(state);\n state.resolution = resolution;\n state.multisample = multisample;\n state.legacy = legacy;\n state.target = target;\n state.sourceFrame.copyFrom(target.filterArea || target.getBounds(true));\n state.sourceFrame.pad(padding);\n var sourceFrameProjected = this.tempRect.copyFrom(renderTextureSystem.sourceFrame);\n // Project source frame into world space (if projection is applied)\n if (renderer.projection.transform) {\n this.transformAABB(tempMatrix$2.copyFrom(renderer.projection.transform).invert(), sourceFrameProjected);\n }\n if (autoFit) {\n state.sourceFrame.fit(sourceFrameProjected);\n if (state.sourceFrame.width <= 0 || state.sourceFrame.height <= 0) {\n state.sourceFrame.width = 0;\n state.sourceFrame.height = 0;\n }\n }\n else if (!state.sourceFrame.intersects(sourceFrameProjected)) {\n state.sourceFrame.width = 0;\n state.sourceFrame.height = 0;\n }\n // Round sourceFrame in screen space based on render-texture.\n this.roundFrame(state.sourceFrame, renderTextureSystem.current ? renderTextureSystem.current.resolution : renderer.resolution, renderTextureSystem.sourceFrame, renderTextureSystem.destinationFrame, renderer.projection.transform);\n state.renderTexture = this.getOptimalFilterTexture(state.sourceFrame.width, state.sourceFrame.height, resolution, multisample);\n state.filters = filters;\n state.destinationFrame.width = state.renderTexture.width;\n state.destinationFrame.height = state.renderTexture.height;\n var destinationFrame = this.tempRect;\n destinationFrame.x = 0;\n destinationFrame.y = 0;\n destinationFrame.width = state.sourceFrame.width;\n destinationFrame.height = state.sourceFrame.height;\n state.renderTexture.filterFrame = state.sourceFrame;\n state.bindingSourceFrame.copyFrom(renderTextureSystem.sourceFrame);\n state.bindingDestinationFrame.copyFrom(renderTextureSystem.destinationFrame);\n state.transform = renderer.projection.transform;\n renderer.projection.transform = null;\n renderTextureSystem.bind(state.renderTexture, state.sourceFrame, destinationFrame);\n renderer.framebuffer.clear(0, 0, 0, 0);\n };\n /** Pops off the filter and applies it. */\n FilterSystem.prototype.pop = function () {\n var filterStack = this.defaultFilterStack;\n var state = filterStack.pop();\n var filters = state.filters;\n this.activeState = state;\n var globalUniforms = this.globalUniforms.uniforms;\n globalUniforms.outputFrame = state.sourceFrame;\n globalUniforms.resolution = state.resolution;\n var inputSize = globalUniforms.inputSize;\n var inputPixel = globalUniforms.inputPixel;\n var inputClamp = globalUniforms.inputClamp;\n inputSize[0] = state.destinationFrame.width;\n inputSize[1] = state.destinationFrame.height;\n inputSize[2] = 1.0 / inputSize[0];\n inputSize[3] = 1.0 / inputSize[1];\n inputPixel[0] = Math.round(inputSize[0] * state.resolution);\n inputPixel[1] = Math.round(inputSize[1] * state.resolution);\n inputPixel[2] = 1.0 / inputPixel[0];\n inputPixel[3] = 1.0 / inputPixel[1];\n inputClamp[0] = 0.5 * inputPixel[2];\n inputClamp[1] = 0.5 * inputPixel[3];\n inputClamp[2] = (state.sourceFrame.width * inputSize[2]) - (0.5 * inputPixel[2]);\n inputClamp[3] = (state.sourceFrame.height * inputSize[3]) - (0.5 * inputPixel[3]);\n // only update the rect if its legacy..\n if (state.legacy) {\n var filterArea = globalUniforms.filterArea;\n filterArea[0] = state.destinationFrame.width;\n filterArea[1] = state.destinationFrame.height;\n filterArea[2] = state.sourceFrame.x;\n filterArea[3] = state.sourceFrame.y;\n globalUniforms.filterClamp = globalUniforms.inputClamp;\n }\n this.globalUniforms.update();\n var lastState = filterStack[filterStack.length - 1];\n this.renderer.framebuffer.blit();\n if (filters.length === 1) {\n filters[0].apply(this, state.renderTexture, lastState.renderTexture, CLEAR_MODES.BLEND, state);\n this.returnFilterTexture(state.renderTexture);\n }\n else {\n var flip = state.renderTexture;\n var flop = this.getOptimalFilterTexture(flip.width, flip.height, state.resolution);\n flop.filterFrame = flip.filterFrame;\n var i = 0;\n for (i = 0; i < filters.length - 1; ++i) {\n if (i === 1 && state.multisample > 1) {\n flop = this.getOptimalFilterTexture(flip.width, flip.height, state.resolution);\n flop.filterFrame = flip.filterFrame;\n }\n filters[i].apply(this, flip, flop, CLEAR_MODES.CLEAR, state);\n var t = flip;\n flip = flop;\n flop = t;\n }\n filters[i].apply(this, flip, lastState.renderTexture, CLEAR_MODES.BLEND, state);\n if (i > 1 && state.multisample > 1) {\n this.returnFilterTexture(state.renderTexture);\n }\n this.returnFilterTexture(flip);\n this.returnFilterTexture(flop);\n }\n // lastState.renderTexture is blitted when lastState is popped\n state.clear();\n this.statePool.push(state);\n };\n /**\n * Binds a renderTexture with corresponding `filterFrame`, clears it if mode corresponds.\n * @param filterTexture - renderTexture to bind, should belong to filter pool or filter stack\n * @param clearMode - clearMode, by default its CLEAR/YES. See {@link PIXI.CLEAR_MODES}\n */\n FilterSystem.prototype.bindAndClear = function (filterTexture, clearMode) {\n if (clearMode === void 0) { clearMode = CLEAR_MODES.CLEAR; }\n var _a = this.renderer, renderTextureSystem = _a.renderTexture, stateSystem = _a.state;\n if (filterTexture === this.defaultFilterStack[this.defaultFilterStack.length - 1].renderTexture) {\n // Restore projection transform if rendering into the output render-target.\n this.renderer.projection.transform = this.activeState.transform;\n }\n else {\n // Prevent projection within filtering pipeline.\n this.renderer.projection.transform = null;\n }\n if (filterTexture && filterTexture.filterFrame) {\n var destinationFrame = this.tempRect;\n destinationFrame.x = 0;\n destinationFrame.y = 0;\n destinationFrame.width = filterTexture.filterFrame.width;\n destinationFrame.height = filterTexture.filterFrame.height;\n renderTextureSystem.bind(filterTexture, filterTexture.filterFrame, destinationFrame);\n }\n else if (filterTexture !== this.defaultFilterStack[this.defaultFilterStack.length - 1].renderTexture) {\n renderTextureSystem.bind(filterTexture);\n }\n else {\n // Restore binding for output render-target.\n this.renderer.renderTexture.bind(filterTexture, this.activeState.bindingSourceFrame, this.activeState.bindingDestinationFrame);\n }\n // Clear the texture in BLIT mode if blending is disabled or the forceClear flag is set. The blending\n // is stored in the 0th bit of the state.\n var autoClear = (stateSystem.stateId & 1) || this.forceClear;\n if (clearMode === CLEAR_MODES.CLEAR\n || (clearMode === CLEAR_MODES.BLIT && autoClear)) {\n // Use framebuffer.clear because we want to clear the whole filter texture, not just the filtering\n // area over which the shaders are run. This is because filters may sampling outside of it (e.g. blur)\n // instead of clamping their arithmetic.\n this.renderer.framebuffer.clear(0, 0, 0, 0);\n }\n };\n /**\n * Draws a filter using the default rendering process.\n *\n * This should be called only by {@link Filter#apply}.\n * @param filter - The filter to draw.\n * @param input - The input render target.\n * @param output - The target to output to.\n * @param clearMode - Should the output be cleared before rendering to it\n */\n FilterSystem.prototype.applyFilter = function (filter, input, output, clearMode) {\n var renderer = this.renderer;\n // Set state before binding, so bindAndClear gets the blend mode.\n renderer.state.set(filter.state);\n this.bindAndClear(output, clearMode);\n // set the uniforms..\n filter.uniforms.uSampler = input;\n filter.uniforms.filterGlobals = this.globalUniforms;\n // TODO make it so that the order of this does not matter..\n // because it does at the moment cos of global uniforms.\n // they need to get resynced\n renderer.shader.bind(filter);\n // check to see if the filter is a legacy one..\n filter.legacy = !!filter.program.attributeData.aTextureCoord;\n if (filter.legacy) {\n this.quadUv.map(input._frame, input.filterFrame);\n renderer.geometry.bind(this.quadUv);\n renderer.geometry.draw(DRAW_MODES.TRIANGLES);\n }\n else {\n renderer.geometry.bind(this.quad);\n renderer.geometry.draw(DRAW_MODES.TRIANGLE_STRIP);\n }\n };\n /**\n * Multiply _input normalized coordinates_ to this matrix to get _sprite texture normalized coordinates_.\n *\n * Use `outputMatrix * vTextureCoord` in the shader.\n * @param outputMatrix - The matrix to output to.\n * @param {PIXI.Sprite} sprite - The sprite to map to.\n * @returns The mapped matrix.\n */\n FilterSystem.prototype.calculateSpriteMatrix = function (outputMatrix, sprite) {\n var _a = this.activeState, sourceFrame = _a.sourceFrame, destinationFrame = _a.destinationFrame;\n var orig = sprite._texture.orig;\n var mappedMatrix = outputMatrix.set(destinationFrame.width, 0, 0, destinationFrame.height, sourceFrame.x, sourceFrame.y);\n var worldTransform = sprite.worldTransform.copyTo(Matrix.TEMP_MATRIX);\n worldTransform.invert();\n mappedMatrix.prepend(worldTransform);\n mappedMatrix.scale(1.0 / orig.width, 1.0 / orig.height);\n mappedMatrix.translate(sprite.anchor.x, sprite.anchor.y);\n return mappedMatrix;\n };\n /** Destroys this Filter System. */\n FilterSystem.prototype.destroy = function () {\n this.renderer = null;\n // Those textures has to be destroyed by RenderTextureSystem or FramebufferSystem\n this.texturePool.clear(false);\n };\n /**\n * Gets a Power-of-Two render texture or fullScreen texture\n * @param minWidth - The minimum width of the render texture in real pixels.\n * @param minHeight - The minimum height of the render texture in real pixels.\n * @param resolution - The resolution of the render texture.\n * @param multisample - Number of samples of the render texture.\n * @returns - The new render texture.\n */\n FilterSystem.prototype.getOptimalFilterTexture = function (minWidth, minHeight, resolution, multisample) {\n if (resolution === void 0) { resolution = 1; }\n if (multisample === void 0) { multisample = MSAA_QUALITY.NONE; }\n return this.texturePool.getOptimalTexture(minWidth, minHeight, resolution, multisample);\n };\n /**\n * Gets extra render texture to use inside current filter\n * To be compliant with older filters, you can use params in any order\n * @param input - renderTexture from which size and resolution will be copied\n * @param resolution - override resolution of the renderTexture\n * @param multisample - number of samples of the renderTexture\n */\n FilterSystem.prototype.getFilterTexture = function (input, resolution, multisample) {\n if (typeof input === 'number') {\n var swap = input;\n input = resolution;\n resolution = swap;\n }\n input = input || this.activeState.renderTexture;\n var filterTexture = this.texturePool.getOptimalTexture(input.width, input.height, resolution || input.resolution, multisample || MSAA_QUALITY.NONE);\n filterTexture.filterFrame = input.filterFrame;\n return filterTexture;\n };\n /**\n * Frees a render texture back into the pool.\n * @param renderTexture - The renderTarget to free\n */\n FilterSystem.prototype.returnFilterTexture = function (renderTexture) {\n this.texturePool.returnTexture(renderTexture);\n };\n /** Empties the texture pool. */\n FilterSystem.prototype.emptyPool = function () {\n this.texturePool.clear(true);\n };\n /** Calls `texturePool.resize()`, affects fullScreen renderTextures. */\n FilterSystem.prototype.resize = function () {\n this.texturePool.setScreenSize(this.renderer.view);\n };\n /**\n * @param matrix - first param\n * @param rect - second param\n */\n FilterSystem.prototype.transformAABB = function (matrix, rect) {\n var lt = tempPoints[0];\n var lb = tempPoints[1];\n var rt = tempPoints[2];\n var rb = tempPoints[3];\n lt.set(rect.left, rect.top);\n lb.set(rect.left, rect.bottom);\n rt.set(rect.right, rect.top);\n rb.set(rect.right, rect.bottom);\n matrix.apply(lt, lt);\n matrix.apply(lb, lb);\n matrix.apply(rt, rt);\n matrix.apply(rb, rb);\n var x0 = Math.min(lt.x, lb.x, rt.x, rb.x);\n var y0 = Math.min(lt.y, lb.y, rt.y, rb.y);\n var x1 = Math.max(lt.x, lb.x, rt.x, rb.x);\n var y1 = Math.max(lt.y, lb.y, rt.y, rb.y);\n rect.x = x0;\n rect.y = y0;\n rect.width = x1 - x0;\n rect.height = y1 - y0;\n };\n FilterSystem.prototype.roundFrame = function (frame, resolution, bindingSourceFrame, bindingDestinationFrame, transform) {\n if (frame.width <= 0 || frame.height <= 0 || bindingSourceFrame.width <= 0 || bindingSourceFrame.height <= 0) {\n return;\n }\n if (transform) {\n var a = transform.a, b = transform.b, c = transform.c, d = transform.d;\n // Skip if skew/rotation present in matrix, except for multiple of 90° rotation. If rotation\n // is a multiple of 90°, then either pair of (b,c) or (a,d) will be (0,0).\n if ((Math.abs(b) > 1e-4 || Math.abs(c) > 1e-4)\n && (Math.abs(a) > 1e-4 || Math.abs(d) > 1e-4)) {\n return;\n }\n }\n transform = transform ? tempMatrix$2.copyFrom(transform) : tempMatrix$2.identity();\n // Get forward transform from world space to screen space\n transform\n .translate(-bindingSourceFrame.x, -bindingSourceFrame.y)\n .scale(bindingDestinationFrame.width / bindingSourceFrame.width, bindingDestinationFrame.height / bindingSourceFrame.height)\n .translate(bindingDestinationFrame.x, bindingDestinationFrame.y);\n // Convert frame to screen space\n this.transformAABB(transform, frame);\n // Round frame in screen space\n frame.ceil(resolution);\n // Project back into world space.\n this.transformAABB(transform.invert(), frame);\n };\n return FilterSystem;\n}());\n\n/**\n * Base for a common object renderer that can be used as a\n * system renderer plugin.\n * @memberof PIXI\n */\nvar ObjectRenderer = /** @class */ (function () {\n /**\n * @param renderer - The renderer this manager works for.\n */\n function ObjectRenderer(renderer) {\n this.renderer = renderer;\n }\n /** Stub method that should be used to empty the current batch by rendering objects now. */\n ObjectRenderer.prototype.flush = function () {\n // flush!\n };\n /** Generic destruction method that frees all resources. This should be called by subclasses. */\n ObjectRenderer.prototype.destroy = function () {\n this.renderer = null;\n };\n /**\n * Stub method that initializes any state required before\n * rendering starts. It is different from the `prerender`\n * signal, which occurs every frame, in that it is called\n * whenever an object requests _this_ renderer specifically.\n */\n ObjectRenderer.prototype.start = function () {\n // set the shader..\n };\n /** Stops the renderer. It should free up any state and become dormant. */\n ObjectRenderer.prototype.stop = function () {\n this.flush();\n };\n /**\n * Keeps the object to render. It doesn't have to be\n * rendered immediately.\n * @param {PIXI.DisplayObject} _object - The object to render.\n */\n ObjectRenderer.prototype.render = function (_object) {\n // render the object\n };\n return ObjectRenderer;\n}());\n\n/**\n * System plugin to the renderer to manage batching.\n * @memberof PIXI\n */\nvar BatchSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function BatchSystem(renderer) {\n this.renderer = renderer;\n this.emptyRenderer = new ObjectRenderer(renderer);\n this.currentRenderer = this.emptyRenderer;\n }\n /**\n * Changes the current renderer to the one given in parameter\n * @param objectRenderer - The object renderer to use.\n */\n BatchSystem.prototype.setObjectRenderer = function (objectRenderer) {\n if (this.currentRenderer === objectRenderer) {\n return;\n }\n this.currentRenderer.stop();\n this.currentRenderer = objectRenderer;\n this.currentRenderer.start();\n };\n /**\n * This should be called if you wish to do some custom rendering\n * It will basically render anything that may be batched up such as sprites\n */\n BatchSystem.prototype.flush = function () {\n this.setObjectRenderer(this.emptyRenderer);\n };\n /** Reset the system to an empty renderer */\n BatchSystem.prototype.reset = function () {\n this.setObjectRenderer(this.emptyRenderer);\n };\n /**\n * Handy function for batch renderers: copies bound textures in first maxTextures locations to array\n * sets actual _batchLocation for them\n * @param arr - arr copy destination\n * @param maxTextures - number of copied elements\n */\n BatchSystem.prototype.copyBoundTextures = function (arr, maxTextures) {\n var boundTextures = this.renderer.texture.boundTextures;\n for (var i = maxTextures - 1; i >= 0; --i) {\n arr[i] = boundTextures[i] || null;\n if (arr[i]) {\n arr[i]._batchLocation = i;\n }\n }\n };\n /**\n * Assigns batch locations to textures in array based on boundTextures state.\n * All textures in texArray should have `_batchEnabled = _batchId`,\n * and their count should be less than `maxTextures`.\n * @param texArray - textures to bound\n * @param boundTextures - current state of bound textures\n * @param batchId - marker for _batchEnabled param of textures in texArray\n * @param maxTextures - number of texture locations to manipulate\n */\n BatchSystem.prototype.boundArray = function (texArray, boundTextures, batchId, maxTextures) {\n var elements = texArray.elements, ids = texArray.ids, count = texArray.count;\n var j = 0;\n for (var i = 0; i < count; i++) {\n var tex = elements[i];\n var loc = tex._batchLocation;\n if (loc >= 0 && loc < maxTextures\n && boundTextures[loc] === tex) {\n ids[i] = loc;\n continue;\n }\n while (j < maxTextures) {\n var bound = boundTextures[j];\n if (bound && bound._batchEnabled === batchId\n && bound._batchLocation === j) {\n j++;\n continue;\n }\n ids[i] = j;\n tex._batchLocation = j;\n boundTextures[j] = tex;\n break;\n }\n }\n };\n /**\n * @ignore\n */\n BatchSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return BatchSystem;\n}());\n\nvar CONTEXT_UID_COUNTER = 0;\n/**\n * System plugin to the renderer to manage the context.\n * @memberof PIXI\n */\nvar ContextSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function ContextSystem(renderer) {\n this.renderer = renderer;\n this.webGLVersion = 1;\n this.extensions = {};\n this.supports = {\n uint32Indices: false,\n };\n // Bind functions\n this.handleContextLost = this.handleContextLost.bind(this);\n this.handleContextRestored = this.handleContextRestored.bind(this);\n renderer.view.addEventListener('webglcontextlost', this.handleContextLost, false);\n renderer.view.addEventListener('webglcontextrestored', this.handleContextRestored, false);\n }\n Object.defineProperty(ContextSystem.prototype, \"isLost\", {\n /**\n * `true` if the context is lost\n * @readonly\n */\n get: function () {\n return (!this.gl || this.gl.isContextLost());\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Handles the context change event.\n * @param {WebGLRenderingContext} gl - New WebGL context.\n */\n ContextSystem.prototype.contextChange = function (gl) {\n this.gl = gl;\n this.renderer.gl = gl;\n this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++;\n };\n /**\n * Initializes the context.\n * @protected\n * @param {WebGLRenderingContext} gl - WebGL context\n */\n ContextSystem.prototype.initFromContext = function (gl) {\n this.gl = gl;\n this.validateContext(gl);\n this.renderer.gl = gl;\n this.renderer.CONTEXT_UID = CONTEXT_UID_COUNTER++;\n this.renderer.runners.contextChange.emit(gl);\n };\n /**\n * Initialize from context options\n * @protected\n * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext\n * @param {object} options - context attributes\n */\n ContextSystem.prototype.initFromOptions = function (options) {\n var gl = this.createContext(this.renderer.view, options);\n this.initFromContext(gl);\n };\n /**\n * Helper class to create a WebGL Context\n * @param canvas - the canvas element that we will get the context from\n * @param options - An options object that gets passed in to the canvas element containing the\n * context attributes\n * @see https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext\n * @returns {WebGLRenderingContext} the WebGL context\n */\n ContextSystem.prototype.createContext = function (canvas, options) {\n var gl;\n if (settings.PREFER_ENV >= ENV.WEBGL2) {\n gl = canvas.getContext('webgl2', options);\n }\n if (gl) {\n this.webGLVersion = 2;\n }\n else {\n this.webGLVersion = 1;\n gl = canvas.getContext('webgl', options) || canvas.getContext('experimental-webgl', options);\n if (!gl) {\n // fail, not able to get a context\n throw new Error('This browser does not support WebGL. Try using the canvas renderer');\n }\n }\n this.gl = gl;\n this.getExtensions();\n return this.gl;\n };\n /** Auto-populate the {@link PIXI.ContextSystem.extensions extensions}. */\n ContextSystem.prototype.getExtensions = function () {\n // time to set up default extensions that Pixi uses.\n var gl = this.gl;\n var common = {\n loseContext: gl.getExtension('WEBGL_lose_context'),\n anisotropicFiltering: gl.getExtension('EXT_texture_filter_anisotropic'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n s3tc: gl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: gl.getExtension('WEBGL_compressed_texture_s3tc_srgb'),\n etc: gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: gl.getExtension('WEBGL_compressed_texture_astc')\n };\n if (this.webGLVersion === 1) {\n Object.assign(this.extensions, common, {\n drawBuffers: gl.getExtension('WEBGL_draw_buffers'),\n depthTexture: gl.getExtension('WEBGL_depth_texture'),\n vertexArrayObject: gl.getExtension('OES_vertex_array_object')\n || gl.getExtension('MOZ_OES_vertex_array_object')\n || gl.getExtension('WEBKIT_OES_vertex_array_object'),\n uint32ElementIndex: gl.getExtension('OES_element_index_uint'),\n // Floats and half-floats\n floatTexture: gl.getExtension('OES_texture_float'),\n floatTextureLinear: gl.getExtension('OES_texture_float_linear'),\n textureHalfFloat: gl.getExtension('OES_texture_half_float'),\n textureHalfFloatLinear: gl.getExtension('OES_texture_half_float_linear'),\n });\n }\n else if (this.webGLVersion === 2) {\n Object.assign(this.extensions, common, {\n // Floats and half-floats\n colorBufferFloat: gl.getExtension('EXT_color_buffer_float')\n });\n }\n };\n /**\n * Handles a lost webgl context\n * @param {WebGLContextEvent} event - The context lost event.\n */\n ContextSystem.prototype.handleContextLost = function (event) {\n var _this = this;\n // Prevent default to be able to restore the context\n event.preventDefault();\n // Restore the context after this event has exited\n setTimeout(function () {\n if (_this.gl.isContextLost() && _this.extensions.loseContext) {\n _this.extensions.loseContext.restoreContext();\n }\n }, 0);\n };\n /** Handles a restored webgl context. */\n ContextSystem.prototype.handleContextRestored = function () {\n this.renderer.runners.contextChange.emit(this.gl);\n };\n ContextSystem.prototype.destroy = function () {\n var view = this.renderer.view;\n this.renderer = null;\n // remove listeners\n view.removeEventListener('webglcontextlost', this.handleContextLost);\n view.removeEventListener('webglcontextrestored', this.handleContextRestored);\n this.gl.useProgram(null);\n if (this.extensions.loseContext) {\n this.extensions.loseContext.loseContext();\n }\n };\n /** Handle the post-render runner event. */\n ContextSystem.prototype.postrender = function () {\n if (this.renderer.renderingToScreen) {\n this.gl.flush();\n }\n };\n /**\n * Validate context.\n * @param {WebGLRenderingContext} gl - Render context.\n */\n ContextSystem.prototype.validateContext = function (gl) {\n var attributes = gl.getContextAttributes();\n var isWebGl2 = 'WebGL2RenderingContext' in globalThis && gl instanceof globalThis.WebGL2RenderingContext;\n if (isWebGl2) {\n this.webGLVersion = 2;\n }\n // this is going to be fairly simple for now.. but at least we have room to grow!\n if (attributes && !attributes.stencil) {\n /* eslint-disable max-len, no-console */\n console.warn('Provided WebGL context does not have a stencil buffer, masks may not render correctly');\n /* eslint-enable max-len, no-console */\n }\n var hasuint32 = isWebGl2 || !!gl.getExtension('OES_element_index_uint');\n this.supports.uint32Indices = hasuint32;\n if (!hasuint32) {\n /* eslint-disable max-len, no-console */\n console.warn('Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly');\n /* eslint-enable max-len, no-console */\n }\n };\n return ContextSystem;\n}());\n\n/**\n * Internal framebuffer for WebGL context.\n * @memberof PIXI\n */\nvar GLFramebuffer = /** @class */ (function () {\n function GLFramebuffer(framebuffer) {\n this.framebuffer = framebuffer;\n this.stencil = null;\n this.dirtyId = -1;\n this.dirtyFormat = -1;\n this.dirtySize = -1;\n this.multisample = MSAA_QUALITY.NONE;\n this.msaaBuffer = null;\n this.blitFramebuffer = null;\n this.mipLevel = 0;\n }\n return GLFramebuffer;\n}());\n\nvar tempRectangle = new Rectangle();\n/**\n * System plugin to the renderer to manage framebuffers.\n * @memberof PIXI\n */\nvar FramebufferSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function FramebufferSystem(renderer) {\n this.renderer = renderer;\n this.managedFramebuffers = [];\n this.unknownFramebuffer = new Framebuffer(10, 10);\n this.msaaSamples = null;\n }\n /** Sets up the renderer context and necessary buffers. */\n FramebufferSystem.prototype.contextChange = function () {\n this.disposeAll(true);\n var gl = this.gl = this.renderer.gl;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle();\n this.hasMRT = true;\n this.writeDepthTexture = true;\n // webgl2\n if (this.renderer.context.webGLVersion === 1) {\n // webgl 1!\n var nativeDrawBuffersExtension_1 = this.renderer.context.extensions.drawBuffers;\n var nativeDepthTextureExtension = this.renderer.context.extensions.depthTexture;\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) {\n nativeDrawBuffersExtension_1 = null;\n nativeDepthTextureExtension = null;\n }\n if (nativeDrawBuffersExtension_1) {\n gl.drawBuffers = function (activeTextures) {\n return nativeDrawBuffersExtension_1.drawBuffersWEBGL(activeTextures);\n };\n }\n else {\n this.hasMRT = false;\n gl.drawBuffers = function () {\n // empty\n };\n }\n if (!nativeDepthTextureExtension) {\n this.writeDepthTexture = false;\n }\n }\n else {\n // WebGL2\n // cache possible MSAA samples\n this.msaaSamples = gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES);\n }\n };\n /**\n * Bind a framebuffer.\n * @param framebuffer\n * @param frame - frame, default is framebuffer size\n * @param mipLevel - optional mip level to set on the framebuffer - defaults to 0\n */\n FramebufferSystem.prototype.bind = function (framebuffer, frame, mipLevel) {\n if (mipLevel === void 0) { mipLevel = 0; }\n var gl = this.gl;\n if (framebuffer) {\n // TODO caching layer!\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID] || this.initFramebuffer(framebuffer);\n if (this.current !== framebuffer) {\n this.current = framebuffer;\n gl.bindFramebuffer(gl.FRAMEBUFFER, fbo.framebuffer);\n }\n // make sure all textures are unbound..\n if (fbo.mipLevel !== mipLevel) {\n framebuffer.dirtyId++;\n framebuffer.dirtyFormat++;\n fbo.mipLevel = mipLevel;\n }\n // now check for updates...\n if (fbo.dirtyId !== framebuffer.dirtyId) {\n fbo.dirtyId = framebuffer.dirtyId;\n if (fbo.dirtyFormat !== framebuffer.dirtyFormat) {\n fbo.dirtyFormat = framebuffer.dirtyFormat;\n fbo.dirtySize = framebuffer.dirtySize;\n this.updateFramebuffer(framebuffer, mipLevel);\n }\n else if (fbo.dirtySize !== framebuffer.dirtySize) {\n fbo.dirtySize = framebuffer.dirtySize;\n this.resizeFramebuffer(framebuffer);\n }\n }\n for (var i = 0; i < framebuffer.colorTextures.length; i++) {\n var tex = framebuffer.colorTextures[i];\n this.renderer.texture.unbind(tex.parentTextureArray || tex);\n }\n if (framebuffer.depthTexture) {\n this.renderer.texture.unbind(framebuffer.depthTexture);\n }\n if (frame) {\n var mipWidth = (frame.width >> mipLevel);\n var mipHeight = (frame.height >> mipLevel);\n var scale = mipWidth / frame.width;\n this.setViewport(frame.x * scale, frame.y * scale, mipWidth, mipHeight);\n }\n else {\n var mipWidth = (framebuffer.width >> mipLevel);\n var mipHeight = (framebuffer.height >> mipLevel);\n this.setViewport(0, 0, mipWidth, mipHeight);\n }\n }\n else {\n if (this.current) {\n this.current = null;\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n if (frame) {\n this.setViewport(frame.x, frame.y, frame.width, frame.height);\n }\n else {\n this.setViewport(0, 0, this.renderer.width, this.renderer.height);\n }\n }\n };\n /**\n * Set the WebGLRenderingContext's viewport.\n * @param x - X position of viewport\n * @param y - Y position of viewport\n * @param width - Width of viewport\n * @param height - Height of viewport\n */\n FramebufferSystem.prototype.setViewport = function (x, y, width, height) {\n var v = this.viewport;\n x = Math.round(x);\n y = Math.round(y);\n width = Math.round(width);\n height = Math.round(height);\n if (v.width !== width || v.height !== height || v.x !== x || v.y !== y) {\n v.x = x;\n v.y = y;\n v.width = width;\n v.height = height;\n this.gl.viewport(x, y, width, height);\n }\n };\n Object.defineProperty(FramebufferSystem.prototype, \"size\", {\n /**\n * Get the size of the current width and height. Returns object with `width` and `height` values.\n * @readonly\n */\n get: function () {\n if (this.current) {\n // TODO store temp\n return { x: 0, y: 0, width: this.current.width, height: this.current.height };\n }\n return { x: 0, y: 0, width: this.renderer.width, height: this.renderer.height };\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clear the color of the context\n * @param r - Red value from 0 to 1\n * @param g - Green value from 0 to 1\n * @param b - Blue value from 0 to 1\n * @param a - Alpha value from 0 to 1\n * @param {PIXI.BUFFER_BITS} [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks\n * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.\n */\n FramebufferSystem.prototype.clear = function (r, g, b, a, mask) {\n if (mask === void 0) { mask = BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH; }\n var gl = this.gl;\n // TODO clear color can be set only one right?\n gl.clearColor(r, g, b, a);\n gl.clear(mask);\n };\n /**\n * Initialize framebuffer for this context\n * @protected\n * @param framebuffer\n * @returns - created GLFramebuffer\n */\n FramebufferSystem.prototype.initFramebuffer = function (framebuffer) {\n var gl = this.gl;\n var fbo = new GLFramebuffer(gl.createFramebuffer());\n fbo.multisample = this.detectSamples(framebuffer.multisample);\n framebuffer.glFramebuffers[this.CONTEXT_UID] = fbo;\n this.managedFramebuffers.push(framebuffer);\n framebuffer.disposeRunner.add(this);\n return fbo;\n };\n /**\n * Resize the framebuffer\n * @param framebuffer\n * @protected\n */\n FramebufferSystem.prototype.resizeFramebuffer = function (framebuffer) {\n var gl = this.gl;\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n if (fbo.msaaBuffer) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.msaaBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.RGBA8, framebuffer.width, framebuffer.height);\n }\n if (fbo.stencil) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.stencil);\n if (fbo.msaaBuffer) {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.DEPTH24_STENCIL8, framebuffer.width, framebuffer.height);\n }\n else {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, framebuffer.width, framebuffer.height);\n }\n }\n var colorTextures = framebuffer.colorTextures;\n var count = colorTextures.length;\n if (!gl.drawBuffers) {\n count = Math.min(count, 1);\n }\n for (var i = 0; i < count; i++) {\n var texture = colorTextures[i];\n var parentTexture = texture.parentTextureArray || texture;\n this.renderer.texture.bind(parentTexture, 0);\n }\n if (framebuffer.depthTexture && this.writeDepthTexture) {\n this.renderer.texture.bind(framebuffer.depthTexture, 0);\n }\n };\n /**\n * Update the framebuffer\n * @param framebuffer\n * @param mipLevel\n * @protected\n */\n FramebufferSystem.prototype.updateFramebuffer = function (framebuffer, mipLevel) {\n var gl = this.gl;\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n // bind the color texture\n var colorTextures = framebuffer.colorTextures;\n var count = colorTextures.length;\n if (!gl.drawBuffers) {\n count = Math.min(count, 1);\n }\n if (fbo.multisample > 1 && this.canMultisampleFramebuffer(framebuffer)) {\n fbo.msaaBuffer = fbo.msaaBuffer || gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.msaaBuffer);\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.RGBA8, framebuffer.width, framebuffer.height);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, fbo.msaaBuffer);\n }\n else if (fbo.msaaBuffer) {\n gl.deleteRenderbuffer(fbo.msaaBuffer);\n fbo.msaaBuffer = null;\n if (fbo.blitFramebuffer) {\n fbo.blitFramebuffer.dispose();\n fbo.blitFramebuffer = null;\n }\n }\n var activeTextures = [];\n for (var i = 0; i < count; i++) {\n var texture = colorTextures[i];\n var parentTexture = texture.parentTextureArray || texture;\n this.renderer.texture.bind(parentTexture, 0);\n if (i === 0 && fbo.msaaBuffer) {\n continue;\n }\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + i, texture.target, parentTexture._glTextures[this.CONTEXT_UID].texture, mipLevel);\n activeTextures.push(gl.COLOR_ATTACHMENT0 + i);\n }\n if (activeTextures.length > 1) {\n gl.drawBuffers(activeTextures);\n }\n if (framebuffer.depthTexture) {\n var writeDepthTexture = this.writeDepthTexture;\n if (writeDepthTexture) {\n var depthTexture = framebuffer.depthTexture;\n this.renderer.texture.bind(depthTexture, 0);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, depthTexture._glTextures[this.CONTEXT_UID].texture, mipLevel);\n }\n }\n if ((framebuffer.stencil || framebuffer.depth) && !(framebuffer.depthTexture && this.writeDepthTexture)) {\n fbo.stencil = fbo.stencil || gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, fbo.stencil);\n if (fbo.msaaBuffer) {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.DEPTH24_STENCIL8, framebuffer.width, framebuffer.height);\n }\n else {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, framebuffer.width, framebuffer.height);\n }\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, fbo.stencil);\n }\n else if (fbo.stencil) {\n gl.deleteRenderbuffer(fbo.stencil);\n fbo.stencil = null;\n }\n };\n /**\n * Returns true if the frame buffer can be multisampled.\n * @param framebuffer\n */\n FramebufferSystem.prototype.canMultisampleFramebuffer = function (framebuffer) {\n return this.renderer.context.webGLVersion !== 1\n && framebuffer.colorTextures.length <= 1 && !framebuffer.depthTexture;\n };\n /**\n * Detects number of samples that is not more than a param but as close to it as possible\n * @param samples - number of samples\n * @returns - recommended number of samples\n */\n FramebufferSystem.prototype.detectSamples = function (samples) {\n var msaaSamples = this.msaaSamples;\n var res = MSAA_QUALITY.NONE;\n if (samples <= 1 || msaaSamples === null) {\n return res;\n }\n for (var i = 0; i < msaaSamples.length; i++) {\n if (msaaSamples[i] <= samples) {\n res = msaaSamples[i];\n break;\n }\n }\n if (res === 1) {\n res = MSAA_QUALITY.NONE;\n }\n return res;\n };\n /**\n * Only works with WebGL2\n *\n * blits framebuffer to another of the same or bigger size\n * after that target framebuffer is bound\n *\n * Fails with WebGL warning if blits multisample framebuffer to different size\n * @param framebuffer - by default it blits \"into itself\", from renderBuffer to texture.\n * @param sourcePixels - source rectangle in pixels\n * @param destPixels - dest rectangle in pixels, assumed to be the same as sourcePixels\n */\n FramebufferSystem.prototype.blit = function (framebuffer, sourcePixels, destPixels) {\n var _a = this, current = _a.current, renderer = _a.renderer, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n if (renderer.context.webGLVersion !== 2) {\n return;\n }\n if (!current) {\n return;\n }\n var fbo = current.glFramebuffers[CONTEXT_UID];\n if (!fbo) {\n return;\n }\n if (!framebuffer) {\n if (!fbo.msaaBuffer) {\n return;\n }\n var colorTexture = current.colorTextures[0];\n if (!colorTexture) {\n return;\n }\n if (!fbo.blitFramebuffer) {\n fbo.blitFramebuffer = new Framebuffer(current.width, current.height);\n fbo.blitFramebuffer.addColorTexture(0, colorTexture);\n }\n framebuffer = fbo.blitFramebuffer;\n if (framebuffer.colorTextures[0] !== colorTexture) {\n framebuffer.colorTextures[0] = colorTexture;\n framebuffer.dirtyId++;\n framebuffer.dirtyFormat++;\n }\n if (framebuffer.width !== current.width || framebuffer.height !== current.height) {\n framebuffer.width = current.width;\n framebuffer.height = current.height;\n framebuffer.dirtyId++;\n framebuffer.dirtySize++;\n }\n }\n if (!sourcePixels) {\n sourcePixels = tempRectangle;\n sourcePixels.width = current.width;\n sourcePixels.height = current.height;\n }\n if (!destPixels) {\n destPixels = sourcePixels;\n }\n var sameSize = sourcePixels.width === destPixels.width && sourcePixels.height === destPixels.height;\n this.bind(framebuffer);\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, fbo.framebuffer);\n gl.blitFramebuffer(sourcePixels.left, sourcePixels.top, sourcePixels.right, sourcePixels.bottom, destPixels.left, destPixels.top, destPixels.right, destPixels.bottom, gl.COLOR_BUFFER_BIT, sameSize ? gl.NEAREST : gl.LINEAR);\n };\n /**\n * Disposes framebuffer.\n * @param framebuffer - framebuffer that has to be disposed of\n * @param contextLost - If context was lost, we suppress all delete function calls\n */\n FramebufferSystem.prototype.disposeFramebuffer = function (framebuffer, contextLost) {\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n var gl = this.gl;\n if (!fbo) {\n return;\n }\n delete framebuffer.glFramebuffers[this.CONTEXT_UID];\n var index = this.managedFramebuffers.indexOf(framebuffer);\n if (index >= 0) {\n this.managedFramebuffers.splice(index, 1);\n }\n framebuffer.disposeRunner.remove(this);\n if (!contextLost) {\n gl.deleteFramebuffer(fbo.framebuffer);\n if (fbo.msaaBuffer) {\n gl.deleteRenderbuffer(fbo.msaaBuffer);\n }\n if (fbo.stencil) {\n gl.deleteRenderbuffer(fbo.stencil);\n }\n }\n if (fbo.blitFramebuffer) {\n fbo.blitFramebuffer.dispose();\n }\n };\n /**\n * Disposes all framebuffers, but not textures bound to them.\n * @param [contextLost=false] - If context was lost, we suppress all delete function calls\n */\n FramebufferSystem.prototype.disposeAll = function (contextLost) {\n var list = this.managedFramebuffers;\n this.managedFramebuffers = [];\n for (var i = 0; i < list.length; i++) {\n this.disposeFramebuffer(list[i], contextLost);\n }\n };\n /**\n * Forcing creation of stencil buffer for current framebuffer, if it wasn't done before.\n * Used by MaskSystem, when its time to use stencil mask for Graphics element.\n *\n * Its an alternative for public lazy `framebuffer.enableStencil`, in case we need stencil without rebind.\n * @private\n */\n FramebufferSystem.prototype.forceStencil = function () {\n var framebuffer = this.current;\n if (!framebuffer) {\n return;\n }\n var fbo = framebuffer.glFramebuffers[this.CONTEXT_UID];\n if (!fbo || fbo.stencil) {\n return;\n }\n framebuffer.stencil = true;\n var w = framebuffer.width;\n var h = framebuffer.height;\n var gl = this.gl;\n var stencil = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, stencil);\n if (fbo.msaaBuffer) {\n gl.renderbufferStorageMultisample(gl.RENDERBUFFER, fbo.multisample, gl.DEPTH24_STENCIL8, w, h);\n }\n else {\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, w, h);\n }\n fbo.stencil = stencil;\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, stencil);\n };\n /** Resets framebuffer stored state, binds screen framebuffer. Should be called before renderTexture reset(). */\n FramebufferSystem.prototype.reset = function () {\n this.current = this.unknownFramebuffer;\n this.viewport = new Rectangle();\n };\n FramebufferSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return FramebufferSystem;\n}());\n\nvar byteSizeMap = { 5126: 4, 5123: 2, 5121: 1 };\n/**\n * System plugin to the renderer to manage geometry.\n * @memberof PIXI\n */\nvar GeometrySystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function GeometrySystem(renderer) {\n this.renderer = renderer;\n this._activeGeometry = null;\n this._activeVao = null;\n this.hasVao = true;\n this.hasInstance = true;\n this.canUseUInt32ElementIndex = false;\n this.managedGeometries = {};\n }\n /** Sets up the renderer context and necessary buffers. */\n GeometrySystem.prototype.contextChange = function () {\n this.disposeAll(true);\n var gl = this.gl = this.renderer.gl;\n var context = this.renderer.context;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n // webgl2\n if (context.webGLVersion !== 2) {\n // webgl 1!\n var nativeVaoExtension_1 = this.renderer.context.extensions.vertexArrayObject;\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) {\n nativeVaoExtension_1 = null;\n }\n if (nativeVaoExtension_1) {\n gl.createVertexArray = function () {\n return nativeVaoExtension_1.createVertexArrayOES();\n };\n gl.bindVertexArray = function (vao) {\n return nativeVaoExtension_1.bindVertexArrayOES(vao);\n };\n gl.deleteVertexArray = function (vao) {\n return nativeVaoExtension_1.deleteVertexArrayOES(vao);\n };\n }\n else {\n this.hasVao = false;\n gl.createVertexArray = function () {\n return null;\n };\n gl.bindVertexArray = function () {\n return null;\n };\n gl.deleteVertexArray = function () {\n return null;\n };\n }\n }\n if (context.webGLVersion !== 2) {\n var instanceExt_1 = gl.getExtension('ANGLE_instanced_arrays');\n if (instanceExt_1) {\n gl.vertexAttribDivisor = function (a, b) {\n return instanceExt_1.vertexAttribDivisorANGLE(a, b);\n };\n gl.drawElementsInstanced = function (a, b, c, d, e) {\n return instanceExt_1.drawElementsInstancedANGLE(a, b, c, d, e);\n };\n gl.drawArraysInstanced = function (a, b, c, d) {\n return instanceExt_1.drawArraysInstancedANGLE(a, b, c, d);\n };\n }\n else {\n this.hasInstance = false;\n }\n }\n this.canUseUInt32ElementIndex = context.webGLVersion === 2 || !!context.extensions.uint32ElementIndex;\n };\n /**\n * Binds geometry so that is can be drawn. Creating a Vao if required\n * @param geometry - Instance of geometry to bind.\n * @param shader - Instance of shader to use vao for.\n */\n GeometrySystem.prototype.bind = function (geometry, shader) {\n shader = shader || this.renderer.shader.shader;\n var gl = this.gl;\n // not sure the best way to address this..\n // currently different shaders require different VAOs for the same geometry\n // Still mulling over the best way to solve this one..\n // will likely need to modify the shader attribute locations at run time!\n var vaos = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n var incRefCount = false;\n if (!vaos) {\n this.managedGeometries[geometry.id] = geometry;\n geometry.disposeRunner.add(this);\n geometry.glVertexArrayObjects[this.CONTEXT_UID] = vaos = {};\n incRefCount = true;\n }\n var vao = vaos[shader.program.id] || this.initGeometryVao(geometry, shader, incRefCount);\n this._activeGeometry = geometry;\n if (this._activeVao !== vao) {\n this._activeVao = vao;\n if (this.hasVao) {\n gl.bindVertexArray(vao);\n }\n else {\n this.activateVao(geometry, shader.program);\n }\n }\n // TODO - optimise later!\n // don't need to loop through if nothing changed!\n // maybe look to add an 'autoupdate' to geometry?\n this.updateBuffers();\n };\n /** Reset and unbind any active VAO and geometry. */\n GeometrySystem.prototype.reset = function () {\n this.unbind();\n };\n /** Update buffers of the currently bound geometry. */\n GeometrySystem.prototype.updateBuffers = function () {\n var geometry = this._activeGeometry;\n var bufferSystem = this.renderer.buffer;\n for (var i = 0; i < geometry.buffers.length; i++) {\n var buffer = geometry.buffers[i];\n bufferSystem.update(buffer);\n }\n };\n /**\n * Check compatibility between a geometry and a program\n * @param geometry - Geometry instance.\n * @param program - Program instance.\n */\n GeometrySystem.prototype.checkCompatibility = function (geometry, program) {\n // geometry must have at least all the attributes that the shader requires.\n var geometryAttributes = geometry.attributes;\n var shaderAttributes = program.attributeData;\n for (var j in shaderAttributes) {\n if (!geometryAttributes[j]) {\n throw new Error(\"shader and geometry incompatible, geometry missing the \\\"\" + j + \"\\\" attribute\");\n }\n }\n };\n /**\n * Takes a geometry and program and generates a unique signature for them.\n * @param geometry - To get signature from.\n * @param program - To test geometry against.\n * @returns - Unique signature of the geometry and program\n */\n GeometrySystem.prototype.getSignature = function (geometry, program) {\n var attribs = geometry.attributes;\n var shaderAttributes = program.attributeData;\n var strings = ['g', geometry.id];\n for (var i in attribs) {\n if (shaderAttributes[i]) {\n strings.push(i, shaderAttributes[i].location);\n }\n }\n return strings.join('-');\n };\n /**\n * Creates or gets Vao with the same structure as the geometry and stores it on the geometry.\n * If vao is created, it is bound automatically. We use a shader to infer what and how to set up the\n * attribute locations.\n * @param geometry - Instance of geometry to to generate Vao for.\n * @param shader - Instance of the shader.\n * @param incRefCount - Increment refCount of all geometry buffers.\n */\n GeometrySystem.prototype.initGeometryVao = function (geometry, shader, incRefCount) {\n if (incRefCount === void 0) { incRefCount = true; }\n var gl = this.gl;\n var CONTEXT_UID = this.CONTEXT_UID;\n var bufferSystem = this.renderer.buffer;\n var program = shader.program;\n if (!program.glPrograms[CONTEXT_UID]) {\n this.renderer.shader.generateProgram(shader);\n }\n this.checkCompatibility(geometry, program);\n var signature = this.getSignature(geometry, program);\n var vaoObjectHash = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n var vao = vaoObjectHash[signature];\n if (vao) {\n // this will give us easy access to the vao\n vaoObjectHash[program.id] = vao;\n return vao;\n }\n var buffers = geometry.buffers;\n var attributes = geometry.attributes;\n var tempStride = {};\n var tempStart = {};\n for (var j in buffers) {\n tempStride[j] = 0;\n tempStart[j] = 0;\n }\n for (var j in attributes) {\n if (!attributes[j].size && program.attributeData[j]) {\n attributes[j].size = program.attributeData[j].size;\n }\n else if (!attributes[j].size) {\n console.warn(\"PIXI Geometry attribute '\" + j + \"' size cannot be determined (likely the bound shader does not have the attribute)\"); // eslint-disable-line\n }\n tempStride[attributes[j].buffer] += attributes[j].size * byteSizeMap[attributes[j].type];\n }\n for (var j in attributes) {\n var attribute = attributes[j];\n var attribSize = attribute.size;\n if (attribute.stride === undefined) {\n if (tempStride[attribute.buffer] === attribSize * byteSizeMap[attribute.type]) {\n attribute.stride = 0;\n }\n else {\n attribute.stride = tempStride[attribute.buffer];\n }\n }\n if (attribute.start === undefined) {\n attribute.start = tempStart[attribute.buffer];\n tempStart[attribute.buffer] += attribSize * byteSizeMap[attribute.type];\n }\n }\n vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n // first update - and create the buffers!\n // only create a gl buffer if it actually gets\n for (var i = 0; i < buffers.length; i++) {\n var buffer = buffers[i];\n bufferSystem.bind(buffer);\n if (incRefCount) {\n buffer._glBuffers[CONTEXT_UID].refCount++;\n }\n }\n // TODO - maybe make this a data object?\n // lets wait to see if we need to first!\n this.activateVao(geometry, program);\n this._activeVao = vao;\n // add it to the cache!\n vaoObjectHash[program.id] = vao;\n vaoObjectHash[signature] = vao;\n return vao;\n };\n /**\n * Disposes geometry.\n * @param geometry - Geometry with buffers. Only VAO will be disposed\n * @param [contextLost=false] - If context was lost, we suppress deleteVertexArray\n */\n GeometrySystem.prototype.disposeGeometry = function (geometry, contextLost) {\n var _a;\n if (!this.managedGeometries[geometry.id]) {\n return;\n }\n delete this.managedGeometries[geometry.id];\n var vaos = geometry.glVertexArrayObjects[this.CONTEXT_UID];\n var gl = this.gl;\n var buffers = geometry.buffers;\n var bufferSystem = (_a = this.renderer) === null || _a === void 0 ? void 0 : _a.buffer;\n geometry.disposeRunner.remove(this);\n if (!vaos) {\n return;\n }\n // bufferSystem may have already been destroyed..\n // if this is the case, there is no need to destroy the geometry buffers...\n // they already have been!\n if (bufferSystem) {\n for (var i = 0; i < buffers.length; i++) {\n var buf = buffers[i]._glBuffers[this.CONTEXT_UID];\n // my be null as context may have changed right before the dispose is called\n if (buf) {\n buf.refCount--;\n if (buf.refCount === 0 && !contextLost) {\n bufferSystem.dispose(buffers[i], contextLost);\n }\n }\n }\n }\n if (!contextLost) {\n for (var vaoId in vaos) {\n // delete only signatures, everything else are copies\n if (vaoId[0] === 'g') {\n var vao = vaos[vaoId];\n if (this._activeVao === vao) {\n this.unbind();\n }\n gl.deleteVertexArray(vao);\n }\n }\n }\n delete geometry.glVertexArrayObjects[this.CONTEXT_UID];\n };\n /**\n * Dispose all WebGL resources of all managed geometries.\n * @param [contextLost=false] - If context was lost, we suppress `gl.delete` calls\n */\n GeometrySystem.prototype.disposeAll = function (contextLost) {\n var all = Object.keys(this.managedGeometries);\n for (var i = 0; i < all.length; i++) {\n this.disposeGeometry(this.managedGeometries[all[i]], contextLost);\n }\n };\n /**\n * Activate vertex array object.\n * @param geometry - Geometry instance.\n * @param program - Shader program instance.\n */\n GeometrySystem.prototype.activateVao = function (geometry, program) {\n var gl = this.gl;\n var CONTEXT_UID = this.CONTEXT_UID;\n var bufferSystem = this.renderer.buffer;\n var buffers = geometry.buffers;\n var attributes = geometry.attributes;\n if (geometry.indexBuffer) {\n // first update the index buffer if we have one..\n bufferSystem.bind(geometry.indexBuffer);\n }\n var lastBuffer = null;\n // add a new one!\n for (var j in attributes) {\n var attribute = attributes[j];\n var buffer = buffers[attribute.buffer];\n var glBuffer = buffer._glBuffers[CONTEXT_UID];\n if (program.attributeData[j]) {\n if (lastBuffer !== glBuffer) {\n bufferSystem.bind(buffer);\n lastBuffer = glBuffer;\n }\n var location = program.attributeData[j].location;\n // TODO introduce state again\n // we can optimise this for older devices that have no VAOs\n gl.enableVertexAttribArray(location);\n gl.vertexAttribPointer(location, attribute.size, attribute.type || gl.FLOAT, attribute.normalized, attribute.stride, attribute.start);\n if (attribute.instance) {\n // TODO calculate instance count based of this...\n if (this.hasInstance) {\n gl.vertexAttribDivisor(location, 1);\n }\n else {\n throw new Error('geometry error, GPU Instancing is not supported on this device');\n }\n }\n }\n }\n };\n /**\n * Draws the currently bound geometry.\n * @param type - The type primitive to render.\n * @param size - The number of elements to be rendered. If not specified, all vertices after the\n * starting vertex will be drawn.\n * @param start - The starting vertex in the geometry to start drawing from. If not specified,\n * drawing will start from the first vertex.\n * @param instanceCount - The number of instances of the set of elements to execute. If not specified,\n * all instances will be drawn.\n */\n GeometrySystem.prototype.draw = function (type, size, start, instanceCount) {\n var gl = this.gl;\n var geometry = this._activeGeometry;\n // TODO.. this should not change so maybe cache the function?\n if (geometry.indexBuffer) {\n var byteSize = geometry.indexBuffer.data.BYTES_PER_ELEMENT;\n var glType = byteSize === 2 ? gl.UNSIGNED_SHORT : gl.UNSIGNED_INT;\n if (byteSize === 2 || (byteSize === 4 && this.canUseUInt32ElementIndex)) {\n if (geometry.instanced) {\n /* eslint-disable max-len */\n gl.drawElementsInstanced(type, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize, instanceCount || 1);\n /* eslint-enable max-len */\n }\n else {\n /* eslint-disable max-len */\n gl.drawElements(type, size || geometry.indexBuffer.data.length, glType, (start || 0) * byteSize);\n /* eslint-enable max-len */\n }\n }\n else {\n console.warn('unsupported index buffer type: uint32');\n }\n }\n else if (geometry.instanced) {\n // TODO need a better way to calculate size..\n gl.drawArraysInstanced(type, start, size || geometry.getSize(), instanceCount || 1);\n }\n else {\n gl.drawArrays(type, start, size || geometry.getSize());\n }\n return this;\n };\n /** Unbind/reset everything. */\n GeometrySystem.prototype.unbind = function () {\n this.gl.bindVertexArray(null);\n this._activeVao = null;\n this._activeGeometry = null;\n };\n GeometrySystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return GeometrySystem;\n}());\n\n/**\n * Component for masked elements.\n *\n * Holds mask mode and temporary data about current mask.\n * @memberof PIXI\n */\nvar MaskData = /** @class */ (function () {\n /**\n * Create MaskData\n * @param {PIXI.DisplayObject} [maskObject=null] - object that describes the mask\n */\n function MaskData(maskObject) {\n if (maskObject === void 0) { maskObject = null; }\n this.type = MASK_TYPES.NONE;\n this.autoDetect = true;\n this.maskObject = maskObject || null;\n this.pooled = false;\n this.isMaskData = true;\n this.resolution = null;\n this.multisample = settings.FILTER_MULTISAMPLE;\n this.enabled = true;\n this.colorMask = 0xf;\n this._filters = null;\n this._stencilCounter = 0;\n this._scissorCounter = 0;\n this._scissorRect = null;\n this._scissorRectLocal = null;\n this._colorMask = 0xf;\n this._target = null;\n }\n Object.defineProperty(MaskData.prototype, \"filter\", {\n /**\n * The sprite mask filter.\n * If set to `null`, the default sprite mask filter is used.\n * @default null\n */\n get: function () {\n return this._filters ? this._filters[0] : null;\n },\n set: function (value) {\n if (value) {\n if (this._filters) {\n this._filters[0] = value;\n }\n else {\n this._filters = [value];\n }\n }\n else {\n this._filters = null;\n }\n },\n enumerable: false,\n configurable: true\n });\n /** Resets the mask data after popMask(). */\n MaskData.prototype.reset = function () {\n if (this.pooled) {\n this.maskObject = null;\n this.type = MASK_TYPES.NONE;\n this.autoDetect = true;\n }\n this._target = null;\n this._scissorRectLocal = null;\n };\n /**\n * Copies counters from maskData above, called from pushMask().\n * @param maskAbove\n */\n MaskData.prototype.copyCountersOrReset = function (maskAbove) {\n if (maskAbove) {\n this._stencilCounter = maskAbove._stencilCounter;\n this._scissorCounter = maskAbove._scissorCounter;\n this._scissorRect = maskAbove._scissorRect;\n }\n else {\n this._stencilCounter = 0;\n this._scissorCounter = 0;\n this._scissorRect = null;\n }\n };\n return MaskData;\n}());\n\n/**\n * @private\n * @param {WebGLRenderingContext} gl - The current WebGL context {WebGLProgram}\n * @param {number} type - the type, can be either VERTEX_SHADER or FRAGMENT_SHADER\n * @param {string} src - The vertex shader source as an array of strings.\n * @returns {WebGLShader} the shader\n */\nfunction compileShader(gl, type, src) {\n var shader = gl.createShader(type);\n gl.shaderSource(shader, src);\n gl.compileShader(shader);\n return shader;\n}\n\n/**\n * will log a shader error highlighting the lines with the error\n * also will add numbers along the side.\n * @param gl - the WebGLContext\n * @param shader - the shader to log errors for\n */\nfunction logPrettyShaderError(gl, shader) {\n var shaderSrc = gl.getShaderSource(shader)\n .split('\\n')\n .map(function (line, index) { return index + \": \" + line; });\n var shaderLog = gl.getShaderInfoLog(shader);\n var splitShader = shaderLog.split('\\n');\n var dedupe = {};\n var lineNumbers = splitShader.map(function (line) { return parseFloat(line.replace(/^ERROR\\: 0\\:([\\d]+)\\:.*$/, '$1')); })\n .filter(function (n) {\n if (n && !dedupe[n]) {\n dedupe[n] = true;\n return true;\n }\n return false;\n });\n var logArgs = [''];\n lineNumbers.forEach(function (number) {\n shaderSrc[number - 1] = \"%c\" + shaderSrc[number - 1] + \"%c\";\n logArgs.push('background: #FF0000; color:#FFFFFF; font-size: 10px', 'font-size: 10px');\n });\n var fragmentSourceToLog = shaderSrc\n .join('\\n');\n logArgs[0] = fragmentSourceToLog;\n console.error(shaderLog);\n // eslint-disable-next-line no-console\n console.groupCollapsed('click to view full shader code');\n console.warn.apply(console, logArgs);\n // eslint-disable-next-line no-console\n console.groupEnd();\n}\n/**\n *\n * logs out any program errors\n * @param gl - The current WebGL context\n * @param program - the WebGL program to display errors for\n * @param vertexShader - the fragment WebGL shader program\n * @param fragmentShader - the vertex WebGL shader program\n */\nfunction logProgramError(gl, program, vertexShader, fragmentShader) {\n // if linking fails, then log and cleanup\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n logPrettyShaderError(gl, vertexShader);\n }\n if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n logPrettyShaderError(gl, fragmentShader);\n }\n console.error('PixiJS Error: Could not initialize shader.');\n // if there is a program info log, log it\n if (gl.getProgramInfoLog(program) !== '') {\n console.warn('PixiJS Warning: gl.getProgramInfoLog()', gl.getProgramInfoLog(program));\n }\n }\n}\n\nfunction booleanArray(size) {\n var array = new Array(size);\n for (var i = 0; i < array.length; i++) {\n array[i] = false;\n }\n return array;\n}\n/**\n * @method defaultValue\n * @memberof PIXI.glCore.shader\n * @param {string} type - Type of value\n * @param {number} size\n * @private\n */\nfunction defaultValue(type, size) {\n switch (type) {\n case 'float':\n return 0;\n case 'vec2':\n return new Float32Array(2 * size);\n case 'vec3':\n return new Float32Array(3 * size);\n case 'vec4':\n return new Float32Array(4 * size);\n case 'int':\n case 'uint':\n case 'sampler2D':\n case 'sampler2DArray':\n return 0;\n case 'ivec2':\n return new Int32Array(2 * size);\n case 'ivec3':\n return new Int32Array(3 * size);\n case 'ivec4':\n return new Int32Array(4 * size);\n case 'uvec2':\n return new Uint32Array(2 * size);\n case 'uvec3':\n return new Uint32Array(3 * size);\n case 'uvec4':\n return new Uint32Array(4 * size);\n case 'bool':\n return false;\n case 'bvec2':\n return booleanArray(2 * size);\n case 'bvec3':\n return booleanArray(3 * size);\n case 'bvec4':\n return booleanArray(4 * size);\n case 'mat2':\n return new Float32Array([1, 0,\n 0, 1]);\n case 'mat3':\n return new Float32Array([1, 0, 0,\n 0, 1, 0,\n 0, 0, 1]);\n case 'mat4':\n return new Float32Array([1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1]);\n }\n return null;\n}\n\nvar unknownContext = {};\nvar context = unknownContext;\n/**\n * returns a little WebGL context to use for program inspection.\n * @static\n * @private\n * @returns {WebGLRenderingContext} a gl context to test with\n */\nfunction getTestContext() {\n if (context === unknownContext || (context && context.isContextLost())) {\n var canvas = settings.ADAPTER.createCanvas();\n var gl = void 0;\n if (settings.PREFER_ENV >= ENV.WEBGL2) {\n gl = canvas.getContext('webgl2', {});\n }\n if (!gl) {\n gl = (canvas.getContext('webgl', {})\n || canvas.getContext('experimental-webgl', {}));\n if (!gl) {\n // fail, not able to get a context\n gl = null;\n }\n else {\n // for shader testing..\n gl.getExtension('WEBGL_draw_buffers');\n }\n }\n context = gl;\n }\n return context;\n}\n\nvar maxFragmentPrecision;\nfunction getMaxFragmentPrecision() {\n if (!maxFragmentPrecision) {\n maxFragmentPrecision = PRECISION.MEDIUM;\n var gl = getTestContext();\n if (gl) {\n if (gl.getShaderPrecisionFormat) {\n var shaderFragment = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);\n maxFragmentPrecision = shaderFragment.precision ? PRECISION.HIGH : PRECISION.MEDIUM;\n }\n }\n }\n return maxFragmentPrecision;\n}\n\n/**\n * Sets the float precision on the shader, ensuring the device supports the request precision.\n * If the precision is already present, it just ensures that the device is able to handle it.\n * @private\n * @param {string} src - The shader source\n * @param {PIXI.PRECISION} requestedPrecision - The request float precision of the shader.\n * @param {PIXI.PRECISION} maxSupportedPrecision - The maximum precision the shader supports.\n * @returns {string} modified shader source\n */\nfunction setPrecision(src, requestedPrecision, maxSupportedPrecision) {\n if (src.substring(0, 9) !== 'precision') {\n // no precision supplied, so PixiJS will add the requested level.\n var precision = requestedPrecision;\n // If highp is requested but not supported, downgrade precision to a level all devices support.\n if (requestedPrecision === PRECISION.HIGH && maxSupportedPrecision !== PRECISION.HIGH) {\n precision = PRECISION.MEDIUM;\n }\n return \"precision \" + precision + \" float;\\n\" + src;\n }\n else if (maxSupportedPrecision !== PRECISION.HIGH && src.substring(0, 15) === 'precision highp') {\n // precision was supplied, but at a level this device does not support, so downgrading to mediump.\n return src.replace('precision highp', 'precision mediump');\n }\n return src;\n}\n\nvar GLSL_TO_SIZE = {\n float: 1,\n vec2: 2,\n vec3: 3,\n vec4: 4,\n int: 1,\n ivec2: 2,\n ivec3: 3,\n ivec4: 4,\n uint: 1,\n uvec2: 2,\n uvec3: 3,\n uvec4: 4,\n bool: 1,\n bvec2: 2,\n bvec3: 3,\n bvec4: 4,\n mat2: 4,\n mat3: 9,\n mat4: 16,\n sampler2D: 1,\n};\n/**\n * @private\n * @method mapSize\n * @memberof PIXI.glCore.shader\n * @param {string} type\n */\nfunction mapSize(type) {\n return GLSL_TO_SIZE[type];\n}\n\nvar GL_TABLE = null;\nvar GL_TO_GLSL_TYPES = {\n FLOAT: 'float',\n FLOAT_VEC2: 'vec2',\n FLOAT_VEC3: 'vec3',\n FLOAT_VEC4: 'vec4',\n INT: 'int',\n INT_VEC2: 'ivec2',\n INT_VEC3: 'ivec3',\n INT_VEC4: 'ivec4',\n UNSIGNED_INT: 'uint',\n UNSIGNED_INT_VEC2: 'uvec2',\n UNSIGNED_INT_VEC3: 'uvec3',\n UNSIGNED_INT_VEC4: 'uvec4',\n BOOL: 'bool',\n BOOL_VEC2: 'bvec2',\n BOOL_VEC3: 'bvec3',\n BOOL_VEC4: 'bvec4',\n FLOAT_MAT2: 'mat2',\n FLOAT_MAT3: 'mat3',\n FLOAT_MAT4: 'mat4',\n SAMPLER_2D: 'sampler2D',\n INT_SAMPLER_2D: 'sampler2D',\n UNSIGNED_INT_SAMPLER_2D: 'sampler2D',\n SAMPLER_CUBE: 'samplerCube',\n INT_SAMPLER_CUBE: 'samplerCube',\n UNSIGNED_INT_SAMPLER_CUBE: 'samplerCube',\n SAMPLER_2D_ARRAY: 'sampler2DArray',\n INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n UNSIGNED_INT_SAMPLER_2D_ARRAY: 'sampler2DArray',\n};\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction mapType(gl, type) {\n if (!GL_TABLE) {\n var typeNames = Object.keys(GL_TO_GLSL_TYPES);\n GL_TABLE = {};\n for (var i = 0; i < typeNames.length; ++i) {\n var tn = typeNames[i];\n GL_TABLE[gl[tn]] = GL_TO_GLSL_TYPES[tn];\n }\n }\n return GL_TABLE[type];\n}\n\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n// Parsers, each one of these will take a look at the type of shader property and uniform.\n// if they pass the test function then the code function is called that returns a the shader upload code for that uniform.\n// Shader upload code is automagically generated with these parsers.\n// If no parser is valid then the default upload functions are used.\n// exposing Parsers means that custom upload logic can be added to pixi's shaders.\n// A good example would be a pixi rectangle can be directly set on a uniform.\n// If the shader sees it it knows how to upload the rectangle structure as a vec4\n// format is as follows:\n//\n// {\n// test: (data, uniform) => {} <--- test is this code should be used for this uniform\n// code: (name, uniform) => {} <--- returns the string of the piece of code that uploads the uniform\n// codeUbo: (name, uniform) => {} <--- returns the string of the piece of code that uploads the\n// uniform to a uniform buffer\n// }\nvar uniformParsers = [\n // a float cache layer\n {\n test: function (data) {\n return data.type === 'float' && data.size === 1 && !data.isArray;\n },\n code: function (name) {\n return \"\\n if(uv[\\\"\" + name + \"\\\"] !== ud[\\\"\" + name + \"\\\"].value)\\n {\\n ud[\\\"\" + name + \"\\\"].value = uv[\\\"\" + name + \"\\\"]\\n gl.uniform1f(ud[\\\"\" + name + \"\\\"].location, uv[\\\"\" + name + \"\\\"])\\n }\\n \";\n },\n },\n // handling samplers\n {\n test: function (data, uniform) {\n // eslint-disable-next-line max-len,no-eq-null,eqeqeq\n return (data.type === 'sampler2D' || data.type === 'samplerCube' || data.type === 'sampler2DArray') && data.size === 1 && !data.isArray && (uniform == null || uniform.castToBaseTexture !== undefined);\n },\n code: function (name) { return \"t = syncData.textureCount++;\\n\\n renderer.texture.bind(uv[\\\"\" + name + \"\\\"], t);\\n\\n if(ud[\\\"\" + name + \"\\\"].value !== t)\\n {\\n ud[\\\"\" + name + \"\\\"].value = t;\\n gl.uniform1i(ud[\\\"\" + name + \"\\\"].location, t);\\n; // eslint-disable-line max-len\\n }\"; },\n },\n // uploading pixi matrix object to mat3\n {\n test: function (data, uniform) {\n return data.type === 'mat3' && data.size === 1 && !data.isArray && uniform.a !== undefined;\n },\n code: function (name) {\n // TODO and some smart caching dirty ids here!\n return \"\\n gl.uniformMatrix3fv(ud[\\\"\" + name + \"\\\"].location, false, uv[\\\"\" + name + \"\\\"].toArray(true));\\n \";\n },\n codeUbo: function (name) {\n return \"\\n var \" + name + \"_matrix = uv.\" + name + \".toArray(true);\\n\\n data[offset] = \" + name + \"_matrix[0];\\n data[offset+1] = \" + name + \"_matrix[1];\\n data[offset+2] = \" + name + \"_matrix[2];\\n \\n data[offset + 4] = \" + name + \"_matrix[3];\\n data[offset + 5] = \" + name + \"_matrix[4];\\n data[offset + 6] = \" + name + \"_matrix[5];\\n \\n data[offset + 8] = \" + name + \"_matrix[6];\\n data[offset + 9] = \" + name + \"_matrix[7];\\n data[offset + 10] = \" + name + \"_matrix[8];\\n \";\n },\n },\n // uploading a pixi point as a vec2 with caching layer\n {\n test: function (data, uniform) {\n return data.type === 'vec2' && data.size === 1 && !data.isArray && uniform.x !== undefined;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v.x || cv[1] !== v.y)\\n {\\n cv[0] = v.x;\\n cv[1] = v.y;\\n gl.uniform2f(ud[\\\"\" + name + \"\\\"].location, v.x, v.y);\\n }\";\n },\n codeUbo: function (name) {\n return \"\\n v = uv.\" + name + \";\\n\\n data[offset] = v.x;\\n data[offset+1] = v.y;\\n \";\n }\n },\n // caching layer for a vec2\n {\n test: function (data) {\n return data.type === 'vec2' && data.size === 1 && !data.isArray;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n gl.uniform2f(ud[\\\"\" + name + \"\\\"].location, v[0], v[1]);\\n }\\n \";\n },\n },\n // upload a pixi rectangle as a vec4 with caching layer\n {\n test: function (data, uniform) {\n return data.type === 'vec4' && data.size === 1 && !data.isArray && uniform.width !== undefined;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\\n {\\n cv[0] = v.x;\\n cv[1] = v.y;\\n cv[2] = v.width;\\n cv[3] = v.height;\\n gl.uniform4f(ud[\\\"\" + name + \"\\\"].location, v.x, v.y, v.width, v.height)\\n }\";\n },\n codeUbo: function (name) {\n return \"\\n v = uv.\" + name + \";\\n\\n data[offset] = v.x;\\n data[offset+1] = v.y;\\n data[offset+2] = v.width;\\n data[offset+3] = v.height;\\n \";\n }\n },\n // a caching layer for vec4 uploading\n {\n test: function (data) {\n return data.type === 'vec4' && data.size === 1 && !data.isArray;\n },\n code: function (name) {\n return \"\\n cv = ud[\\\"\" + name + \"\\\"].value;\\n v = uv[\\\"\" + name + \"\\\"];\\n\\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4f(ud[\\\"\" + name + \"\\\"].location, v[0], v[1], v[2], v[3])\\n }\";\n },\n } ];\n\n// cu = Cached value's uniform data field\n// cv = Cached value\n// v = value to upload\n// ud = uniformData\n// uv = uniformValue\n// l = location\nvar GLSL_TO_SINGLE_SETTERS_CACHED = {\n float: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n gl.uniform1f(location, v);\\n }\",\n vec2: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2f(location, v[0], v[1])\\n }\",\n vec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3f(location, v[0], v[1], v[2])\\n }\",\n vec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\\n }\",\n int: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n ivec2: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2i(location, v[0], v[1]);\\n }\",\n ivec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3i(location, v[0], v[1], v[2]);\\n }\",\n ivec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\\n }\",\n uint: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1ui(location, v);\\n }\",\n uvec2: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2ui(location, v[0], v[1]);\\n }\",\n uvec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3ui(location, v[0], v[1], v[2]);\\n }\",\n uvec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\\n }\",\n bool: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n gl.uniform1i(location, v);\\n }\",\n bvec2: \"\\n if (cv[0] != v[0] || cv[1] != v[1])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n\\n gl.uniform2i(location, v[0], v[1]);\\n }\",\n bvec3: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n\\n gl.uniform3i(location, v[0], v[1], v[2]);\\n }\",\n bvec4: \"\\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\\n {\\n cv[0] = v[0];\\n cv[1] = v[1];\\n cv[2] = v[2];\\n cv[3] = v[3];\\n\\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\\n }\",\n mat2: 'gl.uniformMatrix2fv(location, false, v)',\n mat3: 'gl.uniformMatrix3fv(location, false, v)',\n mat4: 'gl.uniformMatrix4fv(location, false, v)',\n sampler2D: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n samplerCube: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n sampler2DArray: \"\\n if (cv !== v)\\n {\\n cu.value = v;\\n\\n gl.uniform1i(location, v);\\n }\",\n};\nvar GLSL_TO_ARRAY_SETTERS = {\n float: \"gl.uniform1fv(location, v)\",\n vec2: \"gl.uniform2fv(location, v)\",\n vec3: \"gl.uniform3fv(location, v)\",\n vec4: 'gl.uniform4fv(location, v)',\n mat4: 'gl.uniformMatrix4fv(location, false, v)',\n mat3: 'gl.uniformMatrix3fv(location, false, v)',\n mat2: 'gl.uniformMatrix2fv(location, false, v)',\n int: 'gl.uniform1iv(location, v)',\n ivec2: 'gl.uniform2iv(location, v)',\n ivec3: 'gl.uniform3iv(location, v)',\n ivec4: 'gl.uniform4iv(location, v)',\n uint: 'gl.uniform1uiv(location, v)',\n uvec2: 'gl.uniform2uiv(location, v)',\n uvec3: 'gl.uniform3uiv(location, v)',\n uvec4: 'gl.uniform4uiv(location, v)',\n bool: 'gl.uniform1iv(location, v)',\n bvec2: 'gl.uniform2iv(location, v)',\n bvec3: 'gl.uniform3iv(location, v)',\n bvec4: 'gl.uniform4iv(location, v)',\n sampler2D: 'gl.uniform1iv(location, v)',\n samplerCube: 'gl.uniform1iv(location, v)',\n sampler2DArray: 'gl.uniform1iv(location, v)',\n};\nfunction generateUniformsSync(group, uniformData) {\n var _a;\n var funcFragments = [\"\\n var v = null;\\n var cv = null;\\n var cu = null;\\n var t = 0;\\n var gl = renderer.gl;\\n \"];\n for (var i in group.uniforms) {\n var data = uniformData[i];\n if (!data) {\n if ((_a = group.uniforms[i]) === null || _a === void 0 ? void 0 : _a.group) {\n if (group.uniforms[i].ubo) {\n funcFragments.push(\"\\n renderer.shader.syncUniformBufferGroup(uv.\" + i + \", '\" + i + \"');\\n \");\n }\n else {\n funcFragments.push(\"\\n renderer.shader.syncUniformGroup(uv.\" + i + \", syncData);\\n \");\n }\n }\n continue;\n }\n var uniform = group.uniforms[i];\n var parsed = false;\n for (var j = 0; j < uniformParsers.length; j++) {\n if (uniformParsers[j].test(data, uniform)) {\n funcFragments.push(uniformParsers[j].code(i, uniform));\n parsed = true;\n break;\n }\n }\n if (!parsed) {\n var templateType = data.size === 1 && !data.isArray ? GLSL_TO_SINGLE_SETTERS_CACHED : GLSL_TO_ARRAY_SETTERS;\n var template = templateType[data.type].replace('location', \"ud[\\\"\" + i + \"\\\"].location\");\n funcFragments.push(\"\\n cu = ud[\\\"\" + i + \"\\\"];\\n cv = cu.value;\\n v = uv[\\\"\" + i + \"\\\"];\\n \" + template + \";\");\n }\n }\n /*\n * the introduction of syncData is to solve an issue where textures in uniform groups are not set correctly\n * the texture count was always starting from 0 in each group. This needs to increment each time a texture is used\n * no matter which group is being used\n *\n */\n // eslint-disable-next-line no-new-func\n return new Function('ud', 'uv', 'renderer', 'syncData', funcFragments.join('\\n'));\n}\n\nvar fragTemplate = [\n 'precision mediump float;',\n 'void main(void){',\n 'float test = 0.1;',\n '%forloop%',\n 'gl_FragColor = vec4(0.0);',\n '}' ].join('\\n');\nfunction generateIfTestSrc(maxIfs) {\n var src = '';\n for (var i = 0; i < maxIfs; ++i) {\n if (i > 0) {\n src += '\\nelse ';\n }\n if (i < maxIfs - 1) {\n src += \"if(test == \" + i + \".0){}\";\n }\n }\n return src;\n}\nfunction checkMaxIfStatementsInShader(maxIfs, gl) {\n if (maxIfs === 0) {\n throw new Error('Invalid value of `0` passed to `checkMaxIfStatementsInShader`');\n }\n var shader = gl.createShader(gl.FRAGMENT_SHADER);\n while (true) // eslint-disable-line no-constant-condition\n {\n var fragmentSrc = fragTemplate.replace(/%forloop%/gi, generateIfTestSrc(maxIfs));\n gl.shaderSource(shader, fragmentSrc);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n maxIfs = (maxIfs / 2) | 0;\n }\n else {\n // valid!\n break;\n }\n }\n return maxIfs;\n}\n\n// Cache the result to prevent running this over and over\nvar unsafeEval;\n/**\n * Not all platforms allow to generate function code (e.g., `new Function`).\n * this provides the platform-level detection.\n * @private\n * @returns {boolean} `true` if `new Function` is supported.\n */\nfunction unsafeEvalSupported() {\n if (typeof unsafeEval === 'boolean') {\n return unsafeEval;\n }\n try {\n /* eslint-disable no-new-func */\n var func = new Function('param1', 'param2', 'param3', 'return param1[param2] === param3;');\n /* eslint-enable no-new-func */\n unsafeEval = func({ a: 'b' }, 'a', 'b') === true;\n }\n catch (e) {\n unsafeEval = false;\n }\n return unsafeEval;\n}\n\nvar defaultFragment$2 = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void){\\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\\n}\";\n\nvar defaultVertex$3 = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void){\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\\n\";\n\nvar UID$1 = 0;\nvar nameCache = {};\n/**\n * Helper class to create a shader program.\n * @memberof PIXI\n */\nvar Program = /** @class */ (function () {\n /**\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param name - Name for shader\n */\n function Program(vertexSrc, fragmentSrc, name) {\n if (name === void 0) { name = 'pixi-shader'; }\n this.id = UID$1++;\n this.vertexSrc = vertexSrc || Program.defaultVertexSrc;\n this.fragmentSrc = fragmentSrc || Program.defaultFragmentSrc;\n this.vertexSrc = this.vertexSrc.trim();\n this.fragmentSrc = this.fragmentSrc.trim();\n if (this.vertexSrc.substring(0, 8) !== '#version') {\n name = name.replace(/\\s+/g, '-');\n if (nameCache[name]) {\n nameCache[name]++;\n name += \"-\" + nameCache[name];\n }\n else {\n nameCache[name] = 1;\n }\n this.vertexSrc = \"#define SHADER_NAME \" + name + \"\\n\" + this.vertexSrc;\n this.fragmentSrc = \"#define SHADER_NAME \" + name + \"\\n\" + this.fragmentSrc;\n this.vertexSrc = setPrecision(this.vertexSrc, settings.PRECISION_VERTEX, PRECISION.HIGH);\n this.fragmentSrc = setPrecision(this.fragmentSrc, settings.PRECISION_FRAGMENT, getMaxFragmentPrecision());\n }\n // currently this does not extract structs only default types\n // this is where we store shader references..\n this.glPrograms = {};\n this.syncUniforms = null;\n }\n Object.defineProperty(Program, \"defaultVertexSrc\", {\n /**\n * The default vertex shader source.\n * @constant\n */\n get: function () {\n return defaultVertex$3;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Program, \"defaultFragmentSrc\", {\n /**\n * The default fragment shader source.\n * @constant\n */\n get: function () {\n return defaultFragment$2;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A short hand function to create a program based of a vertex and fragment shader.\n *\n * This method will also check to see if there is a cached program.\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param name - Name for shader\n * @returns A shiny new PixiJS shader program!\n */\n Program.from = function (vertexSrc, fragmentSrc, name) {\n var key = vertexSrc + fragmentSrc;\n var program = ProgramCache[key];\n if (!program) {\n ProgramCache[key] = program = new Program(vertexSrc, fragmentSrc, name);\n }\n return program;\n };\n return Program;\n}());\n\n/**\n * A helper class for shaders.\n * @memberof PIXI\n */\nvar Shader = /** @class */ (function () {\n /**\n * @param program - The program the shader will use.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n */\n function Shader(program, uniforms) {\n /**\n * Used internally to bind uniform buffer objects.\n * @ignore\n */\n this.uniformBindCount = 0;\n this.program = program;\n // lets see whats been passed in\n // uniforms should be converted to a uniform group\n if (uniforms) {\n if (uniforms instanceof UniformGroup) {\n this.uniformGroup = uniforms;\n }\n else {\n this.uniformGroup = new UniformGroup(uniforms);\n }\n }\n else {\n this.uniformGroup = new UniformGroup({});\n }\n this.disposeRunner = new Runner('disposeShader');\n }\n // TODO move to shader system..\n Shader.prototype.checkUniformExists = function (name, group) {\n if (group.uniforms[name]) {\n return true;\n }\n for (var i in group.uniforms) {\n var uniform = group.uniforms[i];\n if (uniform.group) {\n if (this.checkUniformExists(name, uniform)) {\n return true;\n }\n }\n }\n return false;\n };\n Shader.prototype.destroy = function () {\n // usage count on programs?\n // remove if not used!\n this.uniformGroup = null;\n this.disposeRunner.emit(this);\n this.disposeRunner.destroy();\n };\n Object.defineProperty(Shader.prototype, \"uniforms\", {\n /**\n * Shader uniform values, shortcut for `uniformGroup.uniforms`.\n * @readonly\n */\n get: function () {\n return this.uniformGroup.uniforms;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * A short hand function to create a shader based of a vertex and fragment shader.\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n * @returns A shiny new PixiJS shader!\n */\n Shader.from = function (vertexSrc, fragmentSrc, uniforms) {\n var program = Program.from(vertexSrc, fragmentSrc);\n return new Shader(program, uniforms);\n };\n return Shader;\n}());\n\n/* eslint-disable max-len */\nvar BLEND$1 = 0;\nvar OFFSET$1 = 1;\nvar CULLING$1 = 2;\nvar DEPTH_TEST$1 = 3;\nvar WINDING$1 = 4;\nvar DEPTH_MASK$1 = 5;\n/**\n * This is a WebGL state, and is is passed to {@link PIXI.StateSystem}.\n *\n * Each mesh rendered may require WebGL to be in a different state.\n * For example you may want different blend mode or to enable polygon offsets\n * @memberof PIXI\n */\nvar State = /** @class */ (function () {\n function State() {\n this.data = 0;\n this.blendMode = BLEND_MODES.NORMAL;\n this.polygonOffset = 0;\n this.blend = true;\n this.depthMask = true;\n // this.depthTest = true;\n }\n Object.defineProperty(State.prototype, \"blend\", {\n /**\n * Activates blending of the computed fragment color values.\n * @default true\n */\n get: function () {\n return !!(this.data & (1 << BLEND$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << BLEND$1)) !== value) {\n this.data ^= (1 << BLEND$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"offsets\", {\n /**\n * Activates adding an offset to depth values of polygon's fragments\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << OFFSET$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << OFFSET$1)) !== value) {\n this.data ^= (1 << OFFSET$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"culling\", {\n /**\n * Activates culling of polygons.\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << CULLING$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << CULLING$1)) !== value) {\n this.data ^= (1 << CULLING$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"depthTest\", {\n /**\n * Activates depth comparisons and updates to the depth buffer.\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << DEPTH_TEST$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << DEPTH_TEST$1)) !== value) {\n this.data ^= (1 << DEPTH_TEST$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"depthMask\", {\n /**\n * Enables or disables writing to the depth buffer.\n * @default true\n */\n get: function () {\n return !!(this.data & (1 << DEPTH_MASK$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << DEPTH_MASK$1)) !== value) {\n this.data ^= (1 << DEPTH_MASK$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"clockwiseFrontFace\", {\n /**\n * Specifies whether or not front or back-facing polygons can be culled.\n * @default false\n */\n get: function () {\n return !!(this.data & (1 << WINDING$1));\n },\n set: function (value) {\n if (!!(this.data & (1 << WINDING$1)) !== value) {\n this.data ^= (1 << WINDING$1);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"blendMode\", {\n /**\n * The blend mode to be applied when this state is set. Apply a value of `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n * Setting this mode to anything other than NO_BLEND will automatically switch blending on.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this._blendMode;\n },\n set: function (value) {\n this.blend = (value !== BLEND_MODES.NONE);\n this._blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(State.prototype, \"polygonOffset\", {\n /**\n * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.\n * @default 0\n */\n get: function () {\n return this._polygonOffset;\n },\n set: function (value) {\n this.offsets = !!value;\n this._polygonOffset = value;\n },\n enumerable: false,\n configurable: true\n });\n State.prototype.toString = function () {\n return \"[@pixi/core:State \"\n + (\"blendMode=\" + this.blendMode + \" \")\n + (\"clockwiseFrontFace=\" + this.clockwiseFrontFace + \" \")\n + (\"culling=\" + this.culling + \" \")\n + (\"depthMask=\" + this.depthMask + \" \")\n + (\"polygonOffset=\" + this.polygonOffset)\n + \"]\";\n };\n State.for2d = function () {\n var state = new State();\n state.depthTest = false;\n state.blend = true;\n return state;\n };\n return State;\n}());\n\nvar defaultFragment$1 = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void){\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n}\\n\";\n\nvar defaultVertex$2 = \"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n gl_Position = filterVertexPosition();\\n vTextureCoord = filterTextureCoord();\\n}\\n\";\n\n/**\n * A filter is a special shader that applies post-processing effects to an input texture and writes into an output\n * render-target.\n *\n * {@link http://pixijs.io/examples/#/filters/blur-filter.js Example} of the\n * {@link PIXI.filters.BlurFilter BlurFilter}.\n *\n * ### Usage\n * Filters can be applied to any DisplayObject or Container.\n * PixiJS' `FilterSystem` renders the container into temporary Framebuffer,\n * then filter renders it to the screen.\n * Multiple filters can be added to the `filters` array property and stacked on each other.\n *\n * ```\n * const filter = new PIXI.Filter(myShaderVert, myShaderFrag, { myUniform: 0.5 });\n * const container = new PIXI.Container();\n * container.filters = [filter];\n * ```\n *\n * ### Previous Version Differences\n *\n * In PixiJS **v3**, a filter was always applied to _whole screen_.\n *\n * In PixiJS **v4**, a filter can be applied _only part of the screen_.\n * Developers had to create a set of uniforms to deal with coordinates.\n *\n * In PixiJS **v5** combines _both approaches_.\n * Developers can use normal coordinates of v3 and then allow filter to use partial Framebuffers,\n * bringing those extra uniforms into account.\n *\n * Also be aware that we have changed default vertex shader, please consult\n * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.\n *\n * ### Frames\n *\n * The following table summarizes the coordinate spaces used in the filtering pipeline:\n *\n * <table>\n * <thead>\n * <tr>\n * <th>Coordinate Space</th>\n * <th>Description</th>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>Texture Coordinates</td>\n * <td>\n * The texture (or UV) coordinates in the input base-texture's space. These are normalized into the (0,1) range along\n * both axes.\n * </td>\n * </tr>\n * <tr>\n * <td>World Space</td>\n * <td>\n * A point in the same space as the world bounds of any display-object (i.e. in the scene graph's space).\n * </td>\n * </tr>\n * <tr>\n * <td>Physical Pixels</td>\n * <td>\n * This is base-texture's space with the origin on the top-left. You can calculate these by multiplying the texture\n * coordinates by the dimensions of the texture.\n * </td>\n * </tr>\n * </tbody>\n * </table>\n *\n * ### Built-in Uniforms\n *\n * PixiJS viewport uses screen (CSS) coordinates, `(0, 0, renderer.screen.width, renderer.screen.height)`,\n * and `projectionMatrix` uniform maps it to the gl viewport.\n *\n * **uSampler**\n *\n * The most important uniform is the input texture that container was rendered into.\n * _Important note: as with all Framebuffers in PixiJS, both input and output are\n * premultiplied by alpha._\n *\n * By default, input normalized coordinates are passed to fragment shader with `vTextureCoord`.\n * Use it to sample the input.\n *\n * ```\n * const fragment = `\n * varying vec2 vTextureCoord;\n * uniform sampler2D uSampler;\n * void main(void)\n * {\n * gl_FragColor = texture2D(uSampler, vTextureCoord);\n * }\n * `;\n *\n * const myFilter = new PIXI.Filter(null, fragment);\n * ```\n *\n * This filter is just one uniform less than {@link PIXI.filters.AlphaFilter AlphaFilter}.\n *\n * **outputFrame**\n *\n * The `outputFrame` holds the rectangle where filter is applied in screen (CSS) coordinates.\n * It's the same as `renderer.screen` for a fullscreen filter.\n * Only a part of `outputFrame.zw` size of temporary Framebuffer is used,\n * `(0, 0, outputFrame.width, outputFrame.height)`,\n *\n * Filters uses this quad to normalized (0-1) space, its passed into `aVertexPosition` attribute.\n * To calculate vertex position in screen space using normalized (0-1) space:\n *\n * ```\n * vec4 filterVertexPosition( void )\n * {\n * vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n * return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n * }\n * ```\n *\n * **inputSize**\n *\n * Temporary framebuffer is different, it can be either the size of screen, either power-of-two.\n * The `inputSize.xy` are size of temporary framebuffer that holds input.\n * The `inputSize.zw` is inverted, it's a shortcut to evade division inside the shader.\n *\n * Set `inputSize.xy = outputFrame.zw` for a fullscreen filter.\n *\n * To calculate input normalized coordinate, you have to map it to filter normalized space.\n * Multiply by `outputFrame.zw` to get input coordinate.\n * Divide by `inputSize.xy` to get input normalized coordinate.\n *\n * ```\n * vec2 filterTextureCoord( void )\n * {\n * return aVertexPosition * (outputFrame.zw * inputSize.zw); // same as /inputSize.xy\n * }\n * ```\n * **resolution**\n *\n * The `resolution` is the ratio of screen (CSS) pixels to real pixels.\n *\n * **inputPixel**\n *\n * `inputPixel.xy` is the size of framebuffer in real pixels, same as `inputSize.xy * resolution`\n * `inputPixel.zw` is inverted `inputPixel.xy`.\n *\n * It's handy for filters that use neighbour pixels, like {@link PIXI.filters.FXAAFilter FXAAFilter}.\n *\n * **inputClamp**\n *\n * If you try to get info from outside of used part of Framebuffer - you'll get undefined behaviour.\n * For displacements, coordinates has to be clamped.\n *\n * The `inputClamp.xy` is left-top pixel center, you may ignore it, because we use left-top part of Framebuffer\n * `inputClamp.zw` is bottom-right pixel center.\n *\n * ```\n * vec4 color = texture2D(uSampler, clamp(modifiedTextureCoord, inputClamp.xy, inputClamp.zw))\n * ```\n * OR\n * ```\n * vec4 color = texture2D(uSampler, min(modifigedTextureCoord, inputClamp.zw))\n * ```\n *\n * ### Additional Information\n *\n * Complete documentation on Filter usage is located in the\n * {@link https://github.com/pixijs/pixi.js/wiki/v5-Creating-filters Wiki}.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters can be downloaded\n * {@link https://github.com/pixijs/pixi-filters here} from the PixiJS Filters repository.\n * @memberof PIXI\n */\nvar Filter = /** @class */ (function (_super) {\n __extends(Filter, _super);\n /**\n * @param vertexSrc - The source of the vertex shader.\n * @param fragmentSrc - The source of the fragment shader.\n * @param uniforms - Custom uniforms to use to augment the built-in ones.\n */\n function Filter(vertexSrc, fragmentSrc, uniforms) {\n var _this = this;\n var program = Program.from(vertexSrc || Filter.defaultVertexSrc, fragmentSrc || Filter.defaultFragmentSrc);\n _this = _super.call(this, program, uniforms) || this;\n _this.padding = 0;\n _this.resolution = settings.FILTER_RESOLUTION;\n _this.multisample = settings.FILTER_MULTISAMPLE;\n _this.enabled = true;\n _this.autoFit = true;\n _this.state = new State();\n return _this;\n }\n /**\n * Applies the filter\n * @param {PIXI.FilterSystem} filterManager - The renderer to retrieve the filter from\n * @param {PIXI.RenderTexture} input - The input render target.\n * @param {PIXI.RenderTexture} output - The target to output to.\n * @param {PIXI.CLEAR_MODES} [clearMode] - Should the output be cleared before rendering to it.\n * @param {object} [_currentState] - It's current state of filter.\n * There are some useful properties in the currentState :\n * target, filters, sourceFrame, destinationFrame, renderTarget, resolution\n */\n Filter.prototype.apply = function (filterManager, input, output, clearMode, _currentState) {\n // do as you please!\n filterManager.applyFilter(this, input, output, clearMode);\n // or just do a regular render..\n };\n Object.defineProperty(Filter.prototype, \"blendMode\", {\n /**\n * Sets the blend mode of the filter.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this.state.blendMode;\n },\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Filter.prototype, \"resolution\", {\n /**\n * The resolution of the filter. Setting this to be lower will lower the quality but\n * increase the performance of the filter.\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._resolution = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Filter, \"defaultVertexSrc\", {\n /**\n * The default vertex shader source\n * @constant\n */\n get: function () {\n return defaultVertex$2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Filter, \"defaultFragmentSrc\", {\n /**\n * The default fragment shader source\n * @constant\n */\n get: function () {\n return defaultFragment$1;\n },\n enumerable: false,\n configurable: true\n });\n return Filter;\n}(Shader));\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 otherMatrix;\\n\\nvarying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\\n}\\n\";\n\nvar fragment = \"varying vec2 vMaskCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform sampler2D mask;\\nuniform float alpha;\\nuniform float npmAlpha;\\nuniform vec4 maskClamp;\\n\\nvoid main(void)\\n{\\n float clip = step(3.5,\\n step(maskClamp.x, vMaskCoord.x) +\\n step(maskClamp.y, vMaskCoord.y) +\\n step(vMaskCoord.x, maskClamp.z) +\\n step(vMaskCoord.y, maskClamp.w));\\n\\n vec4 original = texture2D(uSampler, vTextureCoord);\\n vec4 masky = texture2D(mask, vMaskCoord);\\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\\n\\n original *= (alphaMul * masky.r * alpha * clip);\\n\\n gl_FragColor = original;\\n}\\n\";\n\nvar tempMat = new Matrix();\n/**\n * Class controls uv mapping from Texture normal space to BaseTexture normal space.\n *\n * Takes `trim` and `rotate` into account. May contain clamp settings for Meshes and TilingSprite.\n *\n * Can be used in Texture `uvMatrix` field, or separately, you can use different clamp settings on the same texture.\n * If you want to add support for texture region of certain feature or filter, that's what you're looking for.\n *\n * Takes track of Texture changes through `_lastTextureID` private field.\n * Use `update()` method call to track it from outside.\n * @see PIXI.Texture\n * @see PIXI.Mesh\n * @see PIXI.TilingSprite\n * @memberof PIXI\n */\nvar TextureMatrix = /** @class */ (function () {\n /**\n * @param texture - observed texture\n * @param clampMargin - Changes frame clamping, 0.5 by default. Use -0.5 for extra border.\n */\n function TextureMatrix(texture, clampMargin) {\n this._texture = texture;\n this.mapCoord = new Matrix();\n this.uClampFrame = new Float32Array(4);\n this.uClampOffset = new Float32Array(2);\n this._textureID = -1;\n this._updateID = 0;\n this.clampOffset = 0;\n this.clampMargin = (typeof clampMargin === 'undefined') ? 0.5 : clampMargin;\n this.isSimple = false;\n }\n Object.defineProperty(TextureMatrix.prototype, \"texture\", {\n /** Texture property. */\n get: function () {\n return this._texture;\n },\n set: function (value) {\n this._texture = value;\n this._textureID = -1;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Multiplies uvs array to transform\n * @param uvs - mesh uvs\n * @param [out=uvs] - output\n * @returns - output\n */\n TextureMatrix.prototype.multiplyUvs = function (uvs, out) {\n if (out === undefined) {\n out = uvs;\n }\n var mat = this.mapCoord;\n for (var i = 0; i < uvs.length; i += 2) {\n var x = uvs[i];\n var y = uvs[i + 1];\n out[i] = (x * mat.a) + (y * mat.c) + mat.tx;\n out[i + 1] = (x * mat.b) + (y * mat.d) + mat.ty;\n }\n return out;\n };\n /**\n * Updates matrices if texture was changed.\n * @param [forceUpdate=false] - if true, matrices will be updated any case\n * @returns - Whether or not it was updated\n */\n TextureMatrix.prototype.update = function (forceUpdate) {\n var tex = this._texture;\n if (!tex || !tex.valid) {\n return false;\n }\n if (!forceUpdate\n && this._textureID === tex._updateID) {\n return false;\n }\n this._textureID = tex._updateID;\n this._updateID++;\n var uvs = tex._uvs;\n this.mapCoord.set(uvs.x1 - uvs.x0, uvs.y1 - uvs.y0, uvs.x3 - uvs.x0, uvs.y3 - uvs.y0, uvs.x0, uvs.y0);\n var orig = tex.orig;\n var trim = tex.trim;\n if (trim) {\n tempMat.set(orig.width / trim.width, 0, 0, orig.height / trim.height, -trim.x / trim.width, -trim.y / trim.height);\n this.mapCoord.append(tempMat);\n }\n var texBase = tex.baseTexture;\n var frame = this.uClampFrame;\n var margin = this.clampMargin / texBase.resolution;\n var offset = this.clampOffset;\n frame[0] = (tex._frame.x + margin + offset) / texBase.width;\n frame[1] = (tex._frame.y + margin + offset) / texBase.height;\n frame[2] = (tex._frame.x + tex._frame.width - margin + offset) / texBase.width;\n frame[3] = (tex._frame.y + tex._frame.height - margin + offset) / texBase.height;\n this.uClampOffset[0] = offset / texBase.realWidth;\n this.uClampOffset[1] = offset / texBase.realHeight;\n this.isSimple = tex._frame.width === texBase.width\n && tex._frame.height === texBase.height\n && tex.rotate === 0;\n return true;\n };\n return TextureMatrix;\n}());\n\n/**\n * This handles a Sprite acting as a mask, as opposed to a Graphic.\n *\n * WebGL only.\n * @memberof PIXI\n */\nvar SpriteMaskFilter = /** @class */ (function (_super) {\n __extends(SpriteMaskFilter, _super);\n /** @ignore */\n function SpriteMaskFilter(vertexSrc, fragmentSrc, uniforms) {\n var _this = this;\n var sprite = null;\n if (typeof vertexSrc !== 'string' && fragmentSrc === undefined && uniforms === undefined) {\n sprite = vertexSrc;\n vertexSrc = undefined;\n fragmentSrc = undefined;\n uniforms = undefined;\n }\n _this = _super.call(this, vertexSrc || vertex, fragmentSrc || fragment, uniforms) || this;\n _this.maskSprite = sprite;\n _this.maskMatrix = new Matrix();\n return _this;\n }\n Object.defineProperty(SpriteMaskFilter.prototype, \"maskSprite\", {\n /**\n * Sprite mask\n * @type {PIXI.DisplayObject}\n */\n get: function () {\n return this._maskSprite;\n },\n set: function (value) {\n this._maskSprite = value;\n if (this._maskSprite) {\n this._maskSprite.renderable = false;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Applies the filter\n * @param filterManager - The renderer to retrieve the filter from\n * @param input - The input render target.\n * @param output - The target to output to.\n * @param clearMode - Should the output be cleared before rendering to it.\n */\n SpriteMaskFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var maskSprite = this._maskSprite;\n var tex = maskSprite._texture;\n if (!tex.valid) {\n return;\n }\n if (!tex.uvMatrix) {\n // margin = 0.0, let it bleed a bit, shader code becomes easier\n // assuming that atlas textures were made with 1-pixel padding\n tex.uvMatrix = new TextureMatrix(tex, 0.0);\n }\n tex.uvMatrix.update();\n this.uniforms.npmAlpha = tex.baseTexture.alphaMode ? 0.0 : 1.0;\n this.uniforms.mask = tex;\n // get _normalized sprite texture coords_ and convert them to _normalized atlas texture coords_ with `prepend`\n this.uniforms.otherMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, maskSprite)\n .prepend(tex.uvMatrix.mapCoord);\n this.uniforms.alpha = maskSprite.worldAlpha;\n this.uniforms.maskClamp = tex.uvMatrix.uClampFrame;\n filterManager.applyFilter(this, input, output, clearMode);\n };\n return SpriteMaskFilter;\n}(Filter));\n\n/**\n * System plugin to the renderer to manage masks.\n *\n * There are three built-in types of masking:\n * **Scissor Masking**: Scissor masking discards pixels that are outside of a rectangle called the scissor box. It is\n * the most performant as the scissor test is inexpensive. However, it can only be used when the mask is rectangular.\n * **Stencil Masking**: Stencil masking discards pixels that don't overlap with the pixels rendered into the stencil\n * buffer. It is the next fastest option as it does not require rendering into a separate framebuffer. However, it does\n * cause the mask to be rendered **twice** for each masking operation; hence, minimize the rendering cost of your masks.\n * **Sprite Mask Filtering**: Sprite mask filtering discards pixels based on the red channel of the sprite-mask's\n * texture. (Generally, the masking texture is grayscale). Using advanced techniques, you might be able to embed this\n * type of masking in a custom shader - and hence, bypassing the masking system fully for performance wins.\n *\n * The best type of masking is auto-detected when you `push` one. To use scissor masking, you must pass in a `Graphics`\n * object with just a rectangle drawn.\n *\n * ## Mask Stacks\n *\n * In the scene graph, masks can be applied recursively, i.e. a mask can be applied during a masking operation. The mask\n * stack stores the currently applied masks in order. Each {@link PIXI.BaseRenderTexture} holds its own mask stack, i.e.\n * when you switch render-textures, the old masks only applied when you switch back to rendering to the old render-target.\n * @memberof PIXI\n */\nvar MaskSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function MaskSystem(renderer) {\n this.renderer = renderer;\n this.enableScissor = true;\n this.alphaMaskPool = [];\n this.maskDataPool = [];\n this.maskStack = [];\n this.alphaMaskIndex = 0;\n }\n /**\n * Changes the mask stack that is used by this System.\n * @param maskStack - The mask stack\n */\n MaskSystem.prototype.setMaskStack = function (maskStack) {\n this.maskStack = maskStack;\n this.renderer.scissor.setMaskStack(maskStack);\n this.renderer.stencil.setMaskStack(maskStack);\n };\n /**\n * Enables the mask and appends it to the current mask stack.\n *\n * NOTE: The batch renderer should be flushed beforehand to prevent pending renders from being masked.\n * @param {PIXI.DisplayObject} target - Display Object to push the mask to\n * @param {PIXI.MaskData|PIXI.Sprite|PIXI.Graphics|PIXI.DisplayObject} maskDataOrTarget - The masking data.\n */\n MaskSystem.prototype.push = function (target, maskDataOrTarget) {\n var maskData = maskDataOrTarget;\n if (!maskData.isMaskData) {\n var d = this.maskDataPool.pop() || new MaskData();\n d.pooled = true;\n d.maskObject = maskDataOrTarget;\n maskData = d;\n }\n var maskAbove = this.maskStack.length !== 0 ? this.maskStack[this.maskStack.length - 1] : null;\n maskData.copyCountersOrReset(maskAbove);\n maskData._colorMask = maskAbove ? maskAbove._colorMask : 0xf;\n if (maskData.autoDetect) {\n this.detect(maskData);\n }\n maskData._target = target;\n if (maskData.type !== MASK_TYPES.SPRITE) {\n this.maskStack.push(maskData);\n }\n if (maskData.enabled) {\n switch (maskData.type) {\n case MASK_TYPES.SCISSOR:\n this.renderer.scissor.push(maskData);\n break;\n case MASK_TYPES.STENCIL:\n this.renderer.stencil.push(maskData);\n break;\n case MASK_TYPES.SPRITE:\n maskData.copyCountersOrReset(null);\n this.pushSpriteMask(maskData);\n break;\n case MASK_TYPES.COLOR:\n this.pushColorMask(maskData);\n break;\n }\n }\n if (maskData.type === MASK_TYPES.SPRITE) {\n this.maskStack.push(maskData);\n }\n };\n /**\n * Removes the last mask from the mask stack and doesn't return it.\n *\n * NOTE: The batch renderer should be flushed beforehand to render the masked contents before the mask is removed.\n * @param {PIXI.IMaskTarget} target - Display Object to pop the mask from\n */\n MaskSystem.prototype.pop = function (target) {\n var maskData = this.maskStack.pop();\n if (!maskData || maskData._target !== target) {\n // TODO: add an assert when we have it\n return;\n }\n if (maskData.enabled) {\n switch (maskData.type) {\n case MASK_TYPES.SCISSOR:\n this.renderer.scissor.pop(maskData);\n break;\n case MASK_TYPES.STENCIL:\n this.renderer.stencil.pop(maskData.maskObject);\n break;\n case MASK_TYPES.SPRITE:\n this.popSpriteMask(maskData);\n break;\n case MASK_TYPES.COLOR:\n this.popColorMask(maskData);\n break;\n }\n }\n maskData.reset();\n if (maskData.pooled) {\n this.maskDataPool.push(maskData);\n }\n if (this.maskStack.length !== 0) {\n var maskCurrent = this.maskStack[this.maskStack.length - 1];\n if (maskCurrent.type === MASK_TYPES.SPRITE && maskCurrent._filters) {\n maskCurrent._filters[0].maskSprite = maskCurrent.maskObject;\n }\n }\n };\n /**\n * Sets type of MaskData based on its maskObject.\n * @param maskData\n */\n MaskSystem.prototype.detect = function (maskData) {\n var maskObject = maskData.maskObject;\n if (!maskObject) {\n maskData.type = MASK_TYPES.COLOR;\n }\n else if (maskObject.isSprite) {\n maskData.type = MASK_TYPES.SPRITE;\n }\n else if (this.enableScissor && this.renderer.scissor.testScissor(maskData)) {\n maskData.type = MASK_TYPES.SCISSOR;\n }\n else {\n maskData.type = MASK_TYPES.STENCIL;\n }\n };\n /**\n * Applies the Mask and adds it to the current filter stack.\n * @param maskData - Sprite to be used as the mask.\n */\n MaskSystem.prototype.pushSpriteMask = function (maskData) {\n var _a, _b;\n var maskObject = maskData.maskObject;\n var target = maskData._target;\n var alphaMaskFilter = maskData._filters;\n if (!alphaMaskFilter) {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex];\n if (!alphaMaskFilter) {\n alphaMaskFilter = this.alphaMaskPool[this.alphaMaskIndex] = [new SpriteMaskFilter()];\n }\n }\n var renderer = this.renderer;\n var renderTextureSystem = renderer.renderTexture;\n var resolution;\n var multisample;\n if (renderTextureSystem.current) {\n var renderTexture = renderTextureSystem.current;\n resolution = maskData.resolution || renderTexture.resolution;\n multisample = (_a = maskData.multisample) !== null && _a !== void 0 ? _a : renderTexture.multisample;\n }\n else {\n resolution = maskData.resolution || renderer.resolution;\n multisample = (_b = maskData.multisample) !== null && _b !== void 0 ? _b : renderer.multisample;\n }\n alphaMaskFilter[0].resolution = resolution;\n alphaMaskFilter[0].multisample = multisample;\n alphaMaskFilter[0].maskSprite = maskObject;\n var stashFilterArea = target.filterArea;\n target.filterArea = maskObject.getBounds(true);\n renderer.filter.push(target, alphaMaskFilter);\n target.filterArea = stashFilterArea;\n if (!maskData._filters) {\n this.alphaMaskIndex++;\n }\n };\n /**\n * Removes the last filter from the filter stack and doesn't return it.\n * @param maskData - Sprite to be used as the mask.\n */\n MaskSystem.prototype.popSpriteMask = function (maskData) {\n this.renderer.filter.pop();\n if (maskData._filters) {\n maskData._filters[0].maskSprite = null;\n }\n else {\n this.alphaMaskIndex--;\n this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite = null;\n }\n };\n /**\n * Pushes the color mask.\n * @param maskData - The mask data\n */\n MaskSystem.prototype.pushColorMask = function (maskData) {\n var currColorMask = maskData._colorMask;\n var nextColorMask = maskData._colorMask = currColorMask & maskData.colorMask;\n if (nextColorMask !== currColorMask) {\n this.renderer.gl.colorMask((nextColorMask & 0x1) !== 0, (nextColorMask & 0x2) !== 0, (nextColorMask & 0x4) !== 0, (nextColorMask & 0x8) !== 0);\n }\n };\n /**\n * Pops the color mask.\n * @param maskData - The mask data\n */\n MaskSystem.prototype.popColorMask = function (maskData) {\n var currColorMask = maskData._colorMask;\n var nextColorMask = this.maskStack.length > 0\n ? this.maskStack[this.maskStack.length - 1]._colorMask : 0xf;\n if (nextColorMask !== currColorMask) {\n this.renderer.gl.colorMask((nextColorMask & 0x1) !== 0, (nextColorMask & 0x2) !== 0, (nextColorMask & 0x4) !== 0, (nextColorMask & 0x8) !== 0);\n }\n };\n MaskSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return MaskSystem;\n}());\n\n/**\n * System plugin to the renderer to manage specific types of masking operations.\n * @memberof PIXI\n */\nvar AbstractMaskSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function AbstractMaskSystem(renderer) {\n this.renderer = renderer;\n this.maskStack = [];\n this.glConst = 0;\n }\n /** Gets count of masks of certain type. */\n AbstractMaskSystem.prototype.getStackLength = function () {\n return this.maskStack.length;\n };\n /**\n * Changes the mask stack that is used by this System.\n * @param {PIXI.MaskData[]} maskStack - The mask stack\n */\n AbstractMaskSystem.prototype.setMaskStack = function (maskStack) {\n var gl = this.renderer.gl;\n var curStackLen = this.getStackLength();\n this.maskStack = maskStack;\n var newStackLen = this.getStackLength();\n if (newStackLen !== curStackLen) {\n if (newStackLen === 0) {\n gl.disable(this.glConst);\n }\n else {\n gl.enable(this.glConst);\n this._useCurrent();\n }\n }\n };\n /**\n * Setup renderer to use the current mask data.\n * @private\n */\n AbstractMaskSystem.prototype._useCurrent = function () {\n // OVERWRITE;\n };\n /** Destroys the mask stack. */\n AbstractMaskSystem.prototype.destroy = function () {\n this.renderer = null;\n this.maskStack = null;\n };\n return AbstractMaskSystem;\n}());\n\nvar tempMatrix$1 = new Matrix();\nvar rectPool = [];\n/**\n * System plugin to the renderer to manage scissor masking.\n *\n * Scissor masking discards pixels outside of a rectangle called the scissor box. The scissor box is in the framebuffer\n * viewport's space; however, the mask's rectangle is projected from world-space to viewport space automatically\n * by this system.\n * @memberof PIXI\n */\nvar ScissorSystem = /** @class */ (function (_super) {\n __extends(ScissorSystem, _super);\n /**\n * @param {PIXI.Renderer} renderer - The renderer this System works for.\n */\n function ScissorSystem(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.glConst = settings.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST;\n return _this;\n }\n ScissorSystem.prototype.getStackLength = function () {\n var maskData = this.maskStack[this.maskStack.length - 1];\n if (maskData) {\n return maskData._scissorCounter;\n }\n return 0;\n };\n /**\n * evaluates _boundsTransformed, _scissorRect for MaskData\n * @param maskData\n */\n ScissorSystem.prototype.calcScissorRect = function (maskData) {\n var _a;\n if (maskData._scissorRectLocal) {\n return;\n }\n var prevData = maskData._scissorRect;\n var maskObject = maskData.maskObject;\n var renderer = this.renderer;\n var renderTextureSystem = renderer.renderTexture;\n var rect = maskObject.getBounds(true, (_a = rectPool.pop()) !== null && _a !== void 0 ? _a : new Rectangle());\n this.roundFrameToPixels(rect, renderTextureSystem.current ? renderTextureSystem.current.resolution : renderer.resolution, renderTextureSystem.sourceFrame, renderTextureSystem.destinationFrame, renderer.projection.transform);\n if (prevData) {\n rect.fit(prevData);\n }\n maskData._scissorRectLocal = rect;\n };\n ScissorSystem.isMatrixRotated = function (matrix) {\n if (!matrix) {\n return false;\n }\n var a = matrix.a, b = matrix.b, c = matrix.c, d = matrix.d;\n // Skip if skew/rotation present in matrix, except for multiple of 90° rotation. If rotation\n // is a multiple of 90°, then either pair of (b,c) or (a,d) will be (0,0).\n return ((Math.abs(b) > 1e-4 || Math.abs(c) > 1e-4)\n && (Math.abs(a) > 1e-4 || Math.abs(d) > 1e-4));\n };\n /**\n * Test, whether the object can be scissor mask with current renderer projection.\n * Calls \"calcScissorRect()\" if its true.\n * @param maskData - mask data\n * @returns whether Whether the object can be scissor mask\n */\n ScissorSystem.prototype.testScissor = function (maskData) {\n var maskObject = maskData.maskObject;\n if (!maskObject.isFastRect || !maskObject.isFastRect()) {\n return false;\n }\n if (ScissorSystem.isMatrixRotated(maskObject.worldTransform)) {\n return false;\n }\n if (ScissorSystem.isMatrixRotated(this.renderer.projection.transform)) {\n return false;\n }\n this.calcScissorRect(maskData);\n var rect = maskData._scissorRectLocal;\n return rect.width > 0 && rect.height > 0;\n };\n ScissorSystem.prototype.roundFrameToPixels = function (frame, resolution, bindingSourceFrame, bindingDestinationFrame, transform) {\n if (ScissorSystem.isMatrixRotated(transform)) {\n return;\n }\n transform = transform ? tempMatrix$1.copyFrom(transform) : tempMatrix$1.identity();\n // Get forward transform from world space to screen space\n transform\n .translate(-bindingSourceFrame.x, -bindingSourceFrame.y)\n .scale(bindingDestinationFrame.width / bindingSourceFrame.width, bindingDestinationFrame.height / bindingSourceFrame.height)\n .translate(bindingDestinationFrame.x, bindingDestinationFrame.y);\n // Convert frame to screen space\n this.renderer.filter.transformAABB(transform, frame);\n frame.fit(bindingDestinationFrame);\n frame.x = Math.round(frame.x * resolution);\n frame.y = Math.round(frame.y * resolution);\n frame.width = Math.round(frame.width * resolution);\n frame.height = Math.round(frame.height * resolution);\n };\n /**\n * Applies the Mask and adds it to the current stencil stack.\n * @author alvin\n * @param maskData - The mask data.\n */\n ScissorSystem.prototype.push = function (maskData) {\n if (!maskData._scissorRectLocal) {\n this.calcScissorRect(maskData);\n }\n var gl = this.renderer.gl;\n if (!maskData._scissorRect) {\n gl.enable(gl.SCISSOR_TEST);\n }\n maskData._scissorCounter++;\n maskData._scissorRect = maskData._scissorRectLocal;\n this._useCurrent();\n };\n /**\n * This should be called after a mask is popped off the mask stack. It will rebind the scissor box to be latest with the\n * last mask in the stack.\n *\n * This can also be called when you directly modify the scissor box and want to restore PixiJS state.\n * @param maskData - The mask data.\n */\n ScissorSystem.prototype.pop = function (maskData) {\n var gl = this.renderer.gl;\n if (maskData) {\n rectPool.push(maskData._scissorRectLocal);\n }\n if (this.getStackLength() > 0) {\n this._useCurrent();\n }\n else {\n gl.disable(gl.SCISSOR_TEST);\n }\n };\n /**\n * Setup renderer to use the current scissor data.\n * @private\n */\n ScissorSystem.prototype._useCurrent = function () {\n var rect = this.maskStack[this.maskStack.length - 1]._scissorRect;\n var y;\n if (this.renderer.renderTexture.current) {\n y = rect.y;\n }\n else {\n // flipY. In future we'll have it over renderTextures as an option\n y = this.renderer.height - rect.height - rect.y;\n }\n this.renderer.gl.scissor(rect.x, y, rect.width, rect.height);\n };\n return ScissorSystem;\n}(AbstractMaskSystem));\n\n/**\n * System plugin to the renderer to manage stencils (used for masks).\n * @memberof PIXI\n */\nvar StencilSystem = /** @class */ (function (_super) {\n __extends(StencilSystem, _super);\n /**\n * @param renderer - The renderer this System works for.\n */\n function StencilSystem(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.glConst = settings.ADAPTER.getWebGLRenderingContext().STENCIL_TEST;\n return _this;\n }\n StencilSystem.prototype.getStackLength = function () {\n var maskData = this.maskStack[this.maskStack.length - 1];\n if (maskData) {\n return maskData._stencilCounter;\n }\n return 0;\n };\n /**\n * Applies the Mask and adds it to the current stencil stack.\n * @param maskData - The mask data\n */\n StencilSystem.prototype.push = function (maskData) {\n var maskObject = maskData.maskObject;\n var gl = this.renderer.gl;\n var prevMaskCount = maskData._stencilCounter;\n if (prevMaskCount === 0) {\n // force use stencil texture in current framebuffer\n this.renderer.framebuffer.forceStencil();\n gl.clearStencil(0);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n gl.enable(gl.STENCIL_TEST);\n }\n maskData._stencilCounter++;\n var colorMask = maskData._colorMask;\n if (colorMask !== 0) {\n maskData._colorMask = 0;\n gl.colorMask(false, false, false, false);\n }\n // Increment the reference stencil value where the new mask overlaps with the old ones.\n gl.stencilFunc(gl.EQUAL, prevMaskCount, 0xFFFFFFFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n maskObject.renderable = true;\n maskObject.render(this.renderer);\n this.renderer.batch.flush();\n maskObject.renderable = false;\n if (colorMask !== 0) {\n maskData._colorMask = colorMask;\n gl.colorMask((colorMask & 1) !== 0, (colorMask & 2) !== 0, (colorMask & 4) !== 0, (colorMask & 8) !== 0);\n }\n this._useCurrent();\n };\n /**\n * Pops stencil mask. MaskData is already removed from stack\n * @param {PIXI.DisplayObject} maskObject - object of popped mask data\n */\n StencilSystem.prototype.pop = function (maskObject) {\n var gl = this.renderer.gl;\n if (this.getStackLength() === 0) {\n // the stack is empty!\n gl.disable(gl.STENCIL_TEST);\n }\n else {\n var maskData = this.maskStack.length !== 0 ? this.maskStack[this.maskStack.length - 1] : null;\n var colorMask = maskData ? maskData._colorMask : 0xf;\n if (colorMask !== 0) {\n maskData._colorMask = 0;\n gl.colorMask(false, false, false, false);\n }\n // Decrement the reference stencil value where the popped mask overlaps with the other ones\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n maskObject.renderable = true;\n maskObject.render(this.renderer);\n this.renderer.batch.flush();\n maskObject.renderable = false;\n if (colorMask !== 0) {\n maskData._colorMask = colorMask;\n gl.colorMask((colorMask & 0x1) !== 0, (colorMask & 0x2) !== 0, (colorMask & 0x4) !== 0, (colorMask & 0x8) !== 0);\n }\n this._useCurrent();\n }\n };\n /**\n * Setup renderer to use the current stencil data.\n * @private\n */\n StencilSystem.prototype._useCurrent = function () {\n var gl = this.renderer.gl;\n gl.stencilFunc(gl.EQUAL, this.getStackLength(), 0xFFFFFFFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n };\n return StencilSystem;\n}(AbstractMaskSystem));\n\n/**\n * System plugin to the renderer to manage the projection matrix.\n *\n * The `projectionMatrix` is a global uniform provided to all shaders. It is used to transform points in world space to\n * normalized device coordinates.\n * @memberof PIXI\n */\nvar ProjectionSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function ProjectionSystem(renderer) {\n this.renderer = renderer;\n this.destinationFrame = null;\n this.sourceFrame = null;\n this.defaultFrame = null;\n this.projectionMatrix = new Matrix();\n this.transform = null;\n }\n /**\n * Updates the projection-matrix based on the sourceFrame → destinationFrame mapping provided.\n *\n * NOTE: It is expected you call `renderer.framebuffer.setViewport(destinationFrame)` after this. This is because\n * the framebuffer viewport converts shader vertex output in normalized device coordinates to window coordinates.\n *\n * NOTE-2: {@link RenderTextureSystem#bind} updates the projection-matrix when you bind a render-texture. It is expected\n * that you dirty the current bindings when calling this manually.\n * @param destinationFrame - The rectangle in the render-target to render the contents into. If rendering to the canvas,\n * the origin is on the top-left; if rendering to a render-texture, the origin is on the bottom-left.\n * @param sourceFrame - The rectangle in world space that contains the contents being rendered.\n * @param resolution - The resolution of the render-target, which is the ratio of\n * world-space (or CSS) pixels to physical pixels.\n * @param root - Whether the render-target is the screen. This is required because rendering to textures\n * is y-flipped (i.e. upside down relative to the screen).\n */\n ProjectionSystem.prototype.update = function (destinationFrame, sourceFrame, resolution, root) {\n this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame;\n this.sourceFrame = sourceFrame || this.sourceFrame || destinationFrame;\n // Calculate object-space to clip-space projection\n this.calculateProjection(this.destinationFrame, this.sourceFrame, resolution, root);\n if (this.transform) {\n this.projectionMatrix.append(this.transform);\n }\n var renderer = this.renderer;\n renderer.globalUniforms.uniforms.projectionMatrix = this.projectionMatrix;\n renderer.globalUniforms.update();\n // this will work for now\n // but would be sweet to stick and even on the global uniforms..\n if (renderer.shader.shader) {\n renderer.shader.syncUniformGroup(renderer.shader.shader.uniforms.globals);\n }\n };\n /**\n * Calculates the `projectionMatrix` to map points inside `sourceFrame` to inside `destinationFrame`.\n * @param _destinationFrame - The destination frame in the render-target.\n * @param sourceFrame - The source frame in world space.\n * @param _resolution - The render-target's resolution, i.e. ratio of CSS to physical pixels.\n * @param root - Whether rendering into the screen. Otherwise, if rendering to a framebuffer, the projection\n * is y-flipped.\n */\n ProjectionSystem.prototype.calculateProjection = function (_destinationFrame, sourceFrame, _resolution, root) {\n var pm = this.projectionMatrix;\n var sign = !root ? 1 : -1;\n pm.identity();\n pm.a = (1 / sourceFrame.width * 2);\n pm.d = sign * (1 / sourceFrame.height * 2);\n pm.tx = -1 - (sourceFrame.x * pm.a);\n pm.ty = -sign - (sourceFrame.y * pm.d);\n };\n /**\n * Sets the transform of the active render target to the given matrix.\n * @param _matrix - The transformation matrix\n */\n ProjectionSystem.prototype.setTransform = function (_matrix) {\n // this._activeRenderTarget.transform = matrix;\n };\n ProjectionSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return ProjectionSystem;\n}());\n\n// Temporary rectangle for assigned sourceFrame or destinationFrame\nvar tempRect = new Rectangle();\n// Temporary rectangle for renderTexture destinationFrame\nvar tempRect2 = new Rectangle();\n/* eslint-disable max-len */\n/**\n * System plugin to the renderer to manage render textures.\n *\n * Should be added after FramebufferSystem\n *\n * ### Frames\n *\n * The `RenderTextureSystem` holds a sourceFrame → destinationFrame projection. The following table explains the different\n * coordinate spaces used:\n *\n * | Frame | Description | Coordinate System |\n * | ---------------------- | ---------------------------------------------------------------- | ------------------------------------------------------- |\n * | sourceFrame | The rectangle inside of which display-objects are being rendered | **World Space**: The origin on the top-left |\n * | destinationFrame | The rectangle in the render-target (canvas or texture) into which contents should be rendered | If rendering to the canvas, this is in screen space and the origin is on the top-left. If rendering to a render-texture, this is in its base-texture's space with the origin on the bottom-left. |\n * | viewportFrame | The framebuffer viewport corresponding to the destination-frame | **Window Coordinates**: The origin is always on the bottom-left. |\n * @memberof PIXI\n */\nvar RenderTextureSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this System works for.\n */\n function RenderTextureSystem(renderer) {\n this.renderer = renderer;\n this.clearColor = renderer._backgroundColorRgba;\n this.defaultMaskStack = [];\n this.current = null;\n this.sourceFrame = new Rectangle();\n this.destinationFrame = new Rectangle();\n this.viewportFrame = new Rectangle();\n }\n /**\n * Bind the current render texture.\n * @param renderTexture - RenderTexture to bind, by default its `null` - the screen.\n * @param sourceFrame - Part of world that is mapped to the renderTexture.\n * @param destinationFrame - Part of renderTexture, by default it has the same size as sourceFrame.\n */\n RenderTextureSystem.prototype.bind = function (renderTexture, sourceFrame, destinationFrame) {\n if (renderTexture === void 0) { renderTexture = null; }\n var renderer = this.renderer;\n this.current = renderTexture;\n var baseTexture;\n var framebuffer;\n var resolution;\n if (renderTexture) {\n baseTexture = renderTexture.baseTexture;\n resolution = baseTexture.resolution;\n if (!sourceFrame) {\n tempRect.width = renderTexture.frame.width;\n tempRect.height = renderTexture.frame.height;\n sourceFrame = tempRect;\n }\n if (!destinationFrame) {\n tempRect2.x = renderTexture.frame.x;\n tempRect2.y = renderTexture.frame.y;\n tempRect2.width = sourceFrame.width;\n tempRect2.height = sourceFrame.height;\n destinationFrame = tempRect2;\n }\n framebuffer = baseTexture.framebuffer;\n }\n else {\n resolution = renderer.resolution;\n if (!sourceFrame) {\n tempRect.width = renderer.screen.width;\n tempRect.height = renderer.screen.height;\n sourceFrame = tempRect;\n }\n if (!destinationFrame) {\n destinationFrame = tempRect;\n destinationFrame.width = sourceFrame.width;\n destinationFrame.height = sourceFrame.height;\n }\n }\n var viewportFrame = this.viewportFrame;\n viewportFrame.x = destinationFrame.x * resolution;\n viewportFrame.y = destinationFrame.y * resolution;\n viewportFrame.width = destinationFrame.width * resolution;\n viewportFrame.height = destinationFrame.height * resolution;\n if (!renderTexture) {\n viewportFrame.y = renderer.view.height - (viewportFrame.y + viewportFrame.height);\n }\n viewportFrame.ceil();\n this.renderer.framebuffer.bind(framebuffer, viewportFrame);\n this.renderer.projection.update(destinationFrame, sourceFrame, resolution, !framebuffer);\n if (renderTexture) {\n this.renderer.mask.setMaskStack(baseTexture.maskStack);\n }\n else {\n this.renderer.mask.setMaskStack(this.defaultMaskStack);\n }\n this.sourceFrame.copyFrom(sourceFrame);\n this.destinationFrame.copyFrom(destinationFrame);\n };\n /**\n * Erases the render texture and fills the drawing area with a colour.\n * @param clearColor - The color as rgba, default to use the renderer backgroundColor\n * @param [mask=BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH] - Bitwise OR of masks\n * that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.\n */\n RenderTextureSystem.prototype.clear = function (clearColor, mask) {\n if (this.current) {\n clearColor = clearColor || this.current.baseTexture.clearColor;\n }\n else {\n clearColor = clearColor || this.clearColor;\n }\n var destinationFrame = this.destinationFrame;\n var baseFrame = this.current ? this.current.baseTexture : this.renderer.screen;\n var clearMask = destinationFrame.width !== baseFrame.width || destinationFrame.height !== baseFrame.height;\n if (clearMask) {\n var _a = this.viewportFrame, x = _a.x, y = _a.y, width = _a.width, height = _a.height;\n x = Math.round(x);\n y = Math.round(y);\n width = Math.round(width);\n height = Math.round(height);\n // TODO: ScissorSystem should cache whether the scissor test is enabled or not.\n this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);\n this.renderer.gl.scissor(x, y, width, height);\n }\n this.renderer.framebuffer.clear(clearColor[0], clearColor[1], clearColor[2], clearColor[3], mask);\n if (clearMask) {\n // Restore the scissor box\n this.renderer.scissor.pop();\n }\n };\n RenderTextureSystem.prototype.resize = function () {\n // resize the root only!\n this.bind(null);\n };\n /** Resets render-texture state. */\n RenderTextureSystem.prototype.reset = function () {\n this.bind(null);\n };\n RenderTextureSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return RenderTextureSystem;\n}());\n\nfunction uboUpdate(_ud, _uv, _renderer, _syncData, buffer) {\n _renderer.buffer.update(buffer);\n}\n// cv = CachedValue\n// v = value\n// ud = uniformData\n// uv = uniformValue\n// l = location\nvar UBO_TO_SINGLE_SETTERS = {\n float: \"\\n data[offset] = v;\\n \",\n vec2: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n \",\n vec3: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n\\n \",\n vec4: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n data[offset+3] = v[3];\\n \",\n mat2: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n\\n data[offset+4] = v[2];\\n data[offset+5] = v[3];\\n \",\n mat3: \"\\n data[offset] = v[0];\\n data[offset+1] = v[1];\\n data[offset+2] = v[2];\\n\\n data[offset + 4] = v[3];\\n data[offset + 5] = v[4];\\n data[offset + 6] = v[5];\\n\\n data[offset + 8] = v[6];\\n data[offset + 9] = v[7];\\n data[offset + 10] = v[8];\\n \",\n mat4: \"\\n for(var i = 0; i < 16; i++)\\n {\\n data[offset + i] = v[i];\\n }\\n \"\n};\nvar GLSL_TO_STD40_SIZE = {\n float: 4,\n vec2: 8,\n vec3: 12,\n vec4: 16,\n int: 4,\n ivec2: 8,\n ivec3: 12,\n ivec4: 16,\n uint: 4,\n uvec2: 8,\n uvec3: 12,\n uvec4: 16,\n bool: 4,\n bvec2: 8,\n bvec3: 12,\n bvec4: 16,\n mat2: 16 * 2,\n mat3: 16 * 3,\n mat4: 16 * 4,\n};\n/**\n * logic originally from here: https://github.com/sketchpunk/FunWithWebGL2/blob/master/lesson_022/Shaders.js\n * rewrote it, but this was a great starting point to get a solid understanding of whats going on :)\n * @ignore\n * @param uniformData\n */\nfunction createUBOElements(uniformData) {\n var uboElements = uniformData.map(function (data) {\n return ({\n data: data,\n offset: 0,\n dataLen: 0,\n dirty: 0\n });\n });\n var size = 0;\n var chunkSize = 0;\n var offset = 0;\n for (var i = 0; i < uboElements.length; i++) {\n var uboElement = uboElements[i];\n size = GLSL_TO_STD40_SIZE[uboElement.data.type];\n if (uboElement.data.size > 1) {\n size = Math.max(size, 16) * uboElement.data.size;\n }\n uboElement.dataLen = size;\n // add some size offset..\n // must align to the nearest 16 bytes or internally nearest round size\n if (chunkSize % size !== 0 && chunkSize < 16) {\n // diff required to line up..\n var lineUpValue = (chunkSize % size) % 16;\n chunkSize += lineUpValue;\n offset += lineUpValue;\n }\n if ((chunkSize + size) > 16) {\n offset = Math.ceil(offset / 16) * 16;\n uboElement.offset = offset;\n offset += size;\n chunkSize = size;\n }\n else {\n uboElement.offset = offset;\n chunkSize += size;\n offset += size;\n }\n }\n offset = Math.ceil(offset / 16) * 16;\n return { uboElements: uboElements, size: offset };\n}\nfunction getUBOData(uniforms, uniformData) {\n var usedUniformDatas = [];\n // build..\n for (var i in uniforms) {\n if (uniformData[i]) {\n usedUniformDatas.push(uniformData[i]);\n }\n }\n // sort them out by index!\n usedUniformDatas.sort(function (a, b) { return a.index - b.index; });\n return usedUniformDatas;\n}\nfunction generateUniformBufferSync(group, uniformData) {\n if (!group.autoManage) {\n // if the group is nott automatically managed, we don't need to generate a special function for it...\n return { size: 0, syncFunc: uboUpdate };\n }\n var usedUniformDatas = getUBOData(group.uniforms, uniformData);\n var _a = createUBOElements(usedUniformDatas), uboElements = _a.uboElements, size = _a.size;\n var funcFragments = [\"\\n var v = null;\\n var v2 = null;\\n var cv = null;\\n var t = 0;\\n var gl = renderer.gl\\n var index = 0;\\n var data = buffer.data;\\n \"];\n for (var i = 0; i < uboElements.length; i++) {\n var uboElement = uboElements[i];\n var uniform = group.uniforms[uboElement.data.name];\n var name = uboElement.data.name;\n var parsed = false;\n for (var j = 0; j < uniformParsers.length; j++) {\n var uniformParser = uniformParsers[j];\n if (uniformParser.codeUbo && uniformParser.test(uboElement.data, uniform)) {\n funcFragments.push(\"offset = \" + uboElement.offset / 4 + \";\", uniformParsers[j].codeUbo(uboElement.data.name, uniform));\n parsed = true;\n break;\n }\n }\n if (!parsed) {\n if (uboElement.data.size > 1) {\n var size_1 = mapSize(uboElement.data.type);\n var rowSize = Math.max(GLSL_TO_STD40_SIZE[uboElement.data.type] / 16, 1);\n var elementSize = size_1 / rowSize;\n var remainder = (4 - (elementSize % 4)) % 4;\n funcFragments.push(\"\\n cv = ud.\" + name + \".value;\\n v = uv.\" + name + \";\\n offset = \" + uboElement.offset / 4 + \";\\n\\n t = 0;\\n\\n for(var i=0; i < \" + uboElement.data.size * rowSize + \"; i++)\\n {\\n for(var j = 0; j < \" + elementSize + \"; j++)\\n {\\n data[offset++] = v[t++];\\n }\\n offset += \" + remainder + \";\\n }\\n\\n \");\n }\n else {\n var template = UBO_TO_SINGLE_SETTERS[uboElement.data.type];\n funcFragments.push(\"\\n cv = ud.\" + name + \".value;\\n v = uv.\" + name + \";\\n offset = \" + uboElement.offset / 4 + \";\\n \" + template + \";\\n \");\n }\n }\n }\n funcFragments.push(\"\\n renderer.buffer.update(buffer);\\n \");\n return {\n size: size,\n // eslint-disable-next-line no-new-func\n syncFunc: new Function('ud', 'uv', 'renderer', 'syncData', 'buffer', funcFragments.join('\\n'))\n };\n}\n\n/**\n * @private\n */\nvar IGLUniformData = /** @class */ (function () {\n function IGLUniformData() {\n }\n return IGLUniformData;\n}());\n/**\n * Helper class to create a WebGL Program\n * @memberof PIXI\n */\nvar GLProgram = /** @class */ (function () {\n /**\n * Makes a new Pixi program.\n * @param program - webgl program\n * @param uniformData - uniforms\n */\n function GLProgram(program, uniformData) {\n this.program = program;\n this.uniformData = uniformData;\n this.uniformGroups = {};\n this.uniformDirtyGroups = {};\n this.uniformBufferBindings = {};\n }\n /** Destroys this program. */\n GLProgram.prototype.destroy = function () {\n this.uniformData = null;\n this.uniformGroups = null;\n this.uniformDirtyGroups = null;\n this.uniformBufferBindings = null;\n this.program = null;\n };\n return GLProgram;\n}());\n\n/**\n * returns the attribute data from the program\n * @private\n * @param {WebGLProgram} [program] - the WebGL program\n * @param {WebGLRenderingContext} [gl] - the WebGL context\n * @returns {object} the attribute data for this program\n */\nfunction getAttributeData(program, gl) {\n var attributes = {};\n var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n for (var i = 0; i < totalAttributes; i++) {\n var attribData = gl.getActiveAttrib(program, i);\n if (attribData.name.indexOf('gl_') === 0) {\n continue;\n }\n var type = mapType(gl, attribData.type);\n var data = {\n type: type,\n name: attribData.name,\n size: mapSize(type),\n location: gl.getAttribLocation(program, attribData.name),\n };\n attributes[attribData.name] = data;\n }\n return attributes;\n}\n\n/**\n * returns the uniform data from the program\n * @private\n * @param program - the webgl program\n * @param gl - the WebGL context\n * @returns {object} the uniform data for this program\n */\nfunction getUniformData(program, gl) {\n var uniforms = {};\n var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n for (var i = 0; i < totalUniforms; i++) {\n var uniformData = gl.getActiveUniform(program, i);\n var name = uniformData.name.replace(/\\[.*?\\]$/, '');\n var isArray = !!(uniformData.name.match(/\\[.*?\\]$/));\n var type = mapType(gl, uniformData.type);\n uniforms[name] = {\n name: name,\n index: i,\n type: type,\n size: uniformData.size,\n isArray: isArray,\n value: defaultValue(type, uniformData.size),\n };\n }\n return uniforms;\n}\n\n/**\n * generates a WebGL Program object from a high level Pixi Program.\n * @param gl - a rendering context on which to generate the program\n * @param program - the high level Pixi Program.\n */\nfunction generateProgram(gl, program) {\n var glVertShader = compileShader(gl, gl.VERTEX_SHADER, program.vertexSrc);\n var glFragShader = compileShader(gl, gl.FRAGMENT_SHADER, program.fragmentSrc);\n var webGLProgram = gl.createProgram();\n gl.attachShader(webGLProgram, glVertShader);\n gl.attachShader(webGLProgram, glFragShader);\n gl.linkProgram(webGLProgram);\n if (!gl.getProgramParameter(webGLProgram, gl.LINK_STATUS)) {\n logProgramError(gl, webGLProgram, glVertShader, glFragShader);\n }\n program.attributeData = getAttributeData(webGLProgram, gl);\n program.uniformData = getUniformData(webGLProgram, gl);\n // GLSL 1.00: bind attributes sorted by name in ascending order\n // GLSL 3.00: don't change the attribute locations that where chosen by the compiler\n // or assigned by the layout specifier in the shader source code\n if (!(/^[ \\t]*#[ \\t]*version[ \\t]+300[ \\t]+es[ \\t]*$/m).test(program.vertexSrc)) {\n var keys = Object.keys(program.attributeData);\n keys.sort(function (a, b) { return (a > b) ? 1 : -1; }); // eslint-disable-line no-confusing-arrow\n for (var i = 0; i < keys.length; i++) {\n program.attributeData[keys[i]].location = i;\n gl.bindAttribLocation(webGLProgram, i, keys[i]);\n }\n gl.linkProgram(webGLProgram);\n }\n gl.deleteShader(glVertShader);\n gl.deleteShader(glFragShader);\n var uniformData = {};\n for (var i in program.uniformData) {\n var data = program.uniformData[i];\n uniformData[i] = {\n location: gl.getUniformLocation(webGLProgram, i),\n value: defaultValue(data.type, data.size),\n };\n }\n var glProgram = new GLProgram(webGLProgram, uniformData);\n return glProgram;\n}\n\nvar UID = 0;\n// default sync data so we don't create a new one each time!\nvar defaultSyncData = { textureCount: 0, uboCount: 0 };\n/**\n * System plugin to the renderer to manage shaders.\n * @memberof PIXI\n */\nvar ShaderSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function ShaderSystem(renderer) {\n this.destroyed = false;\n this.renderer = renderer;\n // Validation check that this environment support `new Function`\n this.systemCheck();\n this.gl = null;\n this.shader = null;\n this.program = null;\n this.cache = {};\n this._uboCache = {};\n this.id = UID++;\n }\n /**\n * Overrideable function by `@pixi/unsafe-eval` to silence\n * throwing an error if platform doesn't support unsafe-evals.\n * @private\n */\n ShaderSystem.prototype.systemCheck = function () {\n if (!unsafeEvalSupported()) {\n throw new Error('Current environment does not allow unsafe-eval, '\n + 'please use @pixi/unsafe-eval module to enable support.');\n }\n };\n ShaderSystem.prototype.contextChange = function (gl) {\n this.gl = gl;\n this.reset();\n };\n /**\n * Changes the current shader to the one given in parameter.\n * @param shader - the new shader\n * @param dontSync - false if the shader should automatically sync its uniforms.\n * @returns the glProgram that belongs to the shader.\n */\n ShaderSystem.prototype.bind = function (shader, dontSync) {\n shader.disposeRunner.add(this);\n shader.uniforms.globals = this.renderer.globalUniforms;\n var program = shader.program;\n var glProgram = program.glPrograms[this.renderer.CONTEXT_UID] || this.generateProgram(shader);\n this.shader = shader;\n // TODO - some current Pixi plugins bypass this.. so it not safe to use yet..\n if (this.program !== program) {\n this.program = program;\n this.gl.useProgram(glProgram.program);\n }\n if (!dontSync) {\n defaultSyncData.textureCount = 0;\n defaultSyncData.uboCount = 0;\n this.syncUniformGroup(shader.uniformGroup, defaultSyncData);\n }\n return glProgram;\n };\n /**\n * Uploads the uniforms values to the currently bound shader.\n * @param uniforms - the uniforms values that be applied to the current shader\n */\n ShaderSystem.prototype.setUniforms = function (uniforms) {\n var shader = this.shader.program;\n var glProgram = shader.glPrograms[this.renderer.CONTEXT_UID];\n shader.syncUniforms(glProgram.uniformData, uniforms, this.renderer);\n };\n /* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n /**\n * Syncs uniforms on the group\n * @param group - the uniform group to sync\n * @param syncData - this is data that is passed to the sync function and any nested sync functions\n */\n ShaderSystem.prototype.syncUniformGroup = function (group, syncData) {\n var glProgram = this.getGlProgram();\n if (!group.static || group.dirtyId !== glProgram.uniformDirtyGroups[group.id]) {\n glProgram.uniformDirtyGroups[group.id] = group.dirtyId;\n this.syncUniforms(group, glProgram, syncData);\n }\n };\n /**\n * Overrideable by the @pixi/unsafe-eval package to use static syncUniforms instead.\n * @param group\n * @param glProgram\n * @param syncData\n */\n ShaderSystem.prototype.syncUniforms = function (group, glProgram, syncData) {\n var syncFunc = group.syncUniforms[this.shader.program.id] || this.createSyncGroups(group);\n syncFunc(glProgram.uniformData, group.uniforms, this.renderer, syncData);\n };\n ShaderSystem.prototype.createSyncGroups = function (group) {\n var id = this.getSignature(group, this.shader.program.uniformData, 'u');\n if (!this.cache[id]) {\n this.cache[id] = generateUniformsSync(group, this.shader.program.uniformData);\n }\n group.syncUniforms[this.shader.program.id] = this.cache[id];\n return group.syncUniforms[this.shader.program.id];\n };\n /**\n * Syncs uniform buffers\n * @param group - the uniform buffer group to sync\n * @param name - the name of the uniform buffer\n */\n ShaderSystem.prototype.syncUniformBufferGroup = function (group, name) {\n var glProgram = this.getGlProgram();\n if (!group.static || group.dirtyId !== 0 || !glProgram.uniformGroups[group.id]) {\n group.dirtyId = 0;\n var syncFunc = glProgram.uniformGroups[group.id]\n || this.createSyncBufferGroup(group, glProgram, name);\n // TODO wrap update in a cache??\n group.buffer.update();\n syncFunc(glProgram.uniformData, group.uniforms, this.renderer, defaultSyncData, group.buffer);\n }\n this.renderer.buffer.bindBufferBase(group.buffer, glProgram.uniformBufferBindings[name]);\n };\n /**\n * Will create a function that uploads a uniform buffer using the STD140 standard.\n * The upload function will then be cached for future calls\n * If a group is manually managed, then a simple upload function is generated\n * @param group - the uniform buffer group to sync\n * @param glProgram - the gl program to attach the uniform bindings to\n * @param name - the name of the uniform buffer (must exist on the shader)\n */\n ShaderSystem.prototype.createSyncBufferGroup = function (group, glProgram, name) {\n var gl = this.renderer.gl;\n this.renderer.buffer.bind(group.buffer);\n // bind them...\n var uniformBlockIndex = this.gl.getUniformBlockIndex(glProgram.program, name);\n glProgram.uniformBufferBindings[name] = this.shader.uniformBindCount;\n gl.uniformBlockBinding(glProgram.program, uniformBlockIndex, this.shader.uniformBindCount);\n this.shader.uniformBindCount++;\n var id = this.getSignature(group, this.shader.program.uniformData, 'ubo');\n var uboData = this._uboCache[id];\n if (!uboData) {\n uboData = this._uboCache[id] = generateUniformBufferSync(group, this.shader.program.uniformData);\n }\n if (group.autoManage) {\n var data = new Float32Array(uboData.size / 4);\n group.buffer.update(data);\n }\n glProgram.uniformGroups[group.id] = uboData.syncFunc;\n return glProgram.uniformGroups[group.id];\n };\n /**\n * Takes a uniform group and data and generates a unique signature for them.\n * @param group - The uniform group to get signature of\n * @param group.uniforms\n * @param uniformData - Uniform information generated by the shader\n * @param preFix\n * @returns Unique signature of the uniform group\n */\n ShaderSystem.prototype.getSignature = function (group, uniformData, preFix) {\n var uniforms = group.uniforms;\n var strings = [preFix + \"-\"];\n for (var i in uniforms) {\n strings.push(i);\n if (uniformData[i]) {\n strings.push(uniformData[i].type);\n }\n }\n return strings.join('-');\n };\n /**\n * Returns the underlying GLShade rof the currently bound shader.\n *\n * This can be handy for when you to have a little more control over the setting of your uniforms.\n * @returns The glProgram for the currently bound Shader for this context\n */\n ShaderSystem.prototype.getGlProgram = function () {\n if (this.shader) {\n return this.shader.program.glPrograms[this.renderer.CONTEXT_UID];\n }\n return null;\n };\n /**\n * Generates a glProgram version of the Shader provided.\n * @param shader - The shader that the glProgram will be based on.\n * @returns A shiny new glProgram!\n */\n ShaderSystem.prototype.generateProgram = function (shader) {\n var gl = this.gl;\n var program = shader.program;\n var glProgram = generateProgram(gl, program);\n program.glPrograms[this.renderer.CONTEXT_UID] = glProgram;\n return glProgram;\n };\n /** Resets ShaderSystem state, does not affect WebGL state. */\n ShaderSystem.prototype.reset = function () {\n this.program = null;\n this.shader = null;\n };\n /**\n * Disposes shader.\n * If disposing one equals with current shader, set current as null.\n * @param shader - Shader object\n */\n ShaderSystem.prototype.disposeShader = function (shader) {\n if (this.shader === shader) {\n this.shader = null;\n }\n };\n /** Destroys this System and removes all its textures. */\n ShaderSystem.prototype.destroy = function () {\n this.renderer = null;\n // TODO implement destroy method for ShaderSystem\n this.destroyed = true;\n };\n return ShaderSystem;\n}());\n\n/**\n * Maps gl blend combinations to WebGL.\n * @memberof PIXI\n * @function mapWebGLBlendModesToPixi\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @param {number[][]} [array=[]] - The array to output into.\n * @returns {number[][]} Mapped modes.\n */\nfunction mapWebGLBlendModesToPixi(gl, array) {\n if (array === void 0) { array = []; }\n // TODO - premultiply alpha would be different.\n // add a boolean for that!\n array[BLEND_MODES.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.ADD] = [gl.ONE, gl.ONE];\n array[BLEND_MODES.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SCREEN] = [gl.ONE, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.NONE] = [0, 0];\n // not-premultiplied blend modes\n array[BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.ONE, gl.ONE, gl.ONE];\n array[BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];\n // composite operations\n array[BLEND_MODES.SRC_IN] = [gl.DST_ALPHA, gl.ZERO];\n array[BLEND_MODES.SRC_OUT] = [gl.ONE_MINUS_DST_ALPHA, gl.ZERO];\n array[BLEND_MODES.SRC_ATOP] = [gl.DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DST_OVER] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE];\n array[BLEND_MODES.DST_IN] = [gl.ZERO, gl.SRC_ALPHA];\n array[BLEND_MODES.DST_OUT] = [gl.ZERO, gl.ONE_MINUS_SRC_ALPHA];\n array[BLEND_MODES.DST_ATOP] = [gl.ONE_MINUS_DST_ALPHA, gl.SRC_ALPHA];\n array[BLEND_MODES.XOR] = [gl.ONE_MINUS_DST_ALPHA, gl.ONE_MINUS_SRC_ALPHA];\n // SUBTRACT from flash\n array[BLEND_MODES.SUBTRACT] = [gl.ONE, gl.ONE, gl.ONE, gl.ONE, gl.FUNC_REVERSE_SUBTRACT, gl.FUNC_ADD];\n return array;\n}\n\nvar BLEND = 0;\nvar OFFSET = 1;\nvar CULLING = 2;\nvar DEPTH_TEST = 3;\nvar WINDING = 4;\nvar DEPTH_MASK = 5;\n/**\n * System plugin to the renderer to manage WebGL state machines.\n * @memberof PIXI\n */\nvar StateSystem = /** @class */ (function () {\n function StateSystem() {\n this.gl = null;\n this.stateId = 0;\n this.polygonOffset = 0;\n this.blendMode = BLEND_MODES.NONE;\n this._blendEq = false;\n // map functions for when we set state..\n this.map = [];\n this.map[BLEND] = this.setBlend;\n this.map[OFFSET] = this.setOffset;\n this.map[CULLING] = this.setCullFace;\n this.map[DEPTH_TEST] = this.setDepthTest;\n this.map[WINDING] = this.setFrontFace;\n this.map[DEPTH_MASK] = this.setDepthMask;\n this.checks = [];\n this.defaultState = new State();\n this.defaultState.blend = true;\n }\n StateSystem.prototype.contextChange = function (gl) {\n this.gl = gl;\n this.blendModes = mapWebGLBlendModesToPixi(gl);\n this.set(this.defaultState);\n this.reset();\n };\n /**\n * Sets the current state\n * @param {*} state - The state to set.\n */\n StateSystem.prototype.set = function (state) {\n state = state || this.defaultState;\n // TODO maybe to an object check? ( this.state === state )?\n if (this.stateId !== state.data) {\n var diff = this.stateId ^ state.data;\n var i = 0;\n // order from least to most common\n while (diff) {\n if (diff & 1) {\n // state change!\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n diff = diff >> 1;\n i++;\n }\n this.stateId = state.data;\n }\n // based on the above settings we check for specific modes..\n // for example if blend is active we check and set the blend modes\n // or of polygon offset is active we check the poly depth.\n for (var i = 0; i < this.checks.length; i++) {\n this.checks[i](this, state);\n }\n };\n /**\n * Sets the state, when previous state is unknown.\n * @param {*} state - The state to set\n */\n StateSystem.prototype.forceState = function (state) {\n state = state || this.defaultState;\n for (var i = 0; i < this.map.length; i++) {\n this.map[i].call(this, !!(state.data & (1 << i)));\n }\n for (var i = 0; i < this.checks.length; i++) {\n this.checks[i](this, state);\n }\n this.stateId = state.data;\n };\n /**\n * Sets whether to enable or disable blending.\n * @param value - Turn on or off WebGl blending.\n */\n StateSystem.prototype.setBlend = function (value) {\n this.updateCheck(StateSystem.checkBlendMode, value);\n this.gl[value ? 'enable' : 'disable'](this.gl.BLEND);\n };\n /**\n * Sets whether to enable or disable polygon offset fill.\n * @param value - Turn on or off webgl polygon offset testing.\n */\n StateSystem.prototype.setOffset = function (value) {\n this.updateCheck(StateSystem.checkPolygonOffset, value);\n this.gl[value ? 'enable' : 'disable'](this.gl.POLYGON_OFFSET_FILL);\n };\n /**\n * Sets whether to enable or disable depth test.\n * @param value - Turn on or off webgl depth testing.\n */\n StateSystem.prototype.setDepthTest = function (value) {\n this.gl[value ? 'enable' : 'disable'](this.gl.DEPTH_TEST);\n };\n /**\n * Sets whether to enable or disable depth mask.\n * @param value - Turn on or off webgl depth mask.\n */\n StateSystem.prototype.setDepthMask = function (value) {\n this.gl.depthMask(value);\n };\n /**\n * Sets whether to enable or disable cull face.\n * @param {boolean} value - Turn on or off webgl cull face.\n */\n StateSystem.prototype.setCullFace = function (value) {\n this.gl[value ? 'enable' : 'disable'](this.gl.CULL_FACE);\n };\n /**\n * Sets the gl front face.\n * @param {boolean} value - true is clockwise and false is counter-clockwise\n */\n StateSystem.prototype.setFrontFace = function (value) {\n this.gl.frontFace(this.gl[value ? 'CW' : 'CCW']);\n };\n /**\n * Sets the blend mode.\n * @param {number} value - The blend mode to set to.\n */\n StateSystem.prototype.setBlendMode = function (value) {\n if (value === this.blendMode) {\n return;\n }\n this.blendMode = value;\n var mode = this.blendModes[value];\n var gl = this.gl;\n if (mode.length === 2) {\n gl.blendFunc(mode[0], mode[1]);\n }\n else {\n gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]);\n }\n if (mode.length === 6) {\n this._blendEq = true;\n gl.blendEquationSeparate(mode[4], mode[5]);\n }\n else if (this._blendEq) {\n this._blendEq = false;\n gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD);\n }\n };\n /**\n * Sets the polygon offset.\n * @param {number} value - the polygon offset\n * @param {number} scale - the polygon offset scale\n */\n StateSystem.prototype.setPolygonOffset = function (value, scale) {\n this.gl.polygonOffset(value, scale);\n };\n // used\n /** Resets all the logic and disables the VAOs. */\n StateSystem.prototype.reset = function () {\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n this.forceState(this.defaultState);\n this._blendEq = true;\n this.blendMode = -1;\n this.setBlendMode(0);\n };\n /**\n * Checks to see which updates should be checked based on which settings have been activated.\n *\n * For example, if blend is enabled then we should check the blend modes each time the state is changed\n * or if polygon fill is activated then we need to check if the polygon offset changes.\n * The idea is that we only check what we have too.\n * @param func - the checking function to add or remove\n * @param value - should the check function be added or removed.\n */\n StateSystem.prototype.updateCheck = function (func, value) {\n var index = this.checks.indexOf(func);\n if (value && index === -1) {\n this.checks.push(func);\n }\n else if (!value && index !== -1) {\n this.checks.splice(index, 1);\n }\n };\n /**\n * A private little wrapper function that we call to check the blend mode.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n StateSystem.checkBlendMode = function (system, state) {\n system.setBlendMode(state.blendMode);\n };\n /**\n * A private little wrapper function that we call to check the polygon offset.\n * @param system - the System to perform the state check on\n * @param state - the state that the blendMode will pulled from\n */\n StateSystem.checkPolygonOffset = function (system, state) {\n system.setPolygonOffset(1, state.polygonOffset);\n };\n /**\n * @ignore\n */\n StateSystem.prototype.destroy = function () {\n this.gl = null;\n };\n return StateSystem;\n}());\n\n/**\n * System plugin to the renderer to manage texture garbage collection on the GPU,\n * ensuring that it does not get clogged up with textures that are no longer being used.\n * @memberof PIXI\n */\nvar TextureGCSystem = /** @class */ (function () {\n /** @param renderer - The renderer this System works for. */\n function TextureGCSystem(renderer) {\n this.renderer = renderer;\n this.count = 0;\n this.checkCount = 0;\n this.maxIdle = settings.GC_MAX_IDLE;\n this.checkCountMax = settings.GC_MAX_CHECK_COUNT;\n this.mode = settings.GC_MODE;\n }\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n TextureGCSystem.prototype.postrender = function () {\n if (!this.renderer.renderingToScreen) {\n return;\n }\n this.count++;\n if (this.mode === GC_MODES.MANUAL) {\n return;\n }\n this.checkCount++;\n if (this.checkCount > this.checkCountMax) {\n this.checkCount = 0;\n this.run();\n }\n };\n /**\n * Checks to see when the last time a texture was used\n * if the texture has not been used for a specified amount of time it will be removed from the GPU\n */\n TextureGCSystem.prototype.run = function () {\n var tm = this.renderer.texture;\n var managedTextures = tm.managedTextures;\n var wasRemoved = false;\n for (var i = 0; i < managedTextures.length; i++) {\n var texture = managedTextures[i];\n // only supports non generated textures at the moment!\n if (!texture.framebuffer && this.count - texture.touched > this.maxIdle) {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n if (wasRemoved) {\n var j = 0;\n for (var i = 0; i < managedTextures.length; i++) {\n if (managedTextures[i] !== null) {\n managedTextures[j++] = managedTextures[i];\n }\n }\n managedTextures.length = j;\n }\n };\n /**\n * Removes all the textures within the specified displayObject and its children from the GPU\n * @param {PIXI.DisplayObject} displayObject - the displayObject to remove the textures from.\n */\n TextureGCSystem.prototype.unload = function (displayObject) {\n var tm = this.renderer.texture;\n var texture = displayObject._texture;\n // only destroy non generated textures\n if (texture && !texture.framebuffer) {\n tm.destroyTexture(texture);\n }\n for (var i = displayObject.children.length - 1; i >= 0; i--) {\n this.unload(displayObject.children[i]);\n }\n };\n TextureGCSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return TextureGCSystem;\n}());\n\n/**\n * Returns a lookup table that maps each type-format pair to a compatible internal format.\n * @memberof PIXI\n * @function mapTypeAndFormatToInternalFormat\n * @private\n * @param {WebGLRenderingContext} gl - The rendering context.\n * @returns Lookup table.\n */\nfunction mapTypeAndFormatToInternalFormat(gl) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;\n var table;\n if ('WebGL2RenderingContext' in globalThis && gl instanceof globalThis.WebGL2RenderingContext) {\n table = (_a = {},\n _a[TYPES.UNSIGNED_BYTE] = (_b = {},\n _b[FORMATS.RGBA] = gl.RGBA8,\n _b[FORMATS.RGB] = gl.RGB8,\n _b[FORMATS.RG] = gl.RG8,\n _b[FORMATS.RED] = gl.R8,\n _b[FORMATS.RGBA_INTEGER] = gl.RGBA8UI,\n _b[FORMATS.RGB_INTEGER] = gl.RGB8UI,\n _b[FORMATS.RG_INTEGER] = gl.RG8UI,\n _b[FORMATS.RED_INTEGER] = gl.R8UI,\n _b[FORMATS.ALPHA] = gl.ALPHA,\n _b[FORMATS.LUMINANCE] = gl.LUMINANCE,\n _b[FORMATS.LUMINANCE_ALPHA] = gl.LUMINANCE_ALPHA,\n _b),\n _a[TYPES.BYTE] = (_c = {},\n _c[FORMATS.RGBA] = gl.RGBA8_SNORM,\n _c[FORMATS.RGB] = gl.RGB8_SNORM,\n _c[FORMATS.RG] = gl.RG8_SNORM,\n _c[FORMATS.RED] = gl.R8_SNORM,\n _c[FORMATS.RGBA_INTEGER] = gl.RGBA8I,\n _c[FORMATS.RGB_INTEGER] = gl.RGB8I,\n _c[FORMATS.RG_INTEGER] = gl.RG8I,\n _c[FORMATS.RED_INTEGER] = gl.R8I,\n _c),\n _a[TYPES.UNSIGNED_SHORT] = (_d = {},\n _d[FORMATS.RGBA_INTEGER] = gl.RGBA16UI,\n _d[FORMATS.RGB_INTEGER] = gl.RGB16UI,\n _d[FORMATS.RG_INTEGER] = gl.RG16UI,\n _d[FORMATS.RED_INTEGER] = gl.R16UI,\n _d[FORMATS.DEPTH_COMPONENT] = gl.DEPTH_COMPONENT16,\n _d),\n _a[TYPES.SHORT] = (_e = {},\n _e[FORMATS.RGBA_INTEGER] = gl.RGBA16I,\n _e[FORMATS.RGB_INTEGER] = gl.RGB16I,\n _e[FORMATS.RG_INTEGER] = gl.RG16I,\n _e[FORMATS.RED_INTEGER] = gl.R16I,\n _e),\n _a[TYPES.UNSIGNED_INT] = (_f = {},\n _f[FORMATS.RGBA_INTEGER] = gl.RGBA32UI,\n _f[FORMATS.RGB_INTEGER] = gl.RGB32UI,\n _f[FORMATS.RG_INTEGER] = gl.RG32UI,\n _f[FORMATS.RED_INTEGER] = gl.R32UI,\n _f[FORMATS.DEPTH_COMPONENT] = gl.DEPTH_COMPONENT24,\n _f),\n _a[TYPES.INT] = (_g = {},\n _g[FORMATS.RGBA_INTEGER] = gl.RGBA32I,\n _g[FORMATS.RGB_INTEGER] = gl.RGB32I,\n _g[FORMATS.RG_INTEGER] = gl.RG32I,\n _g[FORMATS.RED_INTEGER] = gl.R32I,\n _g),\n _a[TYPES.FLOAT] = (_h = {},\n _h[FORMATS.RGBA] = gl.RGBA32F,\n _h[FORMATS.RGB] = gl.RGB32F,\n _h[FORMATS.RG] = gl.RG32F,\n _h[FORMATS.RED] = gl.R32F,\n _h[FORMATS.DEPTH_COMPONENT] = gl.DEPTH_COMPONENT32F,\n _h),\n _a[TYPES.HALF_FLOAT] = (_j = {},\n _j[FORMATS.RGBA] = gl.RGBA16F,\n _j[FORMATS.RGB] = gl.RGB16F,\n _j[FORMATS.RG] = gl.RG16F,\n _j[FORMATS.RED] = gl.R16F,\n _j),\n _a[TYPES.UNSIGNED_SHORT_5_6_5] = (_k = {},\n _k[FORMATS.RGB] = gl.RGB565,\n _k),\n _a[TYPES.UNSIGNED_SHORT_4_4_4_4] = (_l = {},\n _l[FORMATS.RGBA] = gl.RGBA4,\n _l),\n _a[TYPES.UNSIGNED_SHORT_5_5_5_1] = (_m = {},\n _m[FORMATS.RGBA] = gl.RGB5_A1,\n _m),\n _a[TYPES.UNSIGNED_INT_2_10_10_10_REV] = (_o = {},\n _o[FORMATS.RGBA] = gl.RGB10_A2,\n _o[FORMATS.RGBA_INTEGER] = gl.RGB10_A2UI,\n _o),\n _a[TYPES.UNSIGNED_INT_10F_11F_11F_REV] = (_p = {},\n _p[FORMATS.RGB] = gl.R11F_G11F_B10F,\n _p),\n _a[TYPES.UNSIGNED_INT_5_9_9_9_REV] = (_q = {},\n _q[FORMATS.RGB] = gl.RGB9_E5,\n _q),\n _a[TYPES.UNSIGNED_INT_24_8] = (_r = {},\n _r[FORMATS.DEPTH_STENCIL] = gl.DEPTH24_STENCIL8,\n _r),\n _a[TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV] = (_s = {},\n _s[FORMATS.DEPTH_STENCIL] = gl.DEPTH32F_STENCIL8,\n _s),\n _a);\n }\n else {\n table = (_t = {},\n _t[TYPES.UNSIGNED_BYTE] = (_u = {},\n _u[FORMATS.RGBA] = gl.RGBA,\n _u[FORMATS.RGB] = gl.RGB,\n _u[FORMATS.ALPHA] = gl.ALPHA,\n _u[FORMATS.LUMINANCE] = gl.LUMINANCE,\n _u[FORMATS.LUMINANCE_ALPHA] = gl.LUMINANCE_ALPHA,\n _u),\n _t[TYPES.UNSIGNED_SHORT_5_6_5] = (_v = {},\n _v[FORMATS.RGB] = gl.RGB,\n _v),\n _t[TYPES.UNSIGNED_SHORT_4_4_4_4] = (_w = {},\n _w[FORMATS.RGBA] = gl.RGBA,\n _w),\n _t[TYPES.UNSIGNED_SHORT_5_5_5_1] = (_x = {},\n _x[FORMATS.RGBA] = gl.RGBA,\n _x),\n _t);\n }\n return table;\n}\n\n/**\n * Internal texture for WebGL context.\n * @memberof PIXI\n */\nvar GLTexture = /** @class */ (function () {\n function GLTexture(texture) {\n this.texture = texture;\n this.width = -1;\n this.height = -1;\n this.dirtyId = -1;\n this.dirtyStyleId = -1;\n this.mipmap = false;\n this.wrapMode = 33071;\n this.type = TYPES.UNSIGNED_BYTE;\n this.internalFormat = FORMATS.RGBA;\n this.samplerType = 0;\n }\n return GLTexture;\n}());\n\n/**\n * System plugin to the renderer to manage textures.\n * @memberof PIXI\n */\nvar TextureSystem = /** @class */ (function () {\n /**\n * @param renderer - The renderer this system works for.\n */\n function TextureSystem(renderer) {\n this.renderer = renderer;\n // TODO set to max textures...\n this.boundTextures = [];\n this.currentLocation = -1;\n this.managedTextures = [];\n this._unknownBoundTextures = false;\n this.unknownTexture = new BaseTexture();\n this.hasIntegerTextures = false;\n }\n /** Sets up the renderer context and necessary buffers. */\n TextureSystem.prototype.contextChange = function () {\n var gl = this.gl = this.renderer.gl;\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n this.webGLVersion = this.renderer.context.webGLVersion;\n this.internalFormats = mapTypeAndFormatToInternalFormat(gl);\n var maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n this.boundTextures.length = maxTextures;\n for (var i = 0; i < maxTextures; i++) {\n this.boundTextures[i] = null;\n }\n // TODO move this.. to a nice make empty textures class..\n this.emptyTextures = {};\n var emptyTexture2D = new GLTexture(gl.createTexture());\n gl.bindTexture(gl.TEXTURE_2D, emptyTexture2D.texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));\n this.emptyTextures[gl.TEXTURE_2D] = emptyTexture2D;\n this.emptyTextures[gl.TEXTURE_CUBE_MAP] = new GLTexture(gl.createTexture());\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, this.emptyTextures[gl.TEXTURE_CUBE_MAP].texture);\n for (var i = 0; i < 6; i++) {\n gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n }\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n for (var i = 0; i < this.boundTextures.length; i++) {\n this.bind(null, i);\n }\n };\n /**\n * Bind a texture to a specific location\n *\n * If you want to unbind something, please use `unbind(texture)` instead of `bind(null, textureLocation)`\n * @param texture - Texture to bind\n * @param [location=0] - Location to bind at\n */\n TextureSystem.prototype.bind = function (texture, location) {\n if (location === void 0) { location = 0; }\n var gl = this.gl;\n texture = texture === null || texture === void 0 ? void 0 : texture.castToBaseTexture();\n // cannot bind partial texture\n // TODO: report a warning\n if (texture && texture.valid && !texture.parentTextureArray) {\n texture.touched = this.renderer.textureGC.count;\n var glTexture = texture._glTextures[this.CONTEXT_UID] || this.initTexture(texture);\n if (this.boundTextures[location] !== texture) {\n if (this.currentLocation !== location) {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n gl.bindTexture(texture.target, glTexture.texture);\n }\n if (glTexture.dirtyId !== texture.dirtyId) {\n if (this.currentLocation !== location) {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n this.updateTexture(texture);\n }\n else if (glTexture.dirtyStyleId !== texture.dirtyStyleId) {\n this.updateTextureStyle(texture);\n }\n this.boundTextures[location] = texture;\n }\n else {\n if (this.currentLocation !== location) {\n this.currentLocation = location;\n gl.activeTexture(gl.TEXTURE0 + location);\n }\n gl.bindTexture(gl.TEXTURE_2D, this.emptyTextures[gl.TEXTURE_2D].texture);\n this.boundTextures[location] = null;\n }\n };\n /** Resets texture location and bound textures Actual `bind(null, i)` calls will be performed at next `unbind()` call */\n TextureSystem.prototype.reset = function () {\n this._unknownBoundTextures = true;\n this.hasIntegerTextures = false;\n this.currentLocation = -1;\n for (var i = 0; i < this.boundTextures.length; i++) {\n this.boundTextures[i] = this.unknownTexture;\n }\n };\n /**\n * Unbind a texture.\n * @param texture - Texture to bind\n */\n TextureSystem.prototype.unbind = function (texture) {\n var _a = this, gl = _a.gl, boundTextures = _a.boundTextures;\n if (this._unknownBoundTextures) {\n this._unknownBoundTextures = false;\n // someone changed webGL state,\n // we have to be sure that our texture does not appear in multi-texture renderer samplers\n for (var i = 0; i < boundTextures.length; i++) {\n if (boundTextures[i] === this.unknownTexture) {\n this.bind(null, i);\n }\n }\n }\n for (var i = 0; i < boundTextures.length; i++) {\n if (boundTextures[i] === texture) {\n if (this.currentLocation !== i) {\n gl.activeTexture(gl.TEXTURE0 + i);\n this.currentLocation = i;\n }\n gl.bindTexture(texture.target, this.emptyTextures[texture.target].texture);\n boundTextures[i] = null;\n }\n }\n };\n /**\n * Ensures that current boundTextures all have FLOAT sampler type,\n * see {@link PIXI.SAMPLER_TYPES} for explanation.\n * @param maxTextures - number of locations to check\n */\n TextureSystem.prototype.ensureSamplerType = function (maxTextures) {\n var _a = this, boundTextures = _a.boundTextures, hasIntegerTextures = _a.hasIntegerTextures, CONTEXT_UID = _a.CONTEXT_UID;\n if (!hasIntegerTextures) {\n return;\n }\n for (var i = maxTextures - 1; i >= 0; --i) {\n var tex = boundTextures[i];\n if (tex) {\n var glTexture = tex._glTextures[CONTEXT_UID];\n if (glTexture.samplerType !== SAMPLER_TYPES.FLOAT) {\n this.renderer.texture.unbind(tex);\n }\n }\n }\n };\n /**\n * Initialize a texture\n * @private\n * @param texture - Texture to initialize\n */\n TextureSystem.prototype.initTexture = function (texture) {\n var glTexture = new GLTexture(this.gl.createTexture());\n // guarantee an update..\n glTexture.dirtyId = -1;\n texture._glTextures[this.CONTEXT_UID] = glTexture;\n this.managedTextures.push(texture);\n texture.on('dispose', this.destroyTexture, this);\n return glTexture;\n };\n TextureSystem.prototype.initTextureType = function (texture, glTexture) {\n var _a, _b;\n glTexture.internalFormat = (_b = (_a = this.internalFormats[texture.type]) === null || _a === void 0 ? void 0 : _a[texture.format]) !== null && _b !== void 0 ? _b : texture.format;\n if (this.webGLVersion === 2 && texture.type === TYPES.HALF_FLOAT) {\n // TYPES.HALF_FLOAT is WebGL1 HALF_FLOAT_OES\n // we have to convert it to WebGL HALF_FLOAT\n glTexture.type = this.gl.HALF_FLOAT;\n }\n else {\n glTexture.type = texture.type;\n }\n };\n /**\n * Update a texture\n * @private\n * @param {PIXI.BaseTexture} texture - Texture to initialize\n */\n TextureSystem.prototype.updateTexture = function (texture) {\n var glTexture = texture._glTextures[this.CONTEXT_UID];\n if (!glTexture) {\n return;\n }\n var renderer = this.renderer;\n this.initTextureType(texture, glTexture);\n if (texture.resource && texture.resource.upload(renderer, texture, glTexture)) {\n // texture is uploaded, dont do anything!\n if (glTexture.samplerType !== SAMPLER_TYPES.FLOAT) {\n this.hasIntegerTextures = true;\n }\n }\n else {\n // default, renderTexture-like logic\n var width = texture.realWidth;\n var height = texture.realHeight;\n var gl = renderer.gl;\n if (glTexture.width !== width\n || glTexture.height !== height\n || glTexture.dirtyId < 0) {\n glTexture.width = width;\n glTexture.height = height;\n gl.texImage2D(texture.target, 0, glTexture.internalFormat, width, height, 0, texture.format, glTexture.type, null);\n }\n }\n // lets only update what changes..\n if (texture.dirtyStyleId !== glTexture.dirtyStyleId) {\n this.updateTextureStyle(texture);\n }\n glTexture.dirtyId = texture.dirtyId;\n };\n /**\n * Deletes the texture from WebGL\n * @private\n * @param texture - the texture to destroy\n * @param [skipRemove=false] - Whether to skip removing the texture from the TextureManager.\n */\n TextureSystem.prototype.destroyTexture = function (texture, skipRemove) {\n var gl = this.gl;\n texture = texture.castToBaseTexture();\n if (texture._glTextures[this.CONTEXT_UID]) {\n this.unbind(texture);\n gl.deleteTexture(texture._glTextures[this.CONTEXT_UID].texture);\n texture.off('dispose', this.destroyTexture, this);\n delete texture._glTextures[this.CONTEXT_UID];\n if (!skipRemove) {\n var i = this.managedTextures.indexOf(texture);\n if (i !== -1) {\n removeItems(this.managedTextures, i, 1);\n }\n }\n }\n };\n /**\n * Update texture style such as mipmap flag\n * @private\n * @param {PIXI.BaseTexture} texture - Texture to update\n */\n TextureSystem.prototype.updateTextureStyle = function (texture) {\n var glTexture = texture._glTextures[this.CONTEXT_UID];\n if (!glTexture) {\n return;\n }\n if ((texture.mipmap === MIPMAP_MODES.POW2 || this.webGLVersion !== 2) && !texture.isPowerOfTwo) {\n glTexture.mipmap = false;\n }\n else {\n glTexture.mipmap = texture.mipmap >= 1;\n }\n if (this.webGLVersion !== 2 && !texture.isPowerOfTwo) {\n glTexture.wrapMode = WRAP_MODES.CLAMP;\n }\n else {\n glTexture.wrapMode = texture.wrapMode;\n }\n if (texture.resource && texture.resource.style(this.renderer, texture, glTexture)) ;\n else {\n this.setStyle(texture, glTexture);\n }\n glTexture.dirtyStyleId = texture.dirtyStyleId;\n };\n /**\n * Set style for texture\n * @private\n * @param texture - Texture to update\n * @param glTexture\n */\n TextureSystem.prototype.setStyle = function (texture, glTexture) {\n var gl = this.gl;\n if (glTexture.mipmap && texture.mipmap !== MIPMAP_MODES.ON_MANUAL) {\n gl.generateMipmap(texture.target);\n }\n gl.texParameteri(texture.target, gl.TEXTURE_WRAP_S, glTexture.wrapMode);\n gl.texParameteri(texture.target, gl.TEXTURE_WRAP_T, glTexture.wrapMode);\n if (glTexture.mipmap) {\n /* eslint-disable max-len */\n gl.texParameteri(texture.target, gl.TEXTURE_MIN_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST);\n /* eslint-disable max-len */\n var anisotropicExt = this.renderer.context.extensions.anisotropicFiltering;\n if (anisotropicExt && texture.anisotropicLevel > 0 && texture.scaleMode === SCALE_MODES.LINEAR) {\n var level = Math.min(texture.anisotropicLevel, gl.getParameter(anisotropicExt.MAX_TEXTURE_MAX_ANISOTROPY_EXT));\n gl.texParameterf(texture.target, anisotropicExt.TEXTURE_MAX_ANISOTROPY_EXT, level);\n }\n }\n else {\n gl.texParameteri(texture.target, gl.TEXTURE_MIN_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR : gl.NEAREST);\n }\n gl.texParameteri(texture.target, gl.TEXTURE_MAG_FILTER, texture.scaleMode === SCALE_MODES.LINEAR ? gl.LINEAR : gl.NEAREST);\n };\n TextureSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n return TextureSystem;\n}());\n\nvar _systems = {\n __proto__: null,\n FilterSystem: FilterSystem,\n BatchSystem: BatchSystem,\n ContextSystem: ContextSystem,\n FramebufferSystem: FramebufferSystem,\n GeometrySystem: GeometrySystem,\n MaskSystem: MaskSystem,\n ScissorSystem: ScissorSystem,\n StencilSystem: StencilSystem,\n ProjectionSystem: ProjectionSystem,\n RenderTextureSystem: RenderTextureSystem,\n ShaderSystem: ShaderSystem,\n StateSystem: StateSystem,\n TextureGCSystem: TextureGCSystem,\n TextureSystem: TextureSystem\n};\n\nvar tempMatrix = new Matrix();\n/**\n * The AbstractRenderer is the base for a PixiJS Renderer. It is extended by the {@link PIXI.CanvasRenderer}\n * and {@link PIXI.Renderer} which can be used for rendering a PixiJS scene.\n * @abstract\n * @class\n * @extends PIXI.utils.EventEmitter\n * @memberof PIXI\n */\nvar AbstractRenderer = /** @class */ (function (_super) {\n __extends(AbstractRenderer, _super);\n /**\n * @param type - The renderer type.\n * @param {PIXI.IRendererOptions} [options] - The optional renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n */\n function AbstractRenderer(type, options) {\n if (type === void 0) { type = RENDERER_TYPE.UNKNOWN; }\n var _this = _super.call(this) || this;\n // Add the default render options\n options = Object.assign({}, settings.RENDER_OPTIONS, options);\n /**\n * The supplied constructor options.\n * @member {object}\n * @readonly\n */\n _this.options = options;\n /**\n * The type of the renderer.\n * @member {number}\n * @default PIXI.RENDERER_TYPE.UNKNOWN\n * @see PIXI.RENDERER_TYPE\n */\n _this.type = type;\n /**\n * Measurements of the screen. (0, 0, screenWidth, screenHeight).\n *\n * Its safe to use as filterArea or hitArea for the whole stage.\n * @member {PIXI.Rectangle}\n */\n _this.screen = new Rectangle(0, 0, options.width, options.height);\n /**\n * The canvas element that everything is drawn to.\n * @member {HTMLCanvasElement}\n */\n _this.view = options.view || settings.ADAPTER.createCanvas();\n /**\n * The resolution / device pixel ratio of the renderer.\n * @member {number}\n * @default PIXI.settings.RESOLUTION\n */\n _this.resolution = options.resolution || settings.RESOLUTION;\n /**\n * Pass-thru setting for the canvas' context `alpha` property. This is typically\n * not something you need to fiddle with. If you want transparency, use `backgroundAlpha`.\n * @member {boolean}\n */\n _this.useContextAlpha = options.useContextAlpha;\n /**\n * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.\n * @member {boolean}\n */\n _this.autoDensity = !!options.autoDensity;\n /**\n * The value of the preserveDrawingBuffer flag affects whether or not the contents of\n * the stencil buffer is retained after rendering.\n * @member {boolean}\n */\n _this.preserveDrawingBuffer = options.preserveDrawingBuffer;\n /**\n * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent PixiJS will use a canvas sized fillRect operation every\n * frame to set the canvas background color. If the scene is transparent PixiJS will use clearRect\n * to clear the canvas every frame. Disable this by setting this to false. For example, if\n * your game has a canvas filling background image you often don't need this set.\n * @member {boolean}\n * @default\n */\n _this.clearBeforeRender = options.clearBeforeRender;\n /**\n * The background color as a number.\n * @member {number}\n * @protected\n */\n _this._backgroundColor = 0x000000;\n /**\n * The background color as an [R, G, B, A] array.\n * @member {number[]}\n * @protected\n */\n _this._backgroundColorRgba = [0, 0, 0, 1];\n /**\n * The background color as a string.\n * @member {string}\n * @protected\n */\n _this._backgroundColorString = '#000000';\n _this.backgroundColor = options.backgroundColor || _this._backgroundColor; // run bg color setter\n _this.backgroundAlpha = options.backgroundAlpha;\n // @deprecated\n if (options.transparent !== undefined) {\n deprecation('6.0.0', 'Option transparent is deprecated, please use backgroundAlpha instead.');\n _this.useContextAlpha = options.transparent;\n _this.backgroundAlpha = options.transparent ? 0 : 1;\n }\n /**\n * The last root object that the renderer tried to render.\n * @member {PIXI.DisplayObject}\n * @protected\n */\n _this._lastObjectRendered = null;\n /**\n * Collection of plugins.\n * @readonly\n * @member {object}\n */\n _this.plugins = {};\n return _this;\n }\n /**\n * Initialize the plugins.\n * @protected\n * @param {object} staticMap - The dictionary of statically saved plugins.\n */\n AbstractRenderer.prototype.initPlugins = function (staticMap) {\n for (var o in staticMap) {\n this.plugins[o] = new (staticMap[o])(this);\n }\n };\n Object.defineProperty(AbstractRenderer.prototype, \"width\", {\n /**\n * Same as view.width, actual number of pixels in the canvas by horizontal.\n * @member {number}\n * @readonly\n * @default 800\n */\n get: function () {\n return this.view.width;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AbstractRenderer.prototype, \"height\", {\n /**\n * Same as view.height, actual number of pixels in the canvas by vertical.\n * @member {number}\n * @readonly\n * @default 600\n */\n get: function () {\n return this.view.height;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Resizes the screen and canvas as close as possible to the specified width and height.\n * Canvas dimensions are multiplied by resolution and rounded to the nearest integers.\n * The new canvas dimensions divided by the resolution become the new screen dimensions.\n * @param desiredScreenWidth - The desired width of the screen.\n * @param desiredScreenHeight - The desired height of the screen.\n */\n AbstractRenderer.prototype.resize = function (desiredScreenWidth, desiredScreenHeight) {\n this.view.width = Math.round(desiredScreenWidth * this.resolution);\n this.view.height = Math.round(desiredScreenHeight * this.resolution);\n var screenWidth = this.view.width / this.resolution;\n var screenHeight = this.view.height / this.resolution;\n this.screen.width = screenWidth;\n this.screen.height = screenHeight;\n if (this.autoDensity) {\n this.view.style.width = screenWidth + \"px\";\n this.view.style.height = screenHeight + \"px\";\n }\n /**\n * Fired after view has been resized.\n * @event PIXI.Renderer#resize\n * @param {number} screenWidth - The new width of the screen.\n * @param {number} screenHeight - The new height of the screen.\n */\n this.emit('resize', screenWidth, screenHeight);\n };\n /**\n * @ignore\n */\n AbstractRenderer.prototype.generateTexture = function (displayObject, options, resolution, region) {\n if (options === void 0) { options = {}; }\n // @deprecated parameters spread, use options instead\n if (typeof options === 'number') {\n deprecation('6.1.0', 'generateTexture options (scaleMode, resolution, region) are now object options.');\n options = { scaleMode: options, resolution: resolution, region: region };\n }\n var manualRegion = options.region, textureOptions = __rest(options, [\"region\"]);\n region = manualRegion || displayObject.getLocalBounds(null, true);\n // minimum texture size is 1x1, 0x0 will throw an error\n if (region.width === 0)\n { region.width = 1; }\n if (region.height === 0)\n { region.height = 1; }\n var renderTexture = RenderTexture.create(__assign({ width: region.width, height: region.height }, textureOptions));\n tempMatrix.tx = -region.x;\n tempMatrix.ty = -region.y;\n this.render(displayObject, {\n renderTexture: renderTexture,\n clear: false,\n transform: tempMatrix,\n skipUpdateTransform: !!displayObject.parent\n });\n return renderTexture;\n };\n /**\n * Removes everything from the renderer and optionally removes the Canvas DOM element.\n * @param [removeView=false] - Removes the Canvas element from the DOM.\n */\n AbstractRenderer.prototype.destroy = function (removeView) {\n for (var o in this.plugins) {\n this.plugins[o].destroy();\n this.plugins[o] = null;\n }\n if (removeView && this.view.parentNode) {\n this.view.parentNode.removeChild(this.view);\n }\n var thisAny = this;\n // null-ing all objects, that's a tradition!\n thisAny.plugins = null;\n thisAny.type = RENDERER_TYPE.UNKNOWN;\n thisAny.view = null;\n thisAny.screen = null;\n thisAny._tempDisplayObjectParent = null;\n thisAny.options = null;\n this._backgroundColorRgba = null;\n this._backgroundColorString = null;\n this._lastObjectRendered = null;\n };\n Object.defineProperty(AbstractRenderer.prototype, \"backgroundColor\", {\n /**\n * The background color to fill if not transparent\n * @member {number}\n */\n get: function () {\n return this._backgroundColor;\n },\n set: function (value) {\n this._backgroundColor = value;\n this._backgroundColorString = hex2string(value);\n hex2rgb(value, this._backgroundColorRgba);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AbstractRenderer.prototype, \"backgroundAlpha\", {\n /**\n * The background color alpha. Setting this to 0 will make the canvas transparent.\n * @member {number}\n */\n get: function () {\n return this._backgroundColorRgba[3];\n },\n set: function (value) {\n this._backgroundColorRgba[3] = value;\n },\n enumerable: false,\n configurable: true\n });\n return AbstractRenderer;\n}(EventEmitter));\n\nvar GLBuffer = /** @class */ (function () {\n function GLBuffer(buffer) {\n this.buffer = buffer || null;\n this.updateID = -1;\n this.byteLength = -1;\n this.refCount = 0;\n }\n return GLBuffer;\n}());\n\n/**\n * System plugin to the renderer to manage buffers.\n *\n * WebGL uses Buffers as a way to store objects to the GPU.\n * This system makes working with them a lot easier.\n *\n * Buffers are used in three main places in WebGL\n * - geometry information\n * - Uniform information (via uniform buffer objects - a WebGL 2 only feature)\n * - Transform feedback information. (WebGL 2 only feature)\n *\n * This system will handle the binding of buffers to the GPU as well as uploading\n * them. With this system, you never need to work directly with GPU buffers, but instead work with\n * the PIXI.Buffer class.\n * @class\n * @memberof PIXI\n */\nvar BufferSystem = /** @class */ (function () {\n /**\n * @param {PIXI.Renderer} renderer - The renderer this System works for.\n */\n function BufferSystem(renderer) {\n this.renderer = renderer;\n this.managedBuffers = {};\n this.boundBufferBases = {};\n }\n /**\n * @ignore\n */\n BufferSystem.prototype.destroy = function () {\n this.renderer = null;\n };\n /** Sets up the renderer context and necessary buffers. */\n BufferSystem.prototype.contextChange = function () {\n this.disposeAll(true);\n this.gl = this.renderer.gl;\n // TODO fill out...\n this.CONTEXT_UID = this.renderer.CONTEXT_UID;\n };\n /**\n * This binds specified buffer. On first run, it will create the webGL buffers for the context too\n * @param buffer - the buffer to bind to the renderer\n */\n BufferSystem.prototype.bind = function (buffer) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n var glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n gl.bindBuffer(buffer.type, glBuffer.buffer);\n };\n /**\n * Binds an uniform buffer to at the given index.\n *\n * A cache is used so a buffer will not be bound again if already bound.\n * @param buffer - the buffer to bind\n * @param index - the base index to bind it to.\n */\n BufferSystem.prototype.bindBufferBase = function (buffer, index) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n if (this.boundBufferBases[index] !== buffer) {\n var glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n this.boundBufferBases[index] = buffer;\n gl.bindBufferBase(gl.UNIFORM_BUFFER, index, glBuffer.buffer);\n }\n };\n /**\n * Binds a buffer whilst also binding its range.\n * This will make the buffer start from the offset supplied rather than 0 when it is read.\n * @param buffer - the buffer to bind\n * @param index - the base index to bind at, defaults to 0\n * @param offset - the offset to bind at (this is blocks of 256). 0 = 0, 1 = 256, 2 = 512 etc\n */\n BufferSystem.prototype.bindBufferRange = function (buffer, index, offset) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n offset = offset || 0;\n var glBuffer = buffer._glBuffers[CONTEXT_UID] || this.createGLBuffer(buffer);\n gl.bindBufferRange(gl.UNIFORM_BUFFER, index || 0, glBuffer.buffer, offset * 256, 256);\n };\n /**\n * Will ensure the data in the buffer is uploaded to the GPU.\n * @param {PIXI.Buffer} buffer - the buffer to update\n */\n BufferSystem.prototype.update = function (buffer) {\n var _a = this, gl = _a.gl, CONTEXT_UID = _a.CONTEXT_UID;\n var glBuffer = buffer._glBuffers[CONTEXT_UID];\n if (buffer._updateID === glBuffer.updateID) {\n return;\n }\n glBuffer.updateID = buffer._updateID;\n gl.bindBuffer(buffer.type, glBuffer.buffer);\n if (glBuffer.byteLength >= buffer.data.byteLength) {\n // offset is always zero for now!\n gl.bufferSubData(buffer.type, 0, buffer.data);\n }\n else {\n var drawType = buffer.static ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW;\n glBuffer.byteLength = buffer.data.byteLength;\n gl.bufferData(buffer.type, buffer.data, drawType);\n }\n };\n /**\n * Disposes buffer\n * @param {PIXI.Buffer} buffer - buffer with data\n * @param {boolean} [contextLost=false] - If context was lost, we suppress deleteVertexArray\n */\n BufferSystem.prototype.dispose = function (buffer, contextLost) {\n if (!this.managedBuffers[buffer.id]) {\n return;\n }\n delete this.managedBuffers[buffer.id];\n var glBuffer = buffer._glBuffers[this.CONTEXT_UID];\n var gl = this.gl;\n buffer.disposeRunner.remove(this);\n if (!glBuffer) {\n return;\n }\n if (!contextLost) {\n gl.deleteBuffer(glBuffer.buffer);\n }\n delete buffer._glBuffers[this.CONTEXT_UID];\n };\n /**\n * dispose all WebGL resources of all managed buffers\n * @param {boolean} [contextLost=false] - If context was lost, we suppress `gl.delete` calls\n */\n BufferSystem.prototype.disposeAll = function (contextLost) {\n var all = Object.keys(this.managedBuffers);\n for (var i = 0; i < all.length; i++) {\n this.dispose(this.managedBuffers[all[i]], contextLost);\n }\n };\n /**\n * creates and attaches a GLBuffer object tied to the current context.\n * @param buffer\n * @protected\n */\n BufferSystem.prototype.createGLBuffer = function (buffer) {\n var _a = this, CONTEXT_UID = _a.CONTEXT_UID, gl = _a.gl;\n buffer._glBuffers[CONTEXT_UID] = new GLBuffer(gl.createBuffer());\n this.managedBuffers[buffer.id] = buffer;\n buffer.disposeRunner.add(this);\n return buffer._glBuffers[CONTEXT_UID];\n };\n return BufferSystem;\n}());\n\n/**\n * The Renderer draws the scene and all its content onto a WebGL enabled canvas.\n *\n * This renderer should be used for browsers that support WebGL.\n *\n * This renderer works by automatically managing WebGLBatchesm, so no need for Sprite Batches or Sprite Clouds.\n * Don't forget to add the view to your DOM or you will not see anything!\n *\n * Renderer is composed of systems that manage specific tasks. The following systems are added by default\n * whenever you create a renderer:\n *\n * | System | Description |\n * | ------------------------------------ | ----------------------------------------------------------------------------- |\n * | {@link PIXI.BatchSystem} | This manages object renderers that defer rendering until a flush. |\n * | {@link PIXI.ContextSystem} | This manages the WebGL context and extensions. |\n * | {@link PIXI.EventSystem} | This manages UI events. |\n * | {@link PIXI.FilterSystem} | This manages the filtering pipeline for post-processing effects. |\n * | {@link PIXI.FramebufferSystem} | This manages framebuffers, which are used for offscreen rendering. |\n * | {@link PIXI.GeometrySystem} | This manages geometries & buffers, which are used to draw object meshes. |\n * | {@link PIXI.MaskSystem} | This manages masking operations. |\n * | {@link PIXI.ProjectionSystem} | This manages the `projectionMatrix`, used by shaders to get NDC coordinates. |\n * | {@link PIXI.RenderTextureSystem} | This manages render-textures, which are an abstraction over framebuffers. |\n * | {@link PIXI.ScissorSystem} | This handles scissor masking, and is used internally by {@link MaskSystem} |\n * | {@link PIXI.ShaderSystem} | This manages shaders, programs that run on the GPU to calculate 'em pixels. |\n * | {@link PIXI.StateSystem} | This manages the WebGL state variables like blend mode, depth testing, etc. |\n * | {@link PIXI.StencilSystem} | This handles stencil masking, and is used internally by {@link MaskSystem} |\n * | {@link PIXI.TextureSystem} | This manages textures and their resources on the GPU. |\n * | {@link PIXI.TextureGCSystem} | This will automatically remove textures from the GPU if they are not used. |\n *\n * The breadth of the API surface provided by the renderer is contained within these systems.\n * @memberof PIXI\n */\nvar Renderer = /** @class */ (function (_super) {\n __extends(Renderer, _super);\n /**\n * @param {PIXI.IRendererOptions} [options] - The optional renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n */\n function Renderer(options) {\n var _this = _super.call(this, RENDERER_TYPE.WEBGL, options) || this;\n // the options will have been modified here in the super constructor with pixi's default settings..\n options = _this.options;\n _this.gl = null;\n _this.CONTEXT_UID = 0;\n _this.runners = {\n destroy: new Runner('destroy'),\n contextChange: new Runner('contextChange'),\n reset: new Runner('reset'),\n update: new Runner('update'),\n postrender: new Runner('postrender'),\n prerender: new Runner('prerender'),\n resize: new Runner('resize'),\n };\n _this.runners.contextChange.add(_this);\n _this.globalUniforms = new UniformGroup({\n projectionMatrix: new Matrix(),\n }, true);\n _this.addSystem(MaskSystem, 'mask')\n .addSystem(ContextSystem, 'context')\n .addSystem(StateSystem, 'state')\n .addSystem(ShaderSystem, 'shader')\n .addSystem(TextureSystem, 'texture')\n .addSystem(BufferSystem, 'buffer')\n .addSystem(GeometrySystem, 'geometry')\n .addSystem(FramebufferSystem, 'framebuffer')\n .addSystem(ScissorSystem, 'scissor')\n .addSystem(StencilSystem, 'stencil')\n .addSystem(ProjectionSystem, 'projection')\n .addSystem(TextureGCSystem, 'textureGC')\n .addSystem(FilterSystem, 'filter')\n .addSystem(RenderTextureSystem, 'renderTexture')\n .addSystem(BatchSystem, 'batch');\n _this.initPlugins(Renderer.__plugins);\n _this.multisample = undefined;\n /*\n * The options passed in to create a new WebGL context.\n */\n if (options.context) {\n _this.context.initFromContext(options.context);\n }\n else {\n _this.context.initFromOptions({\n alpha: !!_this.useContextAlpha,\n antialias: options.antialias,\n premultipliedAlpha: _this.useContextAlpha && _this.useContextAlpha !== 'notMultiplied',\n stencil: true,\n preserveDrawingBuffer: options.preserveDrawingBuffer,\n powerPreference: _this.options.powerPreference,\n });\n }\n _this.renderingToScreen = true;\n sayHello(_this.context.webGLVersion === 2 ? 'WebGL 2' : 'WebGL 1');\n _this.resize(_this.options.width, _this.options.height);\n return _this;\n }\n /**\n * Create renderer if WebGL is available. Overrideable\n * by the **@pixi/canvas-renderer** package to allow fallback.\n * throws error if WebGL is not available.\n * @param options\n * @private\n */\n Renderer.create = function (options) {\n if (isWebGLSupported()) {\n return new Renderer(options);\n }\n throw new Error('WebGL unsupported in this browser, use \"pixi.js-legacy\" for fallback canvas2d support.');\n };\n Renderer.prototype.contextChange = function () {\n var gl = this.gl;\n var samples;\n if (this.context.webGLVersion === 1) {\n var framebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n samples = gl.getParameter(gl.SAMPLES);\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n }\n else {\n var framebuffer = gl.getParameter(gl.DRAW_FRAMEBUFFER_BINDING);\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n samples = gl.getParameter(gl.SAMPLES);\n gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebuffer);\n }\n if (samples >= MSAA_QUALITY.HIGH) {\n this.multisample = MSAA_QUALITY.HIGH;\n }\n else if (samples >= MSAA_QUALITY.MEDIUM) {\n this.multisample = MSAA_QUALITY.MEDIUM;\n }\n else if (samples >= MSAA_QUALITY.LOW) {\n this.multisample = MSAA_QUALITY.LOW;\n }\n else {\n this.multisample = MSAA_QUALITY.NONE;\n }\n };\n /**\n * Add a new system to the renderer.\n * @param ClassRef - Class reference\n * @param name - Property name for system, if not specified\n * will use a static `name` property on the class itself. This\n * name will be assigned as s property on the Renderer so make\n * sure it doesn't collide with properties on Renderer.\n * @returns Return instance of renderer\n */\n Renderer.prototype.addSystem = function (ClassRef, name) {\n var system = new ClassRef(this);\n if (this[name]) {\n throw new Error(\"Whoops! The name \\\"\" + name + \"\\\" is already in use\");\n }\n this[name] = system;\n for (var i in this.runners) {\n this.runners[i].add(system);\n }\n /**\n * Fired after rendering finishes.\n * @event PIXI.Renderer#postrender\n */\n /**\n * Fired before rendering starts.\n * @event PIXI.Renderer#prerender\n */\n /**\n * Fired when the WebGL context is set.\n * @event PIXI.Renderer#context\n * @param {WebGLRenderingContext} gl - WebGL context.\n */\n return this;\n };\n /**\n * @ignore\n */\n Renderer.prototype.render = function (displayObject, options) {\n var renderTexture;\n var clear;\n var transform;\n var skipUpdateTransform;\n if (options) {\n if (options instanceof RenderTexture) {\n deprecation('6.0.0', 'Renderer#render arguments changed, use options instead.');\n /* eslint-disable prefer-rest-params */\n renderTexture = options;\n clear = arguments[2];\n transform = arguments[3];\n skipUpdateTransform = arguments[4];\n /* eslint-enable prefer-rest-params */\n }\n else {\n renderTexture = options.renderTexture;\n clear = options.clear;\n transform = options.transform;\n skipUpdateTransform = options.skipUpdateTransform;\n }\n }\n // can be handy to know!\n this.renderingToScreen = !renderTexture;\n this.runners.prerender.emit();\n this.emit('prerender');\n // apply a transform at a GPU level\n this.projection.transform = transform;\n // no point rendering if our context has been blown up!\n if (this.context.isLost) {\n return;\n }\n if (!renderTexture) {\n this._lastObjectRendered = displayObject;\n }\n if (!skipUpdateTransform) {\n // update the scene graph\n var cacheParent = displayObject.enableTempParent();\n displayObject.updateTransform();\n displayObject.disableTempParent(cacheParent);\n // displayObject.hitArea = //TODO add a temp hit area\n }\n this.renderTexture.bind(renderTexture);\n this.batch.currentRenderer.start();\n if (clear !== undefined ? clear : this.clearBeforeRender) {\n this.renderTexture.clear();\n }\n displayObject.render(this);\n // apply transform..\n this.batch.currentRenderer.flush();\n if (renderTexture) {\n renderTexture.baseTexture.update();\n }\n this.runners.postrender.emit();\n // reset transform after render\n this.projection.transform = null;\n this.emit('postrender');\n };\n /**\n * @override\n * @ignore\n */\n Renderer.prototype.generateTexture = function (displayObject, options, resolution, region) {\n if (options === void 0) { options = {}; }\n var renderTexture = _super.prototype.generateTexture.call(this, displayObject, options, resolution, region);\n this.framebuffer.blit();\n return renderTexture;\n };\n /**\n * Resizes the WebGL view to the specified width and height.\n * @param desiredScreenWidth - The desired width of the screen.\n * @param desiredScreenHeight - The desired height of the screen.\n */\n Renderer.prototype.resize = function (desiredScreenWidth, desiredScreenHeight) {\n _super.prototype.resize.call(this, desiredScreenWidth, desiredScreenHeight);\n this.runners.resize.emit(this.screen.height, this.screen.width);\n };\n /**\n * Resets the WebGL state so you can render things however you fancy!\n * @returns Returns itself.\n */\n Renderer.prototype.reset = function () {\n this.runners.reset.emit();\n return this;\n };\n /** Clear the frame buffer. */\n Renderer.prototype.clear = function () {\n this.renderTexture.bind();\n this.renderTexture.clear();\n };\n /**\n * Removes everything from the renderer (event listeners, spritebatch, etc...)\n * @param [removeView=false] - Removes the Canvas element from the DOM.\n * See: https://github.com/pixijs/pixi.js/issues/2233\n */\n Renderer.prototype.destroy = function (removeView) {\n this.runners.destroy.emit();\n for (var r in this.runners) {\n this.runners[r].destroy();\n }\n // call base destroy\n _super.prototype.destroy.call(this, removeView);\n // TODO nullify all the managers..\n this.gl = null;\n };\n Object.defineProperty(Renderer.prototype, \"extract\", {\n /**\n * Please use `plugins.extract` instead.\n * @member {PIXI.Extract} extract\n * @deprecated since 6.0.0\n * @readonly\n */\n get: function () {\n deprecation('6.0.0', 'Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.');\n return this.plugins.extract;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @param pluginName - The name of the plugin.\n * @param ctor - The constructor function or class for the plugin.\n */\n Renderer.registerPlugin = function (pluginName, ctor) {\n deprecation('6.5.0', 'Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.');\n extensions$1.add({\n name: pluginName,\n type: ExtensionType.RendererPlugin,\n ref: ctor,\n });\n };\n /**\n * Collection of installed plugins. These are included by default in PIXI, but can be excluded\n * by creating a custom build. Consult the README for more information about creating custom\n * builds and excluding plugins.\n * @readonly\n * @property {PIXI.AccessibilityManager} accessibility Support tabbing interactive elements.\n * @property {PIXI.Extract} extract Extract image data from renderer.\n * @property {PIXI.InteractionManager} interaction Handles mouse, touch and pointer events.\n * @property {PIXI.ParticleRenderer} particle Renderer for ParticleContainer objects.\n * @property {PIXI.Prepare} prepare Pre-render display objects.\n * @property {PIXI.BatchRenderer} batch Batching of Sprite, Graphics and Mesh objects.\n * @property {PIXI.TilingSpriteRenderer} tilingSprite Renderer for TilingSprite objects.\n */\n Renderer.__plugins = {};\n return Renderer;\n}(AbstractRenderer));\n// Handle registration of extensions\nextensions$1.handleByMap(ExtensionType.RendererPlugin, Renderer.__plugins);\n\n/**\n * This helper function will automatically detect which renderer you should be using.\n * WebGL is the preferred renderer as it is a lot faster. If WebGL is not supported by\n * the browser then this function will return a canvas renderer.\n * @memberof PIXI\n * @function autoDetectRenderer\n * @param {PIXI.IRendererOptionsAuto} [options] - The optional renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {boolean} [options.forceCanvas=false] -\n * Force using {@link PIXI.CanvasRenderer}, even if WebGL is available. This option only is available when\n * using **pixi.js-legacy** or **@pixi/canvas-renderer** packages, otherwise it is ignored.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n * @returns {PIXI.Renderer|PIXI.CanvasRenderer}\n * Returns {@link PIXI.Renderer} if WebGL is available, otherwise {@link PIXI.CanvasRenderer}.\n */\nfunction autoDetectRenderer(options) {\n return Renderer.create(options);\n}\n\nvar $defaultVertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar $defaultFilterVertex = \"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n gl_Position = filterVertexPosition();\\n vTextureCoord = filterTextureCoord();\\n}\\n\";\n\n/**\n * Default vertex shader\n * @memberof PIXI\n * @member {string} defaultVertex\n */\n/**\n * Default filter vertex shader\n * @memberof PIXI\n * @member {string} defaultFilterVertex\n */\n// NOTE: This black magic is so that @microsoft/api-extractor does not complain! This explicitly specifies the types\n// of defaultVertex, defaultFilterVertex.\nvar defaultVertex$1 = $defaultVertex;\nvar defaultFilterVertex = $defaultFilterVertex;\n\n/**\n * Use the ISystem interface instead.\n * @deprecated since 6.1.0\n * @memberof PIXI\n */\nvar System = /** @class */ (function () {\n /**\n * @param renderer - Reference to Renderer\n */\n function System(renderer) {\n deprecation('6.1.0', 'System class is deprecated, implemement ISystem interface instead.');\n this.renderer = renderer;\n }\n /** Destroy and don't use after this. */\n System.prototype.destroy = function () {\n this.renderer = null;\n };\n return System;\n}());\n\n/**\n * Used by the batcher to draw batches.\n * Each one of these contains all information required to draw a bound geometry.\n * @memberof PIXI\n */\nvar BatchDrawCall = /** @class */ (function () {\n function BatchDrawCall() {\n this.texArray = null;\n this.blend = 0;\n this.type = DRAW_MODES.TRIANGLES;\n this.start = 0;\n this.size = 0;\n this.data = null;\n }\n return BatchDrawCall;\n}());\n\n/**\n * Used by the batcher to build texture batches.\n * Holds list of textures and their respective locations.\n * @memberof PIXI\n */\nvar BatchTextureArray = /** @class */ (function () {\n function BatchTextureArray() {\n this.elements = [];\n this.ids = [];\n this.count = 0;\n }\n BatchTextureArray.prototype.clear = function () {\n for (var i = 0; i < this.count; i++) {\n this.elements[i] = null;\n }\n this.count = 0;\n };\n return BatchTextureArray;\n}());\n\n/**\n * Flexible wrapper around `ArrayBuffer` that also provides typed array views on demand.\n * @memberof PIXI\n */\nvar ViewableBuffer = /** @class */ (function () {\n function ViewableBuffer(sizeOrBuffer) {\n if (typeof sizeOrBuffer === 'number') {\n this.rawBinaryData = new ArrayBuffer(sizeOrBuffer);\n }\n else if (sizeOrBuffer instanceof Uint8Array) {\n this.rawBinaryData = sizeOrBuffer.buffer;\n }\n else {\n this.rawBinaryData = sizeOrBuffer;\n }\n this.uint32View = new Uint32Array(this.rawBinaryData);\n this.float32View = new Float32Array(this.rawBinaryData);\n }\n Object.defineProperty(ViewableBuffer.prototype, \"int8View\", {\n /** View on the raw binary data as a `Int8Array`. */\n get: function () {\n if (!this._int8View) {\n this._int8View = new Int8Array(this.rawBinaryData);\n }\n return this._int8View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"uint8View\", {\n /** View on the raw binary data as a `Uint8Array`. */\n get: function () {\n if (!this._uint8View) {\n this._uint8View = new Uint8Array(this.rawBinaryData);\n }\n return this._uint8View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"int16View\", {\n /** View on the raw binary data as a `Int16Array`. */\n get: function () {\n if (!this._int16View) {\n this._int16View = new Int16Array(this.rawBinaryData);\n }\n return this._int16View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"uint16View\", {\n /** View on the raw binary data as a `Uint16Array`. */\n get: function () {\n if (!this._uint16View) {\n this._uint16View = new Uint16Array(this.rawBinaryData);\n }\n return this._uint16View;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ViewableBuffer.prototype, \"int32View\", {\n /** View on the raw binary data as a `Int32Array`. */\n get: function () {\n if (!this._int32View) {\n this._int32View = new Int32Array(this.rawBinaryData);\n }\n return this._int32View;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns the view of the given type.\n * @param type - One of `int8`, `uint8`, `int16`,\n * `uint16`, `int32`, `uint32`, and `float32`.\n * @returns - typed array of given type\n */\n ViewableBuffer.prototype.view = function (type) {\n return this[type + \"View\"];\n };\n /** Destroys all buffer references. Do not use after calling this. */\n ViewableBuffer.prototype.destroy = function () {\n this.rawBinaryData = null;\n this._int8View = null;\n this._uint8View = null;\n this._int16View = null;\n this._uint16View = null;\n this._int32View = null;\n this.uint32View = null;\n this.float32View = null;\n };\n ViewableBuffer.sizeOf = function (type) {\n switch (type) {\n case 'int8':\n case 'uint8':\n return 1;\n case 'int16':\n case 'uint16':\n return 2;\n case 'int32':\n case 'uint32':\n case 'float32':\n return 4;\n default:\n throw new Error(type + \" isn't a valid view type\");\n }\n };\n return ViewableBuffer;\n}());\n\n/**\n * Renderer dedicated to drawing and batching sprites.\n *\n * This is the default batch renderer. It buffers objects\n * with texture-based geometries and renders them in\n * batches. It uploads multiple textures to the GPU to\n * reduce to the number of draw calls.\n * @memberof PIXI\n */\nvar AbstractBatchRenderer = /** @class */ (function (_super) {\n __extends(AbstractBatchRenderer, _super);\n /**\n * This will hook onto the renderer's `contextChange`\n * and `prerender` signals.\n * @param {PIXI.Renderer} renderer - The renderer this works for.\n */\n function AbstractBatchRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.shaderGenerator = null;\n _this.geometryClass = null;\n _this.vertexSize = null;\n _this.state = State.for2d();\n _this.size = settings.SPRITE_BATCH_SIZE * 4;\n _this._vertexCount = 0;\n _this._indexCount = 0;\n _this._bufferedElements = [];\n _this._bufferedTextures = [];\n _this._bufferSize = 0;\n _this._shader = null;\n _this._packedGeometries = [];\n _this._packedGeometryPoolSize = 2;\n _this._flushId = 0;\n _this._aBuffers = {};\n _this._iBuffers = {};\n _this.MAX_TEXTURES = 1;\n _this.renderer.on('prerender', _this.onPrerender, _this);\n renderer.runners.contextChange.add(_this);\n _this._dcIndex = 0;\n _this._aIndex = 0;\n _this._iIndex = 0;\n _this._attributeBuffer = null;\n _this._indexBuffer = null;\n _this._tempBoundTextures = [];\n return _this;\n }\n /**\n * Handles the `contextChange` signal.\n *\n * It calculates `this.MAX_TEXTURES` and allocating the packed-geometry object pool.\n */\n AbstractBatchRenderer.prototype.contextChange = function () {\n var gl = this.renderer.gl;\n if (settings.PREFER_ENV === ENV.WEBGL_LEGACY) {\n this.MAX_TEXTURES = 1;\n }\n else {\n // step 1: first check max textures the GPU can handle.\n this.MAX_TEXTURES = Math.min(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), settings.SPRITE_MAX_TEXTURES);\n // step 2: check the maximum number of if statements the shader can have too..\n this.MAX_TEXTURES = checkMaxIfStatementsInShader(this.MAX_TEXTURES, gl);\n }\n this._shader = this.shaderGenerator.generateShader(this.MAX_TEXTURES);\n // we use the second shader as the first one depending on your browser\n // may omit aTextureId as it is not used by the shader so is optimized out.\n for (var i = 0; i < this._packedGeometryPoolSize; i++) {\n /* eslint-disable max-len */\n this._packedGeometries[i] = new (this.geometryClass)();\n }\n this.initFlushBuffers();\n };\n /** Makes sure that static and dynamic flush pooled objects have correct dimensions. */\n AbstractBatchRenderer.prototype.initFlushBuffers = function () {\n var _drawCallPool = AbstractBatchRenderer._drawCallPool, _textureArrayPool = AbstractBatchRenderer._textureArrayPool;\n // max draw calls\n var MAX_SPRITES = this.size / 4;\n // max texture arrays\n var MAX_TA = Math.floor(MAX_SPRITES / this.MAX_TEXTURES) + 1;\n while (_drawCallPool.length < MAX_SPRITES) {\n _drawCallPool.push(new BatchDrawCall());\n }\n while (_textureArrayPool.length < MAX_TA) {\n _textureArrayPool.push(new BatchTextureArray());\n }\n for (var i = 0; i < this.MAX_TEXTURES; i++) {\n this._tempBoundTextures[i] = null;\n }\n };\n /** Handles the `prerender` signal. It ensures that flushes start from the first geometry object again. */\n AbstractBatchRenderer.prototype.onPrerender = function () {\n this._flushId = 0;\n };\n /**\n * Buffers the \"batchable\" object. It need not be rendered immediately.\n * @param {PIXI.DisplayObject} element - the element to render when\n * using this renderer\n */\n AbstractBatchRenderer.prototype.render = function (element) {\n if (!element._texture.valid) {\n return;\n }\n if (this._vertexCount + (element.vertexData.length / 2) > this.size) {\n this.flush();\n }\n this._vertexCount += element.vertexData.length / 2;\n this._indexCount += element.indices.length;\n this._bufferedTextures[this._bufferSize] = element._texture.baseTexture;\n this._bufferedElements[this._bufferSize++] = element;\n };\n AbstractBatchRenderer.prototype.buildTexturesAndDrawCalls = function () {\n var _a = this, textures = _a._bufferedTextures, MAX_TEXTURES = _a.MAX_TEXTURES;\n var textureArrays = AbstractBatchRenderer._textureArrayPool;\n var batch = this.renderer.batch;\n var boundTextures = this._tempBoundTextures;\n var touch = this.renderer.textureGC.count;\n var TICK = ++BaseTexture._globalBatch;\n var countTexArrays = 0;\n var texArray = textureArrays[0];\n var start = 0;\n batch.copyBoundTextures(boundTextures, MAX_TEXTURES);\n for (var i = 0; i < this._bufferSize; ++i) {\n var tex = textures[i];\n textures[i] = null;\n if (tex._batchEnabled === TICK) {\n continue;\n }\n if (texArray.count >= MAX_TEXTURES) {\n batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES);\n this.buildDrawCalls(texArray, start, i);\n start = i;\n texArray = textureArrays[++countTexArrays];\n ++TICK;\n }\n tex._batchEnabled = TICK;\n tex.touched = touch;\n texArray.elements[texArray.count++] = tex;\n }\n if (texArray.count > 0) {\n batch.boundArray(texArray, boundTextures, TICK, MAX_TEXTURES);\n this.buildDrawCalls(texArray, start, this._bufferSize);\n ++countTexArrays;\n ++TICK;\n }\n // Clean-up\n for (var i = 0; i < boundTextures.length; i++) {\n boundTextures[i] = null;\n }\n BaseTexture._globalBatch = TICK;\n };\n /**\n * Populating drawcalls for rendering\n * @param texArray\n * @param start\n * @param finish\n */\n AbstractBatchRenderer.prototype.buildDrawCalls = function (texArray, start, finish) {\n var _a = this, elements = _a._bufferedElements, _attributeBuffer = _a._attributeBuffer, _indexBuffer = _a._indexBuffer, vertexSize = _a.vertexSize;\n var drawCalls = AbstractBatchRenderer._drawCallPool;\n var dcIndex = this._dcIndex;\n var aIndex = this._aIndex;\n var iIndex = this._iIndex;\n var drawCall = drawCalls[dcIndex];\n drawCall.start = this._iIndex;\n drawCall.texArray = texArray;\n for (var i = start; i < finish; ++i) {\n var sprite = elements[i];\n var tex = sprite._texture.baseTexture;\n var spriteBlendMode = premultiplyBlendMode[tex.alphaMode ? 1 : 0][sprite.blendMode];\n elements[i] = null;\n if (start < i && drawCall.blend !== spriteBlendMode) {\n drawCall.size = iIndex - drawCall.start;\n start = i;\n drawCall = drawCalls[++dcIndex];\n drawCall.texArray = texArray;\n drawCall.start = iIndex;\n }\n this.packInterleavedGeometry(sprite, _attributeBuffer, _indexBuffer, aIndex, iIndex);\n aIndex += sprite.vertexData.length / 2 * vertexSize;\n iIndex += sprite.indices.length;\n drawCall.blend = spriteBlendMode;\n }\n if (start < finish) {\n drawCall.size = iIndex - drawCall.start;\n ++dcIndex;\n }\n this._dcIndex = dcIndex;\n this._aIndex = aIndex;\n this._iIndex = iIndex;\n };\n /**\n * Bind textures for current rendering\n * @param texArray\n */\n AbstractBatchRenderer.prototype.bindAndClearTexArray = function (texArray) {\n var textureSystem = this.renderer.texture;\n for (var j = 0; j < texArray.count; j++) {\n textureSystem.bind(texArray.elements[j], texArray.ids[j]);\n texArray.elements[j] = null;\n }\n texArray.count = 0;\n };\n AbstractBatchRenderer.prototype.updateGeometry = function () {\n var _a = this, packedGeometries = _a._packedGeometries, attributeBuffer = _a._attributeBuffer, indexBuffer = _a._indexBuffer;\n if (!settings.CAN_UPLOAD_SAME_BUFFER) { /* Usually on iOS devices, where the browser doesn't\n like uploads to the same buffer in a single frame. */\n if (this._packedGeometryPoolSize <= this._flushId) {\n this._packedGeometryPoolSize++;\n packedGeometries[this._flushId] = new (this.geometryClass)();\n }\n packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData);\n packedGeometries[this._flushId]._indexBuffer.update(indexBuffer);\n this.renderer.geometry.bind(packedGeometries[this._flushId]);\n this.renderer.geometry.updateBuffers();\n this._flushId++;\n }\n else {\n // lets use the faster option, always use buffer number 0\n packedGeometries[this._flushId]._buffer.update(attributeBuffer.rawBinaryData);\n packedGeometries[this._flushId]._indexBuffer.update(indexBuffer);\n this.renderer.geometry.updateBuffers();\n }\n };\n AbstractBatchRenderer.prototype.drawBatches = function () {\n var dcCount = this._dcIndex;\n var _a = this.renderer, gl = _a.gl, stateSystem = _a.state;\n var drawCalls = AbstractBatchRenderer._drawCallPool;\n var curTexArray = null;\n // Upload textures and do the draw calls\n for (var i = 0; i < dcCount; i++) {\n var _b = drawCalls[i], texArray = _b.texArray, type = _b.type, size = _b.size, start = _b.start, blend = _b.blend;\n if (curTexArray !== texArray) {\n curTexArray = texArray;\n this.bindAndClearTexArray(texArray);\n }\n this.state.blendMode = blend;\n stateSystem.set(this.state);\n gl.drawElements(type, size, gl.UNSIGNED_SHORT, start * 2);\n }\n };\n /** Renders the content _now_ and empties the current batch. */\n AbstractBatchRenderer.prototype.flush = function () {\n if (this._vertexCount === 0) {\n return;\n }\n this._attributeBuffer = this.getAttributeBuffer(this._vertexCount);\n this._indexBuffer = this.getIndexBuffer(this._indexCount);\n this._aIndex = 0;\n this._iIndex = 0;\n this._dcIndex = 0;\n this.buildTexturesAndDrawCalls();\n this.updateGeometry();\n this.drawBatches();\n // reset elements buffer for the next flush\n this._bufferSize = 0;\n this._vertexCount = 0;\n this._indexCount = 0;\n };\n /** Starts a new sprite batch. */\n AbstractBatchRenderer.prototype.start = function () {\n this.renderer.state.set(this.state);\n this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES);\n this.renderer.shader.bind(this._shader);\n if (settings.CAN_UPLOAD_SAME_BUFFER) {\n // bind buffer #0, we don't need others\n this.renderer.geometry.bind(this._packedGeometries[this._flushId]);\n }\n };\n /** Stops and flushes the current batch. */\n AbstractBatchRenderer.prototype.stop = function () {\n this.flush();\n };\n /** Destroys this `AbstractBatchRenderer`. It cannot be used again. */\n AbstractBatchRenderer.prototype.destroy = function () {\n for (var i = 0; i < this._packedGeometryPoolSize; i++) {\n if (this._packedGeometries[i]) {\n this._packedGeometries[i].destroy();\n }\n }\n this.renderer.off('prerender', this.onPrerender, this);\n this._aBuffers = null;\n this._iBuffers = null;\n this._packedGeometries = null;\n this._attributeBuffer = null;\n this._indexBuffer = null;\n if (this._shader) {\n this._shader.destroy();\n this._shader = null;\n }\n _super.prototype.destroy.call(this);\n };\n /**\n * Fetches an attribute buffer from `this._aBuffers` that can hold atleast `size` floats.\n * @param size - minimum capacity required\n * @returns - buffer than can hold atleast `size` floats\n */\n AbstractBatchRenderer.prototype.getAttributeBuffer = function (size) {\n // 8 vertices is enough for 2 quads\n var roundedP2 = nextPow2(Math.ceil(size / 8));\n var roundedSizeIndex = log2(roundedP2);\n var roundedSize = roundedP2 * 8;\n if (this._aBuffers.length <= roundedSizeIndex) {\n this._iBuffers.length = roundedSizeIndex + 1;\n }\n var buffer = this._aBuffers[roundedSize];\n if (!buffer) {\n this._aBuffers[roundedSize] = buffer = new ViewableBuffer(roundedSize * this.vertexSize * 4);\n }\n return buffer;\n };\n /**\n * Fetches an index buffer from `this._iBuffers` that can\n * have at least `size` capacity.\n * @param size - minimum required capacity\n * @returns - buffer that can fit `size` indices.\n */\n AbstractBatchRenderer.prototype.getIndexBuffer = function (size) {\n // 12 indices is enough for 2 quads\n var roundedP2 = nextPow2(Math.ceil(size / 12));\n var roundedSizeIndex = log2(roundedP2);\n var roundedSize = roundedP2 * 12;\n if (this._iBuffers.length <= roundedSizeIndex) {\n this._iBuffers.length = roundedSizeIndex + 1;\n }\n var buffer = this._iBuffers[roundedSizeIndex];\n if (!buffer) {\n this._iBuffers[roundedSizeIndex] = buffer = new Uint16Array(roundedSize);\n }\n return buffer;\n };\n /**\n * Takes the four batching parameters of `element`, interleaves\n * and pushes them into the batching attribute/index buffers given.\n *\n * It uses these properties: `vertexData` `uvs`, `textureId` and\n * `indicies`. It also uses the \"tint\" of the base-texture, if\n * present.\n * @param {PIXI.DisplayObject} element - element being rendered\n * @param attributeBuffer - attribute buffer.\n * @param indexBuffer - index buffer\n * @param aIndex - number of floats already in the attribute buffer\n * @param iIndex - number of indices already in `indexBuffer`\n */\n AbstractBatchRenderer.prototype.packInterleavedGeometry = function (element, attributeBuffer, indexBuffer, aIndex, iIndex) {\n var uint32View = attributeBuffer.uint32View, float32View = attributeBuffer.float32View;\n var packedVertices = aIndex / this.vertexSize;\n var uvs = element.uvs;\n var indicies = element.indices;\n var vertexData = element.vertexData;\n var textureId = element._texture.baseTexture._batchLocation;\n var alpha = Math.min(element.worldAlpha, 1.0);\n var argb = (alpha < 1.0\n && element._texture.baseTexture.alphaMode)\n ? premultiplyTint(element._tintRGB, alpha)\n : element._tintRGB + (alpha * 255 << 24);\n // lets not worry about tint! for now..\n for (var i = 0; i < vertexData.length; i += 2) {\n float32View[aIndex++] = vertexData[i];\n float32View[aIndex++] = vertexData[i + 1];\n float32View[aIndex++] = uvs[i];\n float32View[aIndex++] = uvs[i + 1];\n uint32View[aIndex++] = argb;\n float32View[aIndex++] = textureId;\n }\n for (var i = 0; i < indicies.length; i++) {\n indexBuffer[iIndex++] = packedVertices + indicies[i];\n }\n };\n /**\n * Pool of `BatchDrawCall` objects that `flush` used\n * to create \"batches\" of the objects being rendered.\n *\n * These are never re-allocated again.\n * Shared between all batch renderers because it can be only one \"flush\" working at the moment.\n * @member {PIXI.BatchDrawCall[]}\n */\n AbstractBatchRenderer._drawCallPool = [];\n /**\n * Pool of `BatchDrawCall` objects that `flush` used\n * to create \"batches\" of the objects being rendered.\n *\n * These are never re-allocated again.\n * Shared between all batch renderers because it can be only one \"flush\" working at the moment.\n * @member {PIXI.BatchTextureArray[]}\n */\n AbstractBatchRenderer._textureArrayPool = [];\n return AbstractBatchRenderer;\n}(ObjectRenderer));\n\n/**\n * Helper that generates batching multi-texture shader. Use it with your new BatchRenderer\n * @memberof PIXI\n */\nvar BatchShaderGenerator = /** @class */ (function () {\n /**\n * @param vertexSrc - Vertex shader\n * @param fragTemplate - Fragment shader template\n */\n function BatchShaderGenerator(vertexSrc, fragTemplate) {\n this.vertexSrc = vertexSrc;\n this.fragTemplate = fragTemplate;\n this.programCache = {};\n this.defaultGroupCache = {};\n if (fragTemplate.indexOf('%count%') < 0) {\n throw new Error('Fragment template must contain \"%count%\".');\n }\n if (fragTemplate.indexOf('%forloop%') < 0) {\n throw new Error('Fragment template must contain \"%forloop%\".');\n }\n }\n BatchShaderGenerator.prototype.generateShader = function (maxTextures) {\n if (!this.programCache[maxTextures]) {\n var sampleValues = new Int32Array(maxTextures);\n for (var i = 0; i < maxTextures; i++) {\n sampleValues[i] = i;\n }\n this.defaultGroupCache[maxTextures] = UniformGroup.from({ uSamplers: sampleValues }, true);\n var fragmentSrc = this.fragTemplate;\n fragmentSrc = fragmentSrc.replace(/%count%/gi, \"\" + maxTextures);\n fragmentSrc = fragmentSrc.replace(/%forloop%/gi, this.generateSampleSrc(maxTextures));\n this.programCache[maxTextures] = new Program(this.vertexSrc, fragmentSrc);\n }\n var uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: this.defaultGroupCache[maxTextures],\n };\n return new Shader(this.programCache[maxTextures], uniforms);\n };\n BatchShaderGenerator.prototype.generateSampleSrc = function (maxTextures) {\n var src = '';\n src += '\\n';\n src += '\\n';\n for (var i = 0; i < maxTextures; i++) {\n if (i > 0) {\n src += '\\nelse ';\n }\n if (i < maxTextures - 1) {\n src += \"if(vTextureId < \" + i + \".5)\";\n }\n src += '\\n{';\n src += \"\\n\\tcolor = texture2D(uSamplers[\" + i + \"], vTextureCoord);\";\n src += '\\n}';\n }\n src += '\\n';\n src += '\\n';\n return src;\n };\n return BatchShaderGenerator;\n}());\n\n/**\n * Geometry used to batch standard PIXI content (e.g. Mesh, Sprite, Graphics objects).\n * @memberof PIXI\n */\nvar BatchGeometry = /** @class */ (function (_super) {\n __extends(BatchGeometry, _super);\n /**\n * @param {boolean} [_static=false] - Optimization flag, where `false`\n * is updated every frame, `true` doesn't change frame-to-frame.\n */\n function BatchGeometry(_static) {\n if (_static === void 0) { _static = false; }\n var _this = _super.call(this) || this;\n _this._buffer = new Buffer(null, _static, false);\n _this._indexBuffer = new Buffer(null, _static, true);\n _this.addAttribute('aVertexPosition', _this._buffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', _this._buffer, 2, false, TYPES.FLOAT)\n .addAttribute('aColor', _this._buffer, 4, true, TYPES.UNSIGNED_BYTE)\n .addAttribute('aTextureId', _this._buffer, 1, true, TYPES.FLOAT)\n .addIndex(_this._indexBuffer);\n return _this;\n }\n return BatchGeometry;\n}(Geometry));\n\nvar defaultVertex = \"precision highp float;\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\nattribute vec4 aColor;\\nattribute float aTextureId;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform vec4 tint;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\nvarying float vTextureId;\\n\\nvoid main(void){\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vTextureId = aTextureId;\\n vColor = aColor * tint;\\n}\\n\";\n\nvar defaultFragment = \"varying vec2 vTextureCoord;\\nvarying vec4 vColor;\\nvarying float vTextureId;\\nuniform sampler2D uSamplers[%count%];\\n\\nvoid main(void){\\n vec4 color;\\n %forloop%\\n gl_FragColor = color * vColor;\\n}\\n\";\n\n/** @memberof PIXI */\nvar BatchPluginFactory = /** @class */ (function () {\n function BatchPluginFactory() {\n }\n /**\n * Create a new BatchRenderer plugin for Renderer. this convenience can provide an easy way\n * to extend BatchRenderer with all the necessary pieces.\n * @example\n * const fragment = `\n * varying vec2 vTextureCoord;\n * varying vec4 vColor;\n * varying float vTextureId;\n * uniform sampler2D uSamplers[%count%];\n *\n * void main(void){\n * vec4 color;\n * %forloop%\n * gl_FragColor = vColor * vec4(color.a - color.rgb, color.a);\n * }\n * `;\n * const InvertBatchRenderer = PIXI.BatchPluginFactory.create({ fragment });\n * PIXI.extensions.add({\n * name: 'invert',\n * ref: InvertBatchRenderer,\n * type: PIXI.ExtensionType.RendererPlugin,\n * });\n * const sprite = new PIXI.Sprite();\n * sprite.pluginName = 'invert';\n * @param {object} [options]\n * @param {string} [options.vertex=PIXI.BatchPluginFactory.defaultVertexSrc] - Vertex shader source\n * @param {string} [options.fragment=PIXI.BatchPluginFactory.defaultFragmentTemplate] - Fragment shader template\n * @param {number} [options.vertexSize=6] - Vertex size\n * @param {object} [options.geometryClass=PIXI.BatchGeometry]\n * @returns {*} New batch renderer plugin\n */\n BatchPluginFactory.create = function (options) {\n var _a = Object.assign({\n vertex: defaultVertex,\n fragment: defaultFragment,\n geometryClass: BatchGeometry,\n vertexSize: 6,\n }, options), vertex = _a.vertex, fragment = _a.fragment, vertexSize = _a.vertexSize, geometryClass = _a.geometryClass;\n return /** @class */ (function (_super) {\n __extends(BatchPlugin, _super);\n function BatchPlugin(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.shaderGenerator = new BatchShaderGenerator(vertex, fragment);\n _this.geometryClass = geometryClass;\n _this.vertexSize = vertexSize;\n return _this;\n }\n return BatchPlugin;\n }(AbstractBatchRenderer));\n };\n Object.defineProperty(BatchPluginFactory, \"defaultVertexSrc\", {\n /**\n * The default vertex shader source\n * @readonly\n */\n get: function () {\n return defaultVertex;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BatchPluginFactory, \"defaultFragmentTemplate\", {\n /**\n * The default fragment shader source\n * @readonly\n */\n get: function () {\n return defaultFragment;\n },\n enumerable: false,\n configurable: true\n });\n return BatchPluginFactory;\n}());\n// Setup the default BatchRenderer plugin, this is what\n// we'll actually export at the root level\nvar BatchRenderer = BatchPluginFactory.create();\nObject.assign(BatchRenderer, {\n extension: {\n name: 'batch',\n type: ExtensionType.RendererPlugin,\n },\n});\n\n/**\n * @memberof PIXI\n * @namespace resources\n * @see PIXI\n * @deprecated since 6.0.0\n */\nvar resources = {};\nvar _loop_1 = function (name) {\n Object.defineProperty(resources, name, {\n get: function () {\n deprecation('6.0.0', \"PIXI.systems.\" + name + \" has moved to PIXI.\" + name);\n return _resources[name];\n },\n });\n};\nfor (var name in _resources) {\n _loop_1(name);\n}\n/**\n * @memberof PIXI\n * @namespace systems\n * @see PIXI\n * @deprecated since 6.0.0\n */\nvar systems = {};\nvar _loop_2 = function (name) {\n Object.defineProperty(systems, name, {\n get: function () {\n deprecation('6.0.0', \"PIXI.resources.\" + name + \" has moved to PIXI.\" + name);\n return _systems[name];\n },\n });\n};\nfor (var name in _systems) {\n _loop_2(name);\n}\n\n/**\n * @namespace PIXI\n */\n/**\n * String of the current PIXI version.\n * @memberof PIXI\n */\nvar VERSION = '6.5.10';\n\nexport { AbstractBatchRenderer, AbstractMultiResource, AbstractRenderer, ArrayResource, Attribute, BaseImageResource, BaseRenderTexture, BaseTexture, BatchDrawCall, BatchGeometry, BatchPluginFactory, BatchRenderer, BatchShaderGenerator, BatchSystem, BatchTextureArray, Buffer, BufferResource, CanvasResource, ContextSystem, CubeResource, Filter, FilterState, FilterSystem, Framebuffer, FramebufferSystem, GLFramebuffer, GLProgram, GLTexture, Geometry, GeometrySystem, IGLUniformData, INSTALLED, ImageBitmapResource, ImageResource, MaskData, MaskSystem, ObjectRenderer, Program, ProjectionSystem, Quad, QuadUv, RenderTexture, RenderTexturePool, RenderTextureSystem, Renderer, Resource, SVGResource, ScissorSystem, Shader, ShaderSystem, SpriteMaskFilter, State, StateSystem, StencilSystem, System, Texture, TextureGCSystem, TextureMatrix, TextureSystem, TextureUvs, UniformGroup, VERSION, VideoResource, ViewableBuffer, autoDetectRenderer, autoDetectResource, checkMaxIfStatementsInShader, createUBOElements, defaultFilterVertex, defaultVertex$1 as defaultVertex, generateProgram, generateUniformBufferSync, getTestContext, getUBOData, resources, systems, uniformParsers };\n//# sourceMappingURL=core.mjs.map\n","/*!\n * @pixi/accessibility - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/accessibility is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { isMobile, removeItems } from '@pixi/utils';\nimport { ExtensionType } from '@pixi/core';\n\n/**\n * Default property values of accessible objects\n * used by {@link PIXI.AccessibilityManager}.\n * @private\n * @function accessibleTarget\n * @memberof PIXI\n * @type {object}\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * MyObject.prototype,\n * PIXI.accessibleTarget\n * );\n */\nvar accessibleTarget = {\n /**\n * Flag for if the object is accessible. If true AccessibilityManager will overlay a\n * shadow div with attributes set\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n accessible: false,\n /**\n * Sets the title attribute of the shadow div\n * If accessibleTitle AND accessibleHint has not been this will default to 'displayObject [tabIndex]'\n * @member {?string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleTitle: null,\n /**\n * Sets the aria-label attribute of the shadow div\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n accessibleHint: null,\n /**\n * @member {number}\n * @memberof PIXI.DisplayObject#\n * @private\n * @todo Needs docs.\n */\n tabIndex: 0,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleActive: false,\n /**\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @todo Needs docs.\n */\n _accessibleDiv: null,\n /**\n * Specify the type of div the accessible layer is. Screen readers treat the element differently\n * depending on this type. Defaults to button.\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'button'\n */\n accessibleType: 'button',\n /**\n * Specify the pointer-events the accessible div will use\n * Defaults to auto.\n * @member {string}\n * @memberof PIXI.DisplayObject#\n * @default 'auto'\n */\n accessiblePointerEvents: 'auto',\n /**\n * Setting to false will prevent any children inside this container to\n * be accessible. Defaults to true.\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n * @default true\n */\n accessibleChildren: true,\n renderId: -1,\n};\n\n// add some extra variables to the container..\nDisplayObject.mixin(accessibleTarget);\nvar KEY_CODE_TAB = 9;\nvar DIV_TOUCH_SIZE = 100;\nvar DIV_TOUCH_POS_X = 0;\nvar DIV_TOUCH_POS_Y = 0;\nvar DIV_TOUCH_ZINDEX = 2;\nvar DIV_HOOK_SIZE = 1;\nvar DIV_HOOK_POS_X = -1000;\nvar DIV_HOOK_POS_Y = -1000;\nvar DIV_HOOK_ZINDEX = 2;\n/**\n * The Accessibility manager recreates the ability to tab and have content read by screen readers.\n * This is very important as it can possibly help people with disabilities access PixiJS content.\n *\n * A DisplayObject can be made accessible just like it can be made interactive. This manager will map the\n * events as if the mouse was being used, minimizing the effort required to implement.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.accessibility`\n * @class\n * @memberof PIXI\n */\nvar AccessibilityManager = /** @class */ (function () {\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n */\n function AccessibilityManager(renderer) {\n /** Setting this to true will visually show the divs. */\n this.debug = false;\n /** Internal variable, see isActive getter. */\n this._isActive = false;\n /** Internal variable, see isMobileAccessibility getter. */\n this._isMobileAccessibility = false;\n /** A simple pool for storing divs. */\n this.pool = [];\n /** This is a tick used to check if an object is no longer being rendered. */\n this.renderId = 0;\n /** The array of currently active accessible items. */\n this.children = [];\n /** Count to throttle div updates on android devices. */\n this.androidUpdateCount = 0;\n /** The frequency to update the div elements. */\n this.androidUpdateFrequency = 500; // 2fps\n this._hookDiv = null;\n if (isMobile.tablet || isMobile.phone) {\n this.createTouchHook();\n }\n // first we create a div that will sit over the PixiJS element. This is where the div overlays will go.\n var div = document.createElement('div');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.position = 'absolute';\n div.style.top = DIV_TOUCH_POS_X + \"px\";\n div.style.left = DIV_TOUCH_POS_Y + \"px\";\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n this.div = div;\n this.renderer = renderer;\n /**\n * pre-bind the functions\n * @type {Function}\n * @private\n */\n this._onKeyDown = this._onKeyDown.bind(this);\n /**\n * pre-bind the functions\n * @type {Function}\n * @private\n */\n this._onMouseMove = this._onMouseMove.bind(this);\n // let listen for tab.. once pressed we can fire up and show the accessibility layer\n globalThis.addEventListener('keydown', this._onKeyDown, false);\n }\n Object.defineProperty(AccessibilityManager.prototype, \"isActive\", {\n /**\n * Value of `true` if accessibility is currently active and accessibility layers are showing.\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isActive;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AccessibilityManager.prototype, \"isMobileAccessibility\", {\n /**\n * Value of `true` if accessibility is enabled for touch devices.\n * @member {boolean}\n * @readonly\n */\n get: function () {\n return this._isMobileAccessibility;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates the touch hooks.\n * @private\n */\n AccessibilityManager.prototype.createTouchHook = function () {\n var _this = this;\n var hookDiv = document.createElement('button');\n hookDiv.style.width = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.height = DIV_HOOK_SIZE + \"px\";\n hookDiv.style.position = 'absolute';\n hookDiv.style.top = DIV_HOOK_POS_X + \"px\";\n hookDiv.style.left = DIV_HOOK_POS_Y + \"px\";\n hookDiv.style.zIndex = DIV_HOOK_ZINDEX.toString();\n hookDiv.style.backgroundColor = '#FF0000';\n hookDiv.title = 'select to enable accessibility for this content';\n hookDiv.addEventListener('focus', function () {\n _this._isMobileAccessibility = true;\n _this.activate();\n _this.destroyTouchHook();\n });\n document.body.appendChild(hookDiv);\n this._hookDiv = hookDiv;\n };\n /**\n * Destroys the touch hooks.\n * @private\n */\n AccessibilityManager.prototype.destroyTouchHook = function () {\n if (!this._hookDiv) {\n return;\n }\n document.body.removeChild(this._hookDiv);\n this._hookDiv = null;\n };\n /**\n * Activating will cause the Accessibility layer to be shown.\n * This is called when a user presses the tab key.\n * @private\n */\n AccessibilityManager.prototype.activate = function () {\n var _a;\n if (this._isActive) {\n return;\n }\n this._isActive = true;\n globalThis.document.addEventListener('mousemove', this._onMouseMove, true);\n globalThis.removeEventListener('keydown', this._onKeyDown, false);\n this.renderer.on('postrender', this.update, this);\n (_a = this.renderer.view.parentNode) === null || _a === void 0 ? void 0 : _a.appendChild(this.div);\n };\n /**\n * Deactivating will cause the Accessibility layer to be hidden.\n * This is called when a user moves the mouse.\n * @private\n */\n AccessibilityManager.prototype.deactivate = function () {\n var _a;\n if (!this._isActive || this._isMobileAccessibility) {\n return;\n }\n this._isActive = false;\n globalThis.document.removeEventListener('mousemove', this._onMouseMove, true);\n globalThis.addEventListener('keydown', this._onKeyDown, false);\n this.renderer.off('postrender', this.update);\n (_a = this.div.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this.div);\n };\n /**\n * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.\n * @private\n * @param {PIXI.Container} displayObject - The DisplayObject to check.\n */\n AccessibilityManager.prototype.updateAccessibleObjects = function (displayObject) {\n if (!displayObject.visible || !displayObject.accessibleChildren) {\n return;\n }\n if (displayObject.accessible && displayObject.interactive) {\n if (!displayObject._accessibleActive) {\n this.addChild(displayObject);\n }\n displayObject.renderId = this.renderId;\n }\n var children = displayObject.children;\n if (children) {\n for (var i = 0; i < children.length; i++) {\n this.updateAccessibleObjects(children[i]);\n }\n }\n };\n /**\n * Before each render this function will ensure that all divs are mapped correctly to their DisplayObjects.\n * @private\n */\n AccessibilityManager.prototype.update = function () {\n /* On Android default web browser, tab order seems to be calculated by position rather than tabIndex,\n * moving buttons can cause focus to flicker between two buttons making it hard/impossible to navigate,\n * so I am just running update every half a second, seems to fix it.\n */\n var now = performance.now();\n if (isMobile.android.device && now < this.androidUpdateCount) {\n return;\n }\n this.androidUpdateCount = now + this.androidUpdateFrequency;\n if (!this.renderer.renderingToScreen) {\n return;\n }\n // update children...\n if (this.renderer._lastObjectRendered) {\n this.updateAccessibleObjects(this.renderer._lastObjectRendered);\n }\n var _a = this.renderer.view.getBoundingClientRect(), left = _a.left, top = _a.top, width = _a.width, height = _a.height;\n var _b = this.renderer, viewWidth = _b.width, viewHeight = _b.height, resolution = _b.resolution;\n var sx = (width / viewWidth) * resolution;\n var sy = (height / viewHeight) * resolution;\n var div = this.div;\n div.style.left = left + \"px\";\n div.style.top = top + \"px\";\n div.style.width = viewWidth + \"px\";\n div.style.height = viewHeight + \"px\";\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n if (child.renderId !== this.renderId) {\n child._accessibleActive = false;\n removeItems(this.children, i, 1);\n this.div.removeChild(child._accessibleDiv);\n this.pool.push(child._accessibleDiv);\n child._accessibleDiv = null;\n i--;\n }\n else {\n // map div to display..\n div = child._accessibleDiv;\n var hitArea = child.hitArea;\n var wt = child.worldTransform;\n if (child.hitArea) {\n div.style.left = (wt.tx + (hitArea.x * wt.a)) * sx + \"px\";\n div.style.top = (wt.ty + (hitArea.y * wt.d)) * sy + \"px\";\n div.style.width = hitArea.width * wt.a * sx + \"px\";\n div.style.height = hitArea.height * wt.d * sy + \"px\";\n }\n else {\n hitArea = child.getBounds();\n this.capHitArea(hitArea);\n div.style.left = hitArea.x * sx + \"px\";\n div.style.top = hitArea.y * sy + \"px\";\n div.style.width = hitArea.width * sx + \"px\";\n div.style.height = hitArea.height * sy + \"px\";\n // update button titles and hints if they exist and they've changed\n if (div.title !== child.accessibleTitle && child.accessibleTitle !== null) {\n div.title = child.accessibleTitle;\n }\n if (div.getAttribute('aria-label') !== child.accessibleHint\n && child.accessibleHint !== null) {\n div.setAttribute('aria-label', child.accessibleHint);\n }\n }\n // the title or index may have changed, if so lets update it!\n if (child.accessibleTitle !== div.title || child.tabIndex !== div.tabIndex) {\n div.title = child.accessibleTitle;\n div.tabIndex = child.tabIndex;\n if (this.debug)\n { this.updateDebugHTML(div); }\n }\n }\n }\n // increment the render id..\n this.renderId++;\n };\n /**\n * private function that will visually add the information to the\n * accessability div\n * @param {HTMLElement} div -\n */\n AccessibilityManager.prototype.updateDebugHTML = function (div) {\n div.innerHTML = \"type: \" + div.type + \"</br> title : \" + div.title + \"</br> tabIndex: \" + div.tabIndex;\n };\n /**\n * Adjust the hit area based on the bounds of a display object\n * @param {PIXI.Rectangle} hitArea - Bounds of the child\n */\n AccessibilityManager.prototype.capHitArea = function (hitArea) {\n if (hitArea.x < 0) {\n hitArea.width += hitArea.x;\n hitArea.x = 0;\n }\n if (hitArea.y < 0) {\n hitArea.height += hitArea.y;\n hitArea.y = 0;\n }\n var _a = this.renderer, viewWidth = _a.width, viewHeight = _a.height;\n if (hitArea.x + hitArea.width > viewWidth) {\n hitArea.width = viewWidth - hitArea.x;\n }\n if (hitArea.y + hitArea.height > viewHeight) {\n hitArea.height = viewHeight - hitArea.y;\n }\n };\n /**\n * Adds a DisplayObject to the accessibility manager\n * @private\n * @param {PIXI.DisplayObject} displayObject - The child to make accessible.\n */\n AccessibilityManager.prototype.addChild = function (displayObject) {\n // this.activate();\n var div = this.pool.pop();\n if (!div) {\n div = document.createElement('button');\n div.style.width = DIV_TOUCH_SIZE + \"px\";\n div.style.height = DIV_TOUCH_SIZE + \"px\";\n div.style.backgroundColor = this.debug ? 'rgba(255,255,255,0.5)' : 'transparent';\n div.style.position = 'absolute';\n div.style.zIndex = DIV_TOUCH_ZINDEX.toString();\n div.style.borderStyle = 'none';\n // ARIA attributes ensure that button title and hint updates are announced properly\n if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {\n // Chrome doesn't need aria-live to work as intended; in fact it just gets more confused.\n div.setAttribute('aria-live', 'off');\n }\n else {\n div.setAttribute('aria-live', 'polite');\n }\n if (navigator.userAgent.match(/rv:.*Gecko\\//)) {\n // FireFox needs this to announce only the new button name\n div.setAttribute('aria-relevant', 'additions');\n }\n else {\n // required by IE, other browsers don't much care\n div.setAttribute('aria-relevant', 'text');\n }\n div.addEventListener('click', this._onClick.bind(this));\n div.addEventListener('focus', this._onFocus.bind(this));\n div.addEventListener('focusout', this._onFocusOut.bind(this));\n }\n // set pointer events\n div.style.pointerEvents = displayObject.accessiblePointerEvents;\n // set the type, this defaults to button!\n div.type = displayObject.accessibleType;\n if (displayObject.accessibleTitle && displayObject.accessibleTitle !== null) {\n div.title = displayObject.accessibleTitle;\n }\n else if (!displayObject.accessibleHint\n || displayObject.accessibleHint === null) {\n div.title = \"displayObject \" + displayObject.tabIndex;\n }\n if (displayObject.accessibleHint\n && displayObject.accessibleHint !== null) {\n div.setAttribute('aria-label', displayObject.accessibleHint);\n }\n if (this.debug)\n { this.updateDebugHTML(div); }\n displayObject._accessibleActive = true;\n displayObject._accessibleDiv = div;\n div.displayObject = displayObject;\n this.children.push(displayObject);\n this.div.appendChild(displayObject._accessibleDiv);\n displayObject._accessibleDiv.tabIndex = displayObject.tabIndex;\n };\n /**\n * Maps the div button press to pixi's InteractionManager (click)\n * @private\n * @param {MouseEvent} e - The click event.\n */\n AccessibilityManager.prototype._onClick = function (e) {\n var interactionManager = this.renderer.plugins.interaction;\n var displayObject = e.target.displayObject;\n var eventData = interactionManager.eventData;\n interactionManager.dispatchEvent(displayObject, 'click', eventData);\n interactionManager.dispatchEvent(displayObject, 'pointertap', eventData);\n interactionManager.dispatchEvent(displayObject, 'tap', eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseover)\n * @private\n * @param {FocusEvent} e - The focus event.\n */\n AccessibilityManager.prototype._onFocus = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'assertive');\n }\n var interactionManager = this.renderer.plugins.interaction;\n var displayObject = e.target.displayObject;\n var eventData = interactionManager.eventData;\n interactionManager.dispatchEvent(displayObject, 'mouseover', eventData);\n };\n /**\n * Maps the div focus events to pixi's InteractionManager (mouseout)\n * @private\n * @param {FocusEvent} e - The focusout event.\n */\n AccessibilityManager.prototype._onFocusOut = function (e) {\n if (!e.target.getAttribute('aria-live')) {\n e.target.setAttribute('aria-live', 'polite');\n }\n var interactionManager = this.renderer.plugins.interaction;\n var displayObject = e.target.displayObject;\n var eventData = interactionManager.eventData;\n interactionManager.dispatchEvent(displayObject, 'mouseout', eventData);\n };\n /**\n * Is called when a key is pressed\n * @private\n * @param {KeyboardEvent} e - The keydown event.\n */\n AccessibilityManager.prototype._onKeyDown = function (e) {\n if (e.keyCode !== KEY_CODE_TAB) {\n return;\n }\n this.activate();\n };\n /**\n * Is called when the mouse moves across the renderer element\n * @private\n * @param {MouseEvent} e - The mouse event.\n */\n AccessibilityManager.prototype._onMouseMove = function (e) {\n if (e.movementX === 0 && e.movementY === 0) {\n return;\n }\n this.deactivate();\n };\n /** Destroys the accessibility manager */\n AccessibilityManager.prototype.destroy = function () {\n this.destroyTouchHook();\n this.div = null;\n globalThis.document.removeEventListener('mousemove', this._onMouseMove, true);\n globalThis.removeEventListener('keydown', this._onKeyDown);\n this.pool = null;\n this.children = null;\n this.renderer = null;\n };\n /** @ignore */\n AccessibilityManager.extension = {\n name: 'accessibility',\n type: [\n ExtensionType.RendererPlugin,\n ExtensionType.CanvasRendererPlugin ],\n };\n return AccessibilityManager;\n}());\n\nexport { AccessibilityManager, accessibleTarget };\n//# sourceMappingURL=accessibility.mjs.map\n","/*!\n * @pixi/interaction - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/interaction is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Point } from '@pixi/math';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { DisplayObject, TemporaryDisplayObject } from '@pixi/display';\nimport { EventEmitter } from '@pixi/utils';\nimport { ExtensionType } from '@pixi/core';\n\n/**\n * Holds all information related to an Interaction event\n * @memberof PIXI\n */\nvar InteractionData = /** @class */ (function () {\n function InteractionData() {\n /**\n * Pressure applied by the pointing device during the event. A Touch's force property\n * will be represented by this value.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pressure\n */\n this.pressure = 0;\n /**\n * From TouchEvents (not PointerEvents triggered by touches), the rotationAngle of the Touch.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Touch/rotationAngle\n */\n this.rotationAngle = 0;\n /**\n * Twist of a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n */\n this.twist = 0;\n /**\n * Barrel pressure on a stylus pointer.\n * @see https://w3c.github.io/pointerevents/#pointerevent-interface\n */\n this.tangentialPressure = 0;\n this.global = new Point();\n this.target = null;\n this.originalEvent = null;\n this.identifier = null;\n this.isPrimary = false;\n this.button = 0;\n this.buttons = 0;\n this.width = 0;\n this.height = 0;\n this.tiltX = 0;\n this.tiltY = 0;\n this.pointerType = null;\n this.pressure = 0;\n this.rotationAngle = 0;\n this.twist = 0;\n this.tangentialPressure = 0;\n }\n Object.defineProperty(InteractionData.prototype, \"pointerId\", {\n /**\n * The unique identifier of the pointer. It will be the same as `identifier`.\n * @readonly\n * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId\n */\n get: function () {\n return this.identifier;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n * @param displayObject - The DisplayObject that you would like the local\n * coords off\n * @param point - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param globalPos - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @returns - A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) {\n return displayObject.worldTransform.applyInverse(globalPos || this.global, point);\n };\n /**\n * Copies properties from normalized event data.\n * @param {Touch|MouseEvent|PointerEvent} event - The normalized event data\n */\n InteractionData.prototype.copyEvent = function (event) {\n // isPrimary should only change on touchstart/pointerdown, so we don't want to overwrite\n // it with \"false\" on later events when our shim for it on touch events might not be\n // accurate\n if ('isPrimary' in event && event.isPrimary) {\n this.isPrimary = true;\n }\n this.button = 'button' in event && event.button;\n // event.buttons is not available in all browsers (ie. Safari), but it does have a non-standard\n // event.which property instead, which conveys the same information.\n var buttons = 'buttons' in event && event.buttons;\n this.buttons = Number.isInteger(buttons) ? buttons : 'which' in event && event.which;\n this.width = 'width' in event && event.width;\n this.height = 'height' in event && event.height;\n this.tiltX = 'tiltX' in event && event.tiltX;\n this.tiltY = 'tiltY' in event && event.tiltY;\n this.pointerType = 'pointerType' in event && event.pointerType;\n this.pressure = 'pressure' in event && event.pressure;\n this.rotationAngle = 'rotationAngle' in event && event.rotationAngle;\n this.twist = ('twist' in event && event.twist) || 0;\n this.tangentialPressure = ('tangentialPressure' in event && event.tangentialPressure) || 0;\n };\n /** Resets the data for pooling. */\n InteractionData.prototype.reset = function () {\n // isPrimary is the only property that we really need to reset - everything else is\n // guaranteed to be overwritten\n this.isPrimary = false;\n };\n return InteractionData;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Event class that mimics native DOM events.\n * @memberof PIXI\n */\nvar InteractionEvent = /** @class */ (function () {\n function InteractionEvent() {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.target = null;\n this.currentTarget = null;\n this.type = null;\n this.data = null;\n }\n /** Prevents event from reaching any objects other than the current object. */\n InteractionEvent.prototype.stopPropagation = function () {\n this.stopped = true;\n this.stopPropagationHint = true;\n this.stopsPropagatingAt = this.currentTarget;\n };\n /** Resets the event. */\n InteractionEvent.prototype.reset = function () {\n this.stopped = false;\n this.stopsPropagatingAt = null;\n this.stopPropagationHint = false;\n this.currentTarget = null;\n this.target = null;\n };\n return InteractionEvent;\n}());\n\n/**\n * DisplayObjects with the {@link PIXI.interactiveTarget} mixin use this class to track interactions\n * @class\n * @private\n * @memberof PIXI\n */\nvar InteractionTrackingData = /** @class */ (function () {\n /**\n * @param {number} pointerId - Unique pointer id of the event\n * @private\n */\n function InteractionTrackingData(pointerId) {\n this._pointerId = pointerId;\n this._flags = InteractionTrackingData.FLAGS.NONE;\n }\n /**\n *\n * @private\n * @param {number} flag - The interaction flag to set\n * @param {boolean} yn - Should the flag be set or unset\n */\n InteractionTrackingData.prototype._doSet = function (flag, yn) {\n if (yn) {\n this._flags = this._flags | flag;\n }\n else {\n this._flags = this._flags & (~flag);\n }\n };\n Object.defineProperty(InteractionTrackingData.prototype, \"pointerId\", {\n /**\n * Unique pointer id of the event\n * @readonly\n * @private\n * @member {number}\n */\n get: function () {\n return this._pointerId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"flags\", {\n /**\n * State of the tracking data, expressed as bit flags\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags;\n },\n set: function (flags) {\n this._flags = flags;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"none\", {\n /**\n * Is the tracked event inactive (not over or down)?\n * @private\n * @member {number}\n */\n get: function () {\n return this._flags === InteractionTrackingData.FLAGS.NONE;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"over\", {\n /**\n * Is the tracked event over the DisplayObject?\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.OVER) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.OVER, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"rightDown\", {\n /**\n * Did the right mouse button come down in the DisplayObject?\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.RIGHT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.RIGHT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionTrackingData.prototype, \"leftDown\", {\n /**\n * Did the left mouse button come down in the DisplayObject?\n * @private\n * @member {boolean}\n */\n get: function () {\n return (this._flags & InteractionTrackingData.FLAGS.LEFT_DOWN) !== 0;\n },\n set: function (yn) {\n this._doSet(InteractionTrackingData.FLAGS.LEFT_DOWN, yn);\n },\n enumerable: false,\n configurable: true\n });\n InteractionTrackingData.FLAGS = Object.freeze({\n NONE: 0,\n OVER: 1 << 0,\n LEFT_DOWN: 1 << 1,\n RIGHT_DOWN: 1 << 2,\n });\n return InteractionTrackingData;\n}());\n\n/**\n * Strategy how to search through stage tree for interactive objects\n * @memberof PIXI\n */\nvar TreeSearch = /** @class */ (function () {\n function TreeSearch() {\n this._tempPoint = new Point();\n }\n /**\n * Recursive implementation for findHit\n * @private\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - this indicates if the objects inside should be hit test against the point\n * @param interactive - Whether the displayObject is interactive\n * @returns - Returns true if the displayObject hit the point\n */\n TreeSearch.prototype.recursiveFindHit = function (interactionEvent, displayObject, func, hitTest, interactive) {\n var _a;\n if (!displayObject || !displayObject.visible) {\n return false;\n }\n var point = interactionEvent.data.global;\n // Took a little while to rework this function correctly! But now it is done and nice and optimized! ^_^\n //\n // This function will now loop through all objects and then only hit test the objects it HAS\n // to, not all of them. MUCH faster..\n // An object will be hit test if the following is true:\n //\n // 1: It is interactive.\n // 2: It belongs to a parent that is interactive AND one of the parents children have not already been hit.\n //\n // As another little optimization once an interactive object has been hit we can carry on\n // through the scenegraph, but we know that there will be no more hits! So we can avoid extra hit tests\n // A final optimization is that an object is not hit test directly if a child has already been hit.\n interactive = displayObject.interactive || interactive;\n var hit = false;\n var interactiveParent = interactive;\n // Flag here can set to false if the event is outside the parents hitArea or mask\n var hitTestChildren = true;\n // If there is a hitArea, no need to test against anything else if the pointer is not within the hitArea\n // There is also no longer a need to hitTest children.\n if (displayObject.hitArea) {\n if (hitTest) {\n displayObject.worldTransform.applyInverse(point, this._tempPoint);\n if (!displayObject.hitArea.contains(this._tempPoint.x, this._tempPoint.y)) {\n hitTest = false;\n hitTestChildren = false;\n }\n else {\n hit = true;\n }\n }\n interactiveParent = false;\n }\n // If there is a mask, no need to hitTest against anything else if the pointer is not within the mask.\n // We still want to hitTestChildren, however, to ensure a mouseout can still be generated.\n // https://github.com/pixijs/pixi.js/issues/5135\n else if (displayObject._mask) {\n if (hitTest) {\n var maskObject = (displayObject._mask.isMaskData\n ? displayObject._mask.maskObject : displayObject._mask);\n if (maskObject && !((_a = maskObject.containsPoint) === null || _a === void 0 ? void 0 : _a.call(maskObject, point))) {\n hitTest = false;\n }\n }\n }\n // ** FREE TIP **! If an object is not interactive or has no buttons in it\n // (such as a game scene!) set interactiveChildren to false for that displayObject.\n // This will allow PixiJS to completely ignore and bypass checking the displayObjects children.\n if (hitTestChildren && displayObject.interactiveChildren && displayObject.children) {\n var children = displayObject.children;\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n // time to get recursive.. if this function will return if something is hit..\n var childHit = this.recursiveFindHit(interactionEvent, child, func, hitTest, interactiveParent);\n if (childHit) {\n // its a good idea to check if a child has lost its parent.\n // this means it has been removed whilst looping so its best\n if (!child.parent) {\n continue;\n }\n // we no longer need to hit test any more objects in this container as we we\n // now know the parent has been hit\n interactiveParent = false;\n // If the child is interactive , that means that the object hit was actually\n // interactive and not just the child of an interactive object.\n // This means we no longer need to hit test anything else. We still need to run\n // through all objects, but we don't need to perform any hit tests.\n if (childHit) {\n if (interactionEvent.target) {\n hitTest = false;\n }\n hit = true;\n }\n }\n }\n }\n // no point running this if the item is not interactive or does not have an interactive parent.\n if (interactive) {\n // if we are hit testing (as in we have no hit any objects yet)\n // We also don't need to worry about hit testing if once of the displayObjects children\n // has already been hit - but only if it was interactive, otherwise we need to keep\n // looking for an interactive child, just in case we hit one\n if (hitTest && !interactionEvent.target) {\n // already tested against hitArea if it is defined\n if (!displayObject.hitArea && displayObject.containsPoint) {\n if (displayObject.containsPoint(point)) {\n hit = true;\n }\n }\n }\n if (displayObject.interactive) {\n if (hit && !interactionEvent.target) {\n interactionEvent.target = displayObject;\n }\n if (func) {\n func(interactionEvent, displayObject, !!hit);\n }\n }\n }\n return hit;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n * @private\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - this indicates if the objects inside should be hit test against the point\n * @returns - Returns true if the displayObject hit the point\n */\n TreeSearch.prototype.findHit = function (interactionEvent, displayObject, func, hitTest) {\n this.recursiveFindHit(interactionEvent, displayObject, func, hitTest, false);\n };\n return TreeSearch;\n}());\n\n/**\n * Interface for classes that represent a hit area.\n *\n * It is implemented by the following classes:\n * - {@link PIXI.Circle}\n * - {@link PIXI.Ellipse}\n * - {@link PIXI.Polygon}\n * - {@link PIXI.RoundedRectangle}\n * @interface IHitArea\n * @memberof PIXI\n */\n/**\n * Checks whether the x and y coordinates given are contained within this area\n * @method\n * @name contains\n * @memberof PIXI.IHitArea#\n * @param {number} x - The X coordinate of the point to test\n * @param {number} y - The Y coordinate of the point to test\n * @returns {boolean} Whether the x/y coordinates are within this area\n */\n/**\n * Default property values of interactive objects\n * Used by {@link PIXI.InteractionManager} to automatically give all DisplayObjects these properties\n * @private\n * @name interactiveTarget\n * @type {object}\n * @memberof PIXI\n * @example\n * function MyObject() {}\n *\n * Object.assign(\n * DisplayObject.prototype,\n * PIXI.interactiveTarget\n * );\n */\nvar interactiveTarget = {\n interactive: false,\n interactiveChildren: true,\n hitArea: null,\n /**\n * If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive\n * Setting this changes the 'cursor' property to `'pointer'`.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.buttonMode = true;\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n get buttonMode() {\n return this.cursor === 'pointer';\n },\n set buttonMode(value) {\n if (value) {\n this.cursor = 'pointer';\n }\n else if (this.cursor === 'pointer') {\n this.cursor = null;\n }\n },\n /**\n * This defines what cursor mode is used when the mouse cursor\n * is hovered over the displayObject.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.interactive = true;\n * sprite.cursor = 'wait';\n * @see https://developer.mozilla.org/en/docs/Web/CSS/cursor\n * @member {string}\n * @memberof PIXI.DisplayObject#\n */\n cursor: null,\n /**\n * Internal set of all active pointers, by identifier\n * @member {Map<number, InteractionTrackingData>}\n * @memberof PIXI.DisplayObject#\n * @private\n */\n get trackedPointers() {\n if (this._trackedPointers === undefined)\n { this._trackedPointers = {}; }\n return this._trackedPointers;\n },\n /**\n * Map of all tracked pointers, by identifier. Use trackedPointers to access.\n * @private\n * @type {Map<number, InteractionTrackingData>}\n */\n _trackedPointers: undefined,\n};\n\n// Mix interactiveTarget into DisplayObject.prototype\nDisplayObject.mixin(interactiveTarget);\nvar MOUSE_POINTER_ID = 1;\n// helpers for hitTest() - only used inside hitTest()\nvar hitTestEvent = {\n target: null,\n data: {\n global: null,\n },\n};\n/**\n * The interaction manager deals with mouse, touch and pointer events.\n *\n * Any DisplayObject can be interactive if its `interactive` property is set to true.\n *\n * This manager also supports multitouch.\n *\n * An instance of this class is automatically created by default, and can be found at `renderer.plugins.interaction`\n * @memberof PIXI\n */\nvar InteractionManager = /** @class */ (function (_super) {\n __extends(InteractionManager, _super);\n /**\n * @param {PIXI.CanvasRenderer|PIXI.Renderer} renderer - A reference to the current renderer\n * @param options - The options for the manager.\n * @param {boolean} [options.autoPreventDefault=true] - Should the manager automatically prevent default browser actions.\n * @param {number} [options.interactionFrequency=10] - Maximum frequency (ms) at pointer over/out states will be checked.\n * @param {number} [options.useSystemTicker=true] - Whether to add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n */\n function InteractionManager(renderer, options) {\n var _this = _super.call(this) || this;\n options = options || {};\n _this.renderer = renderer;\n _this.autoPreventDefault = options.autoPreventDefault !== undefined ? options.autoPreventDefault : true;\n _this.interactionFrequency = options.interactionFrequency || 10;\n _this.mouse = new InteractionData();\n _this.mouse.identifier = MOUSE_POINTER_ID;\n // setting the mouse to start off far off screen will mean that mouse over does\n // not get called before we even move the mouse.\n _this.mouse.global.set(-999999);\n _this.activeInteractionData = {};\n _this.activeInteractionData[MOUSE_POINTER_ID] = _this.mouse;\n _this.interactionDataPool = [];\n _this.eventData = new InteractionEvent();\n _this.interactionDOMElement = null;\n _this.moveWhenInside = false;\n _this.eventsAdded = false;\n _this.tickerAdded = false;\n _this.mouseOverRenderer = !('PointerEvent' in globalThis);\n _this.supportsTouchEvents = 'ontouchstart' in globalThis;\n _this.supportsPointerEvents = !!globalThis.PointerEvent;\n // this will make it so that you don't have to call bind all the time\n _this.onPointerUp = _this.onPointerUp.bind(_this);\n _this.processPointerUp = _this.processPointerUp.bind(_this);\n _this.onPointerCancel = _this.onPointerCancel.bind(_this);\n _this.processPointerCancel = _this.processPointerCancel.bind(_this);\n _this.onPointerDown = _this.onPointerDown.bind(_this);\n _this.processPointerDown = _this.processPointerDown.bind(_this);\n _this.onPointerMove = _this.onPointerMove.bind(_this);\n _this.processPointerMove = _this.processPointerMove.bind(_this);\n _this.onPointerOut = _this.onPointerOut.bind(_this);\n _this.processPointerOverOut = _this.processPointerOverOut.bind(_this);\n _this.onPointerOver = _this.onPointerOver.bind(_this);\n _this.cursorStyles = {\n default: 'inherit',\n pointer: 'pointer',\n };\n _this.currentCursorMode = null;\n _this.cursor = null;\n _this.resolution = 1;\n _this.delayedEvents = [];\n _this.search = new TreeSearch();\n _this._tempDisplayObject = new TemporaryDisplayObject();\n _this._eventListenerOptions = { capture: true, passive: false };\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display\n * object.\n * @event PIXI.InteractionManager#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object.\n * @event PIXI.InteractionManager#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object.\n * @event PIXI.InteractionManager#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object.\n * @event PIXI.InteractionManager#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object.\n * @event PIXI.InteractionManager#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object.\n * @event PIXI.InteractionManager#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.InteractionManager#event:mousedown}.\n * @event PIXI.InteractionManager#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.InteractionManager#event:rightdown}.\n * @event PIXI.InteractionManager#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object\n * @event PIXI.InteractionManager#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object\n * @event PIXI.InteractionManager#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object\n * @event PIXI.InteractionManager#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n * @event PIXI.InteractionManager#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * Not always fired when some buttons are held down while others are released. In those cases,\n * use [mousedown]{@link PIXI.InteractionManager#event:mousedown} and\n * [mouseup]{@link PIXI.InteractionManager#event:mouseup} instead.\n * @event PIXI.InteractionManager#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event\n * @event PIXI.InteractionManager#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * @event PIXI.InteractionManager#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.InteractionManager#event:pointerdown}.\n * @event PIXI.InteractionManager#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object\n * @event PIXI.InteractionManager#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object\n * @event PIXI.InteractionManager#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object\n * @event PIXI.InteractionManager#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n * @event PIXI.InteractionManager#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n * @event PIXI.InteractionManager#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch\n * @event PIXI.InteractionManager#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n * @event PIXI.InteractionManager#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.InteractionManager#event:touchstart}.\n * @event PIXI.InteractionManager#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n * @event PIXI.InteractionManager#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed on the display.\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mousedown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released over the display\n * object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * over the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is pressed and released on\n * the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#click\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is pressed\n * and released on the display object. DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightclick\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button (usually a mouse left-button) is released outside the\n * display object that initially registered a\n * [mousedown]{@link PIXI.DisplayObject#event:mousedown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device secondary button (usually a mouse right-button) is released\n * outside the display object that initially registered a\n * [rightdown]{@link PIXI.DisplayObject#event:rightdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#rightupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mousemove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device (usually a mouse) is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#mouseout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerdown\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerup\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a pointer event.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointercancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is pressed and released on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointertap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device button is released outside the display object that initially\n * registered a [pointerdown]{@link PIXI.DisplayObject#event:pointerdown}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerupoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved while over the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointermove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved onto the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerover\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a pointer device is moved off the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#pointerout\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed on the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchstart\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchend\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when the operating system cancels a touch.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchcancel\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is placed and removed from the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#tap\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is removed outside of the display object that initially\n * registered a [touchstart]{@link PIXI.DisplayObject#event:touchstart}.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchendoutside\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n /**\n * Fired when a touch point is moved along the display object.\n * DisplayObject's `interactive` property must be set to `true` to fire event.\n *\n * This comes from the @pixi/interaction package.\n * @event PIXI.DisplayObject#touchmove\n * @param {PIXI.InteractionEvent} event - Interaction event\n */\n _this._useSystemTicker = options.useSystemTicker !== undefined ? options.useSystemTicker : true;\n _this.setTargetElement(_this.renderer.view, _this.renderer.resolution);\n return _this;\n }\n Object.defineProperty(InteractionManager.prototype, \"useSystemTicker\", {\n /**\n * Should the InteractionManager automatically add {@link tickerUpdate} to {@link PIXI.Ticker.system}.\n * @default true\n */\n get: function () {\n return this._useSystemTicker;\n },\n set: function (useSystemTicker) {\n this._useSystemTicker = useSystemTicker;\n if (useSystemTicker) {\n this.addTickerListener();\n }\n else {\n this.removeTickerListener();\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(InteractionManager.prototype, \"lastObjectRendered\", {\n /**\n * Last rendered object or temp object.\n * @readonly\n * @protected\n */\n get: function () {\n return this.renderer._lastObjectRendered || this._tempDisplayObject;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Hit tests a point against the display tree, returning the first interactive object that is hit.\n * @param globalPoint - A point to hit test with, in global space.\n * @param root - The root display object to start from. If omitted, defaults\n * to the last rendered root of the associated renderer.\n * @returns - The hit display object, if any.\n */\n InteractionManager.prototype.hitTest = function (globalPoint, root) {\n // clear the target for our hit test\n hitTestEvent.target = null;\n // assign the global point\n hitTestEvent.data.global = globalPoint;\n // ensure safety of the root\n if (!root) {\n root = this.lastObjectRendered;\n }\n // run the hit test\n this.processInteractive(hitTestEvent, root, null, true);\n // return our found object - it'll be null if we didn't hit anything\n return hitTestEvent.target;\n };\n /**\n * Sets the DOM element which will receive mouse/touch events. This is useful for when you have\n * other DOM elements on top of the renderers Canvas element. With this you'll be bale to delegate\n * another DOM element to receive those events.\n * @param element - the DOM element which will receive mouse and touch events.\n * @param resolution - The resolution / device pixel ratio of the new element (relative to the canvas).\n */\n InteractionManager.prototype.setTargetElement = function (element, resolution) {\n if (resolution === void 0) { resolution = 1; }\n this.removeTickerListener();\n this.removeEvents();\n this.interactionDOMElement = element;\n this.resolution = resolution;\n this.addEvents();\n this.addTickerListener();\n };\n /** Adds the ticker listener. */\n InteractionManager.prototype.addTickerListener = function () {\n if (this.tickerAdded || !this.interactionDOMElement || !this._useSystemTicker) {\n return;\n }\n Ticker.system.add(this.tickerUpdate, this, UPDATE_PRIORITY.INTERACTION);\n this.tickerAdded = true;\n };\n /** Removes the ticker listener. */\n InteractionManager.prototype.removeTickerListener = function () {\n if (!this.tickerAdded) {\n return;\n }\n Ticker.system.remove(this.tickerUpdate, this);\n this.tickerAdded = false;\n };\n /** Registers all the DOM events. */\n InteractionManager.prototype.addEvents = function () {\n if (this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (globalThis.navigator.msPointerEnabled) {\n style.msContentZooming = 'none';\n style.msTouchAction = 'none';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = 'none';\n }\n /*\n * These events are added first, so that if pointer events are normalized, they are fired\n * in the same order as non-normalized events. ie. pointer event 1st, mouse / touch 2nd\n */\n if (this.supportsPointerEvents) {\n globalThis.document.addEventListener('pointermove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('pointerdown', this.onPointerDown, this._eventListenerOptions);\n // pointerout is fired in addition to pointerup (for touch events) and pointercancel\n // we already handle those, so for the purposes of what we do in onPointerOut, we only\n // care about the pointerleave event\n this.interactionDOMElement.addEventListener('pointerleave', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('pointerover', this.onPointerOver, this._eventListenerOptions);\n globalThis.addEventListener('pointercancel', this.onPointerCancel, this._eventListenerOptions);\n globalThis.addEventListener('pointerup', this.onPointerUp, this._eventListenerOptions);\n }\n else {\n globalThis.document.addEventListener('mousemove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mousedown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mouseout', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('mouseover', this.onPointerOver, this._eventListenerOptions);\n globalThis.addEventListener('mouseup', this.onPointerUp, this._eventListenerOptions);\n }\n // always look directly for touch events so that we can provide original data\n // In a future version we should change this to being just a fallback and rely solely on\n // PointerEvents whenever available\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.addEventListener('touchstart', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchcancel', this.onPointerCancel, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchend', this.onPointerUp, this._eventListenerOptions);\n this.interactionDOMElement.addEventListener('touchmove', this.onPointerMove, this._eventListenerOptions);\n }\n this.eventsAdded = true;\n };\n /** Removes all the DOM events that were previously registered. */\n InteractionManager.prototype.removeEvents = function () {\n if (!this.eventsAdded || !this.interactionDOMElement) {\n return;\n }\n var style = this.interactionDOMElement.style;\n if (globalThis.navigator.msPointerEnabled) {\n style.msContentZooming = '';\n style.msTouchAction = '';\n }\n else if (this.supportsPointerEvents) {\n style.touchAction = '';\n }\n if (this.supportsPointerEvents) {\n globalThis.document.removeEventListener('pointermove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerdown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerleave', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('pointerover', this.onPointerOver, this._eventListenerOptions);\n globalThis.removeEventListener('pointercancel', this.onPointerCancel, this._eventListenerOptions);\n globalThis.removeEventListener('pointerup', this.onPointerUp, this._eventListenerOptions);\n }\n else {\n globalThis.document.removeEventListener('mousemove', this.onPointerMove, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mousedown', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mouseout', this.onPointerOut, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('mouseover', this.onPointerOver, this._eventListenerOptions);\n globalThis.removeEventListener('mouseup', this.onPointerUp, this._eventListenerOptions);\n }\n if (this.supportsTouchEvents) {\n this.interactionDOMElement.removeEventListener('touchstart', this.onPointerDown, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchcancel', this.onPointerCancel, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchend', this.onPointerUp, this._eventListenerOptions);\n this.interactionDOMElement.removeEventListener('touchmove', this.onPointerMove, this._eventListenerOptions);\n }\n this.interactionDOMElement = null;\n this.eventsAdded = false;\n };\n /**\n * Updates the state of interactive objects if at least {@link interactionFrequency}\n * milliseconds have passed since the last invocation.\n *\n * Invoked by a throttled ticker update from {@link PIXI.Ticker.system}.\n * @param deltaTime - time delta since the last call\n */\n InteractionManager.prototype.tickerUpdate = function (deltaTime) {\n this._deltaTime += deltaTime;\n if (this._deltaTime < this.interactionFrequency) {\n return;\n }\n this._deltaTime = 0;\n this.update();\n };\n /** Updates the state of interactive objects. */\n InteractionManager.prototype.update = function () {\n if (!this.interactionDOMElement) {\n return;\n }\n // if the user move the mouse this check has already been done using the mouse move!\n if (this._didMove) {\n this._didMove = false;\n return;\n }\n this.cursor = null;\n // Resets the flag as set by a stopPropagation call. This flag is usually reset by a user interaction of any kind,\n // but there was a scenario of a display object moving under a static mouse cursor.\n // In this case, mouseover and mouseevents would not pass the flag test in dispatchEvent function\n for (var k in this.activeInteractionData) {\n // eslint-disable-next-line no-prototype-builtins\n if (this.activeInteractionData.hasOwnProperty(k)) {\n var interactionData = this.activeInteractionData[k];\n if (interactionData.originalEvent && interactionData.pointerType !== 'touch') {\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, interactionData.originalEvent, interactionData);\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, true);\n }\n }\n }\n this.setCursorMode(this.cursor);\n };\n /**\n * Sets the current cursor mode, handling any callbacks or CSS style changes.\n * @param mode - cursor mode, a key from the cursorStyles dictionary\n */\n InteractionManager.prototype.setCursorMode = function (mode) {\n mode = mode || 'default';\n var applyStyles = true;\n // offscreen canvas does not support setting styles, but cursor modes can be functions,\n // in order to handle pixi rendered cursors, so we can't bail\n if (globalThis.OffscreenCanvas && this.interactionDOMElement instanceof OffscreenCanvas) {\n applyStyles = false;\n }\n // if the mode didn't actually change, bail early\n if (this.currentCursorMode === mode) {\n return;\n }\n this.currentCursorMode = mode;\n var style = this.cursorStyles[mode];\n // only do things if there is a cursor style for it\n if (style) {\n switch (typeof style) {\n case 'string':\n // string styles are handled as cursor CSS\n if (applyStyles) {\n this.interactionDOMElement.style.cursor = style;\n }\n break;\n case 'function':\n // functions are just called, and passed the cursor mode\n style(mode);\n break;\n case 'object':\n // if it is an object, assume that it is a dictionary of CSS styles,\n // apply it to the interactionDOMElement\n if (applyStyles) {\n Object.assign(this.interactionDOMElement.style, style);\n }\n break;\n }\n }\n else if (applyStyles && typeof mode === 'string' && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) {\n // if it mode is a string (not a Symbol) and cursorStyles doesn't have any entry\n // for the mode, then assume that the dev wants it to be CSS for the cursor.\n this.interactionDOMElement.style.cursor = mode;\n }\n };\n /**\n * Dispatches an event on the display object that was interacted with.\n * @param displayObject - the display object in question\n * @param eventString - the name of the event (e.g, mousedown)\n * @param eventData - the event data object\n */\n InteractionManager.prototype.dispatchEvent = function (displayObject, eventString, eventData) {\n // Even if the event was stopped, at least dispatch any remaining events\n // for the same display object.\n if (!eventData.stopPropagationHint || displayObject === eventData.stopsPropagatingAt) {\n eventData.currentTarget = displayObject;\n eventData.type = eventString;\n displayObject.emit(eventString, eventData);\n if (displayObject[eventString]) {\n displayObject[eventString](eventData);\n }\n }\n };\n /**\n * Puts a event on a queue to be dispatched later. This is used to guarantee correct\n * ordering of over/out events.\n * @param displayObject - the display object in question\n * @param eventString - the name of the event (e.g, mousedown)\n * @param eventData - the event data object\n */\n InteractionManager.prototype.delayDispatchEvent = function (displayObject, eventString, eventData) {\n this.delayedEvents.push({ displayObject: displayObject, eventString: eventString, eventData: eventData });\n };\n /**\n * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The\n * resulting value is stored in the point. This takes into account the fact that the DOM\n * element could be scaled and positioned anywhere on the screen.\n * @param point - the point that the result will be stored in\n * @param x - the x coord of the position to map\n * @param y - the y coord of the position to map\n */\n InteractionManager.prototype.mapPositionToPoint = function (point, x, y) {\n var rect;\n // IE 11 fix\n if (!this.interactionDOMElement.parentElement) {\n rect = {\n x: 0,\n y: 0,\n width: this.interactionDOMElement.width,\n height: this.interactionDOMElement.height,\n left: 0,\n top: 0\n };\n }\n else {\n rect = this.interactionDOMElement.getBoundingClientRect();\n }\n var resolutionMultiplier = 1.0 / this.resolution;\n point.x = ((x - rect.left) * (this.interactionDOMElement.width / rect.width)) * resolutionMultiplier;\n point.y = ((y - rect.top) * (this.interactionDOMElement.height / rect.height)) * resolutionMultiplier;\n };\n /**\n * This function is provides a neat way of crawling through the scene graph and running a\n * specified function on all interactive objects it finds. It will also take care of hit\n * testing the interactive objects and passes the hit across in the function.\n * @protected\n * @param interactionEvent - event containing the point that\n * is tested for collision\n * @param displayObject - the displayObject\n * that will be hit test (recursively crawls its children)\n * @param func - the function that will be called on each interactive object. The\n * interactionEvent, displayObject and hit will be passed to the function\n * @param hitTest - indicates whether we want to calculate hits\n * or just iterate through all interactive objects\n */\n InteractionManager.prototype.processInteractive = function (interactionEvent, displayObject, func, hitTest) {\n var hit = this.search.findHit(interactionEvent, displayObject, func, hitTest);\n var delayedEvents = this.delayedEvents;\n if (!delayedEvents.length) {\n return hit;\n }\n // Reset the propagation hint, because we start deeper in the tree again.\n interactionEvent.stopPropagationHint = false;\n var delayedLen = delayedEvents.length;\n this.delayedEvents = [];\n for (var i = 0; i < delayedLen; i++) {\n var _a = delayedEvents[i], displayObject_1 = _a.displayObject, eventString = _a.eventString, eventData = _a.eventData;\n // When we reach the object we wanted to stop propagating at,\n // set the propagation hint.\n if (eventData.stopsPropagatingAt === displayObject_1) {\n eventData.stopPropagationHint = true;\n }\n this.dispatchEvent(displayObject_1, eventString, eventData);\n }\n return hit;\n };\n /**\n * Is called when the pointer button is pressed down on the renderer element\n * @param originalEvent - The DOM event of a pointer button being pressed down\n */\n InteractionManager.prototype.onPointerDown = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n /*\n * No need to prevent default on natural pointer events, as there are no side effects\n * Normalized events, however, may have the double mousedown/touchstart issue on the native android browser,\n * so still need to be prevented.\n */\n // Guaranteed that there will be at least one event in events, and all events must have the same pointer type\n if (this.autoPreventDefault && events[0].isNormalized) {\n var cancelable = originalEvent.cancelable || !('cancelable' in originalEvent);\n if (cancelable) {\n originalEvent.preventDefault();\n }\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerDown, true);\n this.emit('pointerdown', interactionEvent);\n if (event.pointerType === 'touch') {\n this.emit('touchstart', interactionEvent);\n }\n // emit a mouse event for \"pen\" pointers, the way a browser would emit a fallback event\n else if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? 'rightdown' : 'mousedown', this.eventData);\n }\n }\n };\n /**\n * Processes the result of the pointer down check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerDown = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (hit) {\n if (!displayObject.trackedPointers[id]) {\n displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n this.dispatchEvent(displayObject, 'pointerdown', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchstart', interactionEvent);\n }\n else if (data.pointerType === 'mouse' || data.pointerType === 'pen') {\n var isRightButton = data.button === 2;\n if (isRightButton) {\n displayObject.trackedPointers[id].rightDown = true;\n }\n else {\n displayObject.trackedPointers[id].leftDown = true;\n }\n this.dispatchEvent(displayObject, isRightButton ? 'rightdown' : 'mousedown', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n * @param originalEvent - The DOM event of a pointer button being released\n * @param cancelled - true if the pointer is cancelled\n * @param func - Function passed to {@link processInteractive}\n */\n InteractionManager.prototype.onPointerComplete = function (originalEvent, cancelled, func) {\n var events = this.normalizeToPointerData(originalEvent);\n var eventLen = events.length;\n // if the event wasn't targeting our canvas, then consider it to be pointerupoutside\n // in all cases (unless it was a pointercancel)\n var target = originalEvent.target;\n // if in shadow DOM use composedPath to access target\n if (originalEvent.composedPath && originalEvent.composedPath().length > 0) {\n target = originalEvent.composedPath()[0];\n }\n var eventAppend = target !== this.interactionDOMElement ? 'outside' : '';\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n // perform hit testing for events targeting our canvas or cancel events\n this.processInteractive(interactionEvent, this.lastObjectRendered, func, cancelled || !eventAppend);\n this.emit(cancelled ? 'pointercancel' : \"pointerup\" + eventAppend, interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n var isRightButton = event.button === 2;\n this.emit(isRightButton ? \"rightup\" + eventAppend : \"mouseup\" + eventAppend, interactionEvent);\n }\n else if (event.pointerType === 'touch') {\n this.emit(cancelled ? 'touchcancel' : \"touchend\" + eventAppend, interactionEvent);\n this.releaseInteractionDataForPointerId(event.pointerId);\n }\n }\n };\n /**\n * Is called when the pointer button is cancelled\n * @param event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerCancel = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, true, this.processPointerCancel);\n };\n /**\n * Processes the result of the pointer cancel check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n */\n InteractionManager.prototype.processPointerCancel = function (interactionEvent, displayObject) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n if (displayObject.trackedPointers[id] !== undefined) {\n delete displayObject.trackedPointers[id];\n this.dispatchEvent(displayObject, 'pointercancel', interactionEvent);\n if (data.pointerType === 'touch') {\n this.dispatchEvent(displayObject, 'touchcancel', interactionEvent);\n }\n }\n };\n /**\n * Is called when the pointer button is released on the renderer element\n * @param event - The DOM event of a pointer button being released\n */\n InteractionManager.prototype.onPointerUp = function (event) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && event.pointerType === 'touch')\n { return; }\n this.onPointerComplete(event, false, this.processPointerUp);\n };\n /**\n * Processes the result of the pointer up check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerUp = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var trackingData = displayObject.trackedPointers[id];\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n // need to track mouse down status in the mouse block so that we can emit\n // event in a later block\n var isMouseTap = false;\n // Mouse only\n if (isMouse) {\n var isRightButton = data.button === 2;\n var flags = InteractionTrackingData.FLAGS;\n var test = isRightButton ? flags.RIGHT_DOWN : flags.LEFT_DOWN;\n var isDown = trackingData !== undefined && (trackingData.flags & test);\n if (hit) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightup' : 'mouseup', interactionEvent);\n if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightclick' : 'click', interactionEvent);\n // because we can confirm that the mousedown happened on this object, flag for later emit of pointertap\n isMouseTap = true;\n }\n }\n else if (isDown) {\n this.dispatchEvent(displayObject, isRightButton ? 'rightupoutside' : 'mouseupoutside', interactionEvent);\n }\n // update the down state of the tracking data\n if (trackingData) {\n if (isRightButton) {\n trackingData.rightDown = false;\n }\n else {\n trackingData.leftDown = false;\n }\n }\n }\n // Pointers and Touches, and Mouse\n if (hit) {\n this.dispatchEvent(displayObject, 'pointerup', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchend', interactionEvent); }\n if (trackingData) {\n // emit pointertap if not a mouse, or if the mouse block decided it was a tap\n if (!isMouse || isMouseTap) {\n this.dispatchEvent(displayObject, 'pointertap', interactionEvent);\n }\n if (isTouch) {\n this.dispatchEvent(displayObject, 'tap', interactionEvent);\n // touches are no longer over (if they ever were) when we get the touchend\n // so we should ensure that we don't keep pretending that they are\n trackingData.over = false;\n }\n }\n }\n else if (trackingData) {\n this.dispatchEvent(displayObject, 'pointerupoutside', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchendoutside', interactionEvent); }\n }\n // Only remove the tracking data if there is no over/down state still associated with it\n if (trackingData && trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n };\n /**\n * Is called when the pointer moves across the renderer element\n * @param originalEvent - The DOM event of a pointer moving\n */\n InteractionManager.prototype.onPointerMove = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n if (events[0].pointerType === 'mouse' || events[0].pointerType === 'pen') {\n this._didMove = true;\n this.cursor = null;\n }\n var eventLen = events.length;\n for (var i = 0; i < eventLen; i++) {\n var event = events[i];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = originalEvent;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerMove, true);\n this.emit('pointermove', interactionEvent);\n if (event.pointerType === 'touch')\n { this.emit('touchmove', interactionEvent); }\n if (event.pointerType === 'mouse' || event.pointerType === 'pen')\n { this.emit('mousemove', interactionEvent); }\n }\n if (events[0].pointerType === 'mouse') {\n this.setCursorMode(this.cursor);\n // TODO BUG for parents interactive object (border order issue)\n }\n };\n /**\n * Processes the result of the pointer move check and dispatches the event if need be\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerMove = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var isTouch = data.pointerType === 'touch';\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n if (isMouse) {\n this.processPointerOverOut(interactionEvent, displayObject, hit);\n }\n if (!this.moveWhenInside || hit) {\n this.dispatchEvent(displayObject, 'pointermove', interactionEvent);\n if (isTouch)\n { this.dispatchEvent(displayObject, 'touchmove', interactionEvent); }\n if (isMouse)\n { this.dispatchEvent(displayObject, 'mousemove', interactionEvent); }\n }\n };\n /**\n * Is called when the pointer is moved out of the renderer element\n * @private\n * @param {PointerEvent} originalEvent - The DOM event of a pointer being moved out\n */\n InteractionManager.prototype.onPointerOut = function (originalEvent) {\n // if we support touch events, then only use those for touch events, not pointer events\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOut, so events will always be length 1\n var event = events[0];\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = false;\n this.setCursorMode(null);\n }\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n this.processInteractive(interactionEvent, this.lastObjectRendered, this.processPointerOverOut, false);\n this.emit('pointerout', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseout', interactionEvent);\n }\n else {\n // we can get touchleave events after touchend, so we want to make sure we don't\n // introduce memory leaks\n this.releaseInteractionDataForPointerId(interactionData.identifier);\n }\n };\n /**\n * Processes the result of the pointer over/out check and dispatches the event if need be.\n * @param interactionEvent - The interaction event wrapping the DOM event\n * @param displayObject - The display object that was tested\n * @param hit - the result of the hit test on the display object\n */\n InteractionManager.prototype.processPointerOverOut = function (interactionEvent, displayObject, hit) {\n var data = interactionEvent.data;\n var id = interactionEvent.data.identifier;\n var isMouse = (data.pointerType === 'mouse' || data.pointerType === 'pen');\n var trackingData = displayObject.trackedPointers[id];\n // if we just moused over the display object, then we need to track that state\n if (hit && !trackingData) {\n trackingData = displayObject.trackedPointers[id] = new InteractionTrackingData(id);\n }\n if (trackingData === undefined)\n { return; }\n if (hit && this.mouseOverRenderer) {\n if (!trackingData.over) {\n trackingData.over = true;\n this.delayDispatchEvent(displayObject, 'pointerover', interactionEvent);\n if (isMouse) {\n this.delayDispatchEvent(displayObject, 'mouseover', interactionEvent);\n }\n }\n // only change the cursor if it has not already been changed (by something deeper in the\n // display tree)\n if (isMouse && this.cursor === null) {\n this.cursor = displayObject.cursor;\n }\n }\n else if (trackingData.over) {\n trackingData.over = false;\n this.dispatchEvent(displayObject, 'pointerout', this.eventData);\n if (isMouse) {\n this.dispatchEvent(displayObject, 'mouseout', interactionEvent);\n }\n // if there is no mouse down information for the pointer, then it is safe to delete\n if (trackingData.none) {\n delete displayObject.trackedPointers[id];\n }\n }\n };\n /**\n * Is called when the pointer is moved into the renderer element.\n * @param originalEvent - The DOM event of a pointer button being moved into the renderer view.\n */\n InteractionManager.prototype.onPointerOver = function (originalEvent) {\n if (this.supportsTouchEvents && originalEvent.pointerType === 'touch')\n { return; }\n var events = this.normalizeToPointerData(originalEvent);\n // Only mouse and pointer can call onPointerOver, so events will always be length 1\n var event = events[0];\n var interactionData = this.getInteractionDataForPointerId(event);\n var interactionEvent = this.configureInteractionEventForDOMEvent(this.eventData, event, interactionData);\n interactionEvent.data.originalEvent = event;\n if (event.pointerType === 'mouse') {\n this.mouseOverRenderer = true;\n }\n this.emit('pointerover', interactionEvent);\n if (event.pointerType === 'mouse' || event.pointerType === 'pen') {\n this.emit('mouseover', interactionEvent);\n }\n };\n /**\n * Get InteractionData for a given pointerId. Store that data as well.\n * @param event - Normalized pointer event, output from normalizeToPointerData.\n * @returns - Interaction data for the given pointer identifier.\n */\n InteractionManager.prototype.getInteractionDataForPointerId = function (event) {\n var pointerId = event.pointerId;\n var interactionData;\n if (pointerId === MOUSE_POINTER_ID || event.pointerType === 'mouse') {\n interactionData = this.mouse;\n }\n else if (this.activeInteractionData[pointerId]) {\n interactionData = this.activeInteractionData[pointerId];\n }\n else {\n interactionData = this.interactionDataPool.pop() || new InteractionData();\n interactionData.identifier = pointerId;\n this.activeInteractionData[pointerId] = interactionData;\n }\n // copy properties from the event, so that we can make sure that touch/pointer specific\n // data is available\n interactionData.copyEvent(event);\n return interactionData;\n };\n /**\n * Return unused InteractionData to the pool, for a given pointerId\n * @param pointerId - Identifier from a pointer event\n */\n InteractionManager.prototype.releaseInteractionDataForPointerId = function (pointerId) {\n var interactionData = this.activeInteractionData[pointerId];\n if (interactionData) {\n delete this.activeInteractionData[pointerId];\n interactionData.reset();\n this.interactionDataPool.push(interactionData);\n }\n };\n /**\n * Configure an InteractionEvent to wrap a DOM PointerEvent and InteractionData\n * @param interactionEvent - The event to be configured\n * @param pointerEvent - The DOM event that will be paired with the InteractionEvent\n * @param interactionData - The InteractionData that will be paired\n * with the InteractionEvent\n * @returns - the interaction event that was passed in\n */\n InteractionManager.prototype.configureInteractionEventForDOMEvent = function (interactionEvent, pointerEvent, interactionData) {\n interactionEvent.data = interactionData;\n this.mapPositionToPoint(interactionData.global, pointerEvent.clientX, pointerEvent.clientY);\n // Not really sure why this is happening, but it's how a previous version handled things\n if (pointerEvent.pointerType === 'touch') {\n pointerEvent.globalX = interactionData.global.x;\n pointerEvent.globalY = interactionData.global.y;\n }\n interactionData.originalEvent = pointerEvent;\n interactionEvent.reset();\n return interactionEvent;\n };\n /**\n * Ensures that the original event object contains all data that a regular pointer event would have\n * @param {TouchEvent|MouseEvent|PointerEvent} event - The original event data from a touch or mouse event\n * @returns - An array containing a single normalized pointer event, in the case of a pointer\n * or mouse event, or a multiple normalized pointer events if there are multiple changed touches\n */\n InteractionManager.prototype.normalizeToPointerData = function (event) {\n var normalizedEvents = [];\n if (this.supportsTouchEvents && event instanceof TouchEvent) {\n for (var i = 0, li = event.changedTouches.length; i < li; i++) {\n var touch = event.changedTouches[i];\n if (typeof touch.button === 'undefined')\n { touch.button = event.touches.length ? 1 : 0; }\n if (typeof touch.buttons === 'undefined')\n { touch.buttons = event.touches.length ? 1 : 0; }\n if (typeof touch.isPrimary === 'undefined') {\n touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';\n }\n if (typeof touch.width === 'undefined')\n { touch.width = touch.radiusX || 1; }\n if (typeof touch.height === 'undefined')\n { touch.height = touch.radiusY || 1; }\n if (typeof touch.tiltX === 'undefined')\n { touch.tiltX = 0; }\n if (typeof touch.tiltY === 'undefined')\n { touch.tiltY = 0; }\n if (typeof touch.pointerType === 'undefined')\n { touch.pointerType = 'touch'; }\n if (typeof touch.pointerId === 'undefined')\n { touch.pointerId = touch.identifier || 0; }\n if (typeof touch.pressure === 'undefined')\n { touch.pressure = touch.force || 0.5; }\n if (typeof touch.twist === 'undefined')\n { touch.twist = 0; }\n if (typeof touch.tangentialPressure === 'undefined')\n { touch.tangentialPressure = 0; }\n // TODO: Remove these, as layerX/Y is not a standard, is deprecated, has uneven\n // support, and the fill ins are not quite the same\n // offsetX/Y might be okay, but is not the same as clientX/Y when the canvas's top\n // left is not 0,0 on the page\n if (typeof touch.layerX === 'undefined')\n { touch.layerX = touch.offsetX = touch.clientX; }\n if (typeof touch.layerY === 'undefined')\n { touch.layerY = touch.offsetY = touch.clientY; }\n // mark the touch as normalized, just so that we know we did it\n touch.isNormalized = true;\n normalizedEvents.push(touch);\n }\n }\n // apparently PointerEvent subclasses MouseEvent, so yay\n else if (!globalThis.MouseEvent\n || (event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof globalThis.PointerEvent)))) {\n var tempEvent = event;\n if (typeof tempEvent.isPrimary === 'undefined')\n { tempEvent.isPrimary = true; }\n if (typeof tempEvent.width === 'undefined')\n { tempEvent.width = 1; }\n if (typeof tempEvent.height === 'undefined')\n { tempEvent.height = 1; }\n if (typeof tempEvent.tiltX === 'undefined')\n { tempEvent.tiltX = 0; }\n if (typeof tempEvent.tiltY === 'undefined')\n { tempEvent.tiltY = 0; }\n if (typeof tempEvent.pointerType === 'undefined')\n { tempEvent.pointerType = 'mouse'; }\n if (typeof tempEvent.pointerId === 'undefined')\n { tempEvent.pointerId = MOUSE_POINTER_ID; }\n if (typeof tempEvent.pressure === 'undefined')\n { tempEvent.pressure = 0.5; }\n if (typeof tempEvent.twist === 'undefined')\n { tempEvent.twist = 0; }\n if (typeof tempEvent.tangentialPressure === 'undefined')\n { tempEvent.tangentialPressure = 0; }\n // mark the mouse event as normalized, just so that we know we did it\n tempEvent.isNormalized = true;\n normalizedEvents.push(tempEvent);\n }\n else {\n normalizedEvents.push(event);\n }\n return normalizedEvents;\n };\n /** Destroys the interaction manager. */\n InteractionManager.prototype.destroy = function () {\n this.removeEvents();\n this.removeTickerListener();\n this.removeAllListeners();\n this.renderer = null;\n this.mouse = null;\n this.eventData = null;\n this.interactionDOMElement = null;\n this.onPointerDown = null;\n this.processPointerDown = null;\n this.onPointerUp = null;\n this.processPointerUp = null;\n this.onPointerCancel = null;\n this.processPointerCancel = null;\n this.onPointerMove = null;\n this.processPointerMove = null;\n this.onPointerOut = null;\n this.processPointerOverOut = null;\n this.onPointerOver = null;\n this.search = null;\n };\n /** @ignore */\n InteractionManager.extension = {\n name: 'interaction',\n type: [\n ExtensionType.RendererPlugin,\n ExtensionType.CanvasRendererPlugin ],\n };\n return InteractionManager;\n}(EventEmitter));\n\nexport { InteractionData, InteractionEvent, InteractionManager, InteractionTrackingData, interactiveTarget };\n//# sourceMappingURL=interaction.mjs.map\n","/*!\n * @pixi/extract - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/extract is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { MSAA_QUALITY } from '@pixi/constants';\nimport { CanvasRenderTarget } from '@pixi/utils';\nimport { Rectangle } from '@pixi/math';\nimport { ExtensionType, RenderTexture } from '@pixi/core';\n\nvar TEMP_RECT = new Rectangle();\nvar BYTES_PER_PIXEL = 4;\n/**\n * This class provides renderer-specific plugins for exporting content from a renderer.\n * For instance, these plugins can be used for saving an Image, Canvas element or for exporting the raw image data (pixels).\n *\n * Do not instantiate these plugins directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new app (will auto-add extract plugin to renderer)\n * const app = new PIXI.Application();\n *\n * // Draw a red circle\n * const graphics = new PIXI.Graphics()\n * .beginFill(0xFF0000)\n * .drawCircle(0, 0, 50);\n *\n * // Render the graphics as an HTMLImageElement\n * const image = app.renderer.plugins.extract.image(graphics);\n * document.body.appendChild(image);\n * @memberof PIXI\n */\nvar Extract = /** @class */ (function () {\n /**\n * @param renderer - A reference to the current renderer\n */\n function Extract(renderer) {\n this.renderer = renderer;\n }\n /**\n * Will return a HTML Image of the target\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param format - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @returns - HTML Image of the target\n */\n Extract.prototype.image = function (target, format, quality) {\n var image = new Image();\n image.src = this.base64(target, format, quality);\n return image;\n };\n /**\n * Will return a base64 encoded string of this target. It works by calling\n * `Extract.getCanvas` and then running toDataURL on that.\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param format - Image format, e.g. \"image/jpeg\" or \"image/webp\".\n * @param quality - JPEG or Webp compression from 0 to 1. Default is 0.92.\n * @returns - A base64 encoded string of the texture.\n */\n Extract.prototype.base64 = function (target, format, quality) {\n return this.canvas(target).toDataURL(format, quality);\n };\n /**\n * Creates a Canvas element, renders this target to it and then returns it.\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param frame - The frame the extraction is restricted to.\n * @returns - A Canvas element with the texture rendered on.\n */\n Extract.prototype.canvas = function (target, frame) {\n var _a = this._rawPixels(target, frame), pixels = _a.pixels, width = _a.width, height = _a.height, flipY = _a.flipY;\n var canvasBuffer = new CanvasRenderTarget(width, height, 1);\n // Add the pixels to the canvas\n var canvasData = canvasBuffer.context.getImageData(0, 0, width, height);\n Extract.arrayPostDivide(pixels, canvasData.data);\n canvasBuffer.context.putImageData(canvasData, 0, 0);\n // Flipping pixels\n if (flipY) {\n var target_1 = new CanvasRenderTarget(canvasBuffer.width, canvasBuffer.height, 1);\n target_1.context.scale(1, -1);\n // We can't render to itself because we should be empty before render.\n target_1.context.drawImage(canvasBuffer.canvas, 0, -height);\n canvasBuffer.destroy();\n canvasBuffer = target_1;\n }\n // Send the canvas back\n return canvasBuffer.canvas;\n };\n /**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n * @param target - A displayObject or renderTexture\n * to convert. If left empty will use the main renderer\n * @param frame - The frame the extraction is restricted to.\n * @returns - One-dimensional array containing the pixel data of the entire texture\n */\n Extract.prototype.pixels = function (target, frame) {\n var pixels = this._rawPixels(target, frame).pixels;\n Extract.arrayPostDivide(pixels, pixels);\n return pixels;\n };\n Extract.prototype._rawPixels = function (target, frame) {\n var renderer = this.renderer;\n var resolution;\n var flipY = false;\n var renderTexture;\n var generated = false;\n if (target) {\n if (target instanceof RenderTexture) {\n renderTexture = target;\n }\n else {\n var multisample = renderer.context.webGLVersion >= 2 ? renderer.multisample : MSAA_QUALITY.NONE;\n renderTexture = this.renderer.generateTexture(target, { multisample: multisample });\n if (multisample !== MSAA_QUALITY.NONE) {\n // Resolve the multisampled texture to a non-multisampled texture\n var resolvedTexture = RenderTexture.create({\n width: renderTexture.width,\n height: renderTexture.height,\n });\n renderer.framebuffer.bind(renderTexture.framebuffer);\n renderer.framebuffer.blit(resolvedTexture.framebuffer);\n renderer.framebuffer.bind(null);\n renderTexture.destroy(true);\n renderTexture = resolvedTexture;\n }\n generated = true;\n }\n }\n if (renderTexture) {\n resolution = renderTexture.baseTexture.resolution;\n frame = frame !== null && frame !== void 0 ? frame : renderTexture.frame;\n flipY = false;\n renderer.renderTexture.bind(renderTexture);\n }\n else {\n resolution = renderer.resolution;\n if (!frame) {\n frame = TEMP_RECT;\n frame.width = renderer.width;\n frame.height = renderer.height;\n }\n flipY = true;\n renderer.renderTexture.bind(null);\n }\n var width = Math.round(frame.width * resolution);\n var height = Math.round(frame.height * resolution);\n var pixels = new Uint8Array(BYTES_PER_PIXEL * width * height);\n // Read pixels to the array\n var gl = renderer.gl;\n gl.readPixels(Math.round(frame.x * resolution), Math.round(frame.y * resolution), width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);\n if (generated) {\n renderTexture.destroy(true);\n }\n return { pixels: pixels, width: width, height: height, flipY: flipY };\n };\n /** Destroys the extract. */\n Extract.prototype.destroy = function () {\n this.renderer = null;\n };\n /**\n * Takes premultiplied pixel data and produces regular pixel data\n * @private\n * @param pixels - array of pixel data\n * @param out - output array\n */\n Extract.arrayPostDivide = function (pixels, out) {\n for (var i = 0; i < pixels.length; i += 4) {\n var alpha = out[i + 3] = pixels[i + 3];\n if (alpha !== 0) {\n out[i] = Math.round(Math.min(pixels[i] * 255.0 / alpha, 255.0));\n out[i + 1] = Math.round(Math.min(pixels[i + 1] * 255.0 / alpha, 255.0));\n out[i + 2] = Math.round(Math.min(pixels[i + 2] * 255.0 / alpha, 255.0));\n }\n else {\n out[i] = pixels[i];\n out[i + 1] = pixels[i + 1];\n out[i + 2] = pixels[i + 2];\n }\n }\n };\n /** @ignore */\n Extract.extension = {\n name: 'extract',\n type: ExtensionType.RendererPlugin,\n };\n return Extract;\n}());\n\nexport { Extract };\n//# sourceMappingURL=extract.mjs.map\n","/*!\n * @pixi/loaders - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/loaders is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { extensions, ExtensionType, Texture } from '@pixi/core';\nimport { deprecation } from '@pixi/utils';\n\n/* jshint -W097 */\n/**\n * @memberof PIXI\n */\nvar SignalBinding = /** @class */ (function () {\n /**\n * SignalBinding constructor.\n * @constructs SignalBinding\n * @param {Function} fn - Event handler to be called.\n * @param {boolean} [once=false] - Should this listener be removed after dispatch\n * @param {object} [thisArg] - The context of the callback function.\n * @api private\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n function SignalBinding(fn, once, thisArg) {\n if (once === void 0) { once = false; }\n this._fn = fn;\n this._once = once;\n this._thisArg = thisArg;\n this._next = this._prev = this._owner = null;\n }\n SignalBinding.prototype.detach = function () {\n if (this._owner === null)\n { return false; }\n this._owner.detach(this);\n return true;\n };\n return SignalBinding;\n}());\n/**\n * @param self\n * @param node\n * @private\n */\nfunction _addSignalBinding(self, node) {\n if (!self._head) {\n self._head = node;\n self._tail = node;\n }\n else {\n self._tail._next = node;\n node._prev = self._tail;\n self._tail = node;\n }\n node._owner = self;\n return node;\n}\n/**\n * @memberof PIXI\n */\nvar Signal = /** @class */ (function () {\n /**\n * MiniSignal constructor.\n * @example\n * let mySignal = new Signal();\n * let binding = mySignal.add(onSignal);\n * mySignal.dispatch('foo', 'bar');\n * mySignal.detach(binding);\n */\n function Signal() {\n this._head = this._tail = undefined;\n }\n /**\n * Return an array of attached SignalBinding.\n * @param {boolean} [exists=false] - We only need to know if there are handlers.\n * @returns {PIXI.SignalBinding[] | boolean} Array of attached SignalBinding or Boolean if called with exists = true\n * @api public\n */\n Signal.prototype.handlers = function (exists) {\n if (exists === void 0) { exists = false; }\n var node = this._head;\n if (exists)\n { return !!node; }\n var ee = [];\n while (node) {\n ee.push(node);\n node = node._next;\n }\n return ee;\n };\n /**\n * Return true if node is a SignalBinding attached to this MiniSignal\n * @param {PIXI.SignalBinding} node - Node to check.\n * @returns {boolean} True if node is attache to mini-signal\n */\n Signal.prototype.has = function (node) {\n if (!(node instanceof SignalBinding)) {\n throw new Error('MiniSignal#has(): First arg must be a SignalBinding object.');\n }\n return node._owner === this;\n };\n /**\n * Dispaches a signal to all registered listeners.\n * @param {...any} args\n * @returns {boolean} Indication if we've emitted an event.\n */\n Signal.prototype.dispatch = function () {\n var arguments$1 = arguments;\n\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n var node = this._head;\n if (!node)\n { return false; }\n while (node) {\n if (node._once)\n { this.detach(node); }\n node._fn.apply(node._thisArg, args);\n node = node._next;\n }\n return true;\n };\n /**\n * Register a new listener.\n * @param {Function} fn - Callback function.\n * @param {object} [thisArg] - The context of the callback function.\n * @returns {PIXI.SignalBinding} The SignalBinding node that was added.\n */\n Signal.prototype.add = function (fn, thisArg) {\n if (thisArg === void 0) { thisArg = null; }\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#add(): First arg must be a Function.');\n }\n return _addSignalBinding(this, new SignalBinding(fn, false, thisArg));\n };\n /**\n * Register a new listener that will be executed only once.\n * @param {Function} fn - Callback function.\n * @param {object} [thisArg] - The context of the callback function.\n * @returns {PIXI.SignalBinding} The SignalBinding node that was added.\n */\n Signal.prototype.once = function (fn, thisArg) {\n if (thisArg === void 0) { thisArg = null; }\n if (typeof fn !== 'function') {\n throw new Error('MiniSignal#once(): First arg must be a Function.');\n }\n return _addSignalBinding(this, new SignalBinding(fn, true, thisArg));\n };\n /**\n * Remove binding object.\n * @param {PIXI.SignalBinding} node - The binding node that will be removed.\n * @returns {Signal} The instance on which this method was called.\n @api public */\n Signal.prototype.detach = function (node) {\n if (!(node instanceof SignalBinding)) {\n throw new Error('MiniSignal#detach(): First arg must be a SignalBinding object.');\n }\n if (node._owner !== this)\n { return this; } // todo: or error?\n if (node._prev)\n { node._prev._next = node._next; }\n if (node._next)\n { node._next._prev = node._prev; }\n if (node === this._head) { // first node\n this._head = node._next;\n if (node._next === null) {\n this._tail = null;\n }\n }\n else if (node === this._tail) { // last node\n this._tail = node._prev;\n this._tail._next = null;\n }\n node._owner = null;\n return this;\n };\n /**\n * Detach all listeners.\n * @returns {Signal} The instance on which this method was called.\n */\n Signal.prototype.detachAll = function () {\n var node = this._head;\n if (!node)\n { return this; }\n this._head = this._tail = null;\n while (node) {\n node._owner = null;\n node = node._next;\n }\n return this;\n };\n return Signal;\n}());\n\n/**\n * function from npm package `parseUri`, converted to TS to avoid leftpad incident\n * @param {string} str\n * @param [opts] - options\n * @param {boolean} [opts.strictMode] - type of parser\n */\nfunction parseUri(str, opts) {\n opts = opts || {};\n var o = {\n // eslint-disable-next-line max-len\n key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n // eslint-disable-next-line max-len\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n // eslint-disable-next-line max-len\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n };\n var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n var i = 14;\n while (i--)\n { uri[o.key[i]] = m[i] || ''; }\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function (_t0, t1, t2) {\n if (t1)\n { uri[o.q.name][t1] = t2; }\n });\n return uri;\n}\n\n// tests if CORS is supported in XHR, if not we need to use XDR\nvar useXdr;\nvar tempAnchor = null;\n// some status constants\nvar STATUS_NONE = 0;\nvar STATUS_OK = 200;\nvar STATUS_EMPTY = 204;\nvar STATUS_IE_BUG_EMPTY = 1223;\nvar STATUS_TYPE_OK = 2;\n// noop\nfunction _noop$1() { }\n/**\n * Quick helper to set a value on one of the extension maps. Ensures there is no\n * dot at the start of the extension.\n * @ignore\n * @param map - The map to set on.\n * @param extname - The extension (or key) to set.\n * @param val - The value to set.\n */\nfunction setExtMap(map, extname, val) {\n if (extname && extname.indexOf('.') === 0) {\n extname = extname.substring(1);\n }\n if (!extname) {\n return;\n }\n map[extname] = val;\n}\n/**\n * Quick helper to get string xhr type.\n * @ignore\n * @param xhr - The request to check.\n * @returns The type.\n */\nfunction reqType(xhr) {\n return xhr.toString().replace('object ', '');\n}\n/**\n * Manages the state and loading of a resource and all child resources.\n *\n * Can be extended in `GlobalMixins.LoaderResource`.\n * @memberof PIXI\n */\nvar LoaderResource = /** @class */ (function () {\n /**\n * @param {string} name - The name of the resource to load.\n * @param {string|string[]} url - The url for this resource, for audio/video loads you can pass\n * an array of sources.\n * @param {object} [options] - The options for the load.\n * @param {string|boolean} [options.crossOrigin] - Is this request cross-origin? Default is to\n * determine automatically.\n * @param {number} [options.timeout=0] - A timeout in milliseconds for the load. If the load takes\n * longer than this time it is cancelled and the load is considered a failure. If this value is\n * set to `0` then there is no explicit timeout.\n * @param {PIXI.LoaderResource.LOAD_TYPE} [options.loadType=LOAD_TYPE.XHR] - How should this resource\n * be loaded?\n * @param {PIXI.LoaderResource.XHR_RESPONSE_TYPE} [options.xhrType=XHR_RESPONSE_TYPE.DEFAULT] - How\n * should the data being loaded be interpreted when using XHR?\n * @param {PIXI.LoaderResource.IMetadata} [options.metadata] - Extra configuration for middleware\n * and the Resource object.\n */\n function LoaderResource(name, url, options) {\n /**\n * The `dequeue` method that will be used a storage place for the async queue dequeue method\n * used privately by the loader.\n * @private\n * @member {Function}\n */\n this._dequeue = _noop$1;\n /**\n * Used a storage place for the on load binding used privately by the loader.\n * @private\n * @member {Function}\n */\n this._onLoadBinding = null;\n /**\n * The timer for element loads to check if they timeout.\n * @private\n */\n this._elementTimer = 0;\n /**\n * The `complete` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundComplete = null;\n /**\n * The `_onError` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundOnError = null;\n /**\n * The `_onProgress` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundOnProgress = null;\n /**\n * The `_onTimeout` function bound to this resource's context.\n * @private\n * @type {Function}\n */\n this._boundOnTimeout = null;\n this._boundXhrOnError = null;\n this._boundXhrOnTimeout = null;\n this._boundXhrOnAbort = null;\n this._boundXhrOnLoad = null;\n if (typeof name !== 'string' || typeof url !== 'string') {\n throw new Error('Both name and url are required for constructing a resource.');\n }\n options = options || {};\n this._flags = 0;\n // set data url flag, needs to be set early for some _determineX checks to work.\n this._setFlag(LoaderResource.STATUS_FLAGS.DATA_URL, url.indexOf('data:') === 0);\n this.name = name;\n this.url = url;\n this.extension = this._getExtension();\n this.data = null;\n this.crossOrigin = options.crossOrigin === true ? 'anonymous' : options.crossOrigin;\n this.timeout = options.timeout || 0;\n this.loadType = options.loadType || this._determineLoadType();\n // The type used to load the resource via XHR. If unset, determined automatically.\n this.xhrType = options.xhrType;\n // Extra info for middleware, and controlling specifics about how the resource loads.\n // Note that if you pass in a `loadElement`, the Resource class takes ownership of it.\n // Meaning it will modify it as it sees fit.\n this.metadata = options.metadata || {};\n // The error that occurred while loading (if any).\n this.error = null;\n // The XHR object that was used to load this resource. This is only set\n // when `loadType` is `LoaderResource.LOAD_TYPE.XHR`.\n this.xhr = null;\n // The child resources this resource owns.\n this.children = [];\n // The resource type.\n this.type = LoaderResource.TYPE.UNKNOWN;\n // The progress chunk owned by this resource.\n this.progressChunk = 0;\n // The `dequeue` method that will be used a storage place for the async queue dequeue method\n // used privately by the loader.\n this._dequeue = _noop$1;\n // Used a storage place for the on load binding used privately by the loader.\n this._onLoadBinding = null;\n // The timer for element loads to check if they timeout.\n this._elementTimer = 0;\n this._boundComplete = this.complete.bind(this);\n this._boundOnError = this._onError.bind(this);\n this._boundOnProgress = this._onProgress.bind(this);\n this._boundOnTimeout = this._onTimeout.bind(this);\n // xhr callbacks\n this._boundXhrOnError = this._xhrOnError.bind(this);\n this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this);\n this._boundXhrOnAbort = this._xhrOnAbort.bind(this);\n this._boundXhrOnLoad = this._xhrOnLoad.bind(this);\n // Dispatched when the resource beings to load.\n this.onStart = new Signal();\n // Dispatched each time progress of this resource load updates.\n // Not all resources types and loader systems can support this event\n // so sometimes it may not be available. If the resource\n // is being loaded on a modern browser, using XHR, and the remote server\n // properly sets Content-Length headers, then this will be available.\n this.onProgress = new Signal();\n // Dispatched once this resource has loaded, if there was an error it will\n // be in the `error` property.\n this.onComplete = new Signal();\n // Dispatched after this resource has had all the *after* middleware run on it.\n this.onAfterMiddleware = new Signal();\n }\n /**\n * Sets the load type to be used for a specific extension.\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {PIXI.LoaderResource.LOAD_TYPE} loadType - The load type to set it to.\n */\n LoaderResource.setExtensionLoadType = function (extname, loadType) {\n setExtMap(LoaderResource._loadTypeMap, extname, loadType);\n };\n /**\n * Sets the load type to be used for a specific extension.\n * @static\n * @param {string} extname - The extension to set the type for, e.g. \"png\" or \"fnt\"\n * @param {PIXI.LoaderResource.XHR_RESPONSE_TYPE} xhrType - The xhr type to set it to.\n */\n LoaderResource.setExtensionXhrType = function (extname, xhrType) {\n setExtMap(LoaderResource._xhrTypeMap, extname, xhrType);\n };\n Object.defineProperty(LoaderResource.prototype, \"isDataUrl\", {\n /**\n * When the resource starts to load.\n * @memberof PIXI.LoaderResource\n * @callback OnStartSignal\n * @param {PIXI.Resource} resource - The resource that the event happened on.\n */\n /**\n * When the resource reports loading progress.\n * @memberof PIXI.LoaderResource\n * @callback OnProgressSignal\n * @param {PIXI.Resource} resource - The resource that the event happened on.\n * @param {number} percentage - The progress of the load in the range [0, 1].\n */\n /**\n * When the resource finishes loading.\n * @memberof PIXI.LoaderResource\n * @callback OnCompleteSignal\n * @param {PIXI.Resource} resource - The resource that the event happened on.\n */\n /**\n * @memberof PIXI.LoaderResource\n * @typedef {object} IMetadata\n * @property {HTMLImageElement|HTMLAudioElement|HTMLVideoElement} [loadElement=null] - The\n * element to use for loading, instead of creating one.\n * @property {boolean} [skipSource=false] - Skips adding source(s) to the load element. This\n * is useful if you want to pass in a `loadElement` that you already added load sources to.\n * @property {string|string[]} [mimeType] - The mime type to use for the source element\n * of a video/audio elment. If the urls are an array, you can pass this as an array as well\n * where each index is the mime type to use for the corresponding url index.\n */\n /**\n * Stores whether or not this url is a data url.\n * @readonly\n * @member {boolean}\n */\n get: function () {\n return this._hasFlag(LoaderResource.STATUS_FLAGS.DATA_URL);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LoaderResource.prototype, \"isComplete\", {\n /**\n * Describes if this resource has finished loading. Is true when the resource has completely\n * loaded.\n * @readonly\n * @member {boolean}\n */\n get: function () {\n return this._hasFlag(LoaderResource.STATUS_FLAGS.COMPLETE);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(LoaderResource.prototype, \"isLoading\", {\n /**\n * Describes if this resource is currently loading. Is true when the resource starts loading,\n * and is false again when complete.\n * @readonly\n * @member {boolean}\n */\n get: function () {\n return this._hasFlag(LoaderResource.STATUS_FLAGS.LOADING);\n },\n enumerable: false,\n configurable: true\n });\n /** Marks the resource as complete. */\n LoaderResource.prototype.complete = function () {\n this._clearEvents();\n this._finish();\n };\n /**\n * Aborts the loading of this resource, with an optional message.\n * @param {string} message - The message to use for the error\n */\n LoaderResource.prototype.abort = function (message) {\n // abort can be called multiple times, ignore subsequent calls.\n if (this.error) {\n return;\n }\n // store error\n this.error = new Error(message);\n // clear events before calling aborts\n this._clearEvents();\n // abort the actual loading\n if (this.xhr) {\n this.xhr.abort();\n }\n else if (this.xdr) {\n this.xdr.abort();\n }\n else if (this.data) {\n // single source\n if (this.data.src) {\n this.data.src = LoaderResource.EMPTY_GIF;\n }\n // multi-source\n else {\n while (this.data.firstChild) {\n this.data.removeChild(this.data.firstChild);\n }\n }\n }\n // done now.\n this._finish();\n };\n /**\n * Kicks off loading of this resource. This method is asynchronous.\n * @param {PIXI.LoaderResource.OnCompleteSignal} [cb] - Optional callback to call once the resource is loaded.\n */\n LoaderResource.prototype.load = function (cb) {\n var _this = this;\n if (this.isLoading) {\n return;\n }\n if (this.isComplete) {\n if (cb) {\n setTimeout(function () { return cb(_this); }, 1);\n }\n return;\n }\n else if (cb) {\n this.onComplete.once(cb);\n }\n this._setFlag(LoaderResource.STATUS_FLAGS.LOADING, true);\n this.onStart.dispatch(this);\n // if unset, determine the value\n if (this.crossOrigin === false || typeof this.crossOrigin !== 'string') {\n this.crossOrigin = this._determineCrossOrigin(this.url);\n }\n switch (this.loadType) {\n case LoaderResource.LOAD_TYPE.IMAGE:\n this.type = LoaderResource.TYPE.IMAGE;\n this._loadElement('image');\n break;\n case LoaderResource.LOAD_TYPE.AUDIO:\n this.type = LoaderResource.TYPE.AUDIO;\n this._loadSourceElement('audio');\n break;\n case LoaderResource.LOAD_TYPE.VIDEO:\n this.type = LoaderResource.TYPE.VIDEO;\n this._loadSourceElement('video');\n break;\n case LoaderResource.LOAD_TYPE.XHR:\n /* falls through */\n default:\n if (typeof useXdr === 'undefined') {\n useXdr = !!(globalThis.XDomainRequest && !('withCredentials' in (new XMLHttpRequest())));\n }\n if (useXdr && this.crossOrigin) {\n this._loadXdr();\n }\n else {\n this._loadXhr();\n }\n break;\n }\n };\n /**\n * Checks if the flag is set.\n * @param flag - The flag to check.\n * @returns True if the flag is set.\n */\n LoaderResource.prototype._hasFlag = function (flag) {\n return (this._flags & flag) !== 0;\n };\n /**\n * (Un)Sets the flag.\n * @param flag - The flag to (un)set.\n * @param value - Whether to set or (un)set the flag.\n */\n LoaderResource.prototype._setFlag = function (flag, value) {\n this._flags = value ? (this._flags | flag) : (this._flags & ~flag);\n };\n /** Clears all the events from the underlying loading source. */\n LoaderResource.prototype._clearEvents = function () {\n clearTimeout(this._elementTimer);\n if (this.data && this.data.removeEventListener) {\n this.data.removeEventListener('error', this._boundOnError, false);\n this.data.removeEventListener('load', this._boundComplete, false);\n this.data.removeEventListener('progress', this._boundOnProgress, false);\n this.data.removeEventListener('canplaythrough', this._boundComplete, false);\n }\n if (this.xhr) {\n if (this.xhr.removeEventListener) {\n this.xhr.removeEventListener('error', this._boundXhrOnError, false);\n this.xhr.removeEventListener('timeout', this._boundXhrOnTimeout, false);\n this.xhr.removeEventListener('abort', this._boundXhrOnAbort, false);\n this.xhr.removeEventListener('progress', this._boundOnProgress, false);\n this.xhr.removeEventListener('load', this._boundXhrOnLoad, false);\n }\n else {\n this.xhr.onerror = null;\n this.xhr.ontimeout = null;\n this.xhr.onprogress = null;\n this.xhr.onload = null;\n }\n }\n };\n /** Finalizes the load. */\n LoaderResource.prototype._finish = function () {\n if (this.isComplete) {\n throw new Error('Complete called again for an already completed resource.');\n }\n this._setFlag(LoaderResource.STATUS_FLAGS.COMPLETE, true);\n this._setFlag(LoaderResource.STATUS_FLAGS.LOADING, false);\n this.onComplete.dispatch(this);\n };\n /**\n * Loads this resources using an element that has a single source,\n * like an HTMLImageElement.\n * @private\n * @param type - The type of element to use.\n */\n LoaderResource.prototype._loadElement = function (type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n }\n else if (type === 'image' && typeof globalThis.Image !== 'undefined') {\n this.data = new Image();\n }\n else {\n this.data = document.createElement(type);\n }\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n if (!this.metadata.skipSource) {\n this.data.src = this.url;\n }\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n };\n /**\n * Loads this resources using an element that has multiple sources,\n * like an HTMLAudioElement or HTMLVideoElement.\n * @param type - The type of element to use.\n */\n LoaderResource.prototype._loadSourceElement = function (type) {\n if (this.metadata.loadElement) {\n this.data = this.metadata.loadElement;\n }\n else if (type === 'audio' && typeof globalThis.Audio !== 'undefined') {\n this.data = new Audio();\n }\n else {\n this.data = document.createElement(type);\n }\n if (this.data === null) {\n this.abort(\"Unsupported element: \" + type);\n return;\n }\n if (this.crossOrigin) {\n this.data.crossOrigin = this.crossOrigin;\n }\n if (!this.metadata.skipSource) {\n // support for CocoonJS Canvas+ runtime, lacks document.createElement('source')\n if (navigator.isCocoonJS) {\n this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;\n }\n else if (Array.isArray(this.url)) {\n var mimeTypes = this.metadata.mimeType;\n for (var i = 0; i < this.url.length; ++i) {\n this.data.appendChild(this._createSource(type, this.url[i], Array.isArray(mimeTypes) ? mimeTypes[i] : mimeTypes));\n }\n }\n else {\n var mimeTypes = this.metadata.mimeType;\n this.data.appendChild(this._createSource(type, this.url, Array.isArray(mimeTypes) ? mimeTypes[0] : mimeTypes));\n }\n }\n this.data.addEventListener('error', this._boundOnError, false);\n this.data.addEventListener('load', this._boundComplete, false);\n this.data.addEventListener('progress', this._boundOnProgress, false);\n this.data.addEventListener('canplaythrough', this._boundComplete, false);\n this.data.load();\n if (this.timeout) {\n this._elementTimer = setTimeout(this._boundOnTimeout, this.timeout);\n }\n };\n /** Loads this resources using an XMLHttpRequest. */\n LoaderResource.prototype._loadXhr = function () {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n var xhr = this.xhr = new XMLHttpRequest();\n // send credentials when crossOrigin with credentials requested\n if (this.crossOrigin === 'use-credentials') {\n xhr.withCredentials = true;\n }\n // set the request type and url\n xhr.open('GET', this.url, true);\n xhr.timeout = this.timeout;\n // load json as text and parse it ourselves. We do this because some browsers\n // *cough* safari *cough* can't deal with it.\n if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.JSON\n || this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT) {\n xhr.responseType = LoaderResource.XHR_RESPONSE_TYPE.TEXT;\n }\n else {\n xhr.responseType = this.xhrType;\n }\n xhr.addEventListener('error', this._boundXhrOnError, false);\n xhr.addEventListener('timeout', this._boundXhrOnTimeout, false);\n xhr.addEventListener('abort', this._boundXhrOnAbort, false);\n xhr.addEventListener('progress', this._boundOnProgress, false);\n xhr.addEventListener('load', this._boundXhrOnLoad, false);\n xhr.send();\n };\n /** Loads this resources using an XDomainRequest. This is here because we need to support IE9 (gross). */\n LoaderResource.prototype._loadXdr = function () {\n // if unset, determine the value\n if (typeof this.xhrType !== 'string') {\n this.xhrType = this._determineXhrType();\n }\n var xdr = this.xhr = new globalThis.XDomainRequest(); // eslint-disable-line no-undef\n // XDomainRequest has a few quirks. Occasionally it will abort requests\n // A way to avoid this is to make sure ALL callbacks are set even if not used\n // More info here: http://stackoverflow.com/questions/15786966/xdomainrequest-aborts-post-on-ie-9\n xdr.timeout = this.timeout || 5000; // XDR needs a timeout value or it breaks in IE9\n xdr.onerror = this._boundXhrOnError;\n xdr.ontimeout = this._boundXhrOnTimeout;\n xdr.onprogress = this._boundOnProgress;\n xdr.onload = this._boundXhrOnLoad;\n xdr.open('GET', this.url, true);\n // Note: The xdr.send() call is wrapped in a timeout to prevent an\n // issue with the interface where some requests are lost if multiple\n // XDomainRequests are being sent at the same time.\n // Some info here: https://github.com/photonstorm/phaser/issues/1248\n setTimeout(function () { return xdr.send(); }, 1);\n };\n /**\n * Creates a source used in loading via an element.\n * @param type - The element type (video or audio).\n * @param url - The source URL to load from.\n * @param [mime] - The mime type of the video\n * @returns The source element.\n */\n LoaderResource.prototype._createSource = function (type, url, mime) {\n if (!mime) {\n mime = type + \"/\" + this._getExtension(url);\n }\n var source = document.createElement('source');\n source.src = url;\n source.type = mime;\n return source;\n };\n /**\n * Called if a load errors out.\n * @param event - The error event from the element that emits it.\n */\n LoaderResource.prototype._onError = function (event) {\n this.abort(\"Failed to load element using: \" + event.target.nodeName);\n };\n /**\n * Called if a load progress event fires for an element or xhr/xdr.\n * @param event - Progress event.\n */\n LoaderResource.prototype._onProgress = function (event) {\n if (event && event.lengthComputable) {\n this.onProgress.dispatch(this, event.loaded / event.total);\n }\n };\n /** Called if a timeout event fires for an element. */\n LoaderResource.prototype._onTimeout = function () {\n this.abort(\"Load timed out.\");\n };\n /** Called if an error event fires for xhr/xdr. */\n LoaderResource.prototype._xhrOnError = function () {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request failed. Status: \" + xhr.status + \", text: \\\"\" + xhr.statusText + \"\\\"\");\n };\n /** Called if an error event fires for xhr/xdr. */\n LoaderResource.prototype._xhrOnTimeout = function () {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request timed out.\");\n };\n /** Called if an abort event fires for xhr/xdr. */\n LoaderResource.prototype._xhrOnAbort = function () {\n var xhr = this.xhr;\n this.abort(reqType(xhr) + \" Request was aborted by the user.\");\n };\n /** Called when data successfully loads from an xhr/xdr request. */\n LoaderResource.prototype._xhrOnLoad = function () {\n var xhr = this.xhr;\n var text = '';\n var status = typeof xhr.status === 'undefined' ? STATUS_OK : xhr.status; // XDR has no `.status`, assume 200.\n // responseText is accessible only if responseType is '' or 'text' and on older browsers\n if (xhr.responseType === '' || xhr.responseType === 'text' || typeof xhr.responseType === 'undefined') {\n text = xhr.responseText;\n }\n // status can be 0 when using the `file://` protocol so we also check if a response is set.\n // If it has a response, we assume 200; otherwise a 0 status code with no contents is an aborted request.\n if (status === STATUS_NONE && (text.length > 0 || xhr.responseType === LoaderResource.XHR_RESPONSE_TYPE.BUFFER)) {\n status = STATUS_OK;\n }\n // handle IE9 bug: http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request\n else if (status === STATUS_IE_BUG_EMPTY) {\n status = STATUS_EMPTY;\n }\n var statusType = (status / 100) | 0;\n if (statusType === STATUS_TYPE_OK) {\n // if text, just return it\n if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.TEXT) {\n this.data = text;\n this.type = LoaderResource.TYPE.TEXT;\n }\n // if json, parse into json object\n else if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.JSON) {\n try {\n this.data = JSON.parse(text);\n this.type = LoaderResource.TYPE.JSON;\n }\n catch (e) {\n this.abort(\"Error trying to parse loaded json: \" + e);\n return;\n }\n }\n // if xml, parse into an xml document or div element\n else if (this.xhrType === LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT) {\n try {\n if (globalThis.DOMParser) {\n var domparser = new DOMParser();\n this.data = domparser.parseFromString(text, 'text/xml');\n }\n else {\n var div = document.createElement('div');\n div.innerHTML = text;\n this.data = div;\n }\n this.type = LoaderResource.TYPE.XML;\n }\n catch (e$1) {\n this.abort(\"Error trying to parse loaded xml: \" + e$1);\n return;\n }\n }\n // other types just return the response\n else {\n this.data = xhr.response || text;\n }\n }\n else {\n this.abort(\"[\" + xhr.status + \"] \" + xhr.statusText + \": \" + xhr.responseURL);\n return;\n }\n this.complete();\n };\n /**\n * Sets the `crossOrigin` property for this resource based on if the url\n * for this resource is cross-origin. If crossOrigin was manually set, this\n * function does nothing.\n * @private\n * @param url - The url to test.\n * @param [loc=globalThis.location] - The location object to test against.\n * @returns The crossOrigin value to use (or empty string for none).\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n LoaderResource.prototype._determineCrossOrigin = function (url, loc) {\n // data: and javascript: urls are considered same-origin\n if (url.indexOf('data:') === 0) {\n return '';\n }\n // A sandboxed iframe without the 'allow-same-origin' attribute will have a special\n // origin designed not to match globalThis.location.origin, and will always require\n // crossOrigin requests regardless of whether the location matches.\n if (globalThis.origin !== globalThis.location.origin) {\n return 'anonymous';\n }\n // default is globalThis.location\n loc = loc || globalThis.location;\n if (!tempAnchor) {\n tempAnchor = document.createElement('a');\n }\n // let the browser determine the full href for the url of this resource and then\n // parse with the node url lib, we can't use the properties of the anchor element\n // because they don't work in IE9 :(\n tempAnchor.href = url;\n var parsedUrl = parseUri(tempAnchor.href, { strictMode: true });\n var samePort = (!parsedUrl.port && loc.port === '') || (parsedUrl.port === loc.port);\n var protocol = parsedUrl.protocol ? parsedUrl.protocol + \":\" : '';\n // if cross origin\n if (parsedUrl.host !== loc.hostname || !samePort || protocol !== loc.protocol) {\n return 'anonymous';\n }\n return '';\n };\n /**\n * Determines the responseType of an XHR request based on the extension of the\n * resource being loaded.\n * @private\n * @returns {PIXI.LoaderResource.XHR_RESPONSE_TYPE} The responseType to use.\n */\n LoaderResource.prototype._determineXhrType = function () {\n return LoaderResource._xhrTypeMap[this.extension] || LoaderResource.XHR_RESPONSE_TYPE.TEXT;\n };\n /**\n * Determines the loadType of a resource based on the extension of the\n * resource being loaded.\n * @private\n * @returns {PIXI.LoaderResource.LOAD_TYPE} The loadType to use.\n */\n LoaderResource.prototype._determineLoadType = function () {\n return LoaderResource._loadTypeMap[this.extension] || LoaderResource.LOAD_TYPE.XHR;\n };\n /**\n * Extracts the extension (sans '.') of the file being loaded by the resource.\n * @param [url] - url to parse, `this.url` by default.\n * @returns The extension.\n */\n LoaderResource.prototype._getExtension = function (url) {\n if (url === void 0) { url = this.url; }\n var ext = '';\n if (this.isDataUrl) {\n var slashIndex = url.indexOf('/');\n ext = url.substring(slashIndex + 1, url.indexOf(';', slashIndex));\n }\n else {\n var queryStart = url.indexOf('?');\n var hashStart = url.indexOf('#');\n var index = Math.min(queryStart > -1 ? queryStart : url.length, hashStart > -1 ? hashStart : url.length);\n url = url.substring(0, index);\n ext = url.substring(url.lastIndexOf('.') + 1);\n }\n return ext.toLowerCase();\n };\n /**\n * Determines the mime type of an XHR request based on the responseType of\n * resource being loaded.\n * @param type - The type to get a mime type for.\n * @private\n * @returns The mime type to use.\n */\n LoaderResource.prototype._getMimeFromXhrType = function (type) {\n switch (type) {\n case LoaderResource.XHR_RESPONSE_TYPE.BUFFER:\n return 'application/octet-binary';\n case LoaderResource.XHR_RESPONSE_TYPE.BLOB:\n return 'application/blob';\n case LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT:\n return 'application/xml';\n case LoaderResource.XHR_RESPONSE_TYPE.JSON:\n return 'application/json';\n case LoaderResource.XHR_RESPONSE_TYPE.DEFAULT:\n case LoaderResource.XHR_RESPONSE_TYPE.TEXT:\n /* falls through */\n default:\n return 'text/plain';\n }\n };\n return LoaderResource;\n}());\n// eslint-disable-next-line @typescript-eslint/no-namespace\n(function (LoaderResource) {\n (function (STATUS_FLAGS) {\n /** None */\n STATUS_FLAGS[STATUS_FLAGS[\"NONE\"] = 0] = \"NONE\";\n /** Data URL */\n STATUS_FLAGS[STATUS_FLAGS[\"DATA_URL\"] = 1] = \"DATA_URL\";\n /** Complete */\n STATUS_FLAGS[STATUS_FLAGS[\"COMPLETE\"] = 2] = \"COMPLETE\";\n /** Loading */\n STATUS_FLAGS[STATUS_FLAGS[\"LOADING\"] = 4] = \"LOADING\";\n })(LoaderResource.STATUS_FLAGS || (LoaderResource.STATUS_FLAGS = {}));\n (function (TYPE) {\n /** Unknown */\n TYPE[TYPE[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\n /** JSON */\n TYPE[TYPE[\"JSON\"] = 1] = \"JSON\";\n /** XML */\n TYPE[TYPE[\"XML\"] = 2] = \"XML\";\n /** Image */\n TYPE[TYPE[\"IMAGE\"] = 3] = \"IMAGE\";\n /** Audio */\n TYPE[TYPE[\"AUDIO\"] = 4] = \"AUDIO\";\n /** Video */\n TYPE[TYPE[\"VIDEO\"] = 5] = \"VIDEO\";\n /** Plain text */\n TYPE[TYPE[\"TEXT\"] = 6] = \"TEXT\";\n })(LoaderResource.TYPE || (LoaderResource.TYPE = {}));\n (function (LOAD_TYPE) {\n /** Uses XMLHttpRequest to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"XHR\"] = 1] = \"XHR\";\n /** Uses an `Image` object to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"IMAGE\"] = 2] = \"IMAGE\";\n /** Uses an `Audio` object to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"AUDIO\"] = 3] = \"AUDIO\";\n /** Uses a `Video` object to load the resource. */\n LOAD_TYPE[LOAD_TYPE[\"VIDEO\"] = 4] = \"VIDEO\";\n })(LoaderResource.LOAD_TYPE || (LoaderResource.LOAD_TYPE = {}));\n (function (XHR_RESPONSE_TYPE) {\n /** string */\n XHR_RESPONSE_TYPE[\"DEFAULT\"] = \"text\";\n /** ArrayBuffer */\n XHR_RESPONSE_TYPE[\"BUFFER\"] = \"arraybuffer\";\n /** Blob */\n XHR_RESPONSE_TYPE[\"BLOB\"] = \"blob\";\n /** Document */\n XHR_RESPONSE_TYPE[\"DOCUMENT\"] = \"document\";\n /** Object */\n XHR_RESPONSE_TYPE[\"JSON\"] = \"json\";\n /** String */\n XHR_RESPONSE_TYPE[\"TEXT\"] = \"text\";\n })(LoaderResource.XHR_RESPONSE_TYPE || (LoaderResource.XHR_RESPONSE_TYPE = {}));\n LoaderResource._loadTypeMap = {\n // images\n gif: LoaderResource.LOAD_TYPE.IMAGE,\n png: LoaderResource.LOAD_TYPE.IMAGE,\n bmp: LoaderResource.LOAD_TYPE.IMAGE,\n jpg: LoaderResource.LOAD_TYPE.IMAGE,\n jpeg: LoaderResource.LOAD_TYPE.IMAGE,\n tif: LoaderResource.LOAD_TYPE.IMAGE,\n tiff: LoaderResource.LOAD_TYPE.IMAGE,\n webp: LoaderResource.LOAD_TYPE.IMAGE,\n tga: LoaderResource.LOAD_TYPE.IMAGE,\n avif: LoaderResource.LOAD_TYPE.IMAGE,\n svg: LoaderResource.LOAD_TYPE.IMAGE,\n 'svg+xml': LoaderResource.LOAD_TYPE.IMAGE,\n // audio\n mp3: LoaderResource.LOAD_TYPE.AUDIO,\n ogg: LoaderResource.LOAD_TYPE.AUDIO,\n wav: LoaderResource.LOAD_TYPE.AUDIO,\n // videos\n mp4: LoaderResource.LOAD_TYPE.VIDEO,\n webm: LoaderResource.LOAD_TYPE.VIDEO,\n };\n LoaderResource._xhrTypeMap = {\n // xml\n xhtml: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n html: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n htm: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n xml: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n tmx: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n svg: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n // This was added to handle Tiled Tileset XML, but .tsx is also a TypeScript React Component.\n // Since it is way less likely for people to be loading TypeScript files instead of Tiled files,\n // this should probably be fine.\n tsx: LoaderResource.XHR_RESPONSE_TYPE.DOCUMENT,\n // images\n gif: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n png: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n bmp: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n jpg: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n jpeg: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n tif: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n tiff: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n webp: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n tga: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n avif: LoaderResource.XHR_RESPONSE_TYPE.BLOB,\n // json\n json: LoaderResource.XHR_RESPONSE_TYPE.JSON,\n // text\n text: LoaderResource.XHR_RESPONSE_TYPE.TEXT,\n txt: LoaderResource.XHR_RESPONSE_TYPE.TEXT,\n // fonts\n ttf: LoaderResource.XHR_RESPONSE_TYPE.BUFFER,\n otf: LoaderResource.XHR_RESPONSE_TYPE.BUFFER,\n };\n // We can't set the `src` attribute to empty string, so on abort we set it to this 1px transparent gif\n LoaderResource.EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n})(LoaderResource || (LoaderResource = {}));\n\n/**\n * Smaller version of the async library constructs.\n * @ignore\n */\nfunction _noop() {\n}\n/**\n * Ensures a function is only called once.\n * @ignore\n * @param {Function} fn - The function to wrap.\n * @returns {Function} The wrapping function.\n */\nfunction onlyOnce(fn) {\n return function onceWrapper() {\n var arguments$1 = arguments;\n\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n if (fn === null) {\n throw new Error('Callback was already called.');\n }\n var callFn = fn;\n fn = null;\n callFn.apply(this, args);\n };\n}\n/**\n * @private\n * @memberof PIXI\n */\nvar AsyncQueueItem = /** @class */ (function () {\n /**\n * @param data\n * @param callback\n * @private\n */\n function AsyncQueueItem(data, callback) {\n this.data = data;\n this.callback = callback;\n }\n return AsyncQueueItem;\n}());\n/**\n * @private\n * @memberof PIXI\n */\nvar AsyncQueue = /** @class */ (function () {\n /**\n * @param worker\n * @param concurrency\n * @private\n */\n function AsyncQueue(worker, concurrency) {\n var _this = this;\n if (concurrency === void 0) { concurrency = 1; }\n this.workers = 0;\n this.saturated = _noop;\n this.unsaturated = _noop;\n this.empty = _noop;\n this.drain = _noop;\n this.error = _noop;\n this.started = false;\n this.paused = false;\n this._tasks = [];\n this._insert = function (data, insertAtFront, callback) {\n if (callback && typeof callback !== 'function') {\n throw new Error('task callback must be a function');\n }\n _this.started = true;\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (data == null && _this.idle()) {\n // call drain immediately if there are no tasks\n setTimeout(function () { return _this.drain(); }, 1);\n return;\n }\n var item = new AsyncQueueItem(data, typeof callback === 'function' ? callback : _noop);\n if (insertAtFront) {\n _this._tasks.unshift(item);\n }\n else {\n _this._tasks.push(item);\n }\n setTimeout(_this.process, 1);\n };\n this.process = function () {\n while (!_this.paused && _this.workers < _this.concurrency && _this._tasks.length) {\n var task = _this._tasks.shift();\n if (_this._tasks.length === 0) {\n _this.empty();\n }\n _this.workers += 1;\n if (_this.workers === _this.concurrency) {\n _this.saturated();\n }\n _this._worker(task.data, onlyOnce(_this._next(task)));\n }\n };\n this._worker = worker;\n if (concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n this.concurrency = concurrency;\n this.buffer = concurrency / 4.0;\n }\n /**\n * @param task\n * @private\n */\n AsyncQueue.prototype._next = function (task) {\n var _this = this;\n return function () {\n var arguments$1 = arguments;\n\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n _this.workers -= 1;\n task.callback.apply(task, args);\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (args[0] != null) {\n _this.error(args[0], task.data);\n }\n if (_this.workers <= (_this.concurrency - _this.buffer)) {\n _this.unsaturated();\n }\n if (_this.idle()) {\n _this.drain();\n }\n _this.process();\n };\n };\n // That was in object\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n AsyncQueue.prototype.push = function (data, callback) {\n this._insert(data, false, callback);\n };\n AsyncQueue.prototype.kill = function () {\n this.workers = 0;\n this.drain = _noop;\n this.started = false;\n this._tasks = [];\n };\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n AsyncQueue.prototype.unshift = function (data, callback) {\n this._insert(data, true, callback);\n };\n AsyncQueue.prototype.length = function () {\n return this._tasks.length;\n };\n AsyncQueue.prototype.running = function () {\n return this.workers;\n };\n AsyncQueue.prototype.idle = function () {\n return this._tasks.length + this.workers === 0;\n };\n AsyncQueue.prototype.pause = function () {\n if (this.paused === true) {\n return;\n }\n this.paused = true;\n };\n AsyncQueue.prototype.resume = function () {\n if (this.paused === false) {\n return;\n }\n this.paused = false;\n // Need to call this.process once per concurrent\n // worker to preserve full concurrency after pause\n for (var w = 1; w <= this.concurrency; w++) {\n this.process();\n }\n };\n /**\n * Iterates an array in series.\n * @param {Array.<*>} array - Array to iterate.\n * @param {Function} iterator - Function to call for each element.\n * @param {Function} callback - Function to call when done, or on error.\n * @param {boolean} [deferNext=false] - Break synchronous each loop by calling next with a setTimeout of 1.\n */\n AsyncQueue.eachSeries = function (array, iterator, callback, deferNext) {\n var i = 0;\n var len = array.length;\n function next(err) {\n if (err || i === len) {\n if (callback) {\n callback(err);\n }\n return;\n }\n if (deferNext) {\n setTimeout(function () {\n iterator(array[i++], next);\n }, 1);\n }\n else {\n iterator(array[i++], next);\n }\n }\n next();\n };\n /**\n * Async queue implementation,\n * @param {Function} worker - The worker function to call for each task.\n * @param {number} concurrency - How many workers to run in parrallel.\n * @returns {*} The async queue object.\n */\n AsyncQueue.queue = function (worker, concurrency) {\n return new AsyncQueue(worker, concurrency);\n };\n return AsyncQueue;\n}());\n\n// some constants\nvar MAX_PROGRESS = 100;\nvar rgxExtractUrlHash = /(#[\\w-]+)?$/;\n/**\n * The new loader, forked from Resource Loader by Chad Engler: https://github.com/englercj/resource-loader\n *\n * ```js\n * const loader = PIXI.Loader.shared; // PixiJS exposes a premade instance for you to use.\n * // or\n * const loader = new PIXI.Loader(); // You can also create your own if you want\n *\n * const sprites = {};\n *\n * // Chainable `add` to enqueue a resource\n * loader.add('bunny', 'data/bunny.png')\n * .add('spaceship', 'assets/spritesheet.json');\n * loader.add('scoreFont', 'assets/score.fnt');\n *\n * // Chainable `pre` to add a middleware that runs for each resource, *before* loading that resource.\n * // This is useful to implement custom caching modules (using filesystem, indexeddb, memory, etc).\n * loader.pre(cachingMiddleware);\n *\n * // Chainable `use` to add a middleware that runs for each resource, *after* loading that resource.\n * // This is useful to implement custom parsing modules (like spritesheet parsers, spine parser, etc).\n * loader.use(parsingMiddleware);\n *\n * // The `load` method loads the queue of resources, and calls the passed in callback called once all\n * // resources have loaded.\n * loader.load((loader, resources) => {\n * // resources is an object where the key is the name of the resource loaded and the value is the resource object.\n * // They have a couple default properties:\n * // - `url`: The URL that the resource was loaded from\n * // - `error`: The error that happened when trying to load (if any)\n * // - `data`: The raw data that was loaded\n * // also may contain other properties based on the middleware that runs.\n * sprites.bunny = new PIXI.TilingSprite(resources.bunny.texture);\n * sprites.spaceship = new PIXI.TilingSprite(resources.spaceship.texture);\n * sprites.scoreFont = new PIXI.TilingSprite(resources.scoreFont.texture);\n * });\n *\n * // throughout the process multiple signals can be dispatched.\n * loader.onProgress.add(() => {}); // called once per loaded/errored file\n * loader.onError.add(() => {}); // called once per errored file\n * loader.onLoad.add(() => {}); // called once per loaded file\n * loader.onComplete.add(() => {}); // called once when the queued resources all load.\n * ```\n * @memberof PIXI\n */\nvar Loader = /** @class */ (function () {\n /**\n * @param baseUrl - The base url for all resources loaded by this loader.\n * @param concurrency - The number of resources to load concurrently.\n */\n function Loader(baseUrl, concurrency) {\n var _this = this;\n if (baseUrl === void 0) { baseUrl = ''; }\n if (concurrency === void 0) { concurrency = 10; }\n /** The progress percent of the loader going through the queue. */\n this.progress = 0;\n /** Loading state of the loader, true if it is currently loading resources. */\n this.loading = false;\n /**\n * A querystring to append to every URL added to the loader.\n *\n * This should be a valid query string *without* the question-mark (`?`). The loader will\n * also *not* escape values for you. Make sure to escape your parameters with\n * [`encodeURIComponent`](https://mdn.io/encodeURIComponent) before assigning this property.\n * @example\n * const loader = new Loader();\n *\n * loader.defaultQueryString = 'user=me&password=secret';\n *\n * // This will request 'image.png?user=me&password=secret'\n * loader.add('image.png').load();\n *\n * loader.reset();\n *\n * // This will request 'image.png?v=1&user=me&password=secret'\n * loader.add('iamge.png?v=1').load();\n */\n this.defaultQueryString = '';\n /** The middleware to run before loading each resource. */\n this._beforeMiddleware = [];\n /** The middleware to run after loading each resource. */\n this._afterMiddleware = [];\n /** The tracks the resources we are currently completing parsing for. */\n this._resourcesParsing = [];\n /**\n * The `_loadResource` function bound with this object context.\n * @param r - The resource to load\n * @param d - The dequeue function\n */\n this._boundLoadResource = function (r, d) { return _this._loadResource(r, d); };\n /** All the resources for this loader keyed by name. */\n this.resources = {};\n this.baseUrl = baseUrl;\n this._beforeMiddleware = [];\n this._afterMiddleware = [];\n this._resourcesParsing = [];\n this._boundLoadResource = function (r, d) { return _this._loadResource(r, d); };\n this._queue = AsyncQueue.queue(this._boundLoadResource, concurrency);\n this._queue.pause();\n this.resources = {};\n this.onProgress = new Signal();\n this.onError = new Signal();\n this.onLoad = new Signal();\n this.onStart = new Signal();\n this.onComplete = new Signal();\n for (var i = 0; i < Loader._plugins.length; ++i) {\n var plugin = Loader._plugins[i];\n var pre = plugin.pre, use = plugin.use;\n if (pre) {\n this.pre(pre);\n }\n if (use) {\n this.use(use);\n }\n }\n this._protected = false;\n }\n /**\n * Same as add, params have strict order\n * @private\n * @param name - The name of the resource to load.\n * @param url - The url for this resource, relative to the baseUrl of this loader.\n * @param options - The options for the load.\n * @param callback - Function to call when this specific resource completes loading.\n * @returns The loader itself.\n */\n Loader.prototype._add = function (name, url, options, callback) {\n // if loading already you can only add resources that have a parent.\n if (this.loading && (!options || !options.parentResource)) {\n throw new Error('Cannot add resources while the loader is running.');\n }\n // check if resource already exists.\n if (this.resources[name]) {\n throw new Error(\"Resource named \\\"\" + name + \"\\\" already exists.\");\n }\n // add base url if this isn't an absolute url\n url = this._prepareUrl(url);\n // create the store the resource\n this.resources[name] = new LoaderResource(name, url, options);\n if (typeof callback === 'function') {\n this.resources[name].onAfterMiddleware.once(callback);\n }\n // if actively loading, make sure to adjust progress chunks for that parent and its children\n if (this.loading) {\n var parent = options.parentResource;\n var incompleteChildren = [];\n for (var i = 0; i < parent.children.length; ++i) {\n if (!parent.children[i].isComplete) {\n incompleteChildren.push(parent.children[i]);\n }\n }\n var fullChunk = parent.progressChunk * (incompleteChildren.length + 1); // +1 for parent\n var eachChunk = fullChunk / (incompleteChildren.length + 2); // +2 for parent & new child\n parent.children.push(this.resources[name]);\n parent.progressChunk = eachChunk;\n for (var i = 0; i < incompleteChildren.length; ++i) {\n incompleteChildren[i].progressChunk = eachChunk;\n }\n this.resources[name].progressChunk = eachChunk;\n }\n // add the resource to the queue\n this._queue.push(this.resources[name]);\n return this;\n };\n /* eslint-enable require-jsdoc,valid-jsdoc */\n /**\n * Sets up a middleware function that will run *before* the\n * resource is loaded.\n * @param fn - The middleware function to register.\n * @returns The loader itself.\n */\n Loader.prototype.pre = function (fn) {\n this._beforeMiddleware.push(fn);\n return this;\n };\n /**\n * Sets up a middleware function that will run *after* the\n * resource is loaded.\n * @param fn - The middleware function to register.\n * @returns The loader itself.\n */\n Loader.prototype.use = function (fn) {\n this._afterMiddleware.push(fn);\n return this;\n };\n /**\n * Resets the queue of the loader to prepare for a new load.\n * @returns The loader itself.\n */\n Loader.prototype.reset = function () {\n this.progress = 0;\n this.loading = false;\n this._queue.kill();\n this._queue.pause();\n // abort all resource loads\n for (var k in this.resources) {\n var res = this.resources[k];\n if (res._onLoadBinding) {\n res._onLoadBinding.detach();\n }\n if (res.isLoading) {\n res.abort('loader reset');\n }\n }\n this.resources = {};\n return this;\n };\n /**\n * Starts loading the queued resources.\n * @param cb - Optional callback that will be bound to the `complete` event.\n * @returns The loader itself.\n */\n Loader.prototype.load = function (cb) {\n deprecation('6.5.0', '@pixi/loaders is being replaced with @pixi/assets in the next major release.');\n // register complete callback if they pass one\n if (typeof cb === 'function') {\n this.onComplete.once(cb);\n }\n // if the queue has already started we are done here\n if (this.loading) {\n return this;\n }\n if (this._queue.idle()) {\n this._onStart();\n this._onComplete();\n }\n else {\n // distribute progress chunks\n var numTasks = this._queue._tasks.length;\n var chunk = MAX_PROGRESS / numTasks;\n for (var i = 0; i < this._queue._tasks.length; ++i) {\n this._queue._tasks[i].data.progressChunk = chunk;\n }\n // notify we are starting\n this._onStart();\n // start loading\n this._queue.resume();\n }\n return this;\n };\n Object.defineProperty(Loader.prototype, \"concurrency\", {\n /**\n * The number of resources to load concurrently.\n * @default 10\n */\n get: function () {\n return this._queue.concurrency;\n },\n set: function (concurrency) {\n this._queue.concurrency = concurrency;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Prepares a url for usage based on the configuration of this object\n * @param url - The url to prepare.\n * @returns The prepared url.\n */\n Loader.prototype._prepareUrl = function (url) {\n var parsedUrl = parseUri(url, { strictMode: true });\n var result;\n // absolute url, just use it as is.\n if (parsedUrl.protocol || !parsedUrl.path || url.indexOf('//') === 0) {\n result = url;\n }\n // if baseUrl doesn't end in slash and url doesn't start with slash, then add a slash inbetween\n else if (this.baseUrl.length\n && this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1\n && url.charAt(0) !== '/') {\n result = this.baseUrl + \"/\" + url;\n }\n else {\n result = this.baseUrl + url;\n }\n // if we need to add a default querystring, there is a bit more work\n if (this.defaultQueryString) {\n var hash = rgxExtractUrlHash.exec(result)[0];\n result = result.slice(0, result.length - hash.length);\n if (result.indexOf('?') !== -1) {\n result += \"&\" + this.defaultQueryString;\n }\n else {\n result += \"?\" + this.defaultQueryString;\n }\n result += hash;\n }\n return result;\n };\n /**\n * Loads a single resource.\n * @param resource - The resource to load.\n * @param dequeue - The function to call when we need to dequeue this item.\n */\n Loader.prototype._loadResource = function (resource, dequeue) {\n var _this = this;\n resource._dequeue = dequeue;\n // run before middleware\n AsyncQueue.eachSeries(this._beforeMiddleware, function (fn, next) {\n fn.call(_this, resource, function () {\n // if the before middleware marks the resource as complete,\n // break and don't process any more before middleware\n next(resource.isComplete ? {} : null);\n });\n }, function () {\n if (resource.isComplete) {\n _this._onLoad(resource);\n }\n else {\n resource._onLoadBinding = resource.onComplete.once(_this._onLoad, _this);\n resource.load();\n }\n }, true);\n };\n /** Called once loading has started. */\n Loader.prototype._onStart = function () {\n this.progress = 0;\n this.loading = true;\n this.onStart.dispatch(this);\n };\n /** Called once each resource has loaded. */\n Loader.prototype._onComplete = function () {\n this.progress = MAX_PROGRESS;\n this.loading = false;\n this.onComplete.dispatch(this, this.resources);\n };\n /**\n * Called each time a resources is loaded.\n * @param resource - The resource that was loaded\n */\n Loader.prototype._onLoad = function (resource) {\n var _this = this;\n resource._onLoadBinding = null;\n // remove this resource from the async queue, and add it to our list of resources that are being parsed\n this._resourcesParsing.push(resource);\n resource._dequeue();\n // run all the after middleware for this resource\n AsyncQueue.eachSeries(this._afterMiddleware, function (fn, next) {\n fn.call(_this, resource, next);\n }, function () {\n resource.onAfterMiddleware.dispatch(resource);\n _this.progress = Math.min(MAX_PROGRESS, _this.progress + resource.progressChunk);\n _this.onProgress.dispatch(_this, resource);\n if (resource.error) {\n _this.onError.dispatch(resource.error, _this, resource);\n }\n else {\n _this.onLoad.dispatch(_this, resource);\n }\n _this._resourcesParsing.splice(_this._resourcesParsing.indexOf(resource), 1);\n // do completion check\n if (_this._queue.idle() && _this._resourcesParsing.length === 0) {\n _this._onComplete();\n }\n }, true);\n };\n /** Destroy the loader, removes references. */\n Loader.prototype.destroy = function () {\n if (!this._protected) {\n this.reset();\n }\n };\n Object.defineProperty(Loader, \"shared\", {\n /** A premade instance of the loader that can be used to load resources. */\n get: function () {\n var shared = Loader._shared;\n if (!shared) {\n shared = new Loader();\n shared._protected = true;\n Loader._shared = shared;\n }\n return shared;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @param plugin - The plugin to add\n * @returns Reference to PIXI.Loader for chaining\n */\n Loader.registerPlugin = function (plugin) {\n deprecation('6.5.0', 'Loader.registerPlugin() is deprecated, use extensions.add() instead.');\n extensions.add({\n type: ExtensionType.Loader,\n ref: plugin,\n });\n return Loader;\n };\n Loader._plugins = [];\n return Loader;\n}());\nextensions.handleByList(ExtensionType.Loader, Loader._plugins);\nLoader.prototype.add = function add(name, url, options, callback) {\n // special case of an array of objects or urls\n if (Array.isArray(name)) {\n for (var i = 0; i < name.length; ++i) {\n this.add(name[i]);\n }\n return this;\n }\n // if an object is passed instead of params\n if (typeof name === 'object') {\n options = name;\n callback = url || options.callback || options.onComplete;\n url = options.url;\n name = options.name || options.key || options.url;\n }\n // case where no name is passed shift all args over by one.\n if (typeof url !== 'string') {\n callback = options;\n options = url;\n url = name;\n }\n // now that we shifted make sure we have a proper url.\n if (typeof url !== 'string') {\n throw new Error('No url passed to add resource to loader.');\n }\n // options are optional so people might pass a function and no options\n if (typeof options === 'function') {\n callback = options;\n options = null;\n }\n return this._add(name, url, options, callback);\n};\n\n/**\n * Application plugin for supporting loader option. Installing the LoaderPlugin\n * is not necessary if using **pixi.js** or **pixi.js-legacy**.\n * @example\n * import {AppLoaderPlugin} from '@pixi/loaders';\n * import {extensions} from '@pixi/core';\n * extensions.add(AppLoaderPlugin);\n * @memberof PIXI\n */\nvar AppLoaderPlugin = /** @class */ (function () {\n function AppLoaderPlugin() {\n }\n /**\n * Called on application constructor\n * @param options\n * @private\n */\n AppLoaderPlugin.init = function (options) {\n options = Object.assign({\n sharedLoader: false,\n }, options);\n this.loader = options.sharedLoader ? Loader.shared : new Loader();\n };\n /**\n * Called when application destroyed\n * @private\n */\n AppLoaderPlugin.destroy = function () {\n if (this.loader) {\n this.loader.destroy();\n this.loader = null;\n }\n };\n /** @ignore */\n AppLoaderPlugin.extension = ExtensionType.Application;\n return AppLoaderPlugin;\n}());\n\n/**\n * Loader plugin for handling Texture resources.\n * @memberof PIXI\n */\nvar TextureLoader = /** @class */ (function () {\n function TextureLoader() {\n }\n /** Handle SVG elements a text, render with SVGResource. */\n TextureLoader.add = function () {\n LoaderResource.setExtensionLoadType('svg', LoaderResource.LOAD_TYPE.XHR);\n LoaderResource.setExtensionXhrType('svg', LoaderResource.XHR_RESPONSE_TYPE.TEXT);\n };\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param resource\n * @param {Function} next\n */\n TextureLoader.use = function (resource, next) {\n // create a new texture if the data is an Image object\n if (resource.data && (resource.type === LoaderResource.TYPE.IMAGE || resource.extension === 'svg')) {\n var data = resource.data, url = resource.url, name = resource.name, metadata = resource.metadata;\n Texture.fromLoader(data, url, name, metadata).then(function (texture) {\n resource.texture = texture;\n next();\n })\n // TODO: handle errors in Texture.fromLoader\n // so we can pass them to the Loader\n .catch(next);\n }\n else {\n next();\n }\n };\n /** @ignore */\n TextureLoader.extension = ExtensionType.Loader;\n return TextureLoader;\n}());\n\nvar _keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n/**\n * Encodes binary into base64.\n * @function encodeBinary\n * @param {string} input - The input data to encode.\n * @returns {string} The encoded base64 string\n */\nfunction encodeBinary(input) {\n var output = '';\n var inx = 0;\n while (inx < input.length) {\n // Fill byte buffer array\n var bytebuffer = [0, 0, 0];\n var encodedCharIndexes = [0, 0, 0, 0];\n for (var jnx = 0; jnx < bytebuffer.length; ++jnx) {\n if (inx < input.length) {\n // throw away high-order byte, as documented at:\n // https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\n bytebuffer[jnx] = input.charCodeAt(inx++) & 0xff;\n }\n else {\n bytebuffer[jnx] = 0;\n }\n }\n // Get each encoded character, 6 bits at a time\n // index 1: first 6 bits\n encodedCharIndexes[0] = bytebuffer[0] >> 2;\n // index 2: second 6 bits (2 least significant bits from input byte 1 + 4 most significant bits from byte 2)\n encodedCharIndexes[1] = ((bytebuffer[0] & 0x3) << 4) | (bytebuffer[1] >> 4);\n // index 3: third 6 bits (4 least significant bits from input byte 2 + 2 most significant bits from byte 3)\n encodedCharIndexes[2] = ((bytebuffer[1] & 0x0f) << 2) | (bytebuffer[2] >> 6);\n // index 3: forth 6 bits (6 least significant bits from input byte 3)\n encodedCharIndexes[3] = bytebuffer[2] & 0x3f;\n // Determine whether padding happened, and adjust accordingly\n var paddingBytes = inx - (input.length - 1);\n switch (paddingBytes) {\n case 2:\n // Set last 2 characters to padding char\n encodedCharIndexes[3] = 64;\n encodedCharIndexes[2] = 64;\n break;\n case 1:\n // Set last character to padding char\n encodedCharIndexes[3] = 64;\n break;\n }\n // Now we will grab each appropriate character out of our keystring\n // based on our index array and append it to the output string\n for (var jnx = 0; jnx < encodedCharIndexes.length; ++jnx) {\n output += _keyStr.charAt(encodedCharIndexes[jnx]);\n }\n }\n return output;\n}\n\n/**\n * A middleware for transforming XHR loaded Blobs into more useful objects\n * @ignore\n * @function parsing\n * @example\n * import { Loader, middleware } from 'resource-loader';\n * const loader = new Loader();\n * loader.use(middleware.parsing);\n * @param resource - Current Resource\n * @param next - Callback when complete\n */\nfunction parsing(resource, next) {\n if (!resource.data) {\n next();\n return;\n }\n // if this was an XHR load of a blob\n if (resource.xhr && resource.xhrType === LoaderResource.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!self.Blob || typeof resource.data === 'string') {\n var type = resource.xhr.getResponseHeader('content-type');\n // this is an image, convert the binary string into a data url\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = \"data:\" + type + \";base64,\" + encodeBinary(resource.xhr.responseText);\n resource.type = LoaderResource.TYPE.IMAGE;\n // wait until the image loads and then callback\n resource.data.onload = function () {\n resource.data.onload = null;\n next();\n };\n // next will be called on load\n return;\n }\n }\n // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n var Url_1 = globalThis.URL || globalThis.webkitURL;\n var src_1 = Url_1.createObjectURL(resource.data);\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src_1;\n resource.type = LoaderResource.TYPE.IMAGE;\n // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n resource.data.onload = function () {\n Url_1.revokeObjectURL(src_1);\n resource.data.onload = null;\n next();\n };\n // next will be called on load.\n return;\n }\n }\n next();\n}\n\n/**\n * Parse any blob into more usable objects (e.g. Image).\n * @memberof PIXI\n */\nvar ParsingLoader = /** @class */ (function () {\n function ParsingLoader() {\n }\n /** @ignore */\n ParsingLoader.extension = ExtensionType.Loader;\n ParsingLoader.use = parsing;\n return ParsingLoader;\n}());\n\nextensions.add(TextureLoader, ParsingLoader);\n\nexport { AppLoaderPlugin, Loader, LoaderResource, TextureLoader };\n//# sourceMappingURL=loaders.mjs.map\n","/*!\n * @pixi/compressed-textures - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/compressed-textures is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { ViewableBuffer, BufferResource, ExtensionType, Texture, BaseTexture } from '@pixi/core';\nimport { LoaderResource } from '@pixi/loaders';\nimport { url } from '@pixi/utils';\nimport { settings } from '@pixi/settings';\nimport { MIPMAP_MODES, ALPHA_MODES, TYPES, FORMATS } from '@pixi/constants';\n\nvar _a$2;\n/**\n * WebGL internal formats, including compressed texture formats provided by extensions\n * @memberof PIXI\n * @static\n * @name INTERNAL_FORMATS\n * @enum {number}\n * @property {number} [COMPRESSED_RGB_S3TC_DXT1_EXT=0x83F0] -\n * @property {number} [COMPRESSED_RGBA_S3TC_DXT1_EXT=0x83F1] -\n * @property {number} [COMPRESSED_RGBA_S3TC_DXT3_EXT=0x83F2] -\n * @property {number} [COMPRESSED_RGBA_S3TC_DXT5_EXT=0x83F3] -\n * @property {number} [COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917] -\n * @property {number} [COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918] -\n * @property {number} [COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919] -\n * @property {number} [COMPRESSED_SRGB_S3TC_DXT1_EXT=35916] -\n * @property {number} [COMPRESSED_R11_EAC=0x9270] -\n * @property {number} [COMPRESSED_SIGNED_R11_EAC=0x9271] -\n * @property {number} [COMPRESSED_RG11_EAC=0x9272] -\n * @property {number} [COMPRESSED_SIGNED_RG11_EAC=0x9273] -\n * @property {number} [COMPRESSED_RGB8_ETC2=0x9274] -\n * @property {number} [COMPRESSED_RGBA8_ETC2_EAC=0x9278] -\n * @property {number} [COMPRESSED_SRGB8_ETC2=0x9275] -\n * @property {number} [COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=0x9279] -\n * @property {number} [COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=0x9276] -\n * @property {number} [COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=0x9277] -\n * @property {number} [COMPRESSED_RGB_PVRTC_4BPPV1_IMG=0x8C00] -\n * @property {number} [COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=0x8C02] -\n * @property {number} [COMPRESSED_RGB_PVRTC_2BPPV1_IMG=0x8C01] -\n * @property {number} [COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=0x8C03] -\n * @property {number} [COMPRESSED_RGB_ETC1_WEBGL=0x8D64] -\n * @property {number} [COMPRESSED_RGB_ATC_WEBGL=0x8C92] -\n * @property {number} [COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=0x8C92] -\n * @property {number} [COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=0x87EE] -\n * @property {number} [COMPRESSED_RGBA_ASTC_4x4_KHR=0x93B0] -\n */\nvar INTERNAL_FORMATS;\n(function (INTERNAL_FORMATS) {\n // WEBGL_compressed_texture_s3tc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_S3TC_DXT1_EXT\"] = 33776] = \"COMPRESSED_RGB_S3TC_DXT1_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_S3TC_DXT1_EXT\"] = 33777] = \"COMPRESSED_RGBA_S3TC_DXT1_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_S3TC_DXT3_EXT\"] = 33778] = \"COMPRESSED_RGBA_S3TC_DXT3_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_S3TC_DXT5_EXT\"] = 33779] = \"COMPRESSED_RGBA_S3TC_DXT5_EXT\";\n // WEBGL_compressed_texture_s3tc_srgb\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT\"] = 35917] = \"COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT\"] = 35918] = \"COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT\"] = 35919] = \"COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB_S3TC_DXT1_EXT\"] = 35916] = \"COMPRESSED_SRGB_S3TC_DXT1_EXT\";\n // WEBGL_compressed_texture_etc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_R11_EAC\"] = 37488] = \"COMPRESSED_R11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SIGNED_R11_EAC\"] = 37489] = \"COMPRESSED_SIGNED_R11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RG11_EAC\"] = 37490] = \"COMPRESSED_RG11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SIGNED_RG11_EAC\"] = 37491] = \"COMPRESSED_SIGNED_RG11_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB8_ETC2\"] = 37492] = \"COMPRESSED_RGB8_ETC2\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA8_ETC2_EAC\"] = 37496] = \"COMPRESSED_RGBA8_ETC2_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB8_ETC2\"] = 37493] = \"COMPRESSED_SRGB8_ETC2\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC\"] = 37497] = \"COMPRESSED_SRGB8_ALPHA8_ETC2_EAC\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2\"] = 37494] = \"COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2\"] = 37495] = \"COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2\";\n // WEBGL_compressed_texture_pvrtc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_PVRTC_4BPPV1_IMG\"] = 35840] = \"COMPRESSED_RGB_PVRTC_4BPPV1_IMG\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\"] = 35842] = \"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_PVRTC_2BPPV1_IMG\"] = 35841] = \"COMPRESSED_RGB_PVRTC_2BPPV1_IMG\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\"] = 35843] = \"COMPRESSED_RGBA_PVRTC_2BPPV1_IMG\";\n // WEBGL_compressed_texture_etc1\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_ETC1_WEBGL\"] = 36196] = \"COMPRESSED_RGB_ETC1_WEBGL\";\n // WEBGL_compressed_texture_atc\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGB_ATC_WEBGL\"] = 35986] = \"COMPRESSED_RGB_ATC_WEBGL\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL\"] = 35986] = \"COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL\";\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\"] = 34798] = \"COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\";\n // WEBGL_compressed_texture_astc\n /* eslint-disable-next-line camelcase */\n INTERNAL_FORMATS[INTERNAL_FORMATS[\"COMPRESSED_RGBA_ASTC_4x4_KHR\"] = 37808] = \"COMPRESSED_RGBA_ASTC_4x4_KHR\";\n})(INTERNAL_FORMATS || (INTERNAL_FORMATS = {}));\n/**\n * Maps the compressed texture formats in {@link PIXI.INTERNAL_FORMATS} to the number of bytes taken by\n * each texel.\n * @memberof PIXI\n * @static\n * @ignore\n */\nvar INTERNAL_FORMAT_TO_BYTES_PER_PIXEL = (_a$2 = {},\n // WEBGL_compressed_texture_s3tc\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT] = 1,\n // WEBGL_compressed_texture_s3tc\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT] = 1,\n // WEBGL_compressed_texture_etc\n _a$2[INTERNAL_FORMATS.COMPRESSED_R11_EAC] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SIGNED_R11_EAC] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RG11_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SIGNED_RG11_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB8_ETC2] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA8_ETC2_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB8_ETC2] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5,\n // WEBGL_compressed_texture_pvrtc\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_PVRTC_2BPPV1_IMG] = 0.25,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG] = 0.25,\n // WEBGL_compressed_texture_etc1\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_ETC1_WEBGL] = 0.5,\n // @see https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_compressed_ATC_texture.txt\n // WEBGL_compressed_texture_atc\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGB_ATC_WEBGL] = 0.5,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL] = 1,\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL] = 1,\n // @see https://registry.khronos.org/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt\n // WEBGL_compressed_texture_astc\n /* eslint-disable-next-line camelcase */\n _a$2[INTERNAL_FORMATS.COMPRESSED_RGBA_ASTC_4x4_KHR] = 1,\n _a$2);\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) { throw t[1]; } return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) { throw new TypeError(\"Generator is already executing.\"); }\r\n while (_) { try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) { return t; }\r\n if (y = 0, t) { op = [op[0] & 2, t.value]; }\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) { _.ops.pop(); }\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } }\r\n if (op[0] & 5) { throw op[1]; } return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\n\n/**\n * Resource that fetches texture data over the network and stores it in a buffer.\n * @class\n * @extends PIXI.Resource\n * @memberof PIXI\n */\nvar BlobResource = /** @class */ (function (_super) {\n __extends(BlobResource, _super);\n /**\n * @param {string} source - the URL of the texture file\n * @param {PIXI.IBlobOptions} options\n * @param {boolean}[options.autoLoad] - whether to fetch the data immediately;\n * you can fetch it later via {@link BlobResource#load}\n * @param {boolean}[options.width] - the width in pixels.\n * @param {boolean}[options.height] - the height in pixels.\n */\n function BlobResource(source, options) {\n if (options === void 0) { options = { width: 1, height: 1, autoLoad: true }; }\n var _this = this;\n var origin;\n var data;\n if (typeof source === 'string') {\n origin = source;\n data = new Uint8Array();\n }\n else {\n origin = null;\n data = source;\n }\n _this = _super.call(this, data, options) || this;\n /**\n * The URL of the texture file\n * @member {string}\n */\n _this.origin = origin;\n /**\n * The viewable buffer on the data\n * @member {ViewableBuffer}\n */\n // HINT: BlobResource allows \"null\" sources, assuming the child class provides an alternative\n _this.buffer = data ? new ViewableBuffer(data) : null;\n // Allow autoLoad = \"undefined\" still load the resource by default\n if (_this.origin && options.autoLoad !== false) {\n _this.load();\n }\n if (data && data.length) {\n _this.loaded = true;\n _this.onBlobLoaded(_this.buffer.rawBinaryData);\n }\n return _this;\n }\n BlobResource.prototype.onBlobLoaded = function (_data) {\n // TODO: Override this method\n };\n /** Loads the blob */\n BlobResource.prototype.load = function () {\n return __awaiter(this, void 0, Promise, function () {\n var response, blob, arrayBuffer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, fetch(this.origin)];\n case 1:\n response = _a.sent();\n return [4 /*yield*/, response.blob()];\n case 2:\n blob = _a.sent();\n return [4 /*yield*/, blob.arrayBuffer()];\n case 3:\n arrayBuffer = _a.sent();\n this.data = new Uint32Array(arrayBuffer);\n this.buffer = new ViewableBuffer(arrayBuffer);\n this.loaded = true;\n this.onBlobLoaded(arrayBuffer);\n this.update();\n return [2 /*return*/, this];\n }\n });\n });\n };\n return BlobResource;\n}(BufferResource));\n\n/**\n * Resource for compressed texture formats, as follows: S3TC/DXTn (& their sRGB formats), ATC, ASTC, ETC 1/2, PVRTC.\n *\n * Compressed textures improve performance when rendering is texture-bound. The texture data stays compressed in\n * graphics memory, increasing memory locality and speeding up texture fetches. These formats can also be used to store\n * more detail in the same amount of memory.\n *\n * For most developers, container file formats are a better abstraction instead of directly handling raw texture\n * data. PixiJS provides native support for the following texture file formats (via {@link PIXI.Loader}):\n *\n * **.dds** - the DirectDraw Surface file format stores DXTn (DXT-1,3,5) data. See {@link PIXI.DDSLoader}\n * **.ktx** - the Khronos Texture Container file format supports storing all the supported WebGL compression formats.\n * See {@link PIXI.KTXLoader}.\n * **.basis** - the BASIS supercompressed file format stores texture data in an internal format that is transcoded\n * to the compression format supported on the device at _runtime_. It also supports transcoding into a uncompressed\n * format as a fallback; you must install the `@pixi/basis-loader`, `@pixi/basis-transcoder` packages separately to\n * use these files. See {@link PIXI.BasisLoader}.\n *\n * The loaders for the aforementioned formats use `CompressedTextureResource` internally. It is strongly suggested that\n * they be used instead.\n *\n * ## Working directly with CompressedTextureResource\n *\n * Since `CompressedTextureResource` inherits `BlobResource`, you can provide it a URL pointing to a file containing\n * the raw texture data (with no file headers!):\n *\n * ```js\n * // The resource backing the texture data for your textures.\n * // NOTE: You can also provide a ArrayBufferView instead of a URL. This is used when loading data from a container file\n * // format such as KTX, DDS, or BASIS.\n * const compressedResource = new PIXI.CompressedTextureResource(\"bunny.dxt5\", {\n * format: PIXI.INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n * width: 256,\n * height: 256\n * });\n *\n * // You can create a base-texture to the cache, so that future `Texture`s can be created using the `Texture.from` API.\n * const baseTexture = new PIXI.BaseTexture(compressedResource, { pmaMode: PIXI.ALPHA_MODES.NPM });\n *\n * // Create a Texture to add to the TextureCache\n * const texture = new PIXI.Texture(baseTexture);\n *\n * // Add baseTexture & texture to the global texture cache\n * PIXI.BaseTexture.addToCache(baseTexture, \"bunny.dxt5\");\n * PIXI.Texture.addToCache(texture, \"bunny.dxt5\");\n * ```\n * @memberof PIXI\n */\nvar CompressedTextureResource = /** @class */ (function (_super) {\n __extends(CompressedTextureResource, _super);\n /**\n * @param source - the buffer/URL holding the compressed texture data\n * @param options\n * @param {PIXI.INTERNAL_FORMATS} options.format - the compression format\n * @param {number} options.width - the image width in pixels.\n * @param {number} options.height - the image height in pixels.\n * @param {number} [options.level=1] - the mipmap levels stored in the compressed texture, including level 0.\n * @param {number} [options.levelBuffers] - the buffers for each mipmap level. `CompressedTextureResource` can allows you\n * to pass `null` for `source`, for cases where each level is stored in non-contiguous memory.\n */\n function CompressedTextureResource(source, options) {\n var _this = _super.call(this, source, options) || this;\n _this.format = options.format;\n _this.levels = options.levels || 1;\n _this._width = options.width;\n _this._height = options.height;\n _this._extension = CompressedTextureResource._formatToExtension(_this.format);\n if (options.levelBuffers || _this.buffer) {\n // ViewableBuffer doesn't support byteOffset :-( so allow source to be Uint8Array\n _this._levelBuffers = options.levelBuffers\n || CompressedTextureResource._createLevelBuffers(source instanceof Uint8Array ? source : _this.buffer.uint8View, _this.format, _this.levels, 4, 4, // PVRTC has 8x4 blocks in 2bpp mode\n _this.width, _this.height);\n }\n return _this;\n }\n /**\n * @override\n * @param renderer - A reference to the current renderer\n * @param _texture - the texture\n * @param _glTexture - texture instance for this webgl context\n */\n CompressedTextureResource.prototype.upload = function (renderer, _texture, _glTexture) {\n var gl = renderer.gl;\n var extension = renderer.context.extensions[this._extension];\n if (!extension) {\n throw new Error(this._extension + \" textures are not supported on the current machine\");\n }\n if (!this._levelBuffers) {\n // Do not try to upload data before BlobResource loads, unless the levelBuffers were provided directly!\n return false;\n }\n for (var i = 0, j = this.levels; i < j; i++) {\n var _a = this._levelBuffers[i], levelID = _a.levelID, levelWidth = _a.levelWidth, levelHeight = _a.levelHeight, levelBuffer = _a.levelBuffer;\n gl.compressedTexImage2D(gl.TEXTURE_2D, levelID, this.format, levelWidth, levelHeight, 0, levelBuffer);\n }\n return true;\n };\n /** @protected */\n CompressedTextureResource.prototype.onBlobLoaded = function () {\n this._levelBuffers = CompressedTextureResource._createLevelBuffers(this.buffer.uint8View, this.format, this.levels, 4, 4, // PVRTC has 8x4 blocks in 2bpp mode\n this.width, this.height);\n };\n /**\n * Returns the key (to ContextSystem#extensions) for the WebGL extension supporting the compression format\n * @private\n * @param format - the compression format to get the extension for.\n */\n CompressedTextureResource._formatToExtension = function (format) {\n if (format >= 0x83F0 && format <= 0x83F3) {\n return 's3tc';\n }\n else if (format >= 0x9270 && format <= 0x9279) {\n return 'etc';\n }\n else if (format >= 0x8C00 && format <= 0x8C03) {\n return 'pvrtc';\n }\n else if (format >= 0x8D64) {\n return 'etc1';\n }\n else if (format >= 0x8C92 && format <= 0x87EE) {\n return 'atc';\n }\n throw new Error('Invalid (compressed) texture format given!');\n };\n /**\n * Pre-creates buffer views for each mipmap level\n * @private\n * @param buffer -\n * @param format - compression formats\n * @param levels - mipmap levels\n * @param blockWidth -\n * @param blockHeight -\n * @param imageWidth - width of the image in pixels\n * @param imageHeight - height of the image in pixels\n */\n CompressedTextureResource._createLevelBuffers = function (buffer, format, levels, blockWidth, blockHeight, imageWidth, imageHeight) {\n // The byte-size of the first level buffer\n var buffers = new Array(levels);\n var offset = buffer.byteOffset;\n var levelWidth = imageWidth;\n var levelHeight = imageHeight;\n var alignedLevelWidth = (levelWidth + blockWidth - 1) & ~(blockWidth - 1);\n var alignedLevelHeight = (levelHeight + blockHeight - 1) & ~(blockHeight - 1);\n var levelSize = alignedLevelWidth * alignedLevelHeight * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];\n for (var i = 0; i < levels; i++) {\n buffers[i] = {\n levelID: i,\n levelWidth: levels > 1 ? levelWidth : alignedLevelWidth,\n levelHeight: levels > 1 ? levelHeight : alignedLevelHeight,\n levelBuffer: new Uint8Array(buffer.buffer, offset, levelSize)\n };\n offset += levelSize;\n // Calculate levelBuffer dimensions for next iteration\n levelWidth = (levelWidth >> 1) || 1;\n levelHeight = (levelHeight >> 1) || 1;\n alignedLevelWidth = (levelWidth + blockWidth - 1) & ~(blockWidth - 1);\n alignedLevelHeight = (levelHeight + blockHeight - 1) & ~(blockHeight - 1);\n levelSize = alignedLevelWidth * alignedLevelHeight * INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[format];\n }\n return buffers;\n };\n return CompressedTextureResource;\n}(BlobResource));\n\n/* eslint-enable camelcase */\n/**\n * Loader plugin for handling compressed textures for all platforms.\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n */\nvar CompressedTextureLoader = /** @class */ (function () {\n function CompressedTextureLoader() {\n }\n /**\n * Called after a compressed-textures manifest is loaded.\n *\n * This will then load the correct compression format for the device. Your manifest should adhere\n * to the following schema:\n *\n * ```js\n * import { INTERNAL_FORMATS } from '@pixi/constants';\n *\n * type CompressedTextureManifest = {\n * textures: Array<{ src: string, format?: keyof INTERNAL_FORMATS}>,\n * cacheID: string;\n * };\n * ```\n *\n * This is an example of a .json manifest file\n *\n * ```json\n * {\n * \"cacheID\":\"asset\",\n * \"textures\":[\n * { \"src\":\"asset.fallback.png\" },\n * { \"format\":\"COMPRESSED_RGBA_S3TC_DXT5_EXT\", \"src\":\"asset.s3tc.ktx\" },\n * { \"format\":\"COMPRESSED_RGBA8_ETC2_EAC\", \"src\":\"asset.etc.ktx\" },\n * { \"format\":\"RGBA_PVRTC_4BPPV1_IMG\", \"src\":\"asset.pvrtc.ktx\" }\n * ]\n * }\n * ```\n */\n CompressedTextureLoader.use = function (resource, next) {\n var data = resource.data;\n var loader = this;\n if (resource.type === LoaderResource.TYPE.JSON\n && data\n && data.cacheID\n && data.textures) {\n var textures = data.textures;\n var textureURL = void 0;\n var fallbackURL = void 0;\n // Search for an extension that holds one the formats\n for (var i = 0, j = textures.length; i < j; i++) {\n var texture = textures[i];\n var url_1 = texture.src;\n var format = texture.format;\n if (!format) {\n fallbackURL = url_1;\n }\n if (CompressedTextureLoader.textureFormats[format]) {\n textureURL = url_1;\n break;\n }\n }\n textureURL = textureURL || fallbackURL;\n // Make sure we have a URL\n if (!textureURL) {\n next(new Error(\"Cannot load compressed-textures in \" + resource.url + \", make sure you provide a fallback\"));\n return;\n }\n if (textureURL === resource.url) {\n // Prevent infinite loops\n next(new Error('URL of compressed texture cannot be the same as the manifest\\'s URL'));\n return;\n }\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource\n };\n var resourcePath = url.resolve(resource.url.replace(loader.baseUrl, ''), textureURL);\n var resourceName = data.cacheID;\n // The appropriate loader should register the texture\n loader.add(resourceName, resourcePath, loadOptions, function (res) {\n if (res.error) {\n next(res.error);\n return;\n }\n var _a = res.texture, texture = _a === void 0 ? null : _a, _b = res.textures, textures = _b === void 0 ? {} : _b;\n // Make sure texture/textures is assigned to parent resource\n Object.assign(resource, { texture: texture, textures: textures });\n // Pass along any error\n next();\n });\n }\n else {\n next();\n }\n };\n Object.defineProperty(CompressedTextureLoader, \"textureExtensions\", {\n /** Map of available texture extensions. */\n get: function () {\n if (!CompressedTextureLoader._textureExtensions) {\n // Auto-detect WebGL compressed-texture extensions\n var canvas = settings.ADAPTER.createCanvas();\n var gl = canvas.getContext('webgl');\n if (!gl) {\n console.warn('WebGL not available for compressed textures. Silently failing.');\n return {};\n }\n var extensions = {\n s3tc: gl.getExtension('WEBGL_compressed_texture_s3tc'),\n s3tc_sRGB: gl.getExtension('WEBGL_compressed_texture_s3tc_srgb'),\n etc: gl.getExtension('WEBGL_compressed_texture_etc'),\n etc1: gl.getExtension('WEBGL_compressed_texture_etc1'),\n pvrtc: gl.getExtension('WEBGL_compressed_texture_pvrtc')\n || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),\n atc: gl.getExtension('WEBGL_compressed_texture_atc'),\n astc: gl.getExtension('WEBGL_compressed_texture_astc')\n };\n CompressedTextureLoader._textureExtensions = extensions;\n }\n return CompressedTextureLoader._textureExtensions;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CompressedTextureLoader, \"textureFormats\", {\n /** Map of available texture formats. */\n get: function () {\n if (!CompressedTextureLoader._textureFormats) {\n var extensions = CompressedTextureLoader.textureExtensions;\n CompressedTextureLoader._textureFormats = {};\n // Assign all available compressed-texture formats\n for (var extensionName in extensions) {\n var extension = extensions[extensionName];\n if (!extension) {\n continue;\n }\n Object.assign(CompressedTextureLoader._textureFormats, Object.getPrototypeOf(extension));\n }\n }\n return CompressedTextureLoader._textureFormats;\n },\n enumerable: false,\n configurable: true\n });\n /** @ignore */\n CompressedTextureLoader.extension = ExtensionType.Loader;\n return CompressedTextureLoader;\n}());\n\n/**\n * Creates base-textures and textures for each compressed-texture resource and adds them into the global\n * texture cache. The first texture has two IDs - `${url}`, `${url}-1`; while the rest have an ID of the\n * form `${url}-i`.\n * @param url - the original address of the resources\n * @param resources - the resources backing texture data\n * @ignore\n */\nfunction registerCompressedTextures(url, resources, metadata) {\n var result = {\n textures: {},\n texture: null,\n };\n if (!resources) {\n return result;\n }\n var textures = resources.map(function (resource) {\n return (new Texture(new BaseTexture(resource, Object.assign({\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA\n }, metadata))));\n });\n textures.forEach(function (texture, i) {\n var baseTexture = texture.baseTexture;\n var cacheID = url + \"-\" + (i + 1);\n BaseTexture.addToCache(baseTexture, cacheID);\n Texture.addToCache(texture, cacheID);\n if (i === 0) {\n BaseTexture.addToCache(baseTexture, url);\n Texture.addToCache(texture, url);\n result.texture = texture;\n }\n result.textures[cacheID] = texture;\n });\n return result;\n}\n\nvar _a$1, _b$1;\nvar DDS_MAGIC_SIZE = 4;\nvar DDS_HEADER_SIZE = 124;\nvar DDS_HEADER_PF_SIZE = 32;\nvar DDS_HEADER_DX10_SIZE = 20;\n// DDS file format magic word\nvar DDS_MAGIC = 0x20534444;\n/**\n * DWORD offsets of the DDS file header fields (relative to file start).\n * @ignore\n */\nvar DDS_FIELDS = {\n SIZE: 1,\n FLAGS: 2,\n HEIGHT: 3,\n WIDTH: 4,\n MIPMAP_COUNT: 7,\n PIXEL_FORMAT: 19,\n};\n/**\n * DWORD offsets of the DDS PIXEL_FORMAT fields.\n * @ignore\n */\nvar DDS_PF_FIELDS = {\n SIZE: 0,\n FLAGS: 1,\n FOURCC: 2,\n RGB_BITCOUNT: 3,\n R_BIT_MASK: 4,\n G_BIT_MASK: 5,\n B_BIT_MASK: 6,\n A_BIT_MASK: 7\n};\n/**\n * DWORD offsets of the DDS_HEADER_DX10 fields.\n * @ignore\n */\nvar DDS_DX10_FIELDS = {\n DXGI_FORMAT: 0,\n RESOURCE_DIMENSION: 1,\n MISC_FLAG: 2,\n ARRAY_SIZE: 3,\n MISC_FLAGS2: 4\n};\n/**\n * @see https://docs.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format\n * @ignore\n */\n// This is way over-blown for us! Lend us a hand, and remove the ones that aren't used (but set the remaining\n// ones to their correct value)\nvar DXGI_FORMAT;\n(function (DXGI_FORMAT) {\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_UNKNOWN\"] = 0] = \"DXGI_FORMAT_UNKNOWN\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_TYPELESS\"] = 1] = \"DXGI_FORMAT_R32G32B32A32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_FLOAT\"] = 2] = \"DXGI_FORMAT_R32G32B32A32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_UINT\"] = 3] = \"DXGI_FORMAT_R32G32B32A32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32A32_SINT\"] = 4] = \"DXGI_FORMAT_R32G32B32A32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_TYPELESS\"] = 5] = \"DXGI_FORMAT_R32G32B32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_FLOAT\"] = 6] = \"DXGI_FORMAT_R32G32B32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_UINT\"] = 7] = \"DXGI_FORMAT_R32G32B32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32B32_SINT\"] = 8] = \"DXGI_FORMAT_R32G32B32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_TYPELESS\"] = 9] = \"DXGI_FORMAT_R16G16B16A16_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_FLOAT\"] = 10] = \"DXGI_FORMAT_R16G16B16A16_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_UNORM\"] = 11] = \"DXGI_FORMAT_R16G16B16A16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_UINT\"] = 12] = \"DXGI_FORMAT_R16G16B16A16_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_SNORM\"] = 13] = \"DXGI_FORMAT_R16G16B16A16_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16B16A16_SINT\"] = 14] = \"DXGI_FORMAT_R16G16B16A16_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_TYPELESS\"] = 15] = \"DXGI_FORMAT_R32G32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_FLOAT\"] = 16] = \"DXGI_FORMAT_R32G32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_UINT\"] = 17] = \"DXGI_FORMAT_R32G32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G32_SINT\"] = 18] = \"DXGI_FORMAT_R32G32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32G8X24_TYPELESS\"] = 19] = \"DXGI_FORMAT_R32G8X24_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D32_FLOAT_S8X24_UINT\"] = 20] = \"DXGI_FORMAT_D32_FLOAT_S8X24_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS\"] = 21] = \"DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_X32_TYPELESS_G8X24_UINT\"] = 22] = \"DXGI_FORMAT_X32_TYPELESS_G8X24_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10A2_TYPELESS\"] = 23] = \"DXGI_FORMAT_R10G10B10A2_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10A2_UNORM\"] = 24] = \"DXGI_FORMAT_R10G10B10A2_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10A2_UINT\"] = 25] = \"DXGI_FORMAT_R10G10B10A2_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R11G11B10_FLOAT\"] = 26] = \"DXGI_FORMAT_R11G11B10_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_TYPELESS\"] = 27] = \"DXGI_FORMAT_R8G8B8A8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_UNORM\"] = 28] = \"DXGI_FORMAT_R8G8B8A8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_UNORM_SRGB\"] = 29] = \"DXGI_FORMAT_R8G8B8A8_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_UINT\"] = 30] = \"DXGI_FORMAT_R8G8B8A8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_SNORM\"] = 31] = \"DXGI_FORMAT_R8G8B8A8_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8B8A8_SINT\"] = 32] = \"DXGI_FORMAT_R8G8B8A8_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_TYPELESS\"] = 33] = \"DXGI_FORMAT_R16G16_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_FLOAT\"] = 34] = \"DXGI_FORMAT_R16G16_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_UNORM\"] = 35] = \"DXGI_FORMAT_R16G16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_UINT\"] = 36] = \"DXGI_FORMAT_R16G16_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_SNORM\"] = 37] = \"DXGI_FORMAT_R16G16_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16G16_SINT\"] = 38] = \"DXGI_FORMAT_R16G16_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_TYPELESS\"] = 39] = \"DXGI_FORMAT_R32_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D32_FLOAT\"] = 40] = \"DXGI_FORMAT_D32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_FLOAT\"] = 41] = \"DXGI_FORMAT_R32_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_UINT\"] = 42] = \"DXGI_FORMAT_R32_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R32_SINT\"] = 43] = \"DXGI_FORMAT_R32_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R24G8_TYPELESS\"] = 44] = \"DXGI_FORMAT_R24G8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D24_UNORM_S8_UINT\"] = 45] = \"DXGI_FORMAT_D24_UNORM_S8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R24_UNORM_X8_TYPELESS\"] = 46] = \"DXGI_FORMAT_R24_UNORM_X8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_X24_TYPELESS_G8_UINT\"] = 47] = \"DXGI_FORMAT_X24_TYPELESS_G8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_TYPELESS\"] = 48] = \"DXGI_FORMAT_R8G8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_UNORM\"] = 49] = \"DXGI_FORMAT_R8G8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_UINT\"] = 50] = \"DXGI_FORMAT_R8G8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_SNORM\"] = 51] = \"DXGI_FORMAT_R8G8_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_SINT\"] = 52] = \"DXGI_FORMAT_R8G8_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_TYPELESS\"] = 53] = \"DXGI_FORMAT_R16_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_FLOAT\"] = 54] = \"DXGI_FORMAT_R16_FLOAT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_D16_UNORM\"] = 55] = \"DXGI_FORMAT_D16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_UNORM\"] = 56] = \"DXGI_FORMAT_R16_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_UINT\"] = 57] = \"DXGI_FORMAT_R16_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_SNORM\"] = 58] = \"DXGI_FORMAT_R16_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R16_SINT\"] = 59] = \"DXGI_FORMAT_R16_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_TYPELESS\"] = 60] = \"DXGI_FORMAT_R8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_UNORM\"] = 61] = \"DXGI_FORMAT_R8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_UINT\"] = 62] = \"DXGI_FORMAT_R8_UINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_SNORM\"] = 63] = \"DXGI_FORMAT_R8_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8_SINT\"] = 64] = \"DXGI_FORMAT_R8_SINT\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_A8_UNORM\"] = 65] = \"DXGI_FORMAT_A8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R1_UNORM\"] = 66] = \"DXGI_FORMAT_R1_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R9G9B9E5_SHAREDEXP\"] = 67] = \"DXGI_FORMAT_R9G9B9E5_SHAREDEXP\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R8G8_B8G8_UNORM\"] = 68] = \"DXGI_FORMAT_R8G8_B8G8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_G8R8_G8B8_UNORM\"] = 69] = \"DXGI_FORMAT_G8R8_G8B8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC1_TYPELESS\"] = 70] = \"DXGI_FORMAT_BC1_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC1_UNORM\"] = 71] = \"DXGI_FORMAT_BC1_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC1_UNORM_SRGB\"] = 72] = \"DXGI_FORMAT_BC1_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC2_TYPELESS\"] = 73] = \"DXGI_FORMAT_BC2_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC2_UNORM\"] = 74] = \"DXGI_FORMAT_BC2_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC2_UNORM_SRGB\"] = 75] = \"DXGI_FORMAT_BC2_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC3_TYPELESS\"] = 76] = \"DXGI_FORMAT_BC3_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC3_UNORM\"] = 77] = \"DXGI_FORMAT_BC3_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC3_UNORM_SRGB\"] = 78] = \"DXGI_FORMAT_BC3_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC4_TYPELESS\"] = 79] = \"DXGI_FORMAT_BC4_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC4_UNORM\"] = 80] = \"DXGI_FORMAT_BC4_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC4_SNORM\"] = 81] = \"DXGI_FORMAT_BC4_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC5_TYPELESS\"] = 82] = \"DXGI_FORMAT_BC5_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC5_UNORM\"] = 83] = \"DXGI_FORMAT_BC5_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC5_SNORM\"] = 84] = \"DXGI_FORMAT_BC5_SNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B5G6R5_UNORM\"] = 85] = \"DXGI_FORMAT_B5G6R5_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B5G5R5A1_UNORM\"] = 86] = \"DXGI_FORMAT_B5G5R5A1_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8A8_UNORM\"] = 87] = \"DXGI_FORMAT_B8G8R8A8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8X8_UNORM\"] = 88] = \"DXGI_FORMAT_B8G8R8X8_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM\"] = 89] = \"DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8A8_TYPELESS\"] = 90] = \"DXGI_FORMAT_B8G8R8A8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8A8_UNORM_SRGB\"] = 91] = \"DXGI_FORMAT_B8G8R8A8_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8X8_TYPELESS\"] = 92] = \"DXGI_FORMAT_B8G8R8X8_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B8G8R8X8_UNORM_SRGB\"] = 93] = \"DXGI_FORMAT_B8G8R8X8_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC6H_TYPELESS\"] = 94] = \"DXGI_FORMAT_BC6H_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC6H_UF16\"] = 95] = \"DXGI_FORMAT_BC6H_UF16\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC6H_SF16\"] = 96] = \"DXGI_FORMAT_BC6H_SF16\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC7_TYPELESS\"] = 97] = \"DXGI_FORMAT_BC7_TYPELESS\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC7_UNORM\"] = 98] = \"DXGI_FORMAT_BC7_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_BC7_UNORM_SRGB\"] = 99] = \"DXGI_FORMAT_BC7_UNORM_SRGB\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_AYUV\"] = 100] = \"DXGI_FORMAT_AYUV\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y410\"] = 101] = \"DXGI_FORMAT_Y410\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y416\"] = 102] = \"DXGI_FORMAT_Y416\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_NV12\"] = 103] = \"DXGI_FORMAT_NV12\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P010\"] = 104] = \"DXGI_FORMAT_P010\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P016\"] = 105] = \"DXGI_FORMAT_P016\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_420_OPAQUE\"] = 106] = \"DXGI_FORMAT_420_OPAQUE\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_YUY2\"] = 107] = \"DXGI_FORMAT_YUY2\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y210\"] = 108] = \"DXGI_FORMAT_Y210\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_Y216\"] = 109] = \"DXGI_FORMAT_Y216\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_NV11\"] = 110] = \"DXGI_FORMAT_NV11\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_AI44\"] = 111] = \"DXGI_FORMAT_AI44\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_IA44\"] = 112] = \"DXGI_FORMAT_IA44\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P8\"] = 113] = \"DXGI_FORMAT_P8\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_A8P8\"] = 114] = \"DXGI_FORMAT_A8P8\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_B4G4R4A4_UNORM\"] = 115] = \"DXGI_FORMAT_B4G4R4A4_UNORM\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_P208\"] = 116] = \"DXGI_FORMAT_P208\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_V208\"] = 117] = \"DXGI_FORMAT_V208\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_V408\"] = 118] = \"DXGI_FORMAT_V408\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE\"] = 119] = \"DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE\"] = 120] = \"DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE\";\n DXGI_FORMAT[DXGI_FORMAT[\"DXGI_FORMAT_FORCE_UINT\"] = 121] = \"DXGI_FORMAT_FORCE_UINT\";\n})(DXGI_FORMAT || (DXGI_FORMAT = {}));\n/**\n * Possible values of the field {@link DDS_DX10_FIELDS.RESOURCE_DIMENSION}\n * @ignore\n */\nvar D3D10_RESOURCE_DIMENSION;\n(function (D3D10_RESOURCE_DIMENSION) {\n D3D10_RESOURCE_DIMENSION[D3D10_RESOURCE_DIMENSION[\"DDS_DIMENSION_TEXTURE1D\"] = 2] = \"DDS_DIMENSION_TEXTURE1D\";\n D3D10_RESOURCE_DIMENSION[D3D10_RESOURCE_DIMENSION[\"DDS_DIMENSION_TEXTURE2D\"] = 3] = \"DDS_DIMENSION_TEXTURE2D\";\n D3D10_RESOURCE_DIMENSION[D3D10_RESOURCE_DIMENSION[\"DDS_DIMENSION_TEXTURE3D\"] = 6] = \"DDS_DIMENSION_TEXTURE3D\";\n})(D3D10_RESOURCE_DIMENSION || (D3D10_RESOURCE_DIMENSION = {}));\nvar PF_FLAGS = 1;\n// PIXEL_FORMAT flags\nvar DDPF_ALPHA = 0x2;\nvar DDPF_FOURCC = 0x4;\nvar DDPF_RGB = 0x40;\nvar DDPF_YUV = 0x200;\nvar DDPF_LUMINANCE = 0x20000;\n// Four character codes for DXTn formats\nvar FOURCC_DXT1 = 0x31545844;\nvar FOURCC_DXT3 = 0x33545844;\nvar FOURCC_DXT5 = 0x35545844;\nvar FOURCC_DX10 = 0x30315844;\n// Cubemap texture flag (for DDS_DX10_FIELDS.MISC_FLAG)\nvar DDS_RESOURCE_MISC_TEXTURECUBE = 0x4;\n/**\n * Maps `FOURCC_*` formats to internal formats (see {@link PIXI.INTERNAL_FORMATS}).\n * @ignore\n */\nvar FOURCC_TO_FORMAT = (_a$1 = {},\n _a$1[FOURCC_DXT1] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n _a$1[FOURCC_DXT3] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n _a$1[FOURCC_DXT5] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n _a$1);\n/**\n * Maps {@link DXGI_FORMAT} to types/internal-formats (see {@link PIXI.TYPES}, {@link PIXI.INTERNAL_FORMATS})\n * @ignore\n */\nvar DXGI_TO_FORMAT = (_b$1 = {},\n // WEBGL_compressed_texture_s3tc\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC1_TYPELESS] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC2_TYPELESS] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC3_TYPELESS] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM] = INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n // WEBGL_compressed_texture_s3tc_srgb\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM_SRGB] = INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC2_UNORM_SRGB] = INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,\n _b$1[DXGI_FORMAT.DXGI_FORMAT_BC3_UNORM_SRGB] = INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,\n _b$1);\n/**\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n * @see https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide\n */\n/**\n * Parses the DDS file header, generates base-textures, and puts them into the texture cache.\n * @param arrayBuffer\n */\nfunction parseDDS(arrayBuffer) {\n var data = new Uint32Array(arrayBuffer);\n var magicWord = data[0];\n if (magicWord !== DDS_MAGIC) {\n throw new Error('Invalid DDS file magic word');\n }\n var header = new Uint32Array(arrayBuffer, 0, DDS_HEADER_SIZE / Uint32Array.BYTES_PER_ELEMENT);\n // DDS header fields\n var height = header[DDS_FIELDS.HEIGHT];\n var width = header[DDS_FIELDS.WIDTH];\n var mipmapCount = header[DDS_FIELDS.MIPMAP_COUNT];\n // PIXEL_FORMAT fields\n var pixelFormat = new Uint32Array(arrayBuffer, DDS_FIELDS.PIXEL_FORMAT * Uint32Array.BYTES_PER_ELEMENT, DDS_HEADER_PF_SIZE / Uint32Array.BYTES_PER_ELEMENT);\n var formatFlags = pixelFormat[PF_FLAGS];\n // File contains compressed texture(s)\n if (formatFlags & DDPF_FOURCC) {\n var fourCC = pixelFormat[DDS_PF_FIELDS.FOURCC];\n // File contains one DXTn compressed texture\n if (fourCC !== FOURCC_DX10) {\n var internalFormat_1 = FOURCC_TO_FORMAT[fourCC];\n var dataOffset_1 = DDS_MAGIC_SIZE + DDS_HEADER_SIZE;\n var texData = new Uint8Array(arrayBuffer, dataOffset_1);\n var resource = new CompressedTextureResource(texData, {\n format: internalFormat_1,\n width: width,\n height: height,\n levels: mipmapCount // CompressedTextureResource will separate the levelBuffers for us!\n });\n return [resource];\n }\n // FOURCC_DX10 indicates there is a 20-byte DDS_HEADER_DX10 after DDS_HEADER\n var dx10Offset = DDS_MAGIC_SIZE + DDS_HEADER_SIZE;\n var dx10Header = new Uint32Array(data.buffer, dx10Offset, DDS_HEADER_DX10_SIZE / Uint32Array.BYTES_PER_ELEMENT);\n var dxgiFormat = dx10Header[DDS_DX10_FIELDS.DXGI_FORMAT];\n var resourceDimension = dx10Header[DDS_DX10_FIELDS.RESOURCE_DIMENSION];\n var miscFlag = dx10Header[DDS_DX10_FIELDS.MISC_FLAG];\n var arraySize = dx10Header[DDS_DX10_FIELDS.ARRAY_SIZE];\n // Map dxgiFormat to PIXI.INTERNAL_FORMATS\n var internalFormat_2 = DXGI_TO_FORMAT[dxgiFormat];\n if (internalFormat_2 === undefined) {\n throw new Error(\"DDSParser cannot parse texture data with DXGI format \" + dxgiFormat);\n }\n if (miscFlag === DDS_RESOURCE_MISC_TEXTURECUBE) {\n // FIXME: Anybody excited about cubemap compressed textures?\n throw new Error('DDSParser does not support cubemap textures');\n }\n if (resourceDimension === D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D) {\n // FIXME: Anybody excited about 3D compressed textures?\n throw new Error('DDSParser does not supported 3D texture data');\n }\n // Uint8Array buffers of image data, including all mipmap levels in each image\n var imageBuffers = new Array();\n var dataOffset = DDS_MAGIC_SIZE\n + DDS_HEADER_SIZE\n + DDS_HEADER_DX10_SIZE;\n if (arraySize === 1) {\n // No need bothering with the imageSize calculation!\n imageBuffers.push(new Uint8Array(arrayBuffer, dataOffset));\n }\n else {\n // Calculate imageSize for each texture, and then locate each image's texture data\n var pixelSize = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[internalFormat_2];\n var imageSize = 0;\n var levelWidth = width;\n var levelHeight = height;\n for (var i = 0; i < mipmapCount; i++) {\n var alignedLevelWidth = Math.max(1, (levelWidth + 3) & ~3);\n var alignedLevelHeight = Math.max(1, (levelHeight + 3) & ~3);\n var levelSize = alignedLevelWidth * alignedLevelHeight * pixelSize;\n imageSize += levelSize;\n levelWidth = levelWidth >>> 1;\n levelHeight = levelHeight >>> 1;\n }\n var imageOffset = dataOffset;\n // NOTE: Cubemaps have 6-images per texture (but they aren't supported so ^_^)\n for (var i = 0; i < arraySize; i++) {\n imageBuffers.push(new Uint8Array(arrayBuffer, imageOffset, imageSize));\n imageOffset += imageSize;\n }\n }\n // Uint8Array -> CompressedTextureResource, and we're done!\n return imageBuffers.map(function (buffer) { return new CompressedTextureResource(buffer, {\n format: internalFormat_2,\n width: width,\n height: height,\n levels: mipmapCount\n }); });\n }\n if (formatFlags & DDPF_RGB) {\n // FIXME: We might want to allow uncompressed *.dds files?\n throw new Error('DDSParser does not support uncompressed texture data.');\n }\n if (formatFlags & DDPF_YUV) {\n // FIXME: Does anybody need this feature?\n throw new Error('DDSParser does not supported YUV uncompressed texture data.');\n }\n if (formatFlags & DDPF_LUMINANCE) {\n // FIXME: Microsoft says older DDS filers use this feature! Probably not worth the effort!\n throw new Error('DDSParser does not support single-channel (lumninance) texture data!');\n }\n if (formatFlags & DDPF_ALPHA) {\n // FIXME: I'm tired! See above =)\n throw new Error('DDSParser does not support single-channel (alpha) texture data!');\n }\n throw new Error('DDSParser failed to load a texture file due to an unknown reason!');\n}\n\nvar _a, _b, _c;\n/**\n * The 12-byte KTX file identifier\n * @see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/#2.1\n * @ignore\n */\nvar FILE_IDENTIFIER = [0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A];\n/**\n * The value stored in the \"endianness\" field.\n * @see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/#2.2\n * @ignore\n */\nvar ENDIANNESS = 0x04030201;\n/**\n * Byte offsets of the KTX file header fields\n * @ignore\n */\nvar KTX_FIELDS = {\n FILE_IDENTIFIER: 0,\n ENDIANNESS: 12,\n GL_TYPE: 16,\n GL_TYPE_SIZE: 20,\n GL_FORMAT: 24,\n GL_INTERNAL_FORMAT: 28,\n GL_BASE_INTERNAL_FORMAT: 32,\n PIXEL_WIDTH: 36,\n PIXEL_HEIGHT: 40,\n PIXEL_DEPTH: 44,\n NUMBER_OF_ARRAY_ELEMENTS: 48,\n NUMBER_OF_FACES: 52,\n NUMBER_OF_MIPMAP_LEVELS: 56,\n BYTES_OF_KEY_VALUE_DATA: 60\n};\n/**\n * Byte size of the file header fields in {@code KTX_FIELDS}\n * @ignore\n */\nvar FILE_HEADER_SIZE = 64;\n/**\n * Maps {@link PIXI.TYPES} to the bytes taken per component, excluding those ones that are bit-fields.\n * @ignore\n */\nvar TYPES_TO_BYTES_PER_COMPONENT = (_a = {},\n _a[TYPES.UNSIGNED_BYTE] = 1,\n _a[TYPES.UNSIGNED_SHORT] = 2,\n _a[TYPES.INT] = 4,\n _a[TYPES.UNSIGNED_INT] = 4,\n _a[TYPES.FLOAT] = 4,\n _a[TYPES.HALF_FLOAT] = 8,\n _a);\n/**\n * Number of components in each {@link PIXI.FORMATS}\n * @ignore\n */\nvar FORMATS_TO_COMPONENTS = (_b = {},\n _b[FORMATS.RGBA] = 4,\n _b[FORMATS.RGB] = 3,\n _b[FORMATS.RG] = 2,\n _b[FORMATS.RED] = 1,\n _b[FORMATS.LUMINANCE] = 1,\n _b[FORMATS.LUMINANCE_ALPHA] = 2,\n _b[FORMATS.ALPHA] = 1,\n _b);\n/**\n * Number of bytes per pixel in bit-field types in {@link PIXI.TYPES}\n * @ignore\n */\nvar TYPES_TO_BYTES_PER_PIXEL = (_c = {},\n _c[TYPES.UNSIGNED_SHORT_4_4_4_4] = 2,\n _c[TYPES.UNSIGNED_SHORT_5_5_5_1] = 2,\n _c[TYPES.UNSIGNED_SHORT_5_6_5] = 2,\n _c);\nfunction parseKTX(url, arrayBuffer, loadKeyValueData) {\n if (loadKeyValueData === void 0) { loadKeyValueData = false; }\n var dataView = new DataView(arrayBuffer);\n if (!validate(url, dataView)) {\n return null;\n }\n var littleEndian = dataView.getUint32(KTX_FIELDS.ENDIANNESS, true) === ENDIANNESS;\n var glType = dataView.getUint32(KTX_FIELDS.GL_TYPE, littleEndian);\n // const glTypeSize = dataView.getUint32(KTX_FIELDS.GL_TYPE_SIZE, littleEndian);\n var glFormat = dataView.getUint32(KTX_FIELDS.GL_FORMAT, littleEndian);\n var glInternalFormat = dataView.getUint32(KTX_FIELDS.GL_INTERNAL_FORMAT, littleEndian);\n var pixelWidth = dataView.getUint32(KTX_FIELDS.PIXEL_WIDTH, littleEndian);\n var pixelHeight = dataView.getUint32(KTX_FIELDS.PIXEL_HEIGHT, littleEndian) || 1; // \"pixelHeight = 0\" -> \"1\"\n var pixelDepth = dataView.getUint32(KTX_FIELDS.PIXEL_DEPTH, littleEndian) || 1; // ^^\n var numberOfArrayElements = dataView.getUint32(KTX_FIELDS.NUMBER_OF_ARRAY_ELEMENTS, littleEndian) || 1; // ^^\n var numberOfFaces = dataView.getUint32(KTX_FIELDS.NUMBER_OF_FACES, littleEndian);\n var numberOfMipmapLevels = dataView.getUint32(KTX_FIELDS.NUMBER_OF_MIPMAP_LEVELS, littleEndian);\n var bytesOfKeyValueData = dataView.getUint32(KTX_FIELDS.BYTES_OF_KEY_VALUE_DATA, littleEndian);\n // Whether the platform architecture is little endian. If littleEndian !== platformLittleEndian, then the\n // file contents must be endian-converted!\n // TODO: Endianness conversion\n // const platformLittleEndian = new Uint8Array((new Uint32Array([ENDIANNESS])).buffer)[0] === 0x01;\n if (pixelHeight === 0 || pixelDepth !== 1) {\n throw new Error('Only 2D textures are supported');\n }\n if (numberOfFaces !== 1) {\n throw new Error('CubeTextures are not supported by KTXLoader yet!');\n }\n if (numberOfArrayElements !== 1) {\n // TODO: Support splitting array-textures into multiple BaseTextures\n throw new Error('WebGL does not support array textures');\n }\n // TODO: 8x4 blocks for 2bpp pvrtc\n var blockWidth = 4;\n var blockHeight = 4;\n var alignedWidth = (pixelWidth + 3) & ~3;\n var alignedHeight = (pixelHeight + 3) & ~3;\n var imageBuffers = new Array(numberOfArrayElements);\n var imagePixels = pixelWidth * pixelHeight;\n if (glType === 0) {\n // Align to 16 pixels (4x4 blocks)\n imagePixels = alignedWidth * alignedHeight;\n }\n var imagePixelByteSize;\n if (glType !== 0) {\n // Uncompressed texture format\n if (TYPES_TO_BYTES_PER_COMPONENT[glType]) {\n imagePixelByteSize = TYPES_TO_BYTES_PER_COMPONENT[glType] * FORMATS_TO_COMPONENTS[glFormat];\n }\n else {\n imagePixelByteSize = TYPES_TO_BYTES_PER_PIXEL[glType];\n }\n }\n else {\n imagePixelByteSize = INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[glInternalFormat];\n }\n if (imagePixelByteSize === undefined) {\n throw new Error('Unable to resolve the pixel format stored in the *.ktx file!');\n }\n var kvData = loadKeyValueData\n ? parseKvData(dataView, bytesOfKeyValueData, littleEndian)\n : null;\n var imageByteSize = imagePixels * imagePixelByteSize;\n var mipByteSize = imageByteSize;\n var mipWidth = pixelWidth;\n var mipHeight = pixelHeight;\n var alignedMipWidth = alignedWidth;\n var alignedMipHeight = alignedHeight;\n var imageOffset = FILE_HEADER_SIZE + bytesOfKeyValueData;\n for (var mipmapLevel = 0; mipmapLevel < numberOfMipmapLevels; mipmapLevel++) {\n var imageSize = dataView.getUint32(imageOffset, littleEndian);\n var elementOffset = imageOffset + 4;\n for (var arrayElement = 0; arrayElement < numberOfArrayElements; arrayElement++) {\n // TODO: Maybe support 3D textures? :-)\n // for (let zSlice = 0; zSlice < pixelDepth; zSlice)\n var mips = imageBuffers[arrayElement];\n if (!mips) {\n mips = imageBuffers[arrayElement] = new Array(numberOfMipmapLevels);\n }\n mips[mipmapLevel] = {\n levelID: mipmapLevel,\n // don't align mipWidth when texture not compressed! (glType not zero)\n levelWidth: numberOfMipmapLevels > 1 || glType !== 0 ? mipWidth : alignedMipWidth,\n levelHeight: numberOfMipmapLevels > 1 || glType !== 0 ? mipHeight : alignedMipHeight,\n levelBuffer: new Uint8Array(arrayBuffer, elementOffset, mipByteSize)\n };\n elementOffset += mipByteSize;\n }\n // HINT: Aligns to 4-byte boundary after jumping imageSize (in lieu of mipPadding)\n imageOffset += imageSize + 4; // (+4 to jump the imageSize field itself)\n imageOffset = imageOffset % 4 !== 0 ? imageOffset + 4 - (imageOffset % 4) : imageOffset;\n // Calculate mipWidth, mipHeight for _next_ iteration\n mipWidth = (mipWidth >> 1) || 1;\n mipHeight = (mipHeight >> 1) || 1;\n alignedMipWidth = (mipWidth + blockWidth - 1) & ~(blockWidth - 1);\n alignedMipHeight = (mipHeight + blockHeight - 1) & ~(blockHeight - 1);\n // Each mipmap level is 4-times smaller?\n mipByteSize = alignedMipWidth * alignedMipHeight * imagePixelByteSize;\n }\n // We use the levelBuffers feature of CompressedTextureResource b/c texture data is image-major, not level-major.\n if (glType !== 0) {\n return {\n uncompressed: imageBuffers.map(function (levelBuffers) {\n var buffer = levelBuffers[0].levelBuffer;\n var convertToInt = false;\n if (glType === TYPES.FLOAT) {\n buffer = new Float32Array(levelBuffers[0].levelBuffer.buffer, levelBuffers[0].levelBuffer.byteOffset, levelBuffers[0].levelBuffer.byteLength / 4);\n }\n else if (glType === TYPES.UNSIGNED_INT) {\n convertToInt = true;\n buffer = new Uint32Array(levelBuffers[0].levelBuffer.buffer, levelBuffers[0].levelBuffer.byteOffset, levelBuffers[0].levelBuffer.byteLength / 4);\n }\n else if (glType === TYPES.INT) {\n convertToInt = true;\n buffer = new Int32Array(levelBuffers[0].levelBuffer.buffer, levelBuffers[0].levelBuffer.byteOffset, levelBuffers[0].levelBuffer.byteLength / 4);\n }\n return {\n resource: new BufferResource(buffer, {\n width: levelBuffers[0].levelWidth,\n height: levelBuffers[0].levelHeight,\n }),\n type: glType,\n format: convertToInt ? convertFormatToInteger(glFormat) : glFormat,\n };\n }),\n kvData: kvData\n };\n }\n return {\n compressed: imageBuffers.map(function (levelBuffers) { return new CompressedTextureResource(null, {\n format: glInternalFormat,\n width: pixelWidth,\n height: pixelHeight,\n levels: numberOfMipmapLevels,\n levelBuffers: levelBuffers,\n }); }),\n kvData: kvData\n };\n}\n/**\n * Checks whether the arrayBuffer contains a valid *.ktx file.\n * @param url\n * @param dataView\n */\nfunction validate(url, dataView) {\n // NOTE: Do not optimize this into 3 32-bit integer comparison because the endianness\n // of the data is not specified.\n for (var i = 0; i < FILE_IDENTIFIER.length; i++) {\n if (dataView.getUint8(i) !== FILE_IDENTIFIER[i]) {\n console.error(url + \" is not a valid *.ktx file!\");\n return false;\n }\n }\n return true;\n}\nfunction convertFormatToInteger(format) {\n switch (format) {\n case FORMATS.RGBA: return FORMATS.RGBA_INTEGER;\n case FORMATS.RGB: return FORMATS.RGB_INTEGER;\n case FORMATS.RG: return FORMATS.RG_INTEGER;\n case FORMATS.RED: return FORMATS.RED_INTEGER;\n default: return format;\n }\n}\nfunction parseKvData(dataView, bytesOfKeyValueData, littleEndian) {\n var kvData = new Map();\n var bytesIntoKeyValueData = 0;\n while (bytesIntoKeyValueData < bytesOfKeyValueData) {\n var keyAndValueByteSize = dataView.getUint32(FILE_HEADER_SIZE + bytesIntoKeyValueData, littleEndian);\n var keyAndValueByteOffset = FILE_HEADER_SIZE + bytesIntoKeyValueData + 4;\n var valuePadding = 3 - ((keyAndValueByteSize + 3) % 4);\n // Bounds check\n if (keyAndValueByteSize === 0 || keyAndValueByteSize > bytesOfKeyValueData - bytesIntoKeyValueData) {\n console.error('KTXLoader: keyAndValueByteSize out of bounds');\n break;\n }\n // Note: keyNulByte can't be 0 otherwise the key is an empty string.\n var keyNulByte = 0;\n for (; keyNulByte < keyAndValueByteSize; keyNulByte++) {\n if (dataView.getUint8(keyAndValueByteOffset + keyNulByte) === 0x00) {\n break;\n }\n }\n if (keyNulByte === -1) {\n console.error('KTXLoader: Failed to find null byte terminating kvData key');\n break;\n }\n var key = new TextDecoder().decode(new Uint8Array(dataView.buffer, keyAndValueByteOffset, keyNulByte));\n var value = new DataView(dataView.buffer, keyAndValueByteOffset + keyNulByte + 1, keyAndValueByteSize - keyNulByte - 1);\n kvData.set(key, value);\n // 4 = the keyAndValueByteSize field itself\n // keyAndValueByteSize = the bytes taken by the key and value\n // valuePadding = extra padding to align with 4 bytes\n bytesIntoKeyValueData += 4 + keyAndValueByteSize + valuePadding;\n }\n return kvData;\n}\n\n// Set DDS files to be loaded as an ArrayBuffer\nLoaderResource.setExtensionXhrType('dds', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);\n/**\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n * @see https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide\n */\nvar DDSLoader = /** @class */ (function () {\n function DDSLoader() {\n }\n /**\n * Registers a DDS compressed texture\n * @see PIXI.Loader.loaderMiddleware\n * @param resource - loader resource that is checked to see if it is a DDS file\n * @param next - callback Function to call when done\n */\n DDSLoader.use = function (resource, next) {\n if (resource.extension === 'dds' && resource.data) {\n try {\n Object.assign(resource, registerCompressedTextures(resource.name || resource.url, parseDDS(resource.data), resource.metadata));\n }\n catch (err) {\n next(err);\n return;\n }\n }\n next();\n };\n /** @ignore */\n DDSLoader.extension = ExtensionType.Loader;\n return DDSLoader;\n}());\n\n// Set KTX files to be loaded as an ArrayBuffer\nLoaderResource.setExtensionXhrType('ktx', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);\n/**\n * Loader plugin for handling KTX texture container files.\n *\n * This KTX loader does not currently support the following features:\n * * cube textures\n * * 3D textures\n * * endianness conversion for big-endian machines\n * * embedded *.basis files\n *\n * It does supports the following features:\n * * multiple textures per file\n * * mipmapping (only for compressed formats)\n * * vendor-specific key/value data parsing (enable {@link PIXI.KTXLoader.loadKeyValueData})\n * @class\n * @memberof PIXI\n * @implements {PIXI.ILoaderPlugin}\n */\nvar KTXLoader = /** @class */ (function () {\n function KTXLoader() {\n }\n /**\n * Called after a KTX file is loaded.\n *\n * This will parse the KTX file header and add a {@code BaseTexture} to the texture\n * cache.\n * @see PIXI.Loader.loaderMiddleware\n * @param resource - loader resource that is checked to see if it is a KTX file\n * @param next - callback Function to call when done\n */\n KTXLoader.use = function (resource, next) {\n if (resource.extension === 'ktx' && resource.data) {\n try {\n var url_1 = resource.name || resource.url;\n var _a = parseKTX(url_1, resource.data, this.loadKeyValueData), compressed = _a.compressed, uncompressed = _a.uncompressed, kvData_1 = _a.kvData;\n if (compressed) {\n var result = registerCompressedTextures(url_1, compressed, resource.metadata);\n if (kvData_1 && result.textures) {\n for (var textureId in result.textures) {\n result.textures[textureId].baseTexture.ktxKeyValueData = kvData_1;\n }\n }\n Object.assign(resource, result);\n }\n else if (uncompressed) {\n var textures_1 = {};\n uncompressed.forEach(function (image, i) {\n var texture = new Texture(new BaseTexture(image.resource, {\n mipmap: MIPMAP_MODES.OFF,\n alphaMode: ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,\n type: image.type,\n format: image.format,\n }));\n var cacheID = url_1 + \"-\" + (i + 1);\n if (kvData_1)\n { texture.baseTexture.ktxKeyValueData = kvData_1; }\n BaseTexture.addToCache(texture.baseTexture, cacheID);\n Texture.addToCache(texture, cacheID);\n if (i === 0) {\n textures_1[url_1] = texture;\n BaseTexture.addToCache(texture.baseTexture, url_1);\n Texture.addToCache(texture, url_1);\n }\n textures_1[cacheID] = texture;\n });\n Object.assign(resource, { textures: textures_1 });\n }\n }\n catch (err) {\n next(err);\n return;\n }\n }\n next();\n };\n /** @ignore */\n KTXLoader.extension = ExtensionType.Loader;\n /**\n * If set to `true`, {@link PIXI.KTXLoader} will parse key-value data in KTX textures. This feature relies\n * on the [Encoding Standard]{@link https://encoding.spec.whatwg.org}.\n *\n * The key-value data will be available on the base-textures as {@code PIXI.BaseTexture.ktxKeyValueData}. They\n * will hold a reference to the texture data buffer, so make sure to delete key-value data once you are done\n * using it.\n */\n KTXLoader.loadKeyValueData = false;\n return KTXLoader;\n}());\n\nexport { BlobResource, CompressedTextureLoader, CompressedTextureResource, DDSLoader, FORMATS_TO_COMPONENTS, INTERNAL_FORMATS, INTERNAL_FORMAT_TO_BYTES_PER_PIXEL, KTXLoader, TYPES_TO_BYTES_PER_COMPONENT, TYPES_TO_BYTES_PER_PIXEL, parseDDS, parseKTX };\n//# sourceMappingURL=compressed-textures.mjs.map\n","/*!\n * @pixi/particle-container - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/particle-container is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { hex2rgb, createIndicesForQuads, correctBlendMode, premultiplyRgba, premultiplyTint } from '@pixi/utils';\nimport { Geometry, Buffer, ExtensionType, ObjectRenderer, Shader, State } from '@pixi/core';\nimport { Matrix } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * The ParticleContainer class is a really fast version of the Container built solely for speed,\n * so use when you need a lot of sprites or particles.\n *\n * The tradeoff of the ParticleContainer is that most advanced functionality will not work.\n * ParticleContainer implements the basic object transform (position, scale, rotation)\n * and some advanced functionality like tint (as of v4.5.6).\n *\n * Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch.\n *\n * It's extremely easy to use:\n * ```js\n * let container = new ParticleContainer();\n *\n * for (let i = 0; i < 100; ++i)\n * {\n * let sprite = PIXI.Sprite.from(\"myImage.png\");\n * container.addChild(sprite);\n * }\n * ```\n *\n * And here you have a hundred sprites that will be rendered at the speed of light.\n * @memberof PIXI\n */\nvar ParticleContainer = /** @class */ (function (_super) {\n __extends(ParticleContainer, _super);\n /**\n * @param maxSize - The maximum number of particles that can be rendered by the container.\n * Affects size of allocated buffers.\n * @param properties - The properties of children that should be uploaded to the gpu and applied.\n * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied.\n * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`.\n * @param {boolean} [properties.position=true] - When true, position be uploaded and applied.\n * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied.\n * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied.\n * @param {boolean} [properties.tint=false] - When true, alpha and tint be uploaded and applied.\n * @param {number} [batchSize=16384] - Number of particles per batch. If less than maxSize, it uses maxSize instead.\n * @param {boolean} [autoResize=false] - If true, container allocates more batches in case\n * there are more than `maxSize` particles.\n */\n function ParticleContainer(maxSize, properties, batchSize, autoResize) {\n if (maxSize === void 0) { maxSize = 1500; }\n if (batchSize === void 0) { batchSize = 16384; }\n if (autoResize === void 0) { autoResize = false; }\n var _this = _super.call(this) || this;\n // Making sure the batch size is valid\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n var maxBatchSize = 16384;\n if (batchSize > maxBatchSize) {\n batchSize = maxBatchSize;\n }\n _this._properties = [false, true, false, false, false];\n _this._maxSize = maxSize;\n _this._batchSize = batchSize;\n _this._buffers = null;\n _this._bufferUpdateIDs = [];\n _this._updateID = 0;\n _this.interactiveChildren = false;\n _this.blendMode = BLEND_MODES.NORMAL;\n _this.autoResize = autoResize;\n _this.roundPixels = true;\n _this.baseTexture = null;\n _this.setProperties(properties);\n _this._tint = 0;\n _this.tintRgb = new Float32Array(4);\n _this.tint = 0xFFFFFF;\n return _this;\n }\n /**\n * Sets the private properties array to dynamic / static based on the passed properties object\n * @param properties - The properties to be uploaded\n */\n ParticleContainer.prototype.setProperties = function (properties) {\n if (properties) {\n this._properties[0] = 'vertices' in properties || 'scale' in properties\n ? !!properties.vertices || !!properties.scale : this._properties[0];\n this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1];\n this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2];\n this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3];\n this._properties[4] = 'tint' in properties || 'alpha' in properties\n ? !!properties.tint || !!properties.alpha : this._properties[4];\n }\n };\n ParticleContainer.prototype.updateTransform = function () {\n // TODO don't need to!\n this.displayObjectUpdateTransform();\n };\n Object.defineProperty(ParticleContainer.prototype, \"tint\", {\n /**\n * The tint applied to the container. This is a hex value.\n * A value of 0xFFFFFF will remove any tint effect.\n * IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer.\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n hex2rgb(value, this.tintRgb);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Renders the container using the WebGL renderer.\n * @param renderer - The WebGL renderer.\n */\n ParticleContainer.prototype.render = function (renderer) {\n var _this = this;\n if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) {\n return;\n }\n if (!this.baseTexture) {\n this.baseTexture = this.children[0]._texture.baseTexture;\n if (!this.baseTexture.valid) {\n this.baseTexture.once('update', function () { return _this.onChildrenChange(0); });\n }\n }\n renderer.batch.setObjectRenderer(renderer.plugins.particle);\n renderer.plugins.particle.render(this);\n };\n /**\n * Set the flag that static data should be updated to true\n * @param smallestChildIndex - The smallest child index.\n */\n ParticleContainer.prototype.onChildrenChange = function (smallestChildIndex) {\n var bufferIndex = Math.floor(smallestChildIndex / this._batchSize);\n while (this._bufferUpdateIDs.length < bufferIndex) {\n this._bufferUpdateIDs.push(0);\n }\n this._bufferUpdateIDs[bufferIndex] = ++this._updateID;\n };\n ParticleContainer.prototype.dispose = function () {\n if (this._buffers) {\n for (var i = 0; i < this._buffers.length; ++i) {\n this._buffers[i].destroy();\n }\n this._buffers = null;\n }\n };\n /**\n * Destroys the container\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n ParticleContainer.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.dispose();\n this._properties = null;\n this._buffers = null;\n this._bufferUpdateIDs = null;\n };\n return ParticleContainer;\n}(Container));\n\n/*\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that\n * they now share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleBuffer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleBuffer.java\n */\n/**\n * The particle buffer manages the static and dynamic buffers for a particle container.\n * @private\n * @memberof PIXI\n */\nvar ParticleBuffer = /** @class */ (function () {\n /**\n * @param {object} properties - The properties to upload.\n * @param {boolean[]} dynamicPropertyFlags - Flags for which properties are dynamic.\n * @param {number} size - The size of the batch.\n */\n function ParticleBuffer(properties, dynamicPropertyFlags, size) {\n this.geometry = new Geometry();\n this.indexBuffer = null;\n this.size = size;\n this.dynamicProperties = [];\n this.staticProperties = [];\n for (var i = 0; i < properties.length; ++i) {\n var property = properties[i];\n // Make copy of properties object so that when we edit the offset it doesn't\n // change all other instances of the object literal\n property = {\n attributeName: property.attributeName,\n size: property.size,\n uploadFunction: property.uploadFunction,\n type: property.type || TYPES.FLOAT,\n offset: property.offset,\n };\n if (dynamicPropertyFlags[i]) {\n this.dynamicProperties.push(property);\n }\n else {\n this.staticProperties.push(property);\n }\n }\n this.staticStride = 0;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n this.dynamicStride = 0;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this._updateID = 0;\n this.initBuffers();\n }\n /** Sets up the renderer context and necessary buffers. */\n ParticleBuffer.prototype.initBuffers = function () {\n var geometry = this.geometry;\n var dynamicOffset = 0;\n this.indexBuffer = new Buffer(createIndicesForQuads(this.size), true, true);\n geometry.addIndex(this.indexBuffer);\n this.dynamicStride = 0;\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n property.offset = dynamicOffset;\n dynamicOffset += property.size;\n this.dynamicStride += property.size;\n }\n var dynBuffer = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);\n this.dynamicData = new Float32Array(dynBuffer);\n this.dynamicDataUint32 = new Uint32Array(dynBuffer);\n this.dynamicBuffer = new Buffer(this.dynamicData, false, false);\n // static //\n var staticOffset = 0;\n this.staticStride = 0;\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n property.offset = staticOffset;\n staticOffset += property.size;\n this.staticStride += property.size;\n }\n var statBuffer = new ArrayBuffer(this.size * this.staticStride * 4 * 4);\n this.staticData = new Float32Array(statBuffer);\n this.staticDataUint32 = new Uint32Array(statBuffer);\n this.staticBuffer = new Buffer(this.staticData, true, false);\n for (var i = 0; i < this.dynamicProperties.length; ++i) {\n var property = this.dynamicProperties[i];\n geometry.addAttribute(property.attributeName, this.dynamicBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.dynamicStride * 4, property.offset * 4);\n }\n for (var i = 0; i < this.staticProperties.length; ++i) {\n var property = this.staticProperties[i];\n geometry.addAttribute(property.attributeName, this.staticBuffer, 0, property.type === TYPES.UNSIGNED_BYTE, property.type, this.staticStride * 4, property.offset * 4);\n }\n };\n /**\n * Uploads the dynamic properties.\n * @param children - The children to upload.\n * @param startIndex - The index to start at.\n * @param amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadDynamic = function (children, startIndex, amount) {\n for (var i = 0; i < this.dynamicProperties.length; i++) {\n var property = this.dynamicProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, this.dynamicStride, property.offset);\n }\n this.dynamicBuffer._updateID++;\n };\n /**\n * Uploads the static properties.\n * @param children - The children to upload.\n * @param startIndex - The index to start at.\n * @param amount - The number to upload.\n */\n ParticleBuffer.prototype.uploadStatic = function (children, startIndex, amount) {\n for (var i = 0; i < this.staticProperties.length; i++) {\n var property = this.staticProperties[i];\n property.uploadFunction(children, startIndex, amount, property.type === TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, this.staticStride, property.offset);\n }\n this.staticBuffer._updateID++;\n };\n /** Destroys the ParticleBuffer. */\n ParticleBuffer.prototype.destroy = function () {\n this.indexBuffer = null;\n this.dynamicProperties = null;\n this.dynamicBuffer = null;\n this.dynamicData = null;\n this.dynamicDataUint32 = null;\n this.staticProperties = null;\n this.staticBuffer = null;\n this.staticData = null;\n this.staticDataUint32 = null;\n // all buffers are destroyed inside geometry\n this.geometry.destroy();\n };\n return ParticleBuffer;\n}());\n\nvar fragment = \"varying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void){\\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\\n gl_FragColor = color;\\n}\";\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\nattribute vec4 aColor;\\n\\nattribute vec2 aPositionCoord;\\nattribute float aRotation;\\n\\nuniform mat3 translationMatrix;\\nuniform vec4 uColor;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nvoid main(void){\\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\\n\\n vec2 v = vec2(x, y);\\n v = v + aPositionCoord;\\n\\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = aTextureCoord;\\n vColor = aColor * uColor;\\n}\\n\";\n\n/*\n * @author Mat Groves\n *\n * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/\n * for creating the original PixiJS version!\n * Also a thanks to https://github.com/bchevalier for tweaking the tint and alpha so that they now\n * share 4 bytes on the vertex buffer\n *\n * Heavily inspired by LibGDX's ParticleRenderer:\n * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/ParticleRenderer.java\n */\n/**\n * Renderer for Particles that is designer for speed over feature set.\n * @memberof PIXI\n */\nvar ParticleRenderer = /** @class */ (function (_super) {\n __extends(ParticleRenderer, _super);\n /**\n * @param renderer - The renderer this sprite batch works for.\n */\n function ParticleRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n // 65535 is max vertex index in the index buffer (see ParticleRenderer)\n // so max number of particles is 65536 / 4 = 16384\n // and max number of element in the index buffer is 16384 * 6 = 98304\n // Creating a full index buffer, overhead is 98304 * 2 = 196Ko\n // let numIndices = 98304;\n _this.shader = null;\n _this.properties = null;\n _this.tempMatrix = new Matrix();\n _this.properties = [\n // verticesData\n {\n attributeName: 'aVertexPosition',\n size: 2,\n uploadFunction: _this.uploadVertices,\n offset: 0,\n },\n // positionData\n {\n attributeName: 'aPositionCoord',\n size: 2,\n uploadFunction: _this.uploadPosition,\n offset: 0,\n },\n // rotationData\n {\n attributeName: 'aRotation',\n size: 1,\n uploadFunction: _this.uploadRotation,\n offset: 0,\n },\n // uvsData\n {\n attributeName: 'aTextureCoord',\n size: 2,\n uploadFunction: _this.uploadUvs,\n offset: 0,\n },\n // tintData\n {\n attributeName: 'aColor',\n size: 1,\n type: TYPES.UNSIGNED_BYTE,\n uploadFunction: _this.uploadTint,\n offset: 0,\n } ];\n _this.shader = Shader.from(vertex, fragment, {});\n _this.state = State.for2d();\n return _this;\n }\n /**\n * Renders the particle container object.\n * @param container - The container to render using this ParticleRenderer.\n */\n ParticleRenderer.prototype.render = function (container) {\n var children = container.children;\n var maxSize = container._maxSize;\n var batchSize = container._batchSize;\n var renderer = this.renderer;\n var totalChildren = children.length;\n if (totalChildren === 0) {\n return;\n }\n else if (totalChildren > maxSize && !container.autoResize) {\n totalChildren = maxSize;\n }\n var buffers = container._buffers;\n if (!buffers) {\n buffers = container._buffers = this.generateBuffers(container);\n }\n var baseTexture = children[0]._texture.baseTexture;\n var premultiplied = baseTexture.alphaMode > 0;\n // if the uvs have not updated then no point rendering just yet!\n this.state.blendMode = correctBlendMode(container.blendMode, premultiplied);\n renderer.state.set(this.state);\n var gl = renderer.gl;\n var m = container.worldTransform.copyTo(this.tempMatrix);\n m.prepend(renderer.globalUniforms.uniforms.projectionMatrix);\n this.shader.uniforms.translationMatrix = m.toArray(true);\n this.shader.uniforms.uColor = premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, premultiplied);\n this.shader.uniforms.uSampler = baseTexture;\n this.renderer.shader.bind(this.shader);\n var updateStatic = false;\n // now lets upload and render the buffers..\n for (var i = 0, j = 0; i < totalChildren; i += batchSize, j += 1) {\n var amount = (totalChildren - i);\n if (amount > batchSize) {\n amount = batchSize;\n }\n if (j >= buffers.length) {\n buffers.push(this._generateOneMoreBuffer(container));\n }\n var buffer = buffers[j];\n // we always upload the dynamic\n buffer.uploadDynamic(children, i, amount);\n var bid = container._bufferUpdateIDs[j] || 0;\n updateStatic = updateStatic || (buffer._updateID < bid);\n // we only upload the static content when we have to!\n if (updateStatic) {\n buffer._updateID = container._updateID;\n buffer.uploadStatic(children, i, amount);\n }\n // bind the buffer\n renderer.geometry.bind(buffer.geometry);\n gl.drawElements(gl.TRIANGLES, amount * 6, gl.UNSIGNED_SHORT, 0);\n }\n };\n /**\n * Creates one particle buffer for each child in the container we want to render and updates internal properties.\n * @param container - The container to render using this ParticleRenderer\n * @returns - The buffers\n */\n ParticleRenderer.prototype.generateBuffers = function (container) {\n var buffers = [];\n var size = container._maxSize;\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n for (var i = 0; i < size; i += batchSize) {\n buffers.push(new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize));\n }\n return buffers;\n };\n /**\n * Creates one more particle buffer, because container has autoResize feature.\n * @param container - The container to render using this ParticleRenderer\n * @returns - The generated buffer\n */\n ParticleRenderer.prototype._generateOneMoreBuffer = function (container) {\n var batchSize = container._batchSize;\n var dynamicPropertyFlags = container._properties;\n return new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize);\n };\n /**\n * Uploads the vertices.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their vertices uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadVertices = function (children, startIndex, amount, array, stride, offset) {\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var texture = sprite._texture;\n var sx = sprite.scale.x;\n var sy = sprite.scale.y;\n var trim = texture.trim;\n var orig = texture.orig;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the\n // extra space before transforming the sprite coords..\n w1 = trim.x - (sprite.anchor.x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (sprite.anchor.y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w0 = (orig.width) * (1 - sprite.anchor.x);\n w1 = (orig.width) * -sprite.anchor.x;\n h0 = orig.height * (1 - sprite.anchor.y);\n h1 = orig.height * -sprite.anchor.y;\n }\n array[offset] = w1 * sx;\n array[offset + 1] = h1 * sy;\n array[offset + stride] = w0 * sx;\n array[offset + stride + 1] = h1 * sy;\n array[offset + (stride * 2)] = w0 * sx;\n array[offset + (stride * 2) + 1] = h0 * sy;\n array[offset + (stride * 3)] = w1 * sx;\n array[offset + (stride * 3) + 1] = h0 * sy;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the position.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their positions uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadPosition = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spritePosition = children[startIndex + i].position;\n array[offset] = spritePosition.x;\n array[offset + 1] = spritePosition.y;\n array[offset + stride] = spritePosition.x;\n array[offset + stride + 1] = spritePosition.y;\n array[offset + (stride * 2)] = spritePosition.x;\n array[offset + (stride * 2) + 1] = spritePosition.y;\n array[offset + (stride * 3)] = spritePosition.x;\n array[offset + (stride * 3) + 1] = spritePosition.y;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the rotation.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their rotation uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadRotation = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; i++) {\n var spriteRotation = children[startIndex + i].rotation;\n array[offset] = spriteRotation;\n array[offset + stride] = spriteRotation;\n array[offset + (stride * 2)] = spriteRotation;\n array[offset + (stride * 3)] = spriteRotation;\n offset += stride * 4;\n }\n };\n /**\n * Uploads the UVs.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their rotation uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadUvs = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var textureUvs = children[startIndex + i]._texture._uvs;\n if (textureUvs) {\n array[offset] = textureUvs.x0;\n array[offset + 1] = textureUvs.y0;\n array[offset + stride] = textureUvs.x1;\n array[offset + stride + 1] = textureUvs.y1;\n array[offset + (stride * 2)] = textureUvs.x2;\n array[offset + (stride * 2) + 1] = textureUvs.y2;\n array[offset + (stride * 3)] = textureUvs.x3;\n array[offset + (stride * 3) + 1] = textureUvs.y3;\n offset += stride * 4;\n }\n else {\n // TODO you know this can be easier!\n array[offset] = 0;\n array[offset + 1] = 0;\n array[offset + stride] = 0;\n array[offset + stride + 1] = 0;\n array[offset + (stride * 2)] = 0;\n array[offset + (stride * 2) + 1] = 0;\n array[offset + (stride * 3)] = 0;\n array[offset + (stride * 3) + 1] = 0;\n offset += stride * 4;\n }\n }\n };\n /**\n * Uploads the tint.\n * @param children - the array of sprites to render\n * @param startIndex - the index to start from in the children array\n * @param amount - the amount of children that will have their rotation uploaded\n * @param array - The vertices to upload.\n * @param stride - Stride to use for iteration.\n * @param offset - Offset to start at.\n */\n ParticleRenderer.prototype.uploadTint = function (children, startIndex, amount, array, stride, offset) {\n for (var i = 0; i < amount; ++i) {\n var sprite = children[startIndex + i];\n var premultiplied = sprite._texture.baseTexture.alphaMode > 0;\n var alpha = sprite.alpha;\n // we dont call extra function if alpha is 1.0, that's faster\n var argb = alpha < 1.0 && premultiplied\n ? premultiplyTint(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);\n array[offset] = argb;\n array[offset + stride] = argb;\n array[offset + (stride * 2)] = argb;\n array[offset + (stride * 3)] = argb;\n offset += stride * 4;\n }\n };\n /** Destroys the ParticleRenderer. */\n ParticleRenderer.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n if (this.shader) {\n this.shader.destroy();\n this.shader = null;\n }\n this.tempMatrix = null;\n };\n /** @ignore */\n ParticleRenderer.extension = {\n name: 'particle',\n type: ExtensionType.RendererPlugin,\n };\n return ParticleRenderer;\n}(ObjectRenderer));\n\nexport { ParticleContainer, ParticleRenderer };\n//# sourceMappingURL=particle-container.mjs.map\n","/*!\n * @pixi/graphics - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/graphics is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, BaseTexture, BatchDrawCall, BatchTextureArray, BatchGeometry, UniformGroup, Shader, State } from '@pixi/core';\nimport { SHAPES, Point, PI_2, Polygon, Rectangle, RoundedRectangle, Circle, Ellipse, Matrix } from '@pixi/math';\nimport { earcut, premultiplyTint, hex2rgb } from '@pixi/utils';\nimport { WRAP_MODES, DRAW_MODES, BLEND_MODES } from '@pixi/constants';\nimport { Bounds, Container } from '@pixi/display';\n\n/**\n * Supported line joints in `PIXI.LineStyle` for graphics.\n * @see PIXI.Graphics#lineStyle\n * @see https://graphicdesign.stackexchange.com/questions/59018/what-is-a-bevel-join-of-two-lines-exactly-illustrator\n * @name LINE_JOIN\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} MITER - 'miter': make a sharp corner where outer part of lines meet\n * @property {string} BEVEL - 'bevel': add a square butt at each end of line segment and fill the triangle at turn\n * @property {string} ROUND - 'round': add an arc at the joint\n */\nvar LINE_JOIN;\n(function (LINE_JOIN) {\n LINE_JOIN[\"MITER\"] = \"miter\";\n LINE_JOIN[\"BEVEL\"] = \"bevel\";\n LINE_JOIN[\"ROUND\"] = \"round\";\n})(LINE_JOIN || (LINE_JOIN = {}));\n/**\n * Support line caps in `PIXI.LineStyle` for graphics.\n * @see PIXI.Graphics#lineStyle\n * @name LINE_CAP\n * @memberof PIXI\n * @static\n * @enum {string}\n * @property {string} BUTT - 'butt': don't add any cap at line ends (leaves orthogonal edges)\n * @property {string} ROUND - 'round': add semicircle at ends\n * @property {string} SQUARE - 'square': add square at end (like `BUTT` except more length at end)\n */\nvar LINE_CAP;\n(function (LINE_CAP) {\n LINE_CAP[\"BUTT\"] = \"butt\";\n LINE_CAP[\"ROUND\"] = \"round\";\n LINE_CAP[\"SQUARE\"] = \"square\";\n})(LINE_CAP || (LINE_CAP = {}));\n/**\n * Graphics curves resolution settings. If `adaptive` flag is set to `true`,\n * the resolution is calculated based on the curve's length to ensure better visual quality.\n * Adaptive draw works with `bezierCurveTo` and `quadraticCurveTo`.\n * @static\n * @constant\n * @memberof PIXI\n * @name GRAPHICS_CURVES\n * @type {object}\n * @property {boolean} [adaptive=true] - flag indicating if the resolution should be adaptive\n * @property {number} [maxLength=10] - maximal length of a single segment of the curve (if adaptive = false, ignored)\n * @property {number} [minSegments=8] - minimal number of segments in the curve (if adaptive = false, ignored)\n * @property {number} [maxSegments=2048] - maximal number of segments in the curve (if adaptive = false, ignored)\n */\nvar GRAPHICS_CURVES = {\n adaptive: true,\n maxLength: 10,\n minSegments: 8,\n maxSegments: 2048,\n epsilon: 0.0001,\n _segmentsCount: function (length, defaultSegments) {\n if (defaultSegments === void 0) { defaultSegments = 20; }\n if (!this.adaptive || !length || isNaN(length)) {\n return defaultSegments;\n }\n var result = Math.ceil(length / this.maxLength);\n if (result < this.minSegments) {\n result = this.minSegments;\n }\n else if (result > this.maxSegments) {\n result = this.maxSegments;\n }\n return result;\n },\n};\n\n/**\n * Fill style object for Graphics.\n * @memberof PIXI\n */\nvar FillStyle = /** @class */ (function () {\n function FillStyle() {\n /**\n * The hex color value used when coloring the Graphics object.\n * @default 0xFFFFFF\n */\n this.color = 0xFFFFFF;\n /** The alpha value used when filling the Graphics object. */\n this.alpha = 1.0;\n /**\n * The texture to be used for the fill.\n * @default 0\n */\n this.texture = Texture.WHITE;\n /**\n * The transform applied to the texture.\n * @default null\n */\n this.matrix = null;\n /** If the current fill is visible. */\n this.visible = false;\n this.reset();\n }\n /** Clones the object */\n FillStyle.prototype.clone = function () {\n var obj = new FillStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n return obj;\n };\n /** Reset */\n FillStyle.prototype.reset = function () {\n this.color = 0xFFFFFF;\n this.alpha = 1;\n this.texture = Texture.WHITE;\n this.matrix = null;\n this.visible = false;\n };\n /** Destroy and don't use after this. */\n FillStyle.prototype.destroy = function () {\n this.texture = null;\n this.matrix = null;\n };\n return FillStyle;\n}());\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nfunction fixOrientation(points, hole) {\n var _a, _b;\n if (hole === void 0) { hole = false; }\n var m = points.length;\n if (m < 6) {\n return;\n }\n var area = 0;\n for (var i = 0, x1 = points[m - 2], y1 = points[m - 1]; i < m; i += 2) {\n var x2 = points[i];\n var y2 = points[i + 1];\n area += (x2 - x1) * (y2 + y1);\n x1 = x2;\n y1 = y2;\n }\n if ((!hole && area > 0) || (hole && area <= 0)) {\n var n = m / 2;\n for (var i = n + (n % 2); i < m; i += 2) {\n var i1 = m - i - 2;\n var i2 = m - i - 1;\n var i3 = i;\n var i4 = i + 1;\n _a = [points[i3], points[i1]], points[i1] = _a[0], points[i3] = _a[1];\n _b = [points[i4], points[i2]], points[i2] = _b[0], points[i4] = _b[1];\n }\n }\n}\n/**\n * Builds a polygon to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildPoly = {\n build: function (graphicsData) {\n graphicsData.points = graphicsData.shape.points.slice();\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var holes = graphicsData.holes;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n if (points.length >= 6) {\n fixOrientation(points, false);\n var holeArray = [];\n // Process holes..\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n fixOrientation(hole.points, true);\n holeArray.push(points.length / 2);\n points = points.concat(hole.points);\n }\n // sort color\n var triangles = earcut(points, holeArray, 2);\n if (!triangles) {\n return;\n }\n var vertPos = verts.length / 2;\n for (var i = 0; i < triangles.length; i += 3) {\n indices.push(triangles[i] + vertPos);\n indices.push(triangles[i + 1] + vertPos);\n indices.push(triangles[i + 2] + vertPos);\n }\n for (var i = 0; i < points.length; i++) {\n verts.push(points[i]);\n }\n }\n },\n};\n\n// for type only\n/**\n * Builds a circle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object to draw\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildCircle = {\n build: function (graphicsData) {\n // need to convert points to a nice regular data\n var points = graphicsData.points;\n var x;\n var y;\n var dx;\n var dy;\n var rx;\n var ry;\n if (graphicsData.type === SHAPES.CIRC) {\n var circle = graphicsData.shape;\n x = circle.x;\n y = circle.y;\n rx = ry = circle.radius;\n dx = dy = 0;\n }\n else if (graphicsData.type === SHAPES.ELIP) {\n var ellipse = graphicsData.shape;\n x = ellipse.x;\n y = ellipse.y;\n rx = ellipse.width;\n ry = ellipse.height;\n dx = dy = 0;\n }\n else {\n var roundedRect = graphicsData.shape;\n var halfWidth = roundedRect.width / 2;\n var halfHeight = roundedRect.height / 2;\n x = roundedRect.x + halfWidth;\n y = roundedRect.y + halfHeight;\n rx = ry = Math.max(0, Math.min(roundedRect.radius, Math.min(halfWidth, halfHeight)));\n dx = halfWidth - rx;\n dy = halfHeight - ry;\n }\n if (!(rx >= 0 && ry >= 0 && dx >= 0 && dy >= 0)) {\n points.length = 0;\n return;\n }\n // Choose a number of segments such that the maximum absolute deviation from the circle is approximately 0.029\n var n = Math.ceil(2.3 * Math.sqrt(rx + ry));\n var m = (n * 8) + (dx ? 4 : 0) + (dy ? 4 : 0);\n points.length = m;\n if (m === 0) {\n return;\n }\n if (n === 0) {\n points.length = 8;\n points[0] = points[6] = x + dx;\n points[1] = points[3] = y + dy;\n points[2] = points[4] = x - dx;\n points[5] = points[7] = y - dy;\n return;\n }\n var j1 = 0;\n var j2 = (n * 4) + (dx ? 2 : 0) + 2;\n var j3 = j2;\n var j4 = m;\n {\n var x0 = dx + rx;\n var y0 = dy;\n var x1 = x + x0;\n var x2 = x - x0;\n var y1 = y + y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j2] = y1;\n points[--j2] = x2;\n if (dy) {\n var y2 = y - y0;\n points[j3++] = x2;\n points[j3++] = y2;\n points[--j4] = y2;\n points[--j4] = x1;\n }\n }\n for (var i = 1; i < n; i++) {\n var a = Math.PI / 2 * (i / n);\n var x0 = dx + (Math.cos(a) * rx);\n var y0 = dy + (Math.sin(a) * ry);\n var x1 = x + x0;\n var x2 = x - x0;\n var y1 = y + y0;\n var y2 = y - y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j2] = y1;\n points[--j2] = x2;\n points[j3++] = x2;\n points[j3++] = y2;\n points[--j4] = y2;\n points[--j4] = x1;\n }\n {\n var x0 = dx;\n var y0 = dy + ry;\n var x1 = x + x0;\n var x2 = x - x0;\n var y1 = y + y0;\n var y2 = y - y0;\n points[j1++] = x1;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x1;\n if (dx) {\n points[j1++] = x2;\n points[j1++] = y1;\n points[--j4] = y2;\n points[--j4] = x2;\n }\n }\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n if (points.length === 0) {\n return;\n }\n var vertPos = verts.length / 2;\n var center = vertPos;\n var x;\n var y;\n if (graphicsData.type !== SHAPES.RREC) {\n var circle = graphicsData.shape;\n x = circle.x;\n y = circle.y;\n }\n else {\n var roundedRect = graphicsData.shape;\n x = roundedRect.x + (roundedRect.width / 2);\n y = roundedRect.y + (roundedRect.height / 2);\n }\n var matrix = graphicsData.matrix;\n // Push center (special point)\n verts.push(graphicsData.matrix ? (matrix.a * x) + (matrix.c * y) + matrix.tx : x, graphicsData.matrix ? (matrix.b * x) + (matrix.d * y) + matrix.ty : y);\n vertPos++;\n verts.push(points[0], points[1]);\n for (var i = 2; i < points.length; i += 2) {\n verts.push(points[i], points[i + 1]);\n // add some uvs\n indices.push(vertPos++, center, vertPos);\n }\n indices.push(center + 1, center, vertPos);\n },\n};\n\n/**\n * Builds a rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRectangle = {\n build: function (graphicsData) {\n // --- //\n // need to convert points to a nice regular data\n //\n var rectData = graphicsData.shape;\n var x = rectData.x;\n var y = rectData.y;\n var width = rectData.width;\n var height = rectData.height;\n var points = graphicsData.points;\n points.length = 0;\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var vertPos = verts.length / 2;\n verts.push(points[0], points[1], points[2], points[3], points[6], points[7], points[4], points[5]);\n graphicsGeometry.indices.push(vertPos, vertPos + 1, vertPos + 2, vertPos + 1, vertPos + 2, vertPos + 3);\n },\n};\n\n/**\n * Calculate a single point for a quadratic bezier curve.\n * Utility function used by quadraticBezierCurve.\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} n1 - first number\n * @param {number} n2 - second number\n * @param {number} perc - percentage\n * @returns {number} the result\n */\nfunction getPt(n1, n2, perc) {\n var diff = n2 - n1;\n return n1 + (diff * perc);\n}\n/**\n * Calculate the points for a quadratic bezier curve. (helper function..)\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} fromX - Origin point x\n * @param {number} fromY - Origin point x\n * @param {number} cpX - Control point x\n * @param {number} cpY - Control point y\n * @param {number} toX - Destination point x\n * @param {number} toY - Destination point y\n * @param {number[]} [out=[]] - The output array to add points into. If not passed, a new array is created.\n * @returns {number[]} an array of points\n */\nfunction quadraticBezierCurve(fromX, fromY, cpX, cpY, toX, toY, out) {\n if (out === void 0) { out = []; }\n var n = 20;\n var points = out;\n var xa = 0;\n var ya = 0;\n var xb = 0;\n var yb = 0;\n var x = 0;\n var y = 0;\n for (var i = 0, j = 0; i <= n; ++i) {\n j = i / n;\n // The Green Line\n xa = getPt(fromX, cpX, j);\n ya = getPt(fromY, cpY, j);\n xb = getPt(cpX, toX, j);\n yb = getPt(cpY, toY, j);\n // The Black Dot\n x = getPt(xa, xb, j);\n y = getPt(ya, yb, j);\n // Handle case when first curve points overlaps and earcut fails to triangulate\n if (i === 0 && points[points.length - 2] === x && points[points.length - 1] === y) {\n continue;\n }\n points.push(x, y);\n }\n return points;\n}\n/**\n * Builds a rounded rectangle to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.WebGLGraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {object} webGLData - an object containing all the WebGL-specific information to create this shape\n * @param {object} webGLDataNativeLines - an object containing all the WebGL-specific information to create nativeLines\n */\nvar buildRoundedRectangle = {\n build: function (graphicsData) {\n if (Graphics.nextRoundedRectBehavior) {\n buildCircle.build(graphicsData);\n return;\n }\n var rrectData = graphicsData.shape;\n var points = graphicsData.points;\n var x = rrectData.x;\n var y = rrectData.y;\n var width = rrectData.width;\n var height = rrectData.height;\n // Don't allow negative radius or greater than half the smallest width\n var radius = Math.max(0, Math.min(rrectData.radius, Math.min(width, height) / 2));\n points.length = 0;\n // No radius, do a simple rectangle\n if (!radius) {\n points.push(x, y, x + width, y, x + width, y + height, x, y + height);\n }\n else {\n quadraticBezierCurve(x, y + radius, x, y, x + radius, y, points);\n quadraticBezierCurve(x + width - radius, y, x + width, y, x + width, y + radius, points);\n quadraticBezierCurve(x + width, y + height - radius, x + width, y + height, x + width - radius, y + height, points);\n quadraticBezierCurve(x + radius, y + height, x, y + height, x, y + height - radius, points);\n }\n },\n triangulate: function (graphicsData, graphicsGeometry) {\n if (Graphics.nextRoundedRectBehavior) {\n buildCircle.triangulate(graphicsData, graphicsGeometry);\n return;\n }\n var points = graphicsData.points;\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var vecPos = verts.length / 2;\n var triangles = earcut(points, null, 2);\n for (var i = 0, j = triangles.length; i < j; i += 3) {\n indices.push(triangles[i] + vecPos);\n // indices.push(triangles[i] + vecPos);\n indices.push(triangles[i + 1] + vecPos);\n // indices.push(triangles[i + 2] + vecPos);\n indices.push(triangles[i + 2] + vecPos);\n }\n for (var i = 0, j = points.length; i < j; i++) {\n verts.push(points[i], points[++i]);\n }\n },\n};\n\n/**\n * Buffers vertices to draw a square cap.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} x - X-coord of end point\n * @param {number} y - Y-coord of end point\n * @param {number} nx - X-coord of line normal pointing inside\n * @param {number} ny - Y-coord of line normal pointing inside\n * @param {number} innerWeight - Weight of inner points\n * @param {number} outerWeight - Weight of outer points\n * @param {boolean} clockwise - Whether the cap is drawn clockwise\n * @param {Array<number>} verts - vertex buffer\n * @returns {number} - no. of vertices pushed\n */\nfunction square(x, y, nx, ny, innerWeight, outerWeight, clockwise, /* rotation for square (true at left end, false at right end) */ verts) {\n var ix = x - (nx * innerWeight);\n var iy = y - (ny * innerWeight);\n var ox = x + (nx * outerWeight);\n var oy = y + (ny * outerWeight);\n /* Rotate nx,ny for extension vector */\n var exx;\n var eyy;\n if (clockwise) {\n exx = ny;\n eyy = -nx;\n }\n else {\n exx = -ny;\n eyy = nx;\n }\n /* [i|0]x,y extended at cap */\n var eix = ix + exx;\n var eiy = iy + eyy;\n var eox = ox + exx;\n var eoy = oy + eyy;\n /* Square itself must be inserted clockwise*/\n verts.push(eix, eiy);\n verts.push(eox, eoy);\n return 2;\n}\n/**\n * Buffers vertices to draw an arc at the line joint or cap.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {number} cx - X-coord of center\n * @param {number} cy - Y-coord of center\n * @param {number} sx - X-coord of arc start\n * @param {number} sy - Y-coord of arc start\n * @param {number} ex - X-coord of arc end\n * @param {number} ey - Y-coord of arc end\n * @param {Array<number>} verts - buffer of vertices\n * @param {boolean} clockwise - orientation of vertices\n * @returns {number} - no. of vertices pushed\n */\nfunction round(cx, cy, sx, sy, ex, ey, verts, clockwise) {\n var cx2p0x = sx - cx;\n var cy2p0y = sy - cy;\n var angle0 = Math.atan2(cx2p0x, cy2p0y);\n var angle1 = Math.atan2(ex - cx, ey - cy);\n if (clockwise && angle0 < angle1) {\n angle0 += Math.PI * 2;\n }\n else if (!clockwise && angle0 > angle1) {\n angle1 += Math.PI * 2;\n }\n var startAngle = angle0;\n var angleDiff = angle1 - angle0;\n var absAngleDiff = Math.abs(angleDiff);\n /* if (absAngleDiff >= PI_LBOUND && absAngleDiff <= PI_UBOUND)\n {\n const r1x = cx - nxtPx;\n const r1y = cy - nxtPy;\n\n if (r1x === 0)\n {\n if (r1y > 0)\n {\n angleDiff = -angleDiff;\n }\n }\n else if (r1x >= -GRAPHICS_CURVES.epsilon)\n {\n angleDiff = -angleDiff;\n }\n }*/\n var radius = Math.sqrt((cx2p0x * cx2p0x) + (cy2p0y * cy2p0y));\n var segCount = ((15 * absAngleDiff * Math.sqrt(radius) / Math.PI) >> 0) + 1;\n var angleInc = angleDiff / segCount;\n startAngle += angleInc;\n if (clockwise) {\n verts.push(cx, cy);\n verts.push(sx, sy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx, cy);\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n }\n verts.push(cx, cy);\n verts.push(ex, ey);\n }\n else {\n verts.push(sx, sy);\n verts.push(cx, cy);\n for (var i = 1, angle = startAngle; i < segCount; i++, angle += angleInc) {\n verts.push(cx + ((Math.sin(angle) * radius)), cy + ((Math.cos(angle) * radius)));\n verts.push(cx, cy);\n }\n verts.push(ex, ey);\n verts.push(cx, cy);\n }\n return segCount * 2;\n}\n/**\n * Builds a line to draw using the polygon method.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNonNativeLine(graphicsData, graphicsGeometry) {\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points.slice();\n var eps = graphicsGeometry.closePointEps;\n if (points.length === 0) {\n return;\n }\n // if the line width is an odd number add 0.5 to align to a whole pixel\n // commenting this out fixes #711 and #1620\n // if (graphicsData.lineWidth%2)\n // {\n // for (i = 0; i < points.length; i++)\n // {\n // points[i] += 0.5;\n // }\n // }\n var style = graphicsData.lineStyle;\n // get first and last point.. figure out the middle!\n var firstPoint = new Point(points[0], points[1]);\n var lastPoint = new Point(points[points.length - 2], points[points.length - 1]);\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n var closedPath = Math.abs(firstPoint.x - lastPoint.x) < eps\n && Math.abs(firstPoint.y - lastPoint.y) < eps;\n // if the first point is the last point - gonna have issues :)\n if (closedShape) {\n // need to clone as we are going to slightly modify the shape..\n points = points.slice();\n if (closedPath) {\n points.pop();\n points.pop();\n lastPoint.set(points[points.length - 2], points[points.length - 1]);\n }\n var midPointX = (firstPoint.x + lastPoint.x) * 0.5;\n var midPointY = (lastPoint.y + firstPoint.y) * 0.5;\n points.unshift(midPointX, midPointY);\n points.push(midPointX, midPointY);\n }\n var verts = graphicsGeometry.points;\n var length = points.length / 2;\n var indexCount = points.length;\n var indexStart = verts.length / 2;\n // Max. inner and outer width\n var width = style.width / 2;\n var widthSquared = width * width;\n var miterLimitSquared = style.miterLimit * style.miterLimit;\n /* Line segments of interest where (x1,y1) forms the corner. */\n var x0 = points[0];\n var y0 = points[1];\n var x1 = points[2];\n var y1 = points[3];\n var x2 = 0;\n var y2 = 0;\n /* perp[?](x|y) = the line normal with magnitude lineWidth. */\n var perpx = -(y0 - y1);\n var perpy = x0 - x1;\n var perp1x = 0;\n var perp1y = 0;\n var dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n var ratio = style.alignment; // 0.5;\n var innerWeight = (1 - ratio) * 2;\n var outerWeight = ratio * 2;\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x0 - (perpx * (innerWeight - outerWeight) * 0.5), y0 - (perpy * (innerWeight - outerWeight) * 0.5), x0 - (perpx * innerWeight), y0 - (perpy * innerWeight), x0 + (perpx * outerWeight), y0 + (perpy * outerWeight), verts, true) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x0, y0, perpx, perpy, innerWeight, outerWeight, true, verts);\n }\n }\n // Push first point (below & above vertices)\n verts.push(x0 - (perpx * innerWeight), y0 - (perpy * innerWeight));\n verts.push(x0 + (perpx * outerWeight), y0 + (perpy * outerWeight));\n for (var i = 1; i < length - 1; ++i) {\n x0 = points[(i - 1) * 2];\n y0 = points[((i - 1) * 2) + 1];\n x1 = points[i * 2];\n y1 = points[(i * 2) + 1];\n x2 = points[(i + 1) * 2];\n y2 = points[((i + 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n perp1x = -(y1 - y2);\n perp1y = x1 - x2;\n dist = Math.sqrt((perp1x * perp1x) + (perp1y * perp1y));\n perp1x /= dist;\n perp1y /= dist;\n perp1x *= width;\n perp1y *= width;\n /* d[x|y](0|1) = the component displacement between points p(0,1|1,2) */\n var dx0 = x1 - x0;\n var dy0 = y0 - y1;\n var dx1 = x1 - x2;\n var dy1 = y2 - y1;\n /* +ve if internal angle < 90 degree, -ve if internal angle > 90 degree. */\n var dot = (dx0 * dx1) + (dy0 * dy1);\n /* +ve if internal angle counterclockwise, -ve if internal angle clockwise. */\n var cross = (dy0 * dx1) - (dy1 * dx0);\n var clockwise = (cross < 0);\n /* Going nearly parallel? */\n /* atan(0.001) ~= 0.001 rad ~= 0.057 degree */\n if (Math.abs(cross) < 0.001 * Math.abs(dot)) {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n /* 180 degree corner? */\n if (dot >= 0) {\n if (style.join === LINE_JOIN.ROUND) {\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 4;\n }\n else {\n indexCount += 2;\n }\n verts.push(x1 - (perp1x * outerWeight), y1 - (perp1y * outerWeight));\n verts.push(x1 + (perp1x * innerWeight), y1 + (perp1y * innerWeight));\n }\n continue;\n }\n /* p[x|y] is the miter point. pdist is the distance between miter point and p1. */\n var c1 = ((-perpx + x0) * (-perpy + y1)) - ((-perpx + x1) * (-perpy + y0));\n var c2 = ((-perp1x + x2) * (-perp1y + y1)) - ((-perp1x + x1) * (-perp1y + y2));\n var px = ((dx0 * c2) - (dx1 * c1)) / cross;\n var py = ((dy1 * c1) - (dy0 * c2)) / cross;\n var pdist = ((px - x1) * (px - x1)) + ((py - y1) * (py - y1));\n /* Inner miter point */\n var imx = x1 + ((px - x1) * innerWeight);\n var imy = y1 + ((py - y1) * innerWeight);\n /* Outer miter point */\n var omx = x1 - ((px - x1) * outerWeight);\n var omy = y1 - ((py - y1) * outerWeight);\n /* Is the inside miter point too far away, creating a spike? */\n var smallerInsideSegmentSq = Math.min((dx0 * dx0) + (dy0 * dy0), (dx1 * dx1) + (dy1 * dy1));\n var insideWeight = clockwise ? innerWeight : outerWeight;\n var smallerInsideDiagonalSq = smallerInsideSegmentSq + (insideWeight * insideWeight * widthSquared);\n var insideMiterOk = pdist <= smallerInsideDiagonalSq;\n if (insideMiterOk) {\n if (style.join === LINE_JOIN.BEVEL || pdist / widthSquared > miterLimitSquared) {\n if (clockwise) /* rotating at inner angle */ {\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n verts.push(imx, imy); // inner miter point\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n }\n else /* rotating at outer angle */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(omx, omy); // outer miter point\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's outer vertex\n verts.push(omx, omy); // outer miter point\n }\n indexCount += 2;\n }\n else if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n verts.push(imx, imy);\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 4;\n verts.push(imx, imy);\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight));\n }\n else /* arc is inside */ {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(omx, omy);\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 4;\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight));\n verts.push(omx, omy);\n }\n }\n else {\n verts.push(imx, imy);\n verts.push(omx, omy);\n }\n }\n else // inside miter is NOT ok\n {\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight)); // first segment's inner vertex\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight)); // first segment's outer vertex\n if (style.join === LINE_JOIN.ROUND) {\n if (clockwise) /* arc is outside */ {\n indexCount += round(x1, y1, x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight), verts, true) + 2;\n }\n else /* arc is inside */ {\n indexCount += round(x1, y1, x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight), verts, false) + 2;\n }\n }\n else if (style.join === LINE_JOIN.MITER && pdist / widthSquared <= miterLimitSquared) {\n if (clockwise) {\n verts.push(omx, omy); // inner miter point\n verts.push(omx, omy); // inner miter point\n }\n else {\n verts.push(imx, imy); // outer miter point\n verts.push(imx, imy); // outer miter point\n }\n indexCount += 2;\n }\n verts.push(x1 - (perp1x * innerWeight), y1 - (perp1y * innerWeight)); // second segment's inner vertex\n verts.push(x1 + (perp1x * outerWeight), y1 + (perp1y * outerWeight)); // second segment's outer vertex\n indexCount += 2;\n }\n }\n x0 = points[(length - 2) * 2];\n y0 = points[((length - 2) * 2) + 1];\n x1 = points[(length - 1) * 2];\n y1 = points[((length - 1) * 2) + 1];\n perpx = -(y0 - y1);\n perpy = x0 - x1;\n dist = Math.sqrt((perpx * perpx) + (perpy * perpy));\n perpx /= dist;\n perpy /= dist;\n perpx *= width;\n perpy *= width;\n verts.push(x1 - (perpx * innerWeight), y1 - (perpy * innerWeight));\n verts.push(x1 + (perpx * outerWeight), y1 + (perpy * outerWeight));\n if (!closedShape) {\n if (style.cap === LINE_CAP.ROUND) {\n indexCount += round(x1 - (perpx * (innerWeight - outerWeight) * 0.5), y1 - (perpy * (innerWeight - outerWeight) * 0.5), x1 - (perpx * innerWeight), y1 - (perpy * innerWeight), x1 + (perpx * outerWeight), y1 + (perpy * outerWeight), verts, false) + 2;\n }\n else if (style.cap === LINE_CAP.SQUARE) {\n indexCount += square(x1, y1, perpx, perpy, innerWeight, outerWeight, false, verts);\n }\n }\n var indices = graphicsGeometry.indices;\n var eps2 = GRAPHICS_CURVES.epsilon * GRAPHICS_CURVES.epsilon;\n // indices.push(indexStart);\n for (var i = indexStart; i < indexCount + indexStart - 2; ++i) {\n x0 = verts[(i * 2)];\n y0 = verts[(i * 2) + 1];\n x1 = verts[(i + 1) * 2];\n y1 = verts[((i + 1) * 2) + 1];\n x2 = verts[(i + 2) * 2];\n y2 = verts[((i + 2) * 2) + 1];\n /* Skip zero area triangles */\n if (Math.abs((x0 * (y1 - y2)) + (x1 * (y2 - y0)) + (x2 * (y0 - y1))) < eps2) {\n continue;\n }\n indices.push(i, i + 1, i + 2);\n }\n}\n/**\n * Builds a line to draw using the gl.drawArrays(gl.LINES) method\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildNativeLine(graphicsData, graphicsGeometry) {\n var i = 0;\n var shape = graphicsData.shape;\n var points = graphicsData.points || shape.points;\n var closedShape = shape.type !== SHAPES.POLY || shape.closeStroke;\n if (points.length === 0)\n { return; }\n var verts = graphicsGeometry.points;\n var indices = graphicsGeometry.indices;\n var length = points.length / 2;\n var startIndex = verts.length / 2;\n var currentIndex = startIndex;\n verts.push(points[0], points[1]);\n for (i = 1; i < length; i++) {\n verts.push(points[i * 2], points[(i * 2) + 1]);\n indices.push(currentIndex, currentIndex + 1);\n currentIndex++;\n }\n if (closedShape) {\n indices.push(currentIndex, startIndex);\n }\n}\n/**\n * Builds a line to draw\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @private\n * @param {PIXI.GraphicsData} graphicsData - The graphics object containing all the necessary properties\n * @param {PIXI.GraphicsGeometry} graphicsGeometry - Geometry where to append output\n */\nfunction buildLine(graphicsData, graphicsGeometry) {\n if (graphicsData.lineStyle.native) {\n buildNativeLine(graphicsData, graphicsGeometry);\n }\n else {\n buildNonNativeLine(graphicsData, graphicsGeometry);\n }\n}\n\n/**\n * Utilities for arc curves.\n * @private\n */\nvar ArcUtils = /** @class */ (function () {\n function ArcUtils() {\n }\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n * @private\n * @param x1 - The x-coordinate of the beginning of the arc\n * @param y1 - The y-coordinate of the beginning of the arc\n * @param x2 - The x-coordinate of the end of the arc\n * @param y2 - The y-coordinate of the end of the arc\n * @param radius - The radius of the arc\n * @param points -\n * @returns - If the arc length is valid, return center of circle, radius and other info otherwise `null`.\n */\n ArcUtils.curveTo = function (x1, y1, x2, y2, radius, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var a1 = fromY - y1;\n var b1 = fromX - x1;\n var a2 = y2 - y1;\n var b2 = x2 - x1;\n var mm = Math.abs((a1 * b2) - (b1 * a2));\n if (mm < 1.0e-8 || radius === 0) {\n if (points[points.length - 2] !== x1 || points[points.length - 1] !== y1) {\n points.push(x1, y1);\n }\n return null;\n }\n var dd = (a1 * a1) + (b1 * b1);\n var cc = (a2 * a2) + (b2 * b2);\n var tt = (a1 * a2) + (b1 * b2);\n var k1 = radius * Math.sqrt(dd) / mm;\n var k2 = radius * Math.sqrt(cc) / mm;\n var j1 = k1 * tt / dd;\n var j2 = k2 * tt / cc;\n var cx = (k1 * b2) + (k2 * b1);\n var cy = (k1 * a2) + (k2 * a1);\n var px = b1 * (k2 + j1);\n var py = a1 * (k2 + j1);\n var qx = b2 * (k1 + j2);\n var qy = a2 * (k1 + j2);\n var startAngle = Math.atan2(py - cy, px - cx);\n var endAngle = Math.atan2(qy - cy, qx - cx);\n return {\n cx: (cx + x1),\n cy: (cy + y1),\n radius: radius,\n startAngle: startAngle,\n endAngle: endAngle,\n anticlockwise: (b1 * a2 > b2 * a1),\n };\n };\n /* eslint-disable max-len */\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n * @private\n * @param _startX - Start x location of arc\n * @param _startY - Start y location of arc\n * @param cx - The x-coordinate of the center of the circle\n * @param cy - The y-coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param endAngle - The ending angle, in radians\n * @param _anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @param points - Collection of points to add to\n */\n ArcUtils.arc = function (_startX, _startY, cx, cy, radius, startAngle, endAngle, _anticlockwise, points) {\n var sweep = endAngle - startAngle;\n var n = GRAPHICS_CURVES._segmentsCount(Math.abs(sweep) * radius, Math.ceil(Math.abs(sweep) / PI_2) * 40);\n var theta = (sweep) / (n * 2);\n var theta2 = theta * 2;\n var cTheta = Math.cos(theta);\n var sTheta = Math.sin(theta);\n var segMinus = n - 1;\n var remainder = (segMinus % 1) / segMinus;\n for (var i = 0; i <= segMinus; ++i) {\n var real = i + (remainder * i);\n var angle = ((theta) + startAngle + (theta2 * real));\n var c = Math.cos(angle);\n var s = -Math.sin(angle);\n points.push((((cTheta * c) + (sTheta * s)) * radius) + cx, (((cTheta * -s) + (sTheta * c)) * radius) + cy);\n }\n };\n return ArcUtils;\n}());\n\n/**\n * Utilities for bezier curves\n * @private\n */\nvar BezierUtils = /** @class */ (function () {\n function BezierUtils() {\n }\n /**\n * Calculate length of bezier curve.\n * Analytical solution is impossible, since it involves an integral that does not integrate in general.\n * Therefore numerical solution is used.\n * @private\n * @param fromX - Starting point x\n * @param fromY - Starting point y\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - Length of bezier curve\n */\n BezierUtils.curveLength = function (fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY) {\n var n = 10;\n var result = 0.0;\n var t = 0.0;\n var t2 = 0.0;\n var t3 = 0.0;\n var nt = 0.0;\n var nt2 = 0.0;\n var nt3 = 0.0;\n var x = 0.0;\n var y = 0.0;\n var dx = 0.0;\n var dy = 0.0;\n var prevX = fromX;\n var prevY = fromY;\n for (var i = 1; i <= n; ++i) {\n t = i / n;\n t2 = t * t;\n t3 = t2 * t;\n nt = (1.0 - t);\n nt2 = nt * nt;\n nt3 = nt2 * nt;\n x = (nt3 * fromX) + (3.0 * nt2 * t * cpX) + (3.0 * nt * t2 * cpX2) + (t3 * toX);\n y = (nt3 * fromY) + (3.0 * nt2 * t * cpY) + (3 * nt * t2 * cpY2) + (t3 * toY);\n dx = prevX - x;\n dy = prevY - y;\n prevX = x;\n prevY = y;\n result += Math.sqrt((dx * dx) + (dy * dy));\n }\n return result;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n *\n * Ignored from docs since it is not directly exposed.\n * @ignore\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Path array to push points into\n */\n BezierUtils.curveTo = function (cpX, cpY, cpX2, cpY2, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n points.length -= 2;\n var n = GRAPHICS_CURVES._segmentsCount(BezierUtils.curveLength(fromX, fromY, cpX, cpY, cpX2, cpY2, toX, toY));\n var dt = 0;\n var dt2 = 0;\n var dt3 = 0;\n var t2 = 0;\n var t3 = 0;\n points.push(fromX, fromY);\n for (var i = 1, j = 0; i <= n; ++i) {\n j = i / n;\n dt = (1 - j);\n dt2 = dt * dt;\n dt3 = dt2 * dt;\n t2 = j * j;\n t3 = t2 * j;\n points.push((dt3 * fromX) + (3 * dt2 * j * cpX) + (3 * dt * t2 * cpX2) + (t3 * toX), (dt3 * fromY) + (3 * dt2 * j * cpY) + (3 * dt * t2 * cpY2) + (t3 * toY));\n }\n };\n return BezierUtils;\n}());\n\n/**\n * Utilities for quadratic curves.\n * @private\n */\nvar QuadraticUtils = /** @class */ (function () {\n function QuadraticUtils() {\n }\n /**\n * Calculate length of quadratic curve\n * @see {@link http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/}\n * for the detailed explanation of math behind this.\n * @private\n * @param fromX - x-coordinate of curve start point\n * @param fromY - y-coordinate of curve start point\n * @param cpX - x-coordinate of curve control point\n * @param cpY - y-coordinate of curve control point\n * @param toX - x-coordinate of curve end point\n * @param toY - y-coordinate of curve end point\n * @returns - Length of quadratic curve\n */\n QuadraticUtils.curveLength = function (fromX, fromY, cpX, cpY, toX, toY) {\n var ax = fromX - (2.0 * cpX) + toX;\n var ay = fromY - (2.0 * cpY) + toY;\n var bx = (2.0 * cpX) - (2.0 * fromX);\n var by = (2.0 * cpY) - (2.0 * fromY);\n var a = 4.0 * ((ax * ax) + (ay * ay));\n var b = 4.0 * ((ax * bx) + (ay * by));\n var c = (bx * bx) + (by * by);\n var s = 2.0 * Math.sqrt(a + b + c);\n var a2 = Math.sqrt(a);\n var a32 = 2.0 * a * a2;\n var c2 = 2.0 * Math.sqrt(c);\n var ba = b / a2;\n return ((a32 * s)\n + (a2 * b * (s - c2))\n + (((4.0 * c * a) - (b * b))\n * Math.log(((2.0 * a2) + ba + s) / (ba + c2)))) / (4.0 * a32);\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @private\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @param points - Points to add segments to.\n */\n QuadraticUtils.curveTo = function (cpX, cpY, toX, toY, points) {\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n var n = GRAPHICS_CURVES._segmentsCount(QuadraticUtils.curveLength(fromX, fromY, cpX, cpY, toX, toY));\n var xa = 0;\n var ya = 0;\n for (var i = 1; i <= n; ++i) {\n var j = i / n;\n xa = fromX + ((cpX - fromX) * j);\n ya = fromY + ((cpY - fromY) * j);\n points.push(xa + (((cpX + ((toX - cpX) * j)) - xa) * j), ya + (((cpY + ((toY - cpY) * j)) - ya) * j));\n }\n };\n return QuadraticUtils;\n}());\n\n/**\n * A structure to hold interim batch objects for Graphics.\n * @memberof PIXI.graphicsUtils\n */\nvar BatchPart = /** @class */ (function () {\n function BatchPart() {\n this.reset();\n }\n /**\n * Begin batch part.\n * @param style\n * @param startIndex\n * @param attribStart\n */\n BatchPart.prototype.begin = function (style, startIndex, attribStart) {\n this.reset();\n this.style = style;\n this.start = startIndex;\n this.attribStart = attribStart;\n };\n /**\n * End batch part.\n * @param endIndex\n * @param endAttrib\n */\n BatchPart.prototype.end = function (endIndex, endAttrib) {\n this.attribSize = endAttrib - this.attribStart;\n this.size = endIndex - this.start;\n };\n BatchPart.prototype.reset = function () {\n this.style = null;\n this.size = 0;\n this.start = 0;\n this.attribStart = 0;\n this.attribSize = 0;\n };\n return BatchPart;\n}());\n\n/**\n * Generalized convenience utilities for Graphics.\n * @namespace graphicsUtils\n * @memberof PIXI\n */\nvar _a;\n/**\n * Map of fill commands for each shape type.\n * @memberof PIXI.graphicsUtils\n * @member {object} FILL_COMMANDS\n */\nvar FILL_COMMANDS = (_a = {},\n _a[SHAPES.POLY] = buildPoly,\n _a[SHAPES.CIRC] = buildCircle,\n _a[SHAPES.ELIP] = buildCircle,\n _a[SHAPES.RECT] = buildRectangle,\n _a[SHAPES.RREC] = buildRoundedRectangle,\n _a);\n/**\n * Batch pool, stores unused batches for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.graphicsUtils.BatchPart>} BATCH_POOL\n */\nvar BATCH_POOL = [];\n/**\n * Draw call pool, stores unused draw calls for preventing allocations.\n * @memberof PIXI.graphicsUtils\n * @member {Array<PIXI.BatchDrawCall>} DRAW_CALL_POOL\n */\nvar DRAW_CALL_POOL = [];\n\n/**\n * A class to contain data useful for Graphics objects\n * @memberof PIXI\n */\nvar GraphicsData = /** @class */ (function () {\n /**\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param fillStyle - the width of the line to draw\n * @param lineStyle - the color of the line to draw\n * @param matrix - Transform matrix\n */\n function GraphicsData(shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n /** The collection of points. */\n this.points = [];\n /** The collection of holes. */\n this.holes = [];\n this.shape = shape;\n this.lineStyle = lineStyle;\n this.fillStyle = fillStyle;\n this.matrix = matrix;\n this.type = shape.type;\n }\n /**\n * Creates a new GraphicsData object with the same values as this one.\n * @returns - Cloned GraphicsData object\n */\n GraphicsData.prototype.clone = function () {\n return new GraphicsData(this.shape, this.fillStyle, this.lineStyle, this.matrix);\n };\n /** Destroys the Graphics data. */\n GraphicsData.prototype.destroy = function () {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n };\n return GraphicsData;\n}());\n\nvar tmpPoint = new Point();\n/**\n * The Graphics class contains methods used to draw primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them.\n *\n * GraphicsGeometry is designed to not be continually updating the geometry since it's expensive\n * to re-tesselate using **earcut**. Consider using {@link PIXI.Mesh} for this use-case, it's much faster.\n * @memberof PIXI\n */\nvar GraphicsGeometry = /** @class */ (function (_super) {\n __extends(GraphicsGeometry, _super);\n // eslint-disable-next-line @typescript-eslint/no-useless-constructor\n function GraphicsGeometry() {\n var _this = _super.call(this) || this;\n /** Minimal distance between points that are considered different. Affects line tesselation. */\n _this.closePointEps = 1e-4;\n /** Padding to add to the bounds. */\n _this.boundsPadding = 0;\n _this.uvsFloat32 = null;\n _this.indicesUint16 = null;\n _this.batchable = false;\n /** An array of points to draw, 2 numbers per point */\n _this.points = [];\n /** The collection of colors */\n _this.colors = [];\n /** The UVs collection */\n _this.uvs = [];\n /** The indices of the vertices */\n _this.indices = [];\n /** Reference to the texture IDs. */\n _this.textureIds = [];\n /**\n * The collection of drawn shapes.\n * @member {PIXI.GraphicsData[]}\n */\n _this.graphicsData = [];\n /**\n * List of current draw calls drived from the batches.\n * @member {PIXI.BatchDrawCall[]}\n */\n _this.drawCalls = [];\n /** Batches need to regenerated if the geometry is updated. */\n _this.batchDirty = -1;\n /**\n * Intermediate abstract format sent to batch system.\n * Can be converted to drawCalls or to batchable objects.\n * @member {PIXI.graphicsUtils.BatchPart[]}\n */\n _this.batches = [];\n /** Used to detect if the graphics object has changed. */\n _this.dirty = 0;\n /** Used to check if the cache is dirty. */\n _this.cacheDirty = -1;\n /** Used to detect if we cleared the graphicsData. */\n _this.clearDirty = 0;\n /** Index of the last batched shape in the stack of calls. */\n _this.shapeIndex = 0;\n /** Cached bounds. */\n _this._bounds = new Bounds();\n /** The bounds dirty flag. */\n _this.boundsDirty = -1;\n return _this;\n }\n Object.defineProperty(GraphicsGeometry.prototype, \"bounds\", {\n /**\n * Get the current bounds of the graphic geometry.\n * @readonly\n */\n get: function () {\n this.updateBatches();\n if (this.boundsDirty !== this.dirty) {\n this.boundsDirty = this.dirty;\n this.calculateBounds();\n }\n return this._bounds;\n },\n enumerable: false,\n configurable: true\n });\n /** Call if you changed graphicsData manually. Empties all batch buffers. */\n GraphicsGeometry.prototype.invalidate = function () {\n this.boundsDirty = -1;\n this.dirty++;\n this.batchDirty++;\n this.shapeIndex = 0;\n this.points.length = 0;\n this.colors.length = 0;\n this.uvs.length = 0;\n this.indices.length = 0;\n this.textureIds.length = 0;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n for (var i = 0; i < this.batches.length; i++) {\n var batchPart = this.batches[i];\n batchPart.reset();\n BATCH_POOL.push(batchPart);\n }\n this.batches.length = 0;\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n * @returns - This GraphicsGeometry object. Good for chaining method calls\n */\n GraphicsGeometry.prototype.clear = function () {\n if (this.graphicsData.length > 0) {\n this.invalidate();\n this.clearDirty++;\n this.graphicsData.length = 0;\n }\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param fillStyle - Defines style of the fill.\n * @param lineStyle - Defines style of the lines.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawShape = function (shape, fillStyle, lineStyle, matrix) {\n if (fillStyle === void 0) { fillStyle = null; }\n if (lineStyle === void 0) { lineStyle = null; }\n if (matrix === void 0) { matrix = null; }\n var data = new GraphicsData(shape, fillStyle, lineStyle, matrix);\n this.graphicsData.push(data);\n this.dirty++;\n return this;\n };\n /**\n * Draws the given shape to this Graphics object. Can be any of Circle, Rectangle, Ellipse, Line or Polygon.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - The shape object to draw.\n * @param matrix - Transform applied to the points of the shape.\n * @returns - Returns geometry for chaining.\n */\n GraphicsGeometry.prototype.drawHole = function (shape, matrix) {\n if (matrix === void 0) { matrix = null; }\n if (!this.graphicsData.length) {\n return null;\n }\n var data = new GraphicsData(shape, null, null, matrix);\n var lastShape = this.graphicsData[this.graphicsData.length - 1];\n data.lineStyle = lastShape.lineStyle;\n lastShape.holes.push(data);\n this.dirty++;\n return this;\n };\n /** Destroys the GraphicsGeometry object. */\n GraphicsGeometry.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n this.points.length = 0;\n this.points = null;\n this.colors.length = 0;\n this.colors = null;\n this.uvs.length = 0;\n this.uvs = null;\n this.indices.length = 0;\n this.indices = null;\n this.indexBuffer.destroy();\n this.indexBuffer = null;\n this.graphicsData.length = 0;\n this.graphicsData = null;\n this.drawCalls.length = 0;\n this.drawCalls = null;\n this.batches.length = 0;\n this.batches = null;\n this._bounds = null;\n };\n /**\n * Check to see if a point is contained within this geometry.\n * @param point - Point to check if it's contained.\n * @returns {boolean} `true` if the point is contained within geometry.\n */\n GraphicsGeometry.prototype.containsPoint = function (point) {\n var graphicsData = this.graphicsData;\n for (var i = 0; i < graphicsData.length; ++i) {\n var data = graphicsData[i];\n if (!data.fillStyle.visible) {\n continue;\n }\n // only deal with fills..\n if (data.shape) {\n if (data.matrix) {\n data.matrix.applyInverse(point, tmpPoint);\n }\n else {\n tmpPoint.copyFrom(point);\n }\n if (data.shape.contains(tmpPoint.x, tmpPoint.y)) {\n var hitHole = false;\n if (data.holes) {\n for (var i_1 = 0; i_1 < data.holes.length; i_1++) {\n var hole = data.holes[i_1];\n if (hole.shape.contains(tmpPoint.x, tmpPoint.y)) {\n hitHole = true;\n break;\n }\n }\n }\n if (!hitHole) {\n return true;\n }\n }\n }\n }\n return false;\n };\n /**\n * Generates intermediate batch data. Either gets converted to drawCalls\n * or used to convert to batch objects directly by the Graphics object.\n */\n GraphicsGeometry.prototype.updateBatches = function () {\n if (!this.graphicsData.length) {\n this.batchable = true;\n return;\n }\n if (!this.validateBatching()) {\n return;\n }\n this.cacheDirty = this.dirty;\n var uvs = this.uvs;\n var graphicsData = this.graphicsData;\n var batchPart = null;\n var currentStyle = null;\n if (this.batches.length > 0) {\n batchPart = this.batches[this.batches.length - 1];\n currentStyle = batchPart.style;\n }\n for (var i = this.shapeIndex; i < graphicsData.length; i++) {\n this.shapeIndex++;\n var data = graphicsData[i];\n var fillStyle = data.fillStyle;\n var lineStyle = data.lineStyle;\n var command = FILL_COMMANDS[data.type];\n // build out the shapes points..\n command.build(data);\n if (data.matrix) {\n this.transformPoints(data.points, data.matrix);\n }\n if (fillStyle.visible || lineStyle.visible) {\n this.processHoles(data.holes);\n }\n for (var j = 0; j < 2; j++) {\n var style = (j === 0) ? fillStyle : lineStyle;\n if (!style.visible)\n { continue; }\n var nextTexture = style.texture.baseTexture;\n var index_1 = this.indices.length;\n var attribIndex = this.points.length / 2;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n if (j === 0) {\n this.processFill(data);\n }\n else {\n this.processLine(data);\n }\n var size = (this.points.length / 2) - attribIndex;\n if (size === 0)\n { continue; }\n // close batch if style is different\n if (batchPart && !this._compareStyles(currentStyle, style)) {\n batchPart.end(index_1, attribIndex);\n batchPart = null;\n }\n // spawn new batch if its first batch or previous was closed\n if (!batchPart) {\n batchPart = BATCH_POOL.pop() || new BatchPart();\n batchPart.begin(style, index_1, attribIndex);\n this.batches.push(batchPart);\n currentStyle = style;\n }\n this.addUvs(this.points, uvs, style.texture, attribIndex, size, style.matrix);\n }\n }\n var index = this.indices.length;\n var attrib = this.points.length / 2;\n if (batchPart) {\n batchPart.end(index, attrib);\n }\n if (this.batches.length === 0) {\n // there are no visible styles in GraphicsData\n // its possible that someone wants Graphics just for the bounds\n this.batchable = true;\n return;\n }\n var need32 = attrib > 0xffff;\n // prevent allocation when length is same as buffer\n if (this.indicesUint16 && this.indices.length === this.indicesUint16.length\n && need32 === (this.indicesUint16.BYTES_PER_ELEMENT > 2)) {\n this.indicesUint16.set(this.indices);\n }\n else {\n this.indicesUint16 = need32 ? new Uint32Array(this.indices) : new Uint16Array(this.indices);\n }\n // TODO make this a const..\n this.batchable = this.isBatchable();\n if (this.batchable) {\n this.packBatches();\n }\n else {\n this.buildDrawCalls();\n }\n };\n /**\n * Affinity check\n * @param styleA\n * @param styleB\n */\n GraphicsGeometry.prototype._compareStyles = function (styleA, styleB) {\n if (!styleA || !styleB) {\n return false;\n }\n if (styleA.texture.baseTexture !== styleB.texture.baseTexture) {\n return false;\n }\n if (styleA.color + styleA.alpha !== styleB.color + styleB.alpha) {\n return false;\n }\n if (!!styleA.native !== !!styleB.native) {\n return false;\n }\n return true;\n };\n /** Test geometry for batching process. */\n GraphicsGeometry.prototype.validateBatching = function () {\n if (this.dirty === this.cacheDirty || !this.graphicsData.length) {\n return false;\n }\n for (var i = 0, l = this.graphicsData.length; i < l; i++) {\n var data = this.graphicsData[i];\n var fill = data.fillStyle;\n var line = data.lineStyle;\n if (fill && !fill.texture.baseTexture.valid)\n { return false; }\n if (line && !line.texture.baseTexture.valid)\n { return false; }\n }\n return true;\n };\n /** Offset the indices so that it works with the batcher. */\n GraphicsGeometry.prototype.packBatches = function () {\n this.batchDirty++;\n this.uvsFloat32 = new Float32Array(this.uvs);\n var batches = this.batches;\n for (var i = 0, l = batches.length; i < l; i++) {\n var batch = batches[i];\n for (var j = 0; j < batch.size; j++) {\n var index = batch.start + j;\n this.indicesUint16[index] = this.indicesUint16[index] - batch.attribStart;\n }\n }\n };\n /**\n * Checks to see if this graphics geometry can be batched.\n * Currently it needs to be small enough and not contain any native lines.\n */\n GraphicsGeometry.prototype.isBatchable = function () {\n // prevent heavy mesh batching\n if (this.points.length > 0xffff * 2) {\n return false;\n }\n var batches = this.batches;\n for (var i = 0; i < batches.length; i++) {\n if (batches[i].style.native) {\n return false;\n }\n }\n return (this.points.length < GraphicsGeometry.BATCHABLE_SIZE * 2);\n };\n /** Converts intermediate batches data to drawCalls. */\n GraphicsGeometry.prototype.buildDrawCalls = function () {\n var TICK = ++BaseTexture._globalBatch;\n for (var i = 0; i < this.drawCalls.length; i++) {\n this.drawCalls[i].texArray.clear();\n DRAW_CALL_POOL.push(this.drawCalls[i]);\n }\n this.drawCalls.length = 0;\n var colors = this.colors;\n var textureIds = this.textureIds;\n var currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n currentGroup.texArray.count = 0;\n currentGroup.start = 0;\n currentGroup.size = 0;\n currentGroup.type = DRAW_MODES.TRIANGLES;\n var textureCount = 0;\n var currentTexture = null;\n var textureId = 0;\n var native = false;\n var drawMode = DRAW_MODES.TRIANGLES;\n var index = 0;\n this.drawCalls.push(currentGroup);\n // TODO - this can be simplified\n for (var i = 0; i < this.batches.length; i++) {\n var data = this.batches[i];\n // TODO add some full on MAX_TEXTURE CODE..\n var MAX_TEXTURES = 8;\n // Forced cast for checking `native` without errors\n var style = data.style;\n var nextTexture = style.texture.baseTexture;\n if (native !== !!style.native) {\n native = !!style.native;\n drawMode = native ? DRAW_MODES.LINES : DRAW_MODES.TRIANGLES;\n // force the batch to break!\n currentTexture = null;\n textureCount = MAX_TEXTURES;\n TICK++;\n }\n if (currentTexture !== nextTexture) {\n currentTexture = nextTexture;\n if (nextTexture._batchEnabled !== TICK) {\n if (textureCount === MAX_TEXTURES) {\n TICK++;\n textureCount = 0;\n if (currentGroup.size > 0) {\n currentGroup = DRAW_CALL_POOL.pop();\n if (!currentGroup) {\n currentGroup = new BatchDrawCall();\n currentGroup.texArray = new BatchTextureArray();\n }\n this.drawCalls.push(currentGroup);\n }\n currentGroup.start = index;\n currentGroup.size = 0;\n currentGroup.texArray.count = 0;\n currentGroup.type = drawMode;\n }\n // TODO add this to the render part..\n // Hack! Because texture has protected `touched`\n nextTexture.touched = 1; // touch;\n nextTexture._batchEnabled = TICK;\n nextTexture._batchLocation = textureCount;\n nextTexture.wrapMode = WRAP_MODES.REPEAT;\n currentGroup.texArray.elements[currentGroup.texArray.count++] = nextTexture;\n textureCount++;\n }\n }\n currentGroup.size += data.size;\n index += data.size;\n textureId = nextTexture._batchLocation;\n this.addColors(colors, style.color, style.alpha, data.attribSize, data.attribStart);\n this.addTextureIds(textureIds, textureId, data.attribSize, data.attribStart);\n }\n BaseTexture._globalBatch = TICK;\n // upload..\n // merge for now!\n this.packAttributes();\n };\n /** Packs attributes to single buffer. */\n GraphicsGeometry.prototype.packAttributes = function () {\n var verts = this.points;\n var uvs = this.uvs;\n var colors = this.colors;\n var textureIds = this.textureIds;\n // verts are 2 positions.. so we * by 3 as there are 6 properties.. then 4 cos its bytes\n var glPoints = new ArrayBuffer(verts.length * 3 * 4);\n var f32 = new Float32Array(glPoints);\n var u32 = new Uint32Array(glPoints);\n var p = 0;\n for (var i = 0; i < verts.length / 2; i++) {\n f32[p++] = verts[i * 2];\n f32[p++] = verts[(i * 2) + 1];\n f32[p++] = uvs[i * 2];\n f32[p++] = uvs[(i * 2) + 1];\n u32[p++] = colors[i];\n f32[p++] = textureIds[i];\n }\n this._buffer.update(glPoints);\n this._indexBuffer.update(this.indicesUint16);\n };\n /**\n * Process fill part of Graphics.\n * @param data\n */\n GraphicsGeometry.prototype.processFill = function (data) {\n if (data.holes.length) {\n buildPoly.triangulate(data, this);\n }\n else {\n var command = FILL_COMMANDS[data.type];\n command.triangulate(data, this);\n }\n };\n /**\n * Process line part of Graphics.\n * @param data\n */\n GraphicsGeometry.prototype.processLine = function (data) {\n buildLine(data, this);\n for (var i = 0; i < data.holes.length; i++) {\n buildLine(data.holes[i], this);\n }\n };\n /**\n * Process the holes data.\n * @param holes\n */\n GraphicsGeometry.prototype.processHoles = function (holes) {\n for (var i = 0; i < holes.length; i++) {\n var hole = holes[i];\n var command = FILL_COMMANDS[hole.type];\n command.build(hole);\n if (hole.matrix) {\n this.transformPoints(hole.points, hole.matrix);\n }\n }\n };\n /** Update the local bounds of the object. Expensive to use performance-wise. */\n GraphicsGeometry.prototype.calculateBounds = function () {\n var bounds = this._bounds;\n bounds.clear();\n bounds.addVertexData(this.points, 0, this.points.length);\n bounds.pad(this.boundsPadding, this.boundsPadding);\n };\n /**\n * Transform points using matrix.\n * @param points - Points to transform\n * @param matrix - Transform matrix\n */\n GraphicsGeometry.prototype.transformPoints = function (points, matrix) {\n for (var i = 0; i < points.length / 2; i++) {\n var x = points[(i * 2)];\n var y = points[(i * 2) + 1];\n points[(i * 2)] = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n points[(i * 2) + 1] = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n }\n };\n /**\n * Add colors.\n * @param colors - List of colors to add to\n * @param color - Color to add\n * @param alpha - Alpha to use\n * @param size - Number of colors to add\n * @param offset\n */\n GraphicsGeometry.prototype.addColors = function (colors, color, alpha, size, offset) {\n if (offset === void 0) { offset = 0; }\n // TODO use the premultiply bits Ivan added\n var rgb = (color >> 16) + (color & 0xff00) + ((color & 0xff) << 16);\n var rgba = premultiplyTint(rgb, alpha);\n colors.length = Math.max(colors.length, offset + size);\n for (var i = 0; i < size; i++) {\n colors[offset + i] = rgba;\n }\n };\n /**\n * Add texture id that the shader/fragment wants to use.\n * @param textureIds\n * @param id\n * @param size\n * @param offset\n */\n GraphicsGeometry.prototype.addTextureIds = function (textureIds, id, size, offset) {\n if (offset === void 0) { offset = 0; }\n textureIds.length = Math.max(textureIds.length, offset + size);\n for (var i = 0; i < size; i++) {\n textureIds[offset + i] = id;\n }\n };\n /**\n * Generates the UVs for a shape.\n * @param verts - Vertices\n * @param uvs - UVs\n * @param texture - Reference to Texture\n * @param start - Index buffer start index.\n * @param size - The size/length for index buffer.\n * @param matrix - Optional transform for all points.\n */\n GraphicsGeometry.prototype.addUvs = function (verts, uvs, texture, start, size, matrix) {\n if (matrix === void 0) { matrix = null; }\n var index = 0;\n var uvsStart = uvs.length;\n var frame = texture.frame;\n while (index < size) {\n var x = verts[(start + index) * 2];\n var y = verts[((start + index) * 2) + 1];\n if (matrix) {\n var nx = (matrix.a * x) + (matrix.c * y) + matrix.tx;\n y = (matrix.b * x) + (matrix.d * y) + matrix.ty;\n x = nx;\n }\n index++;\n uvs.push(x / frame.width, y / frame.height);\n }\n var baseTexture = texture.baseTexture;\n if (frame.width < baseTexture.width\n || frame.height < baseTexture.height) {\n this.adjustUvs(uvs, texture, uvsStart, size);\n }\n };\n /**\n * Modify uvs array according to position of texture region\n * Does not work with rotated or trimmed textures\n * @param uvs - array\n * @param texture - region\n * @param start - starting index for uvs\n * @param size - how many points to adjust\n */\n GraphicsGeometry.prototype.adjustUvs = function (uvs, texture, start, size) {\n var baseTexture = texture.baseTexture;\n var eps = 1e-6;\n var finish = start + (size * 2);\n var frame = texture.frame;\n var scaleX = frame.width / baseTexture.width;\n var scaleY = frame.height / baseTexture.height;\n var offsetX = frame.x / frame.width;\n var offsetY = frame.y / frame.height;\n var minX = Math.floor(uvs[start] + eps);\n var minY = Math.floor(uvs[start + 1] + eps);\n for (var i = start + 2; i < finish; i += 2) {\n minX = Math.min(minX, Math.floor(uvs[i] + eps));\n minY = Math.min(minY, Math.floor(uvs[i + 1] + eps));\n }\n offsetX -= minX;\n offsetY -= minY;\n for (var i = start; i < finish; i += 2) {\n uvs[i] = (uvs[i] + offsetX) * scaleX;\n uvs[i + 1] = (uvs[i + 1] + offsetY) * scaleY;\n }\n };\n /**\n * The maximum number of points to consider an object \"batchable\",\n * able to be batched by the renderer's batch system.\n\\\n */\n GraphicsGeometry.BATCHABLE_SIZE = 100;\n return GraphicsGeometry;\n}(BatchGeometry));\n\n/**\n * Represents the line style for Graphics.\n * @memberof PIXI\n */\nvar LineStyle = /** @class */ (function (_super) {\n __extends(LineStyle, _super);\n function LineStyle() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n /** The width (thickness) of any lines drawn. */\n _this.width = 0;\n /** The alignment of any lines drawn (0.5 = middle, 1 = outer, 0 = inner). WebGL only. */\n _this.alignment = 0.5;\n /** If true the lines will be draw using LINES instead of TRIANGLE_STRIP. */\n _this.native = false;\n /**\n * Line cap style.\n * @member {PIXI.LINE_CAP}\n * @default PIXI.LINE_CAP.BUTT\n */\n _this.cap = LINE_CAP.BUTT;\n /**\n * Line join style.\n * @member {PIXI.LINE_JOIN}\n * @default PIXI.LINE_JOIN.MITER\n */\n _this.join = LINE_JOIN.MITER;\n /** Miter limit. */\n _this.miterLimit = 10;\n return _this;\n }\n /** Clones the object. */\n LineStyle.prototype.clone = function () {\n var obj = new LineStyle();\n obj.color = this.color;\n obj.alpha = this.alpha;\n obj.texture = this.texture;\n obj.matrix = this.matrix;\n obj.visible = this.visible;\n obj.width = this.width;\n obj.alignment = this.alignment;\n obj.native = this.native;\n obj.cap = this.cap;\n obj.join = this.join;\n obj.miterLimit = this.miterLimit;\n return obj;\n };\n /** Reset the line style to default. */\n LineStyle.prototype.reset = function () {\n _super.prototype.reset.call(this);\n // Override default line style color\n this.color = 0x0;\n this.alignment = 0.5;\n this.width = 0;\n this.native = false;\n };\n return LineStyle;\n}(FillStyle));\n\nvar temp = new Float32Array(3);\n// a default shaders map used by graphics..\nvar DEFAULT_SHADERS = {};\n/**\n * The Graphics class is primarily used to render primitive shapes such as lines, circles and\n * rectangles to the display, and to color and fill them. However, you can also use a Graphics\n * object to build a list of primitives to use as a mask, or as a complex hitArea.\n *\n * Please note that due to legacy naming conventions, the behavior of some functions in this class\n * can be confusing. Each call to `drawRect()`, `drawPolygon()`, etc. actually stores that primitive\n * in the Geometry class's GraphicsGeometry object for later use in rendering or hit testing - the\n * functions do not directly draw anything to the screen. Similarly, the `clear()` function doesn't\n * change the screen, it simply resets the list of primitives, which can be useful if you want to\n * rebuild the contents of an existing Graphics object.\n *\n * Once a GraphicsGeometry list is built, you can re-use it in other Geometry objects as\n * an optimization, by passing it into a new Geometry object's constructor. Because of this\n * ability, it's important to call `destroy()` on Geometry objects once you are done with them, to\n * properly dereference each GraphicsGeometry and prevent memory leaks.\n * @memberof PIXI\n */\nvar Graphics = /** @class */ (function (_super) {\n __extends(Graphics, _super);\n /**\n * @param geometry - Geometry to use, if omitted will create a new GraphicsGeometry instance.\n */\n function Graphics(geometry) {\n if (geometry === void 0) { geometry = null; }\n var _this = _super.call(this) || this;\n /**\n * Represents the vertex and fragment shaders that processes the geometry and runs on the GPU.\n * Can be shared between multiple Graphics objects.\n */\n _this.shader = null;\n /** Renderer plugin for batching */\n _this.pluginName = 'batch';\n /**\n * Current path\n * @readonly\n */\n _this.currentPath = null;\n /** A collections of batches! These can be drawn by the renderer batch system. */\n _this.batches = [];\n /** Update dirty for limiting calculating tints for batches. */\n _this.batchTint = -1;\n /** Update dirty for limiting calculating batches.*/\n _this.batchDirty = -1;\n /** Copy of the object vertex data. */\n _this.vertexData = null;\n /** Current fill style. */\n _this._fillStyle = new FillStyle();\n /** Current line style. */\n _this._lineStyle = new LineStyle();\n /** Current shape transform matrix. */\n _this._matrix = null;\n /** Current hole mode is enabled. */\n _this._holeMode = false;\n /**\n * Represents the WebGL state the Graphics required to render, excludes shader and geometry. E.g.,\n * blend mode, culling, depth testing, direction of rendering triangles, backface, etc.\n */\n _this.state = State.for2d();\n _this._geometry = geometry || new GraphicsGeometry();\n _this._geometry.refCount++;\n /**\n * When cacheAsBitmap is set to true the graphics object will be rendered as if it was a sprite.\n * This is useful if your graphics element does not change often, as it will speed up the rendering\n * of the object in exchange for taking up texture memory. It is also useful if you need the graphics\n * object to be anti-aliased, because it will be rendered using canvas. This is not recommended if\n * you are constantly redrawing the graphics element.\n * @name cacheAsBitmap\n * @member {boolean}\n * @memberof PIXI.Graphics#\n * @default false\n */\n _this._transformID = -1;\n // Set default\n _this.tint = 0xFFFFFF;\n _this.blendMode = BLEND_MODES.NORMAL;\n return _this;\n }\n Object.defineProperty(Graphics.prototype, \"geometry\", {\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh or Graphics objects.\n * @readonly\n */\n get: function () {\n return this._geometry;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Creates a new Graphics object with the same values as this one.\n * Note that only the geometry of the object is cloned, not its transform (position,scale,etc)\n * @returns - A clone of the graphics object\n */\n Graphics.prototype.clone = function () {\n this.finishPoly();\n return new Graphics(this._geometry);\n };\n Object.defineProperty(Graphics.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the graphic shape. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode. Note that, since each\n * primitive in the GraphicsGeometry list is rendered sequentially, modes\n * such as `PIXI.BLEND_MODES.ADD` and `PIXI.BLEND_MODES.MULTIPLY` will\n * be applied per-primitive.\n * @default PIXI.BLEND_MODES.NORMAL\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"tint\", {\n /**\n * The tint applied to each graphic shape. This is a hex value. A value of\n * 0xFFFFFF will remove any tint effect.\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"fill\", {\n /**\n * The current fill style.\n * @readonly\n */\n get: function () {\n return this._fillStyle;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Graphics.prototype, \"line\", {\n /**\n * The current line style.\n * @readonly\n */\n get: function () {\n return this._lineStyle;\n },\n enumerable: false,\n configurable: true\n });\n Graphics.prototype.lineStyle = function (options, color, alpha, alignment, native) {\n if (options === void 0) { options = null; }\n if (color === void 0) { color = 0x0; }\n if (alpha === void 0) { alpha = 1; }\n if (alignment === void 0) { alignment = 0.5; }\n if (native === void 0) { native = false; }\n // Support non-object params: (width, color, alpha, alignment, native)\n if (typeof options === 'number') {\n options = { width: options, color: color, alpha: alpha, alignment: alignment, native: native };\n }\n return this.lineTextureStyle(options);\n };\n /**\n * Like line style but support texture for line fill.\n * @param [options] - Collection of options for setting line style.\n * @param {number} [options.width=0] - width of the line to draw, will update the objects stored style\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to use\n * @param {number} [options.color=0x0] - color of the line to draw, will update the objects stored style.\n * Default 0xFFFFFF if texture present.\n * @param {number} [options.alpha=1] - alpha of the line to draw, will update the objects stored style\n * @param {PIXI.Matrix} [options.matrix=null] - Texture matrix to transform texture\n * @param {number} [options.alignment=0.5] - alignment of the line to draw, (0 = inner, 0.5 = middle, 1 = outer).\n * WebGL only.\n * @param {boolean} [options.native=false] - If true the lines will be draw using LINES instead of TRIANGLE_STRIP\n * @param {PIXI.LINE_CAP}[options.cap=PIXI.LINE_CAP.BUTT] - line cap style\n * @param {PIXI.LINE_JOIN}[options.join=PIXI.LINE_JOIN.MITER] - line join style\n * @param {number}[options.miterLimit=10] - miter limit ratio\n * @returns {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTextureStyle = function (options) {\n // Apply defaults\n options = Object.assign({\n width: 0,\n texture: Texture.WHITE,\n color: (options && options.texture) ? 0xFFFFFF : 0x0,\n alpha: 1,\n matrix: null,\n alignment: 0.5,\n native: false,\n cap: LINE_CAP.BUTT,\n join: LINE_JOIN.MITER,\n miterLimit: 10,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.width > 0 && options.alpha > 0;\n if (!visible) {\n this._lineStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._lineStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Start a polygon object internally.\n * @protected\n */\n Graphics.prototype.startPoly = function () {\n if (this.currentPath) {\n var points = this.currentPath.points;\n var len = this.currentPath.points.length;\n if (len > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n this.currentPath.points.push(points[len - 2], points[len - 1]);\n }\n }\n else {\n this.currentPath = new Polygon();\n this.currentPath.closeStroke = false;\n }\n };\n /**\n * Finish the polygon object.\n * @protected\n */\n Graphics.prototype.finishPoly = function () {\n if (this.currentPath) {\n if (this.currentPath.points.length > 2) {\n this.drawShape(this.currentPath);\n this.currentPath = null;\n }\n else {\n this.currentPath.points.length = 0;\n }\n }\n };\n /**\n * Moves the current drawing position to x, y.\n * @param x - the X coordinate to move to\n * @param y - the Y coordinate to move to\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.moveTo = function (x, y) {\n this.startPoly();\n this.currentPath.points[0] = x;\n this.currentPath.points[1] = y;\n return this;\n };\n /**\n * Draws a line using the current line style from the current drawing position to (x, y);\n * The current drawing position is then set to (x, y).\n * @param x - the X coordinate to draw to\n * @param y - the Y coordinate to draw to\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.lineTo = function (x, y) {\n if (!this.currentPath) {\n this.moveTo(0, 0);\n }\n // remove duplicates..\n var points = this.currentPath.points;\n var fromX = points[points.length - 2];\n var fromY = points[points.length - 1];\n if (fromX !== x || fromY !== y) {\n points.push(x, y);\n }\n return this;\n };\n /**\n * Initialize the curve\n * @param x\n * @param y\n */\n Graphics.prototype._initCurve = function (x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (this.currentPath) {\n if (this.currentPath.points.length === 0) {\n this.currentPath.points = [x, y];\n }\n }\n else {\n this.moveTo(x, y);\n }\n };\n /**\n * Calculate the points for a quadratic bezier curve and then draws it.\n * Based on: https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.quadraticCurveTo = function (cpX, cpY, toX, toY) {\n this._initCurve();\n var points = this.currentPath.points;\n if (points.length === 0) {\n this.moveTo(0, 0);\n }\n QuadraticUtils.curveTo(cpX, cpY, toX, toY, points);\n return this;\n };\n /**\n * Calculate the points for a bezier curve and then draws it.\n * @param cpX - Control point x\n * @param cpY - Control point y\n * @param cpX2 - Second Control point x\n * @param cpY2 - Second Control point y\n * @param toX - Destination point x\n * @param toY - Destination point y\n * @returns This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.bezierCurveTo = function (cpX, cpY, cpX2, cpY2, toX, toY) {\n this._initCurve();\n BezierUtils.curveTo(cpX, cpY, cpX2, cpY2, toX, toY, this.currentPath.points);\n return this;\n };\n /**\n * The arcTo() method creates an arc/curve between two tangents on the canvas.\n *\n * \"borrowed\" from https://code.google.com/p/fxcanvas/ - thanks google!\n * @param x1 - The x-coordinate of the first tangent point of the arc\n * @param y1 - The y-coordinate of the first tangent point of the arc\n * @param x2 - The x-coordinate of the end of the arc\n * @param y2 - The y-coordinate of the end of the arc\n * @param radius - The radius of the arc\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n this._initCurve(x1, y1);\n var points = this.currentPath.points;\n var result = ArcUtils.curveTo(x1, y1, x2, y2, radius, points);\n if (result) {\n var cx = result.cx, cy = result.cy, radius_1 = result.radius, startAngle = result.startAngle, endAngle = result.endAngle, anticlockwise = result.anticlockwise;\n this.arc(cx, cy, radius_1, startAngle, endAngle, anticlockwise);\n }\n return this;\n };\n /**\n * The arc method creates an arc/curve (used to create circles, or parts of circles).\n * @param cx - The x-coordinate of the center of the circle\n * @param cy - The y-coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @param startAngle - The starting angle, in radians (0 is at the 3 o'clock position\n * of the arc's circle)\n * @param endAngle - The ending angle, in radians\n * @param anticlockwise - Specifies whether the drawing should be\n * counter-clockwise or clockwise. False is default, and indicates clockwise, while true\n * indicates counter-clockwise.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.arc = function (cx, cy, radius, startAngle, endAngle, anticlockwise) {\n if (anticlockwise === void 0) { anticlockwise = false; }\n if (startAngle === endAngle) {\n return this;\n }\n if (!anticlockwise && endAngle <= startAngle) {\n endAngle += PI_2;\n }\n else if (anticlockwise && startAngle <= endAngle) {\n startAngle += PI_2;\n }\n var sweep = endAngle - startAngle;\n if (sweep === 0) {\n return this;\n }\n var startX = cx + (Math.cos(startAngle) * radius);\n var startY = cy + (Math.sin(startAngle) * radius);\n var eps = this._geometry.closePointEps;\n // If the currentPath exists, take its points. Otherwise call `moveTo` to start a path.\n var points = this.currentPath ? this.currentPath.points : null;\n if (points) {\n // TODO: make a better fix.\n // We check how far our start is from the last existing point\n var xDiff = Math.abs(points[points.length - 2] - startX);\n var yDiff = Math.abs(points[points.length - 1] - startY);\n if (xDiff < eps && yDiff < eps) ;\n else {\n points.push(startX, startY);\n }\n }\n else {\n this.moveTo(startX, startY);\n points = this.currentPath.points;\n }\n ArcUtils.arc(startX, startY, cx, cy, radius, startAngle, endAngle, anticlockwise, points);\n return this;\n };\n /**\n * Specifies a simple one-color fill that subsequent calls to other Graphics methods\n * (such as lineTo() or drawCircle()) use when drawing.\n * @param color - the color of the fill\n * @param alpha - the alpha of the fill\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginFill = function (color, alpha) {\n if (color === void 0) { color = 0; }\n if (alpha === void 0) { alpha = 1; }\n return this.beginTextureFill({ texture: Texture.WHITE, color: color, alpha: alpha });\n };\n /**\n * Begin the texture fill\n * @param options - Object object.\n * @param {PIXI.Texture} [options.texture=PIXI.Texture.WHITE] - Texture to fill\n * @param {number} [options.color=0xffffff] - Background to fill behind texture\n * @param {number} [options.alpha=1] - Alpha of fill\n * @param {PIXI.Matrix} [options.matrix=null] - Transform matrix\n * @returns {PIXI.Graphics} This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.beginTextureFill = function (options) {\n // Apply defaults\n options = Object.assign({\n texture: Texture.WHITE,\n color: 0xFFFFFF,\n alpha: 1,\n matrix: null,\n }, options);\n if (this.currentPath) {\n this.startPoly();\n }\n var visible = options.alpha > 0;\n if (!visible) {\n this._fillStyle.reset();\n }\n else {\n if (options.matrix) {\n options.matrix = options.matrix.clone();\n options.matrix.invert();\n }\n Object.assign(this._fillStyle, { visible: visible }, options);\n }\n return this;\n };\n /**\n * Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.endFill = function () {\n this.finishPoly();\n this._fillStyle.reset();\n return this;\n };\n /**\n * Draws a rectangle shape.\n * @param x - The X coord of the top-left of the rectangle\n * @param y - The Y coord of the top-left of the rectangle\n * @param width - The width of the rectangle\n * @param height - The height of the rectangle\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRect = function (x, y, width, height) {\n return this.drawShape(new Rectangle(x, y, width, height));\n };\n /**\n * Draw a rectangle shape with rounded/beveled corners.\n * @param x - The X coord of the top-left of the rectangle\n * @param y - The Y coord of the top-left of the rectangle\n * @param width - The width of the rectangle\n * @param height - The height of the rectangle\n * @param radius - Radius of the rectangle corners\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawRoundedRect = function (x, y, width, height, radius) {\n return this.drawShape(new RoundedRectangle(x, y, width, height, radius));\n };\n /**\n * Draws a circle.\n * @param x - The X coordinate of the center of the circle\n * @param y - The Y coordinate of the center of the circle\n * @param radius - The radius of the circle\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawCircle = function (x, y, radius) {\n return this.drawShape(new Circle(x, y, radius));\n };\n /**\n * Draws an ellipse.\n * @param x - The X coordinate of the center of the ellipse\n * @param y - The Y coordinate of the center of the ellipse\n * @param width - The half width of the ellipse\n * @param height - The half height of the ellipse\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawEllipse = function (x, y, width, height) {\n return this.drawShape(new Ellipse(x, y, width, height));\n };\n /**\n * Draws a polygon using the given path.\n * @param {number[]|PIXI.IPointData[]|PIXI.Polygon} path - The path data used to construct the polygon.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawPolygon = function () {\n var arguments$1 = arguments;\n\n var path = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n path[_i] = arguments$1[_i];\n }\n var points;\n var closeStroke = true; // !!this._fillStyle;\n var poly = path[0];\n // check if data has points..\n if (poly.points) {\n closeStroke = poly.closeStroke;\n points = poly.points;\n }\n else if (Array.isArray(path[0])) {\n points = path[0];\n }\n else {\n points = path;\n }\n var shape = new Polygon(points);\n shape.closeStroke = closeStroke;\n this.drawShape(shape);\n return this;\n };\n /**\n * Draw any shape.\n * @param {PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.Rectangle|PIXI.RoundedRectangle} shape - Shape to draw\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.drawShape = function (shape) {\n if (!this._holeMode) {\n this._geometry.drawShape(shape, this._fillStyle.clone(), this._lineStyle.clone(), this._matrix);\n }\n else {\n this._geometry.drawHole(shape, this._matrix);\n }\n return this;\n };\n /**\n * Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.\n * @returns - This Graphics object. Good for chaining method calls\n */\n Graphics.prototype.clear = function () {\n this._geometry.clear();\n this._lineStyle.reset();\n this._fillStyle.reset();\n this._boundsID++;\n this._matrix = null;\n this._holeMode = false;\n this.currentPath = null;\n return this;\n };\n /**\n * True if graphics consists of one rectangle, and thus, can be drawn like a Sprite and\n * masked with gl.scissor.\n * @returns - True if only 1 rect.\n */\n Graphics.prototype.isFastRect = function () {\n var data = this._geometry.graphicsData;\n return data.length === 1\n && data[0].shape.type === SHAPES.RECT\n && !data[0].matrix\n && !data[0].holes.length\n && !(data[0].lineStyle.visible && data[0].lineStyle.width);\n };\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n Graphics.prototype._render = function (renderer) {\n this.finishPoly();\n var geometry = this._geometry;\n // batch part..\n // batch it!\n geometry.updateBatches();\n if (geometry.batchable) {\n if (this.batchDirty !== geometry.batchDirty) {\n this._populateBatches();\n }\n this._renderBatched(renderer);\n }\n else {\n // no batching...\n renderer.batch.flush();\n this._renderDirect(renderer);\n }\n };\n /** Populating batches for rendering. */\n Graphics.prototype._populateBatches = function () {\n var geometry = this._geometry;\n var blendMode = this.blendMode;\n var len = geometry.batches.length;\n this.batchTint = -1;\n this._transformID = -1;\n this.batchDirty = geometry.batchDirty;\n this.batches.length = len;\n this.vertexData = new Float32Array(geometry.points);\n for (var i = 0; i < len; i++) {\n var gI = geometry.batches[i];\n var color = gI.style.color;\n var vertexData = new Float32Array(this.vertexData.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var uvs = new Float32Array(geometry.uvsFloat32.buffer, gI.attribStart * 4 * 2, gI.attribSize * 2);\n var indices = new Uint16Array(geometry.indicesUint16.buffer, gI.start * 2, gI.size);\n var batch = {\n vertexData: vertexData,\n blendMode: blendMode,\n indices: indices,\n uvs: uvs,\n _batchRGB: hex2rgb(color),\n _tintRGB: color,\n _texture: gI.style.texture,\n alpha: gI.style.alpha,\n worldAlpha: 1\n };\n this.batches[i] = batch;\n }\n };\n /**\n * Renders the batches using the BathedRenderer plugin\n * @param renderer - The renderer\n */\n Graphics.prototype._renderBatched = function (renderer) {\n if (!this.batches.length) {\n return;\n }\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n this.calculateVertices();\n this.calculateTints();\n for (var i = 0, l = this.batches.length; i < l; i++) {\n var batch = this.batches[i];\n batch.worldAlpha = this.worldAlpha * batch.alpha;\n renderer.plugins[this.pluginName].render(batch);\n }\n };\n /**\n * Renders the graphics direct\n * @param renderer - The renderer\n */\n Graphics.prototype._renderDirect = function (renderer) {\n var shader = this._resolveDirectShader(renderer);\n var geometry = this._geometry;\n var tint = this.tint;\n var worldAlpha = this.worldAlpha;\n var uniforms = shader.uniforms;\n var drawCalls = geometry.drawCalls;\n // lets set the transfomr\n uniforms.translationMatrix = this.transform.worldTransform;\n // and then lets set the tint..\n uniforms.tint[0] = (((tint >> 16) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[1] = (((tint >> 8) & 0xFF) / 255) * worldAlpha;\n uniforms.tint[2] = ((tint & 0xFF) / 255) * worldAlpha;\n uniforms.tint[3] = worldAlpha;\n // the first draw call, we can set the uniforms of the shader directly here.\n // this means that we can tack advantage of the sync function of pixi!\n // bind and sync uniforms..\n // there is a way to optimise this..\n renderer.shader.bind(shader);\n renderer.geometry.bind(geometry, shader);\n // set state..\n renderer.state.set(this.state);\n // then render the rest of them...\n for (var i = 0, l = drawCalls.length; i < l; i++) {\n this._renderDrawCallDirect(renderer, geometry.drawCalls[i]);\n }\n };\n /**\n * Renders specific DrawCall\n * @param renderer\n * @param drawCall\n */\n Graphics.prototype._renderDrawCallDirect = function (renderer, drawCall) {\n var texArray = drawCall.texArray, type = drawCall.type, size = drawCall.size, start = drawCall.start;\n var groupTextureCount = texArray.count;\n for (var j = 0; j < groupTextureCount; j++) {\n renderer.texture.bind(texArray.elements[j], j);\n }\n renderer.geometry.draw(type, size, start);\n };\n /**\n * Resolves shader for direct rendering\n * @param renderer - The renderer\n */\n Graphics.prototype._resolveDirectShader = function (renderer) {\n var shader = this.shader;\n var pluginName = this.pluginName;\n if (!shader) {\n // if there is no shader here, we can use the default shader.\n // and that only gets created if we actually need it..\n // but may be more than one plugins for graphics\n if (!DEFAULT_SHADERS[pluginName]) {\n var MAX_TEXTURES = renderer.plugins[pluginName].MAX_TEXTURES;\n var sampleValues = new Int32Array(MAX_TEXTURES);\n for (var i = 0; i < MAX_TEXTURES; i++) {\n sampleValues[i] = i;\n }\n var uniforms = {\n tint: new Float32Array([1, 1, 1, 1]),\n translationMatrix: new Matrix(),\n default: UniformGroup.from({ uSamplers: sampleValues }, true),\n };\n var program = renderer.plugins[pluginName]._shader.program;\n DEFAULT_SHADERS[pluginName] = new Shader(program, uniforms);\n }\n shader = DEFAULT_SHADERS[pluginName];\n }\n return shader;\n };\n /** Retrieves the bounds of the graphic shape as a rectangle object. */\n Graphics.prototype._calculateBounds = function () {\n this.finishPoly();\n var geometry = this._geometry;\n // skipping when graphics is empty, like a container\n if (!geometry.graphicsData.length) {\n return;\n }\n var _a = geometry.bounds, minX = _a.minX, minY = _a.minY, maxX = _a.maxX, maxY = _a.maxY;\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Tests if a point is inside this graphics object\n * @param point - the point to test\n * @returns - the result of the test\n */\n Graphics.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, Graphics._TEMP_POINT);\n return this._geometry.containsPoint(Graphics._TEMP_POINT);\n };\n /** Recalculate the tint by applying tint to batches using Graphics tint. */\n Graphics.prototype.calculateTints = function () {\n if (this.batchTint !== this.tint) {\n this.batchTint = this.tint;\n var tintRGB = hex2rgb(this.tint, temp);\n for (var i = 0; i < this.batches.length; i++) {\n var batch = this.batches[i];\n var batchTint = batch._batchRGB;\n var r = (tintRGB[0] * batchTint[0]) * 255;\n var g = (tintRGB[1] * batchTint[1]) * 255;\n var b = (tintRGB[2] * batchTint[2]) * 255;\n // TODO Ivan, can this be done in one go?\n var color = (r << 16) + (g << 8) + (b | 0);\n batch._tintRGB = (color >> 16)\n + (color & 0xff00)\n + ((color & 0xff) << 16);\n }\n }\n };\n /** If there's a transform update or a change to the shape of the geometry, recalculate the vertices. */\n Graphics.prototype.calculateVertices = function () {\n var wtID = this.transform._worldID;\n if (this._transformID === wtID) {\n return;\n }\n this._transformID = wtID;\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var data = this._geometry.points; // batch.vertexDataOriginal;\n var vertexData = this.vertexData;\n var count = 0;\n for (var i = 0; i < data.length; i += 2) {\n var x = data[i];\n var y = data[i + 1];\n vertexData[count++] = (a * x) + (c * y) + tx;\n vertexData[count++] = (d * y) + (b * x) + ty;\n }\n };\n /**\n * Closes the current path.\n * @returns - Returns itself.\n */\n Graphics.prototype.closePath = function () {\n var currentPath = this.currentPath;\n if (currentPath) {\n // we don't need to add extra point in the end because buildLine will take care of that\n currentPath.closeStroke = true;\n // ensure that the polygon is completed, and is available for hit detection\n // (even if the graphics is not rendered yet)\n this.finishPoly();\n }\n return this;\n };\n /**\n * Apply a matrix to the positional data.\n * @param matrix - Matrix to use for transform current shape.\n * @returns - Returns itself.\n */\n Graphics.prototype.setMatrix = function (matrix) {\n this._matrix = matrix;\n return this;\n };\n /**\n * Begin adding holes to the last draw shape\n * IMPORTANT: holes must be fully inside a shape to work\n * Also weirdness ensues if holes overlap!\n * Ellipses, Circles, Rectangles and Rounded Rectangles cannot be holes or host for holes in CanvasRenderer,\n * please use `moveTo` `lineTo`, `quadraticCurveTo` if you rely on pixi-legacy bundle.\n * @returns - Returns itself.\n */\n Graphics.prototype.beginHole = function () {\n this.finishPoly();\n this._holeMode = true;\n return this;\n };\n /**\n * End adding holes to the last draw shape.\n * @returns - Returns itself.\n */\n Graphics.prototype.endHole = function () {\n this.finishPoly();\n this._holeMode = false;\n return this;\n };\n /**\n * Destroys the Graphics object.\n * @param options - Options parameter. A boolean will act as if all\n * options have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have\n * their destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the texture of the child sprite\n * @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true\n * Should it destroy the base texture of the child sprite\n */\n Graphics.prototype.destroy = function (options) {\n this._geometry.refCount--;\n if (this._geometry.refCount === 0) {\n this._geometry.dispose();\n }\n this._matrix = null;\n this.currentPath = null;\n this._lineStyle.destroy();\n this._lineStyle = null;\n this._fillStyle.destroy();\n this._fillStyle = null;\n this._geometry = null;\n this.shader = null;\n this.vertexData = null;\n this.batches.length = 0;\n this.batches = null;\n _super.prototype.destroy.call(this, options);\n };\n /**\n * New rendering behavior for rounded rectangles: circular arcs instead of quadratic bezier curves.\n * In the next major release, we'll enable this by default.\n */\n Graphics.nextRoundedRectBehavior = false;\n /**\n * Temporary point to use for containsPoint.\n * @private\n */\n Graphics._TEMP_POINT = new Point();\n return Graphics;\n}(Container));\n\nvar graphicsUtils = {\n buildPoly: buildPoly,\n buildCircle: buildCircle,\n buildRectangle: buildRectangle,\n buildRoundedRectangle: buildRoundedRectangle,\n buildLine: buildLine,\n ArcUtils: ArcUtils,\n BezierUtils: BezierUtils,\n QuadraticUtils: QuadraticUtils,\n BatchPart: BatchPart,\n FILL_COMMANDS: FILL_COMMANDS,\n BATCH_POOL: BATCH_POOL,\n DRAW_CALL_POOL: DRAW_CALL_POOL\n};\n\nexport { FillStyle, GRAPHICS_CURVES, Graphics, GraphicsData, GraphicsGeometry, LINE_CAP, LINE_JOIN, LineStyle, graphicsUtils };\n//# sourceMappingURL=graphics.mjs.map\n","/*!\n * @pixi/sprite - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/sprite is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { BLEND_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\nimport { Bounds, Container } from '@pixi/display';\nimport { Point, Rectangle, ObservablePoint } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\nvar indices = new Uint16Array([0, 1, 2, 0, 2, 3]);\n/**\n * The Sprite object is the base for all textured objects that are rendered to the screen\n *\n * A sprite can be created directly from an image like this:\n *\n * ```js\n * let sprite = PIXI.Sprite.from('assets/image.png');\n * ```\n *\n * The more efficient way to create sprites is using a {@link PIXI.Spritesheet},\n * as swapping base textures when rendering to the screen is inefficient.\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * let sprite = new PIXI.Sprite(sheet.textures[\"image.png\"]);\n * ...\n * }\n * ```\n * @memberof PIXI\n */\nvar Sprite = /** @class */ (function (_super) {\n __extends(Sprite, _super);\n /** @param texture - The texture for this sprite. */\n function Sprite(texture) {\n var _this = _super.call(this) || this;\n _this._anchor = new ObservablePoint(_this._onAnchorUpdate, _this, (texture ? texture.defaultAnchor.x : 0), (texture ? texture.defaultAnchor.y : 0));\n _this._texture = null;\n _this._width = 0;\n _this._height = 0;\n _this._tint = null;\n _this._tintRGB = null;\n _this.tint = 0xFFFFFF;\n _this.blendMode = BLEND_MODES.NORMAL;\n _this._cachedTint = 0xFFFFFF;\n _this.uvs = null;\n // call texture setter\n _this.texture = texture || Texture.EMPTY;\n _this.vertexData = new Float32Array(8);\n _this.vertexTrimmedData = null;\n _this._transformID = -1;\n _this._textureID = -1;\n _this._transformTrimmedID = -1;\n _this._textureTrimmedID = -1;\n // Batchable stuff..\n // TODO could make this a mixin?\n _this.indices = indices;\n _this.pluginName = 'batch';\n /**\n * Used to fast check if a sprite is.. a sprite!\n * @member {boolean}\n */\n _this.isSprite = true;\n _this._roundPixels = settings.ROUND_PIXELS;\n return _this;\n }\n /** When the texture is updated, this event will fire to update the scale and frame. */\n Sprite.prototype._onTextureUpdate = function () {\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n // so if _width is 0 then width was not set..\n if (this._width) {\n this.scale.x = sign(this.scale.x) * this._width / this._texture.orig.width;\n }\n if (this._height) {\n this.scale.y = sign(this.scale.y) * this._height / this._texture.orig.height;\n }\n };\n /** Called when the anchor position updates. */\n Sprite.prototype._onAnchorUpdate = function () {\n this._transformID = -1;\n this._transformTrimmedID = -1;\n };\n /** Calculates worldTransform * vertices, store it in vertexData. */\n Sprite.prototype.calculateVertices = function () {\n var texture = this._texture;\n if (this._transformID === this.transform._worldID && this._textureID === texture._updateID) {\n return;\n }\n // update texture UV here, because base texture can be changed without calling `_onTextureUpdate`\n if (this._textureID !== texture._updateID) {\n this.uvs = this._texture._uvs.uvsFloat32;\n }\n this._transformID = this.transform._worldID;\n this._textureID = texture._updateID;\n // set the vertex data\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n var trim = texture.trim;\n var orig = texture.orig;\n var anchor = this._anchor;\n var w0 = 0;\n var w1 = 0;\n var h0 = 0;\n var h1 = 0;\n if (trim) {\n // if the sprite is trimmed and is not a tilingsprite then we need to add the extra\n // space before transforming the sprite coords.\n w1 = trim.x - (anchor._x * orig.width);\n w0 = w1 + trim.width;\n h1 = trim.y - (anchor._y * orig.height);\n h0 = h1 + trim.height;\n }\n else {\n w1 = -anchor._x * orig.width;\n w0 = w1 + orig.width;\n h1 = -anchor._y * orig.height;\n h0 = h1 + orig.height;\n }\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n };\n /**\n * Calculates worldTransform * vertices for a non texture with a trim. store it in vertexTrimmedData.\n *\n * This is used to ensure that the true width and height of a trimmed texture is respected.\n */\n Sprite.prototype.calculateTrimmedVertices = function () {\n if (!this.vertexTrimmedData) {\n this.vertexTrimmedData = new Float32Array(8);\n }\n else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) {\n return;\n }\n this._transformTrimmedID = this.transform._worldID;\n this._textureTrimmedID = this._texture._updateID;\n // lets do some special trim code!\n var texture = this._texture;\n var vertexData = this.vertexTrimmedData;\n var orig = texture.orig;\n var anchor = this._anchor;\n // lets calculate the new untrimmed bounds..\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var w1 = -anchor._x * orig.width;\n var w0 = w1 + orig.width;\n var h1 = -anchor._y * orig.height;\n var h0 = h1 + orig.height;\n // xy\n vertexData[0] = (a * w1) + (c * h1) + tx;\n vertexData[1] = (d * h1) + (b * w1) + ty;\n // xy\n vertexData[2] = (a * w0) + (c * h1) + tx;\n vertexData[3] = (d * h1) + (b * w0) + ty;\n // xy\n vertexData[4] = (a * w0) + (c * h0) + tx;\n vertexData[5] = (d * h0) + (b * w0) + ty;\n // xy\n vertexData[6] = (a * w1) + (c * h0) + tx;\n vertexData[7] = (d * h0) + (b * w1) + ty;\n };\n /**\n *\n * Renders the object using the WebGL renderer\n * @param renderer - The webgl renderer to use.\n */\n Sprite.prototype._render = function (renderer) {\n this.calculateVertices();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /** Updates the bounds of the sprite. */\n Sprite.prototype._calculateBounds = function () {\n var trim = this._texture.trim;\n var orig = this._texture.orig;\n // First lets check to see if the current texture has a trim..\n if (!trim || (trim.width === orig.width && trim.height === orig.height)) {\n // no trim! lets use the usual calculations..\n this.calculateVertices();\n this._bounds.addQuad(this.vertexData);\n }\n else {\n // lets calculate a special trimmed bounds...\n this.calculateTrimmedVertices();\n this._bounds.addQuad(this.vertexTrimmedData);\n }\n };\n /**\n * Gets the local bounds of the sprite object.\n * @param rect - Optional output rectangle.\n * @returns The bounds.\n */\n Sprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n if (!this._localBounds) {\n this._localBounds = new Bounds();\n }\n this._localBounds.minX = this._texture.orig.width * -this._anchor._x;\n this._localBounds.minY = this._texture.orig.height * -this._anchor._y;\n this._localBounds.maxX = this._texture.orig.width * (1 - this._anchor._x);\n this._localBounds.maxY = this._texture.orig.height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._localBounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Tests if a point is inside this sprite\n * @param point - the point to test\n * @returns The result of the test\n */\n Sprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._texture.orig.width;\n var height = this._texture.orig.height;\n var x1 = -width * this.anchor.x;\n var y1 = 0;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n y1 = -height * this.anchor.y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n Sprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this._texture.off('update', this._onTextureUpdate, this);\n this._anchor = null;\n var destroyTexture = typeof options === 'boolean' ? options : options && options.texture;\n if (destroyTexture) {\n var destroyBaseTexture = typeof options === 'boolean' ? options : options && options.baseTexture;\n this._texture.destroy(!!destroyBaseTexture);\n }\n this._texture = null;\n };\n // some helper functions..\n /**\n * Helper function that creates a new sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {object} [options] - See {@link PIXI.BaseTexture}'s constructor for options.\n * @returns The newly created sprite\n */\n Sprite.from = function (source, options) {\n var texture = (source instanceof Texture)\n ? source\n : Texture.from(source, options);\n return new Sprite(texture);\n };\n Object.defineProperty(Sprite.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n *\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n *\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}.\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"width\", {\n /** The width of the sprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"height\", {\n /** The height of the sprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the sprite. The default value is taken from the {@link PIXI.Texture|Texture}\n * and passed to the constructor.\n *\n * The default is `(0,0)`, this means the sprite's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n *\n * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n * @example\n * const sprite = new PIXI.Sprite(texture);\n * sprite.anchor.set(0.5); // This will set the origin to center. (0.5) is same as (0.5, 0.5).\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n this._anchor.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"tint\", {\n /**\n * The tint applied to the sprite. This is a hex value.\n *\n * A value of 0xFFFFFF will remove any tint effect.\n * @default 0xFFFFFF\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Sprite.prototype, \"texture\", {\n /** The texture that the sprite is using. */\n get: function () {\n return this._texture;\n },\n set: function (value) {\n if (this._texture === value) {\n return;\n }\n if (this._texture) {\n this._texture.off('update', this._onTextureUpdate, this);\n }\n this._texture = value || Texture.EMPTY;\n this._cachedTint = 0xFFFFFF;\n this._textureID = -1;\n this._textureTrimmedID = -1;\n if (value) {\n // wait for the texture to load\n if (value.baseTexture.valid) {\n this._onTextureUpdate();\n }\n else {\n value.once('update', this._onTextureUpdate, this);\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return Sprite;\n}(Container));\n\nexport { Sprite };\n//# sourceMappingURL=sprite.mjs.map\n","/*!\n * @pixi/text - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/text is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Sprite } from '@pixi/sprite';\nimport { Texture } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { Rectangle } from '@pixi/math';\nimport { hex2string, hex2rgb, string2hex, trimCanvas, sign } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Constants that define the type of gradient on text.\n * @static\n * @constant\n * @name TEXT_GRADIENT\n * @memberof PIXI\n * @type {object}\n * @property {number} LINEAR_VERTICAL Vertical gradient\n * @property {number} LINEAR_HORIZONTAL Linear gradient\n */\nvar TEXT_GRADIENT;\n(function (TEXT_GRADIENT) {\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_VERTICAL\"] = 0] = \"LINEAR_VERTICAL\";\n TEXT_GRADIENT[TEXT_GRADIENT[\"LINEAR_HORIZONTAL\"] = 1] = \"LINEAR_HORIZONTAL\";\n})(TEXT_GRADIENT || (TEXT_GRADIENT = {}));\n\n// disabling eslint for now, going to rewrite this in v5\nvar defaultStyle = {\n align: 'left',\n breakWords: false,\n dropShadow: false,\n dropShadowAlpha: 1,\n dropShadowAngle: Math.PI / 6,\n dropShadowBlur: 0,\n dropShadowColor: 'black',\n dropShadowDistance: 5,\n fill: 'black',\n fillGradientType: TEXT_GRADIENT.LINEAR_VERTICAL,\n fillGradientStops: [],\n fontFamily: 'Arial',\n fontSize: 26,\n fontStyle: 'normal',\n fontVariant: 'normal',\n fontWeight: 'normal',\n letterSpacing: 0,\n lineHeight: 0,\n lineJoin: 'miter',\n miterLimit: 10,\n padding: 0,\n stroke: 'black',\n strokeThickness: 0,\n textBaseline: 'alphabetic',\n trim: false,\n whiteSpace: 'pre',\n wordWrap: false,\n wordWrapWidth: 100,\n leading: 0,\n};\nvar genericFontFamilies = [\n 'serif',\n 'sans-serif',\n 'monospace',\n 'cursive',\n 'fantasy',\n 'system-ui' ];\n/**\n * A TextStyle Object contains information to decorate a Text objects.\n *\n * An instance can be shared between multiple Text objects; then changing the style will update all text objects using it.\n *\n * A tool can be used to generate a text style [here](https://pixijs.io/pixi-text-style).\n *\n * @memberof PIXI\n */\nvar TextStyle = /** @class */ (function () {\n /**\n * @param {object} [style] - The style parameters\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center' or 'right'),\n * does not affect single line text\n * @param {boolean} [style.breakWords=false] - Indicates if lines can be wrapped within words, it\n * needs wordWrap to be set to true\n * @param {boolean} [style.dropShadow=false] - Set a drop shadow for the text\n * @param {number} [style.dropShadowAlpha=1] - Set alpha for the drop shadow\n * @param {number} [style.dropShadowAngle=Math.PI/6] - Set a angle of the drop shadow\n * @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius\n * @param {string|number} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'\n * @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow\n * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas\n * fillstyle that will be used on the text e.g 'red', '#00FF00'. Can be an array to create a gradient\n * eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n * @param {number} [style.fillGradientType=PIXI.TEXT_GRADIENT.LINEAR_VERTICAL] - If fill is an array of colours\n * to create a gradient, this can change the type/direction of the gradient. See {@link PIXI.TEXT_GRADIENT}\n * @param {number[]} [style.fillGradientStops] - If fill is an array of colours to create a gradient, this array can set\n * the stop points (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n * @param {string|string[]} [style.fontFamily='Arial'] - The font family\n * @param {number|string} [style.fontSize=26] - The font size (as a number it converts to px, but as a string,\n * equivalents are '26px','20pt','160%' or '1.6em')\n * @param {string} [style.fontStyle='normal'] - The font style ('normal', 'italic' or 'oblique')\n * @param {string} [style.fontVariant='normal'] - The font variant ('normal' or 'small-caps')\n * @param {string} [style.fontWeight='normal'] - The font weight ('normal', 'bold', 'bolder', 'lighter' and '100',\n * '200', '300', '400', '500', '600', '700', '800' or '900')\n * @param {number} [style.leading=0] - The space between lines\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters, default is 0\n * @param {number} [style.lineHeight] - The line height, a number that represents the vertical space that a letter uses\n * @param {string} [style.lineJoin='miter'] - The lineJoin property sets the type of corner created, it can resolve\n * spiked text issues. Possible values \"miter\" (creates a sharp corner), \"round\" (creates a round corner) or \"bevel\"\n * (creates a squared corner).\n * @param {number} [style.miterLimit=10] - The miter limit to use when using the 'miter' lineJoin mode. This can reduce\n * or increase the spikiness of rendered text.\n * @param {number} [style.padding=0] - Occasionally some fonts are cropped. Adding some padding will prevent this from\n * happening by adding padding to all sides of the text.\n * @param {string|number} [style.stroke='black'] - A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n * @param {number} [style.strokeThickness=0] - A number that represents the thickness of the stroke.\n * Default is 0 (no stroke)\n * @param {boolean} [style.trim=false] - Trim transparent borders\n * @param {string} [style.textBaseline='alphabetic'] - The baseline of the text that is rendered.\n * @param {string} [style.whiteSpace='pre'] - Determines whether newlines & spaces are collapsed or preserved \"normal\"\n * (collapse, collapse), \"pre\" (preserve, preserve) | \"pre-line\" (preserve, collapse). It needs wordWrap to be set to true\n * @param {boolean} [style.wordWrap=false] - Indicates if word wrap should be used\n * @param {number} [style.wordWrapWidth=100] - The width at which text will wrap, it needs wordWrap to be set to true\n */\n function TextStyle(style) {\n this.styleID = 0;\n this.reset();\n deepCopyProperties(this, style, style);\n }\n /**\n * Creates a new TextStyle object with the same values as this one.\n * Note that the only the properties of the object are cloned.\n *\n * @return New cloned TextStyle object\n */\n TextStyle.prototype.clone = function () {\n var clonedProperties = {};\n deepCopyProperties(clonedProperties, this, defaultStyle);\n return new TextStyle(clonedProperties);\n };\n /** Resets all properties to the defaults specified in TextStyle.prototype._default */\n TextStyle.prototype.reset = function () {\n deepCopyProperties(this, defaultStyle, defaultStyle);\n };\n Object.defineProperty(TextStyle.prototype, \"align\", {\n /**\n * Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text\n *\n * @member {string}\n */\n get: function () {\n return this._align;\n },\n set: function (align) {\n if (this._align !== align) {\n this._align = align;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"breakWords\", {\n /** Indicates if lines can be wrapped within words, it needs wordWrap to be set to true. */\n get: function () {\n return this._breakWords;\n },\n set: function (breakWords) {\n if (this._breakWords !== breakWords) {\n this._breakWords = breakWords;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadow\", {\n /** Set a drop shadow for the text. */\n get: function () {\n return this._dropShadow;\n },\n set: function (dropShadow) {\n if (this._dropShadow !== dropShadow) {\n this._dropShadow = dropShadow;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAlpha\", {\n /** Set alpha for the drop shadow. */\n get: function () {\n return this._dropShadowAlpha;\n },\n set: function (dropShadowAlpha) {\n if (this._dropShadowAlpha !== dropShadowAlpha) {\n this._dropShadowAlpha = dropShadowAlpha;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowAngle\", {\n /** Set a angle of the drop shadow. */\n get: function () {\n return this._dropShadowAngle;\n },\n set: function (dropShadowAngle) {\n if (this._dropShadowAngle !== dropShadowAngle) {\n this._dropShadowAngle = dropShadowAngle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowBlur\", {\n /** Set a shadow blur radius. */\n get: function () {\n return this._dropShadowBlur;\n },\n set: function (dropShadowBlur) {\n if (this._dropShadowBlur !== dropShadowBlur) {\n this._dropShadowBlur = dropShadowBlur;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowColor\", {\n /** A fill style to be used on the dropshadow e.g 'red', '#00FF00'. */\n get: function () {\n return this._dropShadowColor;\n },\n set: function (dropShadowColor) {\n var outputColor = getColor(dropShadowColor);\n if (this._dropShadowColor !== outputColor) {\n this._dropShadowColor = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"dropShadowDistance\", {\n /** Set a distance of the drop shadow. */\n get: function () {\n return this._dropShadowDistance;\n },\n set: function (dropShadowDistance) {\n if (this._dropShadowDistance !== dropShadowDistance) {\n this._dropShadowDistance = dropShadowDistance;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fill\", {\n /**\n * A canvas fillstyle that will be used on the text e.g 'red', '#00FF00'.\n *\n * Can be an array to create a gradient eg ['#000000','#FFFFFF']\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle|MDN}\n *\n * @member {string|string[]|number|number[]|CanvasGradient|CanvasPattern}\n */\n get: function () {\n return this._fill;\n },\n set: function (fill) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n // TODO: Not sure if getColor works properly with CanvasGradient and/or CanvasPattern, can't pass in\n // without casting here.\n var outputColor = getColor(fill);\n if (this._fill !== outputColor) {\n this._fill = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientType\", {\n /**\n * If fill is an array of colours to create a gradient, this can change the type/direction of the gradient.\n *\n * @see PIXI.TEXT_GRADIENT\n */\n get: function () {\n return this._fillGradientType;\n },\n set: function (fillGradientType) {\n if (this._fillGradientType !== fillGradientType) {\n this._fillGradientType = fillGradientType;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fillGradientStops\", {\n /**\n * If fill is an array of colours to create a gradient, this array can set the stop points\n * (numbers between 0 and 1) for the color, overriding the default behaviour of evenly spacing them.\n */\n get: function () {\n return this._fillGradientStops;\n },\n set: function (fillGradientStops) {\n if (!areArraysEqual(this._fillGradientStops, fillGradientStops)) {\n this._fillGradientStops = fillGradientStops;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontFamily\", {\n /** The font family. */\n get: function () {\n return this._fontFamily;\n },\n set: function (fontFamily) {\n if (this.fontFamily !== fontFamily) {\n this._fontFamily = fontFamily;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontSize\", {\n /**\n * The font size\n * (as a number it converts to px, but as a string, equivalents are '26px','20pt','160%' or '1.6em')\n */\n get: function () {\n return this._fontSize;\n },\n set: function (fontSize) {\n if (this._fontSize !== fontSize) {\n this._fontSize = fontSize;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontStyle\", {\n /**\n * The font style\n * ('normal', 'italic' or 'oblique')\n *\n * @member {string}\n */\n get: function () {\n return this._fontStyle;\n },\n set: function (fontStyle) {\n if (this._fontStyle !== fontStyle) {\n this._fontStyle = fontStyle;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontVariant\", {\n /**\n * The font variant\n * ('normal' or 'small-caps')\n *\n * @member {string}\n */\n get: function () {\n return this._fontVariant;\n },\n set: function (fontVariant) {\n if (this._fontVariant !== fontVariant) {\n this._fontVariant = fontVariant;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"fontWeight\", {\n /**\n * The font weight\n * ('normal', 'bold', 'bolder', 'lighter' and '100', '200', '300', '400', '500', '600', '700', 800' or '900')\n *\n * @member {string}\n */\n get: function () {\n return this._fontWeight;\n },\n set: function (fontWeight) {\n if (this._fontWeight !== fontWeight) {\n this._fontWeight = fontWeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"letterSpacing\", {\n /** The amount of spacing between letters, default is 0. */\n get: function () {\n return this._letterSpacing;\n },\n set: function (letterSpacing) {\n if (this._letterSpacing !== letterSpacing) {\n this._letterSpacing = letterSpacing;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineHeight\", {\n /** The line height, a number that represents the vertical space that a letter uses. */\n get: function () {\n return this._lineHeight;\n },\n set: function (lineHeight) {\n if (this._lineHeight !== lineHeight) {\n this._lineHeight = lineHeight;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"leading\", {\n /** The space between lines. */\n get: function () {\n return this._leading;\n },\n set: function (leading) {\n if (this._leading !== leading) {\n this._leading = leading;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"lineJoin\", {\n /**\n * The lineJoin property sets the type of corner created, it can resolve spiked text issues.\n * Default is 'miter' (creates a sharp corner).\n *\n * @member {string}\n */\n get: function () {\n return this._lineJoin;\n },\n set: function (lineJoin) {\n if (this._lineJoin !== lineJoin) {\n this._lineJoin = lineJoin;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"miterLimit\", {\n /**\n * The miter limit to use when using the 'miter' lineJoin mode.\n *\n * This can reduce or increase the spikiness of rendered text.\n */\n get: function () {\n return this._miterLimit;\n },\n set: function (miterLimit) {\n if (this._miterLimit !== miterLimit) {\n this._miterLimit = miterLimit;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"padding\", {\n /**\n * Occasionally some fonts are cropped. Adding some padding will prevent this from happening\n * by adding padding to all sides of the text.\n */\n get: function () {\n return this._padding;\n },\n set: function (padding) {\n if (this._padding !== padding) {\n this._padding = padding;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"stroke\", {\n /**\n * A canvas fillstyle that will be used on the text stroke\n * e.g 'blue', '#FCFF00'\n */\n get: function () {\n return this._stroke;\n },\n set: function (stroke) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var outputColor = getColor(stroke);\n if (this._stroke !== outputColor) {\n this._stroke = outputColor;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"strokeThickness\", {\n /**\n * A number that represents the thickness of the stroke.\n *\n * @default 0\n */\n get: function () {\n return this._strokeThickness;\n },\n set: function (strokeThickness) {\n if (this._strokeThickness !== strokeThickness) {\n this._strokeThickness = strokeThickness;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"textBaseline\", {\n /**\n * The baseline of the text that is rendered.\n *\n * @member {string}\n */\n get: function () {\n return this._textBaseline;\n },\n set: function (textBaseline) {\n if (this._textBaseline !== textBaseline) {\n this._textBaseline = textBaseline;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"trim\", {\n /** Trim transparent borders. */\n get: function () {\n return this._trim;\n },\n set: function (trim) {\n if (this._trim !== trim) {\n this._trim = trim;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"whiteSpace\", {\n /**\n * How newlines and spaces should be handled.\n * Default is 'pre' (preserve, preserve).\n *\n * value | New lines | Spaces\n * --- | --- | ---\n * 'normal' | Collapse | Collapse\n * 'pre' | Preserve | Preserve\n * 'pre-line' | Preserve | Collapse\n *\n * @member {string}\n */\n get: function () {\n return this._whiteSpace;\n },\n set: function (whiteSpace) {\n if (this._whiteSpace !== whiteSpace) {\n this._whiteSpace = whiteSpace;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrap\", {\n /** Indicates if word wrap should be used. */\n get: function () {\n return this._wordWrap;\n },\n set: function (wordWrap) {\n if (this._wordWrap !== wordWrap) {\n this._wordWrap = wordWrap;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextStyle.prototype, \"wordWrapWidth\", {\n /** The width at which text will wrap, it needs wordWrap to be set to true. */\n get: function () {\n return this._wordWrapWidth;\n },\n set: function (wordWrapWidth) {\n if (this._wordWrapWidth !== wordWrapWidth) {\n this._wordWrapWidth = wordWrapWidth;\n this.styleID++;\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Generates a font style string to use for `TextMetrics.measureFont()`.\n *\n * @return Font style string, for passing to `TextMetrics.measureFont()`\n */\n TextStyle.prototype.toFontString = function () {\n // build canvas api font setting from individual components. Convert a numeric this.fontSize to px\n var fontSizeString = (typeof this.fontSize === 'number') ? this.fontSize + \"px\" : this.fontSize;\n // Clean-up fontFamily property by quoting each font name\n // this will support font names with spaces\n var fontFamilies = this.fontFamily;\n if (!Array.isArray(this.fontFamily)) {\n fontFamilies = this.fontFamily.split(',');\n }\n for (var i = fontFamilies.length - 1; i >= 0; i--) {\n // Trim any extra white-space\n var fontFamily = fontFamilies[i].trim();\n // Check if font already contains strings\n if (!(/([\\\"\\'])[^\\'\\\"]+\\1/).test(fontFamily) && genericFontFamilies.indexOf(fontFamily) < 0) {\n fontFamily = \"\\\"\" + fontFamily + \"\\\"\";\n }\n fontFamilies[i] = fontFamily;\n }\n return this.fontStyle + \" \" + this.fontVariant + \" \" + this.fontWeight + \" \" + fontSizeString + \" \" + fontFamilies.join(',');\n };\n return TextStyle;\n}());\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * @private\n * @param color\n * @return The color as a string.\n */\nfunction getSingleColor(color) {\n if (typeof color === 'number') {\n return hex2string(color);\n }\n else if (typeof color === 'string') {\n if (color.indexOf('0x') === 0) {\n color = color.replace('0x', '#');\n }\n }\n return color;\n}\nfunction getColor(color) {\n if (!Array.isArray(color)) {\n return getSingleColor(color);\n }\n else {\n for (var i = 0; i < color.length; ++i) {\n color[i] = getSingleColor(color[i]);\n }\n return color;\n }\n}\n/**\n * Utility function to convert hexadecimal colors to strings, and simply return the color if it's a string.\n * This version can also convert array of colors\n * @private\n * @param array1 - First array to compare\n * @param array2 - Second array to compare\n * @return Do the arrays contain the same values in the same order\n */\nfunction areArraysEqual(array1, array2) {\n if (!Array.isArray(array1) || !Array.isArray(array2)) {\n return false;\n }\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; ++i) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}\n/**\n * Utility function to ensure that object properties are copied by value, and not by reference\n * @private\n * @param target - Target object to copy properties into\n * @param source - Source object for the properties to copy\n * @param propertyObj - Object containing properties names we want to loop over\n */\nfunction deepCopyProperties(target, source, propertyObj) {\n for (var prop in propertyObj) {\n if (Array.isArray(source[prop])) {\n target[prop] = source[prop].slice();\n }\n else {\n target[prop] = source[prop];\n }\n }\n}\n\n// Default settings used for all getContext calls\nvar contextSettings = {\n // TextMetrics requires getImageData readback for measuring fonts.\n willReadFrequently: true,\n};\n/**\n * The TextMetrics object represents the measurement of a block of text with a specified style.\n *\n * ```js\n * let style = new PIXI.TextStyle({fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'})\n * let textMetrics = PIXI.TextMetrics.measureText('Your text', style)\n * ```\n * @memberof PIXI\n */\nvar TextMetrics = /** @class */ (function () {\n /**\n * @param text - the text that was measured\n * @param style - the style that was measured\n * @param width - the measured width of the text\n * @param height - the measured height of the text\n * @param lines - an array of the lines of text broken by new lines and wrapping if specified in style\n * @param lineWidths - an array of the line widths for each line matched to `lines`\n * @param lineHeight - the measured line height for this style\n * @param maxLineWidth - the maximum line width for all measured lines\n * @param {PIXI.IFontMetrics} fontProperties - the font properties object from TextMetrics.measureFont\n */\n function TextMetrics(text, style, width, height, lines, lineWidths, lineHeight, maxLineWidth, fontProperties) {\n this.text = text;\n this.style = style;\n this.width = width;\n this.height = height;\n this.lines = lines;\n this.lineWidths = lineWidths;\n this.lineHeight = lineHeight;\n this.maxLineWidth = maxLineWidth;\n this.fontProperties = fontProperties;\n }\n /**\n * Measures the supplied string of text and returns a Rectangle.\n * @param text - The text to measure.\n * @param style - The text style to use for measuring\n * @param wordWrap - Override for if word-wrap should be applied to the text.\n * @param canvas - optional specification of the canvas to use for measuring.\n * @returns Measured width and height of the text.\n */\n TextMetrics.measureText = function (text, style, wordWrap, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n wordWrap = (wordWrap === undefined || wordWrap === null) ? style.wordWrap : wordWrap;\n var font = style.toFontString();\n var fontProperties = TextMetrics.measureFont(font);\n // fallback in case UA disallow canvas data extraction\n // (toDataURI, getImageData functions)\n if (fontProperties.fontSize === 0) {\n fontProperties.fontSize = style.fontSize;\n fontProperties.ascent = style.fontSize;\n }\n var context = canvas.getContext('2d', contextSettings);\n context.font = font;\n var outputText = wordWrap ? TextMetrics.wordWrap(text, style, canvas) : text;\n var lines = outputText.split(/(?:\\r\\n|\\r|\\n)/);\n var lineWidths = new Array(lines.length);\n var maxLineWidth = 0;\n for (var i = 0; i < lines.length; i++) {\n var lineWidth = context.measureText(lines[i]).width + ((lines[i].length - 1) * style.letterSpacing);\n lineWidths[i] = lineWidth;\n maxLineWidth = Math.max(maxLineWidth, lineWidth);\n }\n var width = maxLineWidth + style.strokeThickness;\n if (style.dropShadow) {\n width += style.dropShadowDistance;\n }\n var lineHeight = style.lineHeight || fontProperties.fontSize + style.strokeThickness;\n var height = Math.max(lineHeight, fontProperties.fontSize + style.strokeThickness)\n + ((lines.length - 1) * (lineHeight + style.leading));\n if (style.dropShadow) {\n height += style.dropShadowDistance;\n }\n return new TextMetrics(text, style, width, height, lines, lineWidths, lineHeight + style.leading, maxLineWidth, fontProperties);\n };\n /**\n * Applies newlines to a string to have it optimally fit into the horizontal\n * bounds set by the Text object's wordWrapWidth property.\n * @param text - String to apply word wrapping to\n * @param style - the style to use when wrapping\n * @param canvas - optional specification of the canvas to use for measuring.\n * @returns New string with new lines applied where required\n */\n TextMetrics.wordWrap = function (text, style, canvas) {\n if (canvas === void 0) { canvas = TextMetrics._canvas; }\n var context = canvas.getContext('2d', contextSettings);\n var width = 0;\n var line = '';\n var lines = '';\n var cache = Object.create(null);\n var letterSpacing = style.letterSpacing, whiteSpace = style.whiteSpace;\n // How to handle whitespaces\n var collapseSpaces = TextMetrics.collapseSpaces(whiteSpace);\n var collapseNewlines = TextMetrics.collapseNewlines(whiteSpace);\n // whether or not spaces may be added to the beginning of lines\n var canPrependSpaces = !collapseSpaces;\n // There is letterSpacing after every char except the last one\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!\n // so for convenience the above needs to be compared to width + 1 extra letterSpace\n // t_h_i_s_' '_i_s_' '_a_n_' '_e_x_a_m_p_l_e_' '_!_\n // ________________________________________________\n // And then the final space is simply no appended to each line\n var wordWrapWidth = style.wordWrapWidth + letterSpacing;\n // break text into words, spaces and newline chars\n var tokens = TextMetrics.tokenize(text);\n for (var i = 0; i < tokens.length; i++) {\n // get the word, space or newlineChar\n var token = tokens[i];\n // if word is a new line\n if (TextMetrics.isNewline(token)) {\n // keep the new line\n if (!collapseNewlines) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = !collapseSpaces;\n line = '';\n width = 0;\n continue;\n }\n // if we should collapse new lines\n // we simply convert it into a space\n token = ' ';\n }\n // if we should collapse repeated whitespaces\n if (collapseSpaces) {\n // check both this and the last tokens for spaces\n var currIsBreakingSpace = TextMetrics.isBreakingSpace(token);\n var lastIsBreakingSpace = TextMetrics.isBreakingSpace(line[line.length - 1]);\n if (currIsBreakingSpace && lastIsBreakingSpace) {\n continue;\n }\n }\n // get word width from cache if possible\n var tokenWidth = TextMetrics.getFromCache(token, letterSpacing, cache, context);\n // word is longer than desired bounds\n if (tokenWidth > wordWrapWidth) {\n // if we are not already at the beginning of a line\n if (line !== '') {\n // start newlines for overflow words\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n // break large word over multiple lines\n if (TextMetrics.canBreakWords(token, style.breakWords)) {\n // break word into characters\n var characters = TextMetrics.wordWrapSplit(token);\n // loop the characters\n for (var j = 0; j < characters.length; j++) {\n var char = characters[j];\n var k = 1;\n // we are not at the end of the token\n while (characters[j + k]) {\n var nextChar = characters[j + k];\n var lastChar = char[char.length - 1];\n // should not split chars\n if (!TextMetrics.canBreakChars(lastChar, nextChar, token, j, style.breakWords)) {\n // combine chars & move forward one\n char += nextChar;\n }\n else {\n break;\n }\n k++;\n }\n j += char.length - 1;\n var characterWidth = TextMetrics.getFromCache(char, letterSpacing, cache, context);\n if (characterWidth + width > wordWrapWidth) {\n lines += TextMetrics.addLine(line);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n line += char;\n width += characterWidth;\n }\n }\n // run word out of the bounds\n else {\n // if there are words in this line already\n // finish that line and start a new one\n if (line.length > 0) {\n lines += TextMetrics.addLine(line);\n line = '';\n width = 0;\n }\n var isLastToken = i === tokens.length - 1;\n // give it its own line if it's not the end\n lines += TextMetrics.addLine(token, !isLastToken);\n canPrependSpaces = false;\n line = '';\n width = 0;\n }\n }\n // word could fit\n else {\n // word won't fit because of existing words\n // start a new line\n if (tokenWidth + width > wordWrapWidth) {\n // if its a space we don't want it\n canPrependSpaces = false;\n // add a new line\n lines += TextMetrics.addLine(line);\n // start a new line\n line = '';\n width = 0;\n }\n // don't add spaces to the beginning of lines\n if (line.length > 0 || !TextMetrics.isBreakingSpace(token) || canPrependSpaces) {\n // add the word to the current line\n line += token;\n // update width counter\n width += tokenWidth;\n }\n }\n }\n lines += TextMetrics.addLine(line, false);\n return lines;\n };\n /**\n * Convienience function for logging each line added during the wordWrap method.\n * @param line - The line of text to add\n * @param newLine - Add new line character to end\n * @returns A formatted line\n */\n TextMetrics.addLine = function (line, newLine) {\n if (newLine === void 0) { newLine = true; }\n line = TextMetrics.trimRight(line);\n line = (newLine) ? line + \"\\n\" : line;\n return line;\n };\n /**\n * Gets & sets the widths of calculated characters in a cache object\n * @param key - The key\n * @param letterSpacing - The letter spacing\n * @param cache - The cache\n * @param context - The canvas context\n * @returns The from cache.\n */\n TextMetrics.getFromCache = function (key, letterSpacing, cache, context) {\n var width = cache[key];\n if (typeof width !== 'number') {\n var spacing = ((key.length) * letterSpacing);\n width = context.measureText(key).width + spacing;\n cache[key] = width;\n }\n return width;\n };\n /**\n * Determines whether we should collapse breaking spaces.\n * @param whiteSpace - The TextStyle property whiteSpace\n * @returns Should collapse\n */\n TextMetrics.collapseSpaces = function (whiteSpace) {\n return (whiteSpace === 'normal' || whiteSpace === 'pre-line');\n };\n /**\n * Determines whether we should collapse newLine chars.\n * @param whiteSpace - The white space\n * @returns should collapse\n */\n TextMetrics.collapseNewlines = function (whiteSpace) {\n return (whiteSpace === 'normal');\n };\n /**\n * Trims breaking whitespaces from string.\n * @param text - The text\n * @returns Trimmed string\n */\n TextMetrics.trimRight = function (text) {\n if (typeof text !== 'string') {\n return '';\n }\n for (var i = text.length - 1; i >= 0; i--) {\n var char = text[i];\n if (!TextMetrics.isBreakingSpace(char)) {\n break;\n }\n text = text.slice(0, -1);\n }\n return text;\n };\n /**\n * Determines if char is a newline.\n * @param char - The character\n * @returns True if newline, False otherwise.\n */\n TextMetrics.isNewline = function (char) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._newlines.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Determines if char is a breaking whitespace.\n *\n * It allows one to determine whether char should be a breaking whitespace\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n * @param char - The character\n * @param [_nextChar] - The next character\n * @returns True if whitespace, False otherwise.\n */\n TextMetrics.isBreakingSpace = function (char, _nextChar) {\n if (typeof char !== 'string') {\n return false;\n }\n return (TextMetrics._breakingSpaces.indexOf(char.charCodeAt(0)) >= 0);\n };\n /**\n * Splits a string into words, breaking-spaces and newLine characters\n * @param text - The text\n * @returns A tokenized array\n */\n TextMetrics.tokenize = function (text) {\n var tokens = [];\n var token = '';\n if (typeof text !== 'string') {\n return tokens;\n }\n for (var i = 0; i < text.length; i++) {\n var char = text[i];\n var nextChar = text[i + 1];\n if (TextMetrics.isBreakingSpace(char, nextChar) || TextMetrics.isNewline(char)) {\n if (token !== '') {\n tokens.push(token);\n token = '';\n }\n tokens.push(char);\n continue;\n }\n token += char;\n }\n if (token !== '') {\n tokens.push(token);\n }\n return tokens;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to customise which words should break\n * Examples are if the token is CJK or numbers.\n * It must return a boolean.\n * @param _token - The token\n * @param breakWords - The style attr break words\n * @returns Whether to break word or not\n */\n TextMetrics.canBreakWords = function (_token, breakWords) {\n return breakWords;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It allows one to determine whether a pair of characters\n * should be broken by newlines\n * For example certain characters in CJK langs or numbers.\n * It must return a boolean.\n * @param _char - The character\n * @param _nextChar - The next character\n * @param _token - The token/word the characters are from\n * @param _index - The index in the token of the char\n * @param _breakWords - The style attr break words\n * @returns whether to break word or not\n */\n TextMetrics.canBreakChars = function (_char, _nextChar, _token, _index, _breakWords) {\n return true;\n };\n /**\n * Overridable helper method used internally by TextMetrics, exposed to allow customizing the class's behavior.\n *\n * It is called when a token (usually a word) has to be split into separate pieces\n * in order to determine the point to break a word.\n * It must return an array of characters.\n * @example\n * // Correctly splits emojis, eg \"🤪🤪\" will result in two element array, each with one emoji.\n * TextMetrics.wordWrapSplit = (token) => [...token];\n * @param token - The token to split\n * @returns The characters of the token\n */\n TextMetrics.wordWrapSplit = function (token) {\n return token.split('');\n };\n /**\n * Calculates the ascent, descent and fontSize of a given font-style\n * @param font - String representing the style of the font\n * @returns Font properties object\n */\n TextMetrics.measureFont = function (font) {\n // as this method is used for preparing assets, don't recalculate things if we don't need to\n if (TextMetrics._fonts[font]) {\n return TextMetrics._fonts[font];\n }\n var properties = {\n ascent: 0,\n descent: 0,\n fontSize: 0,\n };\n var canvas = TextMetrics._canvas;\n var context = TextMetrics._context;\n context.font = font;\n var metricsString = TextMetrics.METRICS_STRING + TextMetrics.BASELINE_SYMBOL;\n var width = Math.ceil(context.measureText(metricsString).width);\n var baseline = Math.ceil(context.measureText(TextMetrics.BASELINE_SYMBOL).width);\n var height = Math.ceil(TextMetrics.HEIGHT_MULTIPLIER * baseline);\n baseline = baseline * TextMetrics.BASELINE_MULTIPLIER | 0;\n canvas.width = width;\n canvas.height = height;\n context.fillStyle = '#f00';\n context.fillRect(0, 0, width, height);\n context.font = font;\n context.textBaseline = 'alphabetic';\n context.fillStyle = '#000';\n context.fillText(metricsString, 0, baseline);\n var imagedata = context.getImageData(0, 0, width, height).data;\n var pixels = imagedata.length;\n var line = width * 4;\n var i = 0;\n var idx = 0;\n var stop = false;\n // ascent. scan from top to bottom until we find a non red pixel\n for (i = 0; i < baseline; ++i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx += line;\n }\n else {\n break;\n }\n }\n properties.ascent = baseline - i;\n idx = pixels - line;\n stop = false;\n // descent. scan from bottom to top until we find a non red pixel\n for (i = height; i > baseline; --i) {\n for (var j = 0; j < line; j += 4) {\n if (imagedata[idx + j] !== 255) {\n stop = true;\n break;\n }\n }\n if (!stop) {\n idx -= line;\n }\n else {\n break;\n }\n }\n properties.descent = i - baseline;\n properties.fontSize = properties.ascent + properties.descent;\n TextMetrics._fonts[font] = properties;\n return properties;\n };\n /**\n * Clear font metrics in metrics cache.\n * @param {string} [font] - font name. If font name not set then clear cache for all fonts.\n */\n TextMetrics.clearMetrics = function (font) {\n if (font === void 0) { font = ''; }\n if (font) {\n delete TextMetrics._fonts[font];\n }\n else {\n TextMetrics._fonts = {};\n }\n };\n Object.defineProperty(TextMetrics, \"_canvas\", {\n /**\n * Cached canvas element for measuring text\n * TODO: this should be private, but isn't because of backward compat, will fix later.\n * @ignore\n */\n get: function () {\n if (!TextMetrics.__canvas) {\n var canvas = void 0;\n try {\n // OffscreenCanvas2D measureText can be up to 40% faster.\n var c = new OffscreenCanvas(0, 0);\n var context = c.getContext('2d', contextSettings);\n if (context && context.measureText) {\n TextMetrics.__canvas = c;\n return c;\n }\n canvas = settings.ADAPTER.createCanvas();\n }\n catch (ex) {\n canvas = settings.ADAPTER.createCanvas();\n }\n canvas.width = canvas.height = 10;\n TextMetrics.__canvas = canvas;\n }\n return TextMetrics.__canvas;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TextMetrics, \"_context\", {\n /**\n * TODO: this should be private, but isn't because of backward compat, will fix later.\n * @ignore\n */\n get: function () {\n if (!TextMetrics.__context) {\n TextMetrics.__context = TextMetrics._canvas.getContext('2d', contextSettings);\n }\n return TextMetrics.__context;\n },\n enumerable: false,\n configurable: true\n });\n return TextMetrics;\n}());\n/**\n * Internal return object for {@link PIXI.TextMetrics.measureFont `TextMetrics.measureFont`}.\n * @typedef {object} FontMetrics\n * @property {number} ascent - The ascent distance\n * @property {number} descent - The descent distance\n * @property {number} fontSize - Font size from ascent to descent\n * @memberof PIXI.TextMetrics\n * @private\n */\n/**\n * Cache of {@see PIXI.TextMetrics.FontMetrics} objects.\n * @memberof PIXI.TextMetrics\n * @type {object}\n * @private\n */\nTextMetrics._fonts = {};\n/**\n * String used for calculate font metrics.\n * These characters are all tall to help calculate the height required for text.\n * @static\n * @memberof PIXI.TextMetrics\n * @name METRICS_STRING\n * @type {string}\n * @default |ÉqÅ\n */\nTextMetrics.METRICS_STRING = '|ÉqÅ';\n/**\n * Baseline symbol for calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_SYMBOL\n * @type {string}\n * @default M\n */\nTextMetrics.BASELINE_SYMBOL = 'M';\n/**\n * Baseline multiplier for calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name BASELINE_MULTIPLIER\n * @type {number}\n * @default 1.4\n */\nTextMetrics.BASELINE_MULTIPLIER = 1.4;\n/**\n * Height multiplier for setting height of canvas to calculate font metrics.\n * @static\n * @memberof PIXI.TextMetrics\n * @name HEIGHT_MULTIPLIER\n * @type {number}\n * @default 2.00\n */\nTextMetrics.HEIGHT_MULTIPLIER = 2.0;\n/**\n * Cache of new line chars.\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._newlines = [\n 0x000A,\n 0x000D ];\n/**\n * Cache of breaking spaces.\n * @memberof PIXI.TextMetrics\n * @type {number[]}\n * @private\n */\nTextMetrics._breakingSpaces = [\n 0x0009,\n 0x0020,\n 0x2000,\n 0x2001,\n 0x2002,\n 0x2003,\n 0x2004,\n 0x2005,\n 0x2006,\n 0x2008,\n 0x2009,\n 0x200A,\n 0x205F,\n 0x3000 ];\n/**\n * A number, or a string containing a number.\n * @memberof PIXI\n * @typedef {object} IFontMetrics\n * @property {number} ascent - Font ascent\n * @property {number} descent - Font descent\n * @property {number} fontSize - Font size\n */\n\nvar defaultDestroyOptions = {\n texture: true,\n children: false,\n baseTexture: true,\n};\n/**\n * A Text Object will create a line or multiple lines of text.\n *\n * The text is created using the [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).\n *\n * The primary advantage of this class over BitmapText is that you have great control over the style of the text,\n * which you can change at runtime.\n *\n * The primary disadvantages is that each piece of text has it's own texture, which can use more memory.\n * When text changes, this texture has to be re-generated and re-uploaded to the GPU, taking up time.\n *\n * To split a line you can use '\\n' in your text string, or, on the `style` object,\n * change its `wordWrap` property to true and and give the `wordWrapWidth` property a value.\n *\n * A Text can be created directly from a string and a style object,\n * which can be generated [here](https://pixijs.io/pixi-text-style).\n *\n * ```js\n * let text = new PIXI.Text('This is a PixiJS text',{fontFamily : 'Arial', fontSize: 24, fill : 0xff1010, align : 'center'});\n * ```\n * @memberof PIXI\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n /**\n * @param text - The string that you would like the text to display\n * @param {object|PIXI.TextStyle} [style] - The style parameters\n * @param canvas - The canvas element for drawing text\n */\n function Text(text, style, canvas) {\n var _this = this;\n var ownCanvas = false;\n if (!canvas) {\n canvas = settings.ADAPTER.createCanvas();\n ownCanvas = true;\n }\n canvas.width = 3;\n canvas.height = 3;\n var texture = Texture.from(canvas);\n texture.orig = new Rectangle();\n texture.trim = new Rectangle();\n _this = _super.call(this, texture) || this;\n _this._ownCanvas = ownCanvas;\n _this.canvas = canvas;\n _this.context = canvas.getContext('2d', {\n // required for trimming to work without warnings\n willReadFrequently: true,\n });\n _this._resolution = settings.RESOLUTION;\n _this._autoResolution = true;\n _this._text = null;\n _this._style = null;\n _this._styleListener = null;\n _this._font = '';\n _this.text = text;\n _this.style = style;\n _this.localStyleID = -1;\n return _this;\n }\n /**\n * Renders text to its canvas, and updates its texture.\n *\n * By default this is used internally to ensure the texture is correct before rendering,\n * but it can be used called externally, for example from this class to 'pre-generate' the texture from a piece of text,\n * and then shared across multiple Sprites.\n * @param respectDirty - Whether to abort updating the text if the Text isn't dirty and the function is called.\n */\n Text.prototype.updateText = function (respectDirty) {\n var style = this._style;\n // check if style has changed..\n if (this.localStyleID !== style.styleID) {\n this.dirty = true;\n this.localStyleID = style.styleID;\n }\n if (!this.dirty && respectDirty) {\n return;\n }\n this._font = this._style.toFontString();\n var context = this.context;\n var measured = TextMetrics.measureText(this._text || ' ', this._style, this._style.wordWrap, this.canvas);\n var width = measured.width;\n var height = measured.height;\n var lines = measured.lines;\n var lineHeight = measured.lineHeight;\n var lineWidths = measured.lineWidths;\n var maxLineWidth = measured.maxLineWidth;\n var fontProperties = measured.fontProperties;\n this.canvas.width = Math.ceil(Math.ceil((Math.max(1, width) + (style.padding * 2))) * this._resolution);\n this.canvas.height = Math.ceil(Math.ceil((Math.max(1, height) + (style.padding * 2))) * this._resolution);\n context.scale(this._resolution, this._resolution);\n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n context.font = this._font;\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n var linePositionX;\n var linePositionY;\n // require 2 passes if a shadow; the first to draw the drop shadow, the second to draw the text\n var passesCount = style.dropShadow ? 2 : 1;\n // For v4, we drew text at the colours of the drop shadow underneath the normal text. This gave the correct zIndex,\n // but features such as alpha and shadowblur did not look right at all, since we were using actual text as a shadow.\n //\n // For v5.0.0, we moved over to just use the canvas API for drop shadows, which made them look much nicer and more\n // visually please, but now because the stroke is drawn and then the fill, drop shadows would appear on both the fill\n // and the stroke; and fill drop shadows would appear over the top of the stroke.\n //\n // For v5.1.1, the new route is to revert to v4 style of drawing text first to get the drop shadows underneath normal\n // text, but instead drawing text in the correct location, we'll draw it off screen (-paddingY), and then adjust the\n // drop shadow so only that appears on screen (+paddingY). Now we'll have the correct draw order of the shadow\n // beneath the text, whilst also having the proper text shadow styling.\n for (var i = 0; i < passesCount; ++i) {\n var isShadowPass = style.dropShadow && i === 0;\n // we only want the drop shadow, so put text way off-screen\n var dsOffsetText = isShadowPass ? Math.ceil(Math.max(1, height) + (style.padding * 2)) : 0;\n var dsOffsetShadow = dsOffsetText * this._resolution;\n if (isShadowPass) {\n // On Safari, text with gradient and drop shadows together do not position correctly\n // if the scale of the canvas is not 1: https://bugs.webkit.org/show_bug.cgi?id=197689\n // Therefore we'll set the styles to be a plain black whilst generating this drop shadow\n context.fillStyle = 'black';\n context.strokeStyle = 'black';\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n var dropShadowBlur = style.dropShadowBlur * this._resolution;\n var dropShadowDistance = style.dropShadowDistance * this._resolution;\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * dropShadowDistance;\n context.shadowOffsetY = (Math.sin(style.dropShadowAngle) * dropShadowDistance) + dsOffsetShadow;\n }\n else {\n // set canvas text styles\n context.fillStyle = this._generateFillStyle(style, lines, measured);\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n context.strokeStyle = style.stroke;\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n var linePositionYShift = (lineHeight - fontProperties.fontSize) / 2;\n if (!Text.nextLineHeightBehavior || lineHeight - fontProperties.fontSize < 0) {\n linePositionYShift = 0;\n }\n // draw lines line by line\n for (var i_1 = 0; i_1 < lines.length; i_1++) {\n linePositionX = style.strokeThickness / 2;\n linePositionY = ((style.strokeThickness / 2) + (i_1 * lineHeight)) + fontProperties.ascent\n + linePositionYShift;\n if (style.align === 'right') {\n linePositionX += maxLineWidth - lineWidths[i_1];\n }\n else if (style.align === 'center') {\n linePositionX += (maxLineWidth - lineWidths[i_1]) / 2;\n }\n if (style.stroke && style.strokeThickness) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText, true);\n }\n if (style.fill) {\n this.drawLetterSpacing(lines[i_1], linePositionX + style.padding, linePositionY + style.padding - dsOffsetText);\n }\n }\n }\n this.updateTexture();\n };\n /**\n * Render the text with letter-spacing.\n * @param text - The text to draw\n * @param x - Horizontal position to draw the text\n * @param y - Vertical position to draw the text\n * @param isStroke - Is this drawing for the outside stroke of the\n * text? If not, it's for the inside fill\n */\n Text.prototype.drawLetterSpacing = function (text, x, y, isStroke) {\n if (isStroke === void 0) { isStroke = false; }\n var style = this._style;\n // letterSpacing of 0 means normal\n var letterSpacing = style.letterSpacing;\n // Checking that we can use moddern canvas2D api\n // https://developer.chrome.com/origintrials/#/view_trial/3585991203293757441\n // note: this is unstable API, Chrome less 94 use a `textLetterSpacing`, newest use a letterSpacing\n // eslint-disable-next-line max-len\n var supportLetterSpacing = Text.experimentalLetterSpacing\n && ('letterSpacing' in CanvasRenderingContext2D.prototype\n || 'textLetterSpacing' in CanvasRenderingContext2D.prototype);\n if (letterSpacing === 0 || supportLetterSpacing) {\n if (supportLetterSpacing) {\n this.context.letterSpacing = letterSpacing;\n this.context.textLetterSpacing = letterSpacing;\n }\n if (isStroke) {\n this.context.strokeText(text, x, y);\n }\n else {\n this.context.fillText(text, x, y);\n }\n return;\n }\n var currentPosition = x;\n // Using Array.from correctly splits characters whilst keeping emoji together.\n // This is not supported on IE as it requires ES6, so regular text splitting occurs.\n // This also doesn't account for emoji that are multiple emoji put together to make something else.\n // Handling all of this would require a big library itself.\n // https://medium.com/@giltayar/iterating-over-emoji-characters-the-es6-way-f06e4589516\n // https://github.com/orling/grapheme-splitter\n var stringArray = Array.from ? Array.from(text) : text.split('');\n var previousWidth = this.context.measureText(text).width;\n var currentWidth = 0;\n for (var i = 0; i < stringArray.length; ++i) {\n var currentChar = stringArray[i];\n if (isStroke) {\n this.context.strokeText(currentChar, currentPosition, y);\n }\n else {\n this.context.fillText(currentChar, currentPosition, y);\n }\n var textStr = '';\n for (var j = i + 1; j < stringArray.length; ++j) {\n textStr += stringArray[j];\n }\n currentWidth = this.context.measureText(textStr).width;\n currentPosition += previousWidth - currentWidth + letterSpacing;\n previousWidth = currentWidth;\n }\n };\n /** Updates texture size based on canvas size. */\n Text.prototype.updateTexture = function () {\n var canvas = this.canvas;\n if (this._style.trim) {\n var trimmed = trimCanvas(canvas);\n if (trimmed.data) {\n canvas.width = trimmed.width;\n canvas.height = trimmed.height;\n this.context.putImageData(trimmed.data, 0, 0);\n }\n }\n var texture = this._texture;\n var style = this._style;\n var padding = style.trim ? 0 : style.padding;\n var baseTexture = texture.baseTexture;\n texture.trim.width = texture._frame.width = canvas.width / this._resolution;\n texture.trim.height = texture._frame.height = canvas.height / this._resolution;\n texture.trim.x = -padding;\n texture.trim.y = -padding;\n texture.orig.width = texture._frame.width - (padding * 2);\n texture.orig.height = texture._frame.height - (padding * 2);\n // call sprite onTextureUpdate to update scale if _width or _height were set\n this._onTextureUpdate();\n baseTexture.setRealSize(canvas.width, canvas.height, this._resolution);\n texture.updateUvs();\n this.dirty = false;\n };\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n Text.prototype._render = function (renderer) {\n if (this._autoResolution && this._resolution !== renderer.resolution) {\n this._resolution = renderer.resolution;\n this.dirty = true;\n }\n this.updateText(true);\n _super.prototype._render.call(this, renderer);\n };\n /** Updates the transform on all children of this container for rendering. */\n Text.prototype.updateTransform = function () {\n this.updateText(true);\n _super.prototype.updateTransform.call(this);\n };\n Text.prototype.getBounds = function (skipUpdate, rect) {\n this.updateText(true);\n if (this._textureID === -1) {\n // texture was updated: recalculate transforms\n skipUpdate = false;\n }\n return _super.prototype.getBounds.call(this, skipUpdate, rect);\n };\n /**\n * Gets the local bounds of the text object.\n * @param rect - The output rectangle.\n * @returns The bounds.\n */\n Text.prototype.getLocalBounds = function (rect) {\n this.updateText(true);\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /** Calculates the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account. */\n Text.prototype._calculateBounds = function () {\n this.calculateVertices();\n // if we have already done this on THIS frame.\n this._bounds.addQuad(this.vertexData);\n };\n /**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n * @param style - The style.\n * @param lines - The lines of text.\n * @param metrics\n * @returns The fill style\n */\n Text.prototype._generateFillStyle = function (style, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = (this.canvas.width / this._resolution) - dropShadowCorrection - (padding * 2);\n var height = (this.canvas.height / this._resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = this.context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n for (var i = 0; i < lines.length; i++) {\n var lastLineBottom = (metrics.lineHeight * (i - 1)) + textHeight;\n var thisLineTop = metrics.lineHeight * i;\n var thisLineGradientStart = thisLineTop;\n // Handle case where last & this line overlap\n if (i > 0 && lastLineBottom > thisLineTop) {\n thisLineGradientStart = (thisLineTop + lastLineBottom) / 2;\n }\n var thisLineBottom = thisLineTop + textHeight;\n var nextLineTop = metrics.lineHeight * (i + 1);\n var thisLineGradientEnd = thisLineBottom;\n // Handle case where this & next line overlap\n if (i + 1 < lines.length && nextLineTop < thisLineBottom) {\n thisLineGradientEnd = (thisLineBottom + nextLineTop) / 2;\n }\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = (thisLineGradientEnd - thisLineGradientStart) / height;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = Math.min(1, Math.max(0, (thisLineGradientStart / height) + (lineStop * gradStopLineHeight)));\n // There's potential for floating point precision issues at the seams between gradient repeats.\n globalStop = Number(globalStop.toFixed(5));\n gradient.addColorStop(globalStop, fill[j]);\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = this.context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n };\n /**\n * Destroys this text object.\n *\n * Note* Unlike a Sprite, a Text object will automatically destroy its baseTexture and texture as\n * the majority of the time the texture will not be shared with any other Sprites.\n * @param options - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their\n * destroy method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=true] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=true] - Should it destroy the base texture of the sprite as well\n */\n Text.prototype.destroy = function (options) {\n if (typeof options === 'boolean') {\n options = { children: options };\n }\n options = Object.assign({}, defaultDestroyOptions, options);\n _super.prototype.destroy.call(this, options);\n // set canvas width and height to 0 to workaround memory leak in Safari < 13\n // https://stackoverflow.com/questions/52532614/total-canvas-memory-use-exceeds-the-maximum-limit-safari-12\n if (this._ownCanvas) {\n this.canvas.height = this.canvas.width = 0;\n }\n // make sure to reset the context and canvas.. dont want this hanging around in memory!\n this.context = null;\n this.canvas = null;\n this._style = null;\n };\n Object.defineProperty(Text.prototype, \"width\", {\n /** The width of the Text, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.x) * this._texture.orig.width;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.x) || 1;\n this.scale.x = s * value / this._texture.orig.width;\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"height\", {\n /** The height of the Text, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n this.updateText(true);\n return Math.abs(this.scale.y) * this._texture.orig.height;\n },\n set: function (value) {\n this.updateText(true);\n var s = sign(this.scale.y) || 1;\n this.scale.y = s * value / this._texture.orig.height;\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"style\", {\n /**\n * Set the style of the text.\n *\n * Set up an event listener to listen for changes on the style object and mark the text as dirty.\n */\n get: function () {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the ITextStyle\n // since the setter creates the TextStyle. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n return this._style;\n },\n set: function (style) {\n style = style || {};\n if (style instanceof TextStyle) {\n this._style = style;\n }\n else {\n this._style = new TextStyle(style);\n }\n this.localStyleID = -1;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"text\", {\n /** Set the copy for the text object. To split a line you can use '\\n'. */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Text.prototype, \"resolution\", {\n /**\n * The resolution / device pixel ratio of the canvas.\n *\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @default 1\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._autoResolution = false;\n if (this._resolution === value) {\n return;\n }\n this._resolution = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * New behavior for `lineHeight` that's meant to mimic HTML text. A value of `true` will\n * make sure the first baseline is offset by the `lineHeight` value if it is greater than `fontSize`.\n * A value of `false` will use the legacy behavior and not change the baseline of the first line.\n * In the next major release, we'll enable this by default.\n */\n Text.nextLineHeightBehavior = false;\n /**\n * New rendering behavior for letter-spacing which uses Chrome's new native API. This will\n * lead to more accurate letter-spacing results because it does not try to manually draw\n * each character. However, this Chrome API is experimental and may not serve all cases yet.\n */\n Text.experimentalLetterSpacing = false;\n return Text;\n}(Sprite));\n\nexport { TEXT_GRADIENT, Text, TextMetrics, TextStyle };\n//# sourceMappingURL=text.mjs.map\n","/*!\n * @pixi/prepare - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/prepare is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { settings } from '@pixi/settings';\nimport { Texture, BaseTexture, ExtensionType } from '@pixi/core';\nimport { Graphics } from '@pixi/graphics';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\nimport { Container } from '@pixi/display';\nimport { Text, TextStyle, TextMetrics } from '@pixi/text';\nimport { deprecation } from '@pixi/utils';\n\n/**\n * Default number of uploads per frame using prepare plugin.\n * @static\n * @memberof PIXI.settings\n * @name UPLOADS_PER_FRAME\n * @type {number}\n * @default 4\n */\nsettings.UPLOADS_PER_FRAME = 4;\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * CountLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of items per frame.\n * @memberof PIXI\n */\nvar CountLimiter = /** @class */ (function () {\n /**\n * @param maxItemsPerFrame - The maximum number of items that can be prepared each frame.\n */\n function CountLimiter(maxItemsPerFrame) {\n this.maxItemsPerFrame = maxItemsPerFrame;\n this.itemsLeft = 0;\n }\n /** Resets any counting properties to start fresh on a new frame. */\n CountLimiter.prototype.beginFrame = function () {\n this.itemsLeft = this.maxItemsPerFrame;\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns If the item is allowed to be uploaded.\n */\n CountLimiter.prototype.allowedToUpload = function () {\n return this.itemsLeft-- > 0;\n };\n return CountLimiter;\n}());\n\n/**\n * Built-in hook to find multiple textures from objects like AnimatedSprites.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.Texture object was found.\n */\nfunction findMultipleBaseTextures(item, queue) {\n var result = false;\n // Objects with multiple textures\n if (item && item._textures && item._textures.length) {\n for (var i = 0; i < item._textures.length; i++) {\n if (item._textures[i] instanceof Texture) {\n var baseTexture = item._textures[i].baseTexture;\n if (queue.indexOf(baseTexture) === -1) {\n queue.push(baseTexture);\n result = true;\n }\n }\n }\n }\n return result;\n}\n/**\n * Built-in hook to find BaseTextures from Texture.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.Texture object was found.\n */\nfunction findBaseTexture(item, queue) {\n if (item.baseTexture instanceof BaseTexture) {\n var texture = item.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find textures from objects.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.Texture object was found.\n */\nfunction findTexture(item, queue) {\n if (item._texture && item._texture instanceof Texture) {\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to draw PIXI.Text to its texture.\n * @private\n * @param _helper - Not used by this upload handler\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction drawText(_helper, item) {\n if (item instanceof Text) {\n // updating text will return early if it is not dirty\n item.updateText(true);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to calculate a text style for a PIXI.Text object.\n * @private\n * @param _helper - Not used by this upload handler\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction calculateTextStyle(_helper, item) {\n if (item instanceof TextStyle) {\n var font = item.toFontString();\n TextMetrics.measureFont(font);\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find Text objects.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns if a PIXI.Text object was found.\n */\nfunction findText(item, queue) {\n if (item instanceof Text) {\n // push the text style to prepare it - this can be really expensive\n if (queue.indexOf(item.style) === -1) {\n queue.push(item.style);\n }\n // also push the text object so that we can render it (to canvas/texture) if needed\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n // also push the Text's texture for upload to GPU\n var texture = item._texture.baseTexture;\n if (queue.indexOf(texture) === -1) {\n queue.push(texture);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to find TextStyle objects.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns If a PIXI.TextStyle object was found.\n */\nfunction findTextStyle(item, queue) {\n if (item instanceof TextStyle) {\n if (queue.indexOf(item) === -1) {\n queue.push(item);\n }\n return true;\n }\n return false;\n}\n/**\n * The prepare manager provides functionality to upload content to the GPU.\n *\n * BasePrepare handles basic queuing functionality and is extended by\n * {@link PIXI.Prepare} and {@link PIXI.CanvasPrepare}\n * to provide preparation capabilities specific to their respective renderers.\n * @example\n * // Create a sprite\n * const sprite = PIXI.Sprite.from('something.png');\n *\n * // Load object into GPU\n * app.renderer.plugins.prepare.upload(sprite, () => {\n *\n * //Texture(s) has been uploaded to GPU\n * app.stage.addChild(sprite);\n *\n * })\n * @abstract\n * @memberof PIXI\n */\nvar BasePrepare = /** @class */ (function () {\n /**\n * @param {PIXI.AbstractRenderer} renderer - A reference to the current renderer\n */\n function BasePrepare(renderer) {\n var _this = this;\n this.limiter = new CountLimiter(settings.UPLOADS_PER_FRAME);\n this.renderer = renderer;\n this.uploadHookHelper = null;\n this.queue = [];\n this.addHooks = [];\n this.uploadHooks = [];\n this.completes = [];\n this.ticking = false;\n this.delayedTick = function () {\n // unlikely, but in case we were destroyed between tick() and delayedTick()\n if (!_this.queue) {\n return;\n }\n _this.prepareItems();\n };\n // hooks to find the correct texture\n this.registerFindHook(findText);\n this.registerFindHook(findTextStyle);\n this.registerFindHook(findMultipleBaseTextures);\n this.registerFindHook(findBaseTexture);\n this.registerFindHook(findTexture);\n // upload hooks\n this.registerUploadHook(drawText);\n this.registerUploadHook(calculateTextStyle);\n }\n /** @ignore */\n BasePrepare.prototype.upload = function (item, done) {\n var _this = this;\n if (typeof item === 'function') {\n done = item;\n item = null;\n }\n if (done) {\n deprecation('6.5.0', 'BasePrepare.upload callback is deprecated, use the return Promise instead.');\n }\n return new Promise(function (resolve) {\n // If a display object, search for items\n // that we could upload\n if (item) {\n _this.add(item);\n }\n // TODO: remove done callback and just use resolve\n var complete = function () {\n done === null || done === void 0 ? void 0 : done();\n resolve();\n };\n // Get the items for upload from the display\n if (_this.queue.length) {\n _this.completes.push(complete);\n if (!_this.ticking) {\n _this.ticking = true;\n Ticker.system.addOnce(_this.tick, _this, UPDATE_PRIORITY.UTILITY);\n }\n }\n else {\n complete();\n }\n });\n };\n /**\n * Handle tick update\n * @private\n */\n BasePrepare.prototype.tick = function () {\n setTimeout(this.delayedTick, 0);\n };\n /**\n * Actually prepare items. This is handled outside of the tick because it will take a while\n * and we do NOT want to block the current animation frame from rendering.\n * @private\n */\n BasePrepare.prototype.prepareItems = function () {\n this.limiter.beginFrame();\n // Upload the graphics\n while (this.queue.length && this.limiter.allowedToUpload()) {\n var item = this.queue[0];\n var uploaded = false;\n if (item && !item._destroyed) {\n for (var i = 0, len = this.uploadHooks.length; i < len; i++) {\n if (this.uploadHooks[i](this.uploadHookHelper, item)) {\n this.queue.shift();\n uploaded = true;\n break;\n }\n }\n }\n if (!uploaded) {\n this.queue.shift();\n }\n }\n // We're finished\n if (!this.queue.length) {\n this.ticking = false;\n var completes = this.completes.slice(0);\n this.completes.length = 0;\n for (var i = 0, len = completes.length; i < len; i++) {\n completes[i]();\n }\n }\n else {\n // if we are not finished, on the next rAF do this again\n Ticker.system.addOnce(this.tick, this, UPDATE_PRIORITY.UTILITY);\n }\n };\n /**\n * Adds hooks for finding items.\n * @param {Function} addHook - Function call that takes two parameters: `item:*, queue:Array`\n * function must return `true` if it was able to add item to the queue.\n * @returns Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerFindHook = function (addHook) {\n if (addHook) {\n this.addHooks.push(addHook);\n }\n return this;\n };\n /**\n * Adds hooks for uploading items.\n * @param {Function} uploadHook - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and\n * function must return `true` if it was able to handle upload of item.\n * @returns Instance of plugin for chaining.\n */\n BasePrepare.prototype.registerUploadHook = function (uploadHook) {\n if (uploadHook) {\n this.uploadHooks.push(uploadHook);\n }\n return this;\n };\n /**\n * Manually add an item to the uploading queue.\n * @param {PIXI.DisplayObject|PIXI.Container|PIXI.BaseTexture|PIXI.Texture|PIXI.Graphics|PIXI.Text|*} item - Object to\n * add to the queue\n * @returns Instance of plugin for chaining.\n */\n BasePrepare.prototype.add = function (item) {\n // Add additional hooks for finding elements on special\n // types of objects that\n for (var i = 0, len = this.addHooks.length; i < len; i++) {\n if (this.addHooks[i](item, this.queue)) {\n break;\n }\n }\n // Get children recursively\n if (item instanceof Container) {\n for (var i = item.children.length - 1; i >= 0; i--) {\n this.add(item.children[i]);\n }\n }\n return this;\n };\n /** Destroys the plugin, don't use after this. */\n BasePrepare.prototype.destroy = function () {\n if (this.ticking) {\n Ticker.system.remove(this.tick, this);\n }\n this.ticking = false;\n this.addHooks = null;\n this.uploadHooks = null;\n this.renderer = null;\n this.completes = null;\n this.queue = null;\n this.limiter = null;\n this.uploadHookHelper = null;\n };\n return BasePrepare;\n}());\n\n/**\n * Built-in hook to upload PIXI.Texture objects to the GPU.\n * @private\n * @param renderer - instance of the webgl renderer\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction uploadBaseTextures(renderer, item) {\n if (item instanceof BaseTexture) {\n // if the texture already has a GL texture, then the texture has been prepared or rendered\n // before now. If the texture changed, then the changer should be calling texture.update() which\n // reuploads the texture without need for preparing it again\n if (!item._glTextures[renderer.CONTEXT_UID]) {\n renderer.texture.bind(item);\n }\n return true;\n }\n return false;\n}\n/**\n * Built-in hook to upload PIXI.Graphics to the GPU.\n * @private\n * @param renderer - instance of the webgl renderer\n * @param item - Item to check\n * @returns If item was uploaded.\n */\nfunction uploadGraphics(renderer, item) {\n if (!(item instanceof Graphics)) {\n return false;\n }\n var geometry = item.geometry;\n // update dirty graphics to get batches\n item.finishPoly();\n geometry.updateBatches();\n var batches = geometry.batches;\n // upload all textures found in styles\n for (var i = 0; i < batches.length; i++) {\n var texture = batches[i].style.texture;\n if (texture) {\n uploadBaseTextures(renderer, texture.baseTexture);\n }\n }\n // if its not batchable - update vao for particular shader\n if (!geometry.batchable) {\n renderer.geometry.bind(geometry, item._resolveDirectShader(renderer));\n }\n return true;\n}\n/**\n * Built-in hook to find graphics.\n * @private\n * @param item - Display object to check\n * @param queue - Collection of items to upload\n * @returns if a PIXI.Graphics object was found.\n */\nfunction findGraphics(item, queue) {\n if (item instanceof Graphics) {\n queue.push(item);\n return true;\n }\n return false;\n}\n/**\n * The prepare plugin provides renderer-specific plugins for pre-rendering DisplayObjects. These plugins are useful for\n * asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.\n *\n * Do not instantiate this plugin directly. It is available from the `renderer.plugins` property.\n * See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n * document.body.appendChild(app.view);\n *\n * // Don't start rendering right away\n * app.stop();\n *\n * // create a display object\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add to the stage\n * app.stage.addChild(rect);\n *\n * // Don't start rendering until the graphic is uploaded to the GPU\n * app.renderer.plugins.prepare.upload(app.stage, () => {\n * app.start();\n * });\n * @memberof PIXI\n */\nvar Prepare = /** @class */ (function (_super) {\n __extends(Prepare, _super);\n /**\n * @param {PIXI.Renderer} renderer - A reference to the current renderer\n */\n function Prepare(renderer) {\n var _this = _super.call(this, renderer) || this;\n _this.uploadHookHelper = _this.renderer;\n // Add textures and graphics to upload\n _this.registerFindHook(findGraphics);\n _this.registerUploadHook(uploadBaseTextures);\n _this.registerUploadHook(uploadGraphics);\n return _this;\n }\n /** @ignore */\n Prepare.extension = {\n name: 'prepare',\n type: ExtensionType.RendererPlugin,\n };\n return Prepare;\n}(BasePrepare));\n\n/**\n * TimeLimiter limits the number of items handled by a {@link PIXI.BasePrepare} to a specified\n * number of milliseconds per frame.\n * @memberof PIXI\n */\nvar TimeLimiter = /** @class */ (function () {\n /** @param maxMilliseconds - The maximum milliseconds that can be spent preparing items each frame. */\n function TimeLimiter(maxMilliseconds) {\n this.maxMilliseconds = maxMilliseconds;\n this.frameStart = 0;\n }\n /** Resets any counting properties to start fresh on a new frame. */\n TimeLimiter.prototype.beginFrame = function () {\n this.frameStart = Date.now();\n };\n /**\n * Checks to see if another item can be uploaded. This should only be called once per item.\n * @returns - If the item is allowed to be uploaded.\n */\n TimeLimiter.prototype.allowedToUpload = function () {\n return Date.now() - this.frameStart < this.maxMilliseconds;\n };\n return TimeLimiter;\n}());\n\nexport { BasePrepare, CountLimiter, Prepare, TimeLimiter };\n//# sourceMappingURL=prepare.mjs.map\n","/*!\n * @pixi/spritesheet - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/spritesheet is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle } from '@pixi/math';\nimport { Texture, BaseTexture, ExtensionType } from '@pixi/core';\nimport { getResolutionOfUrl, deprecation, url } from '@pixi/utils';\nimport { LoaderResource } from '@pixi/loaders';\n\n/**\n * Utility class for maintaining reference to a collection\n * of Textures on a single Spritesheet.\n *\n * To access a sprite sheet from your code you may pass its JSON data file to Pixi's loader:\n *\n * ```js\n * PIXI.Loader.shared.add(\"images/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"images/spritesheet.json\"].spritesheet;\n * ...\n * }\n * ```\n *\n * Alternately, you may circumvent the loader by instantiating the Spritesheet directly:\n * ```js\n * const sheet = new PIXI.Spritesheet(texture, spritesheetData);\n * await sheet.parse();\n * console.log('Spritesheet ready to use!');\n * ```\n *\n * With the `sheet.textures` you can create Sprite objects,`sheet.animations` can be used to create an AnimatedSprite.\n *\n * Sprite sheets can be packed using tools like {@link https://codeandweb.com/texturepacker|TexturePacker},\n * {@link https://renderhjs.net/shoebox/|Shoebox} or {@link https://github.com/krzysztof-o/spritesheet.js|Spritesheet.js}.\n * Default anchor points (see {@link PIXI.Texture#defaultAnchor}) and grouping of animation sprites are currently only\n * supported by TexturePacker.\n * @memberof PIXI\n */\nvar Spritesheet = /** @class */ (function () {\n /**\n * @param texture - Reference to the source BaseTexture object.\n * @param {object} data - Spritesheet image data.\n * @param resolutionFilename - The filename to consider when determining\n * the resolution of the spritesheet. If not provided, the imageUrl will\n * be used on the BaseTexture.\n */\n function Spritesheet(texture, data, resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n /** For multi-packed spritesheets, this contains a reference to all the other spritesheets it depends on. */\n this.linkedSheets = [];\n this._texture = texture instanceof Texture ? texture : null;\n this.baseTexture = texture instanceof BaseTexture ? texture : this._texture.baseTexture;\n this.textures = {};\n this.animations = {};\n this.data = data;\n var resource = this.baseTexture.resource;\n this.resolution = this._updateResolution(resolutionFilename || (resource ? resource.url : null));\n this._frames = this.data.frames;\n this._frameKeys = Object.keys(this._frames);\n this._batchIndex = 0;\n this._callback = null;\n }\n /**\n * Generate the resolution from the filename or fallback\n * to the meta.scale field of the JSON data.\n * @param resolutionFilename - The filename to use for resolving\n * the default resolution.\n * @returns Resolution to use for spritesheet.\n */\n Spritesheet.prototype._updateResolution = function (resolutionFilename) {\n if (resolutionFilename === void 0) { resolutionFilename = null; }\n var scale = this.data.meta.scale;\n // Use a defaultValue of `null` to check if a url-based resolution is set\n var resolution = getResolutionOfUrl(resolutionFilename, null);\n // No resolution found via URL\n if (resolution === null) {\n // Use the scale value or default to 1\n resolution = scale !== undefined ? parseFloat(scale) : 1;\n }\n // For non-1 resolutions, update baseTexture\n if (resolution !== 1) {\n this.baseTexture.setResolution(resolution);\n }\n return resolution;\n };\n /** @ignore */\n Spritesheet.prototype.parse = function (callback) {\n var _this = this;\n if (callback) {\n deprecation('6.5.0', 'Spritesheet.parse callback is deprecated, use the return Promise instead.');\n }\n return new Promise(function (resolve) {\n _this._callback = function (textures) {\n callback === null || callback === void 0 ? void 0 : callback(textures);\n resolve(textures);\n };\n _this._batchIndex = 0;\n if (_this._frameKeys.length <= Spritesheet.BATCH_SIZE) {\n _this._processFrames(0);\n _this._processAnimations();\n _this._parseComplete();\n }\n else {\n _this._nextBatch();\n }\n });\n };\n /**\n * Process a batch of frames\n * @param initialFrameIndex - The index of frame to start.\n */\n Spritesheet.prototype._processFrames = function (initialFrameIndex) {\n var frameIndex = initialFrameIndex;\n var maxFrames = Spritesheet.BATCH_SIZE;\n while (frameIndex - initialFrameIndex < maxFrames && frameIndex < this._frameKeys.length) {\n var i = this._frameKeys[frameIndex];\n var data = this._frames[i];\n var rect = data.frame;\n if (rect) {\n var frame = null;\n var trim = null;\n var sourceSize = data.trimmed !== false && data.sourceSize\n ? data.sourceSize : data.frame;\n var orig = new Rectangle(0, 0, Math.floor(sourceSize.w) / this.resolution, Math.floor(sourceSize.h) / this.resolution);\n if (data.rotated) {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.h) / this.resolution, Math.floor(rect.w) / this.resolution);\n }\n else {\n frame = new Rectangle(Math.floor(rect.x) / this.resolution, Math.floor(rect.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n // Check to see if the sprite is trimmed\n if (data.trimmed !== false && data.spriteSourceSize) {\n trim = new Rectangle(Math.floor(data.spriteSourceSize.x) / this.resolution, Math.floor(data.spriteSourceSize.y) / this.resolution, Math.floor(rect.w) / this.resolution, Math.floor(rect.h) / this.resolution);\n }\n this.textures[i] = new Texture(this.baseTexture, frame, orig, trim, data.rotated ? 2 : 0, data.anchor);\n // lets also add the frame to pixi's global cache for 'from' and 'fromLoader' functions\n Texture.addToCache(this.textures[i], i);\n }\n frameIndex++;\n }\n };\n /** Parse animations config. */\n Spritesheet.prototype._processAnimations = function () {\n var animations = this.data.animations || {};\n for (var animName in animations) {\n this.animations[animName] = [];\n for (var i = 0; i < animations[animName].length; i++) {\n var frameName = animations[animName][i];\n this.animations[animName].push(this.textures[frameName]);\n }\n }\n };\n /** The parse has completed. */\n Spritesheet.prototype._parseComplete = function () {\n var callback = this._callback;\n this._callback = null;\n this._batchIndex = 0;\n callback.call(this, this.textures);\n };\n /** Begin the next batch of textures. */\n Spritesheet.prototype._nextBatch = function () {\n var _this = this;\n this._processFrames(this._batchIndex * Spritesheet.BATCH_SIZE);\n this._batchIndex++;\n setTimeout(function () {\n if (_this._batchIndex * Spritesheet.BATCH_SIZE < _this._frameKeys.length) {\n _this._nextBatch();\n }\n else {\n _this._processAnimations();\n _this._parseComplete();\n }\n }, 0);\n };\n /**\n * Destroy Spritesheet and don't use after this.\n * @param {boolean} [destroyBase=false] - Whether to destroy the base texture as well\n */\n Spritesheet.prototype.destroy = function (destroyBase) {\n var _a;\n if (destroyBase === void 0) { destroyBase = false; }\n for (var i in this.textures) {\n this.textures[i].destroy();\n }\n this._frames = null;\n this._frameKeys = null;\n this.data = null;\n this.textures = null;\n if (destroyBase) {\n (_a = this._texture) === null || _a === void 0 ? void 0 : _a.destroy();\n this.baseTexture.destroy();\n }\n this._texture = null;\n this.baseTexture = null;\n this.linkedSheets = [];\n };\n /** The maximum number of Textures to build per process. */\n Spritesheet.BATCH_SIZE = 1000;\n return Spritesheet;\n}());\n/**\n * Reference to Spritesheet object created.\n * @member {PIXI.Spritesheet} spritesheet\n * @memberof PIXI.LoaderResource\n * @instance\n */\n/**\n * Dictionary of textures from Spritesheet.\n * @member {Object<string, PIXI.Texture>} textures\n * @memberof PIXI.LoaderResource\n * @instance\n */\n\n/**\n * {@link PIXI.Loader} middleware for loading texture atlases that have been created with\n * TexturePacker or similar JSON-based spritesheet.\n *\n * This middleware automatically generates Texture resources.\n *\n * If you're using Webpack or other bundlers and plan on bundling the atlas' JSON,\n * use the {@link PIXI.Spritesheet} class to directly parse the JSON.\n *\n * The Loader's image Resource name is automatically appended with `\"_image\"`.\n * If a Resource with this name is already loaded, the Loader will skip parsing the\n * Spritesheet. The code below will generate an internal Loader Resource called `\"myatlas_image\"`.\n * @example\n * loader.add('myatlas', 'path/to/myatlas.json');\n * loader.load(() => {\n * loader.resources.myatlas; // atlas JSON resource\n * loader.resources.myatlas_image; // atlas Image resource\n * });\n * @memberof PIXI\n */\nvar SpritesheetLoader = /** @class */ (function () {\n function SpritesheetLoader() {\n }\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param resource\n * @param next\n */\n SpritesheetLoader.use = function (resource, next) {\n var _a, _b;\n // because this is middleware, it execute in loader context. `this` = loader\n var loader = this;\n var imageResourceName = resource.name + \"_image\";\n // skip if no data, its not json, it isn't spritesheet data, or the image resource already exists\n if (!resource.data\n || resource.type !== LoaderResource.TYPE.JSON\n || !resource.data.frames\n || loader.resources[imageResourceName]) {\n next();\n return;\n }\n // Check and add the multi atlas\n // Heavily influenced and based on https://github.com/rocket-ua/pixi-tps-loader/blob/master/src/ResourceLoader.js\n // eslint-disable-next-line camelcase\n var multiPacks = (_b = (_a = resource.data) === null || _a === void 0 ? void 0 : _a.meta) === null || _b === void 0 ? void 0 : _b.related_multi_packs;\n if (Array.isArray(multiPacks)) {\n var _loop_1 = function (item) {\n if (typeof item !== 'string') {\n return \"continue\";\n }\n var itemName = item.replace('.json', '');\n var itemUrl = url.resolve(resource.url.replace(loader.baseUrl, ''), item);\n // Check if the file wasn't already added as multipacks are redundant\n if (loader.resources[itemName]\n || Object.values(loader.resources).some(function (r) { return url.format(url.parse(r.url)) === itemUrl; })) {\n return \"continue\";\n }\n var options = {\n crossOrigin: resource.crossOrigin,\n loadType: LoaderResource.LOAD_TYPE.XHR,\n xhrType: LoaderResource.XHR_RESPONSE_TYPE.JSON,\n parentResource: resource,\n metadata: resource.metadata\n };\n loader.add(itemName, itemUrl, options);\n };\n for (var _i = 0, multiPacks_1 = multiPacks; _i < multiPacks_1.length; _i++) {\n var item = multiPacks_1[_i];\n _loop_1(item);\n }\n }\n var loadOptions = {\n crossOrigin: resource.crossOrigin,\n metadata: resource.metadata.imageMetadata,\n parentResource: resource,\n };\n var resourcePath = SpritesheetLoader.getResourcePath(resource, loader.baseUrl);\n // load the image for this sheet\n loader.add(imageResourceName, resourcePath, loadOptions, function onImageLoad(res) {\n if (res.error) {\n next(res.error);\n return;\n }\n var spritesheet = new Spritesheet(res.texture, resource.data, resource.url);\n spritesheet.parse().then(function () {\n resource.spritesheet = spritesheet;\n resource.textures = spritesheet.textures;\n next();\n });\n });\n };\n /**\n * Get the spritesheets root path\n * @param resource - Resource to check path\n * @param baseUrl - Base root url\n */\n SpritesheetLoader.getResourcePath = function (resource, baseUrl) {\n // Prepend url path unless the resource image is a data url\n if (resource.isDataUrl) {\n return resource.data.meta.image;\n }\n return url.resolve(resource.url.replace(baseUrl, ''), resource.data.meta.image);\n };\n /** @ignore */\n SpritesheetLoader.extension = ExtensionType.Loader;\n return SpritesheetLoader;\n}());\n\nexport { Spritesheet, SpritesheetLoader };\n//# sourceMappingURL=spritesheet.mjs.map\n","/*!\n * @pixi/sprite-tiling - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/sprite-tiling is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, TextureMatrix, Shader, ExtensionType, QuadUv, State, ObjectRenderer } from '@pixi/core';\nimport { Point, Rectangle, Transform, Matrix } from '@pixi/math';\nimport { Sprite } from '@pixi/sprite';\nimport { WRAP_MODES } from '@pixi/constants';\nimport { premultiplyTintToRgba, correctBlendMode } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar tempPoint = new Point();\n/**\n * A tiling sprite is a fast way of rendering a tiling image.\n * @memberof PIXI\n */\nvar TilingSprite = /** @class */ (function (_super) {\n __extends(TilingSprite, _super);\n /**\n * @param texture - The texture of the tiling sprite.\n * @param width - The width of the tiling sprite.\n * @param height - The height of the tiling sprite.\n */\n function TilingSprite(texture, width, height) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n var _this = _super.call(this, texture) || this;\n _this.tileTransform = new Transform();\n // The width of the tiling sprite\n _this._width = width;\n // The height of the tiling sprite\n _this._height = height;\n _this.uvMatrix = _this.texture.uvMatrix || new TextureMatrix(texture);\n /**\n * Plugin that is responsible for rendering this element.\n * Allows to customize the rendering process without overriding '_render' method.\n * @default 'tilingSprite'\n */\n _this.pluginName = 'tilingSprite';\n _this.uvRespectAnchor = false;\n return _this;\n }\n Object.defineProperty(TilingSprite.prototype, \"clampMargin\", {\n /**\n * Changes frame clamping in corresponding textureTransform, shortcut\n * Change to -0.5 to add a pixel to the edge, recommended for transparent trimmed textures in atlas\n * @default 0.5\n * @member {number}\n */\n get: function () {\n return this.uvMatrix.clampMargin;\n },\n set: function (value) {\n this.uvMatrix.clampMargin = value;\n this.uvMatrix.update(true);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tileScale\", {\n /** The scaling of the image that is being tiled. */\n get: function () {\n return this.tileTransform.scale;\n },\n set: function (value) {\n this.tileTransform.scale.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"tilePosition\", {\n /** The offset of the image that is being tiled. */\n get: function () {\n return this.tileTransform.position;\n },\n set: function (value) {\n this.tileTransform.position.copyFrom(value);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * @protected\n */\n TilingSprite.prototype._onTextureUpdate = function () {\n if (this.uvMatrix) {\n this.uvMatrix.texture = this._texture;\n }\n this._cachedTint = 0xFFFFFF;\n };\n /**\n * Renders the object using the WebGL renderer\n * @param renderer - The renderer\n */\n TilingSprite.prototype._render = function (renderer) {\n // tweak our texture temporarily..\n var texture = this._texture;\n if (!texture || !texture.valid) {\n return;\n }\n this.tileTransform.updateLocalTransform();\n this.uvMatrix.update();\n renderer.batch.setObjectRenderer(renderer.plugins[this.pluginName]);\n renderer.plugins[this.pluginName].render(this);\n };\n /** Updates the bounds of the tiling sprite. */\n TilingSprite.prototype._calculateBounds = function () {\n var minX = this._width * -this._anchor._x;\n var minY = this._height * -this._anchor._y;\n var maxX = this._width * (1 - this._anchor._x);\n var maxY = this._height * (1 - this._anchor._y);\n this._bounds.addFrame(this.transform, minX, minY, maxX, maxY);\n };\n /**\n * Gets the local bounds of the sprite object.\n * @param rect - Optional output rectangle.\n * @returns The bounds.\n */\n TilingSprite.prototype.getLocalBounds = function (rect) {\n // we can do a fast local bounds if the sprite has no children!\n if (this.children.length === 0) {\n this._bounds.minX = this._width * -this._anchor._x;\n this._bounds.minY = this._height * -this._anchor._y;\n this._bounds.maxX = this._width * (1 - this._anchor._x);\n this._bounds.maxY = this._height * (1 - this._anchor._y);\n if (!rect) {\n if (!this._localBoundsRect) {\n this._localBoundsRect = new Rectangle();\n }\n rect = this._localBoundsRect;\n }\n return this._bounds.getRectangle(rect);\n }\n return _super.prototype.getLocalBounds.call(this, rect);\n };\n /**\n * Checks if a point is inside this tiling sprite.\n * @param point - The point to check.\n * @returns Whether or not the sprite contains the point.\n */\n TilingSprite.prototype.containsPoint = function (point) {\n this.worldTransform.applyInverse(point, tempPoint);\n var width = this._width;\n var height = this._height;\n var x1 = -width * this.anchor._x;\n if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {\n var y1 = -height * this.anchor._y;\n if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {\n return true;\n }\n }\n return false;\n };\n /**\n * Destroys this sprite and optionally its texture and children\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [options.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well\n */\n TilingSprite.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n this.tileTransform = null;\n this.uvMatrix = null;\n };\n /**\n * Helper function that creates a new tiling sprite based on the source you provide.\n * The source can be - frame id, image url, video url, canvas element, video element, base texture\n * @static\n * @param {string|PIXI.Texture|HTMLCanvasElement|HTMLVideoElement} source - Source to create texture from\n * @param {object} options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {number} options.width - required width of the tiling sprite\n * @param {number} options.height - required height of the tiling sprite\n * @returns {PIXI.TilingSprite} The newly created texture\n */\n TilingSprite.from = function (source, options) {\n var texture = (source instanceof Texture)\n ? source\n : Texture.from(source, options);\n return new TilingSprite(texture, options.width, options.height);\n };\n Object.defineProperty(TilingSprite.prototype, \"width\", {\n /** The width of the sprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TilingSprite.prototype, \"height\", {\n /** The height of the TilingSprite, setting this will actually modify the scale to achieve the value set. */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n },\n enumerable: false,\n configurable: true\n });\n return TilingSprite;\n}(Sprite));\n\nvar fragmentSimpleSrc = \"#version 100\\n#define SHADER_NAME Tiling-Sprite-Simple-100\\n\\nprecision lowp float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\n\\nvoid main(void)\\n{\\n vec4 texSample = texture2D(uSampler, vTextureCoord);\\n gl_FragColor = texSample * uColor;\\n}\\n\";\n\nvar gl1VertexSrc = \"#version 100\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nattribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n\";\n\nvar gl1FragmentSrc = \"#version 100\\n#ifdef GL_EXT_shader_texture_lod\\n #extension GL_EXT_shader_texture_lod : enable\\n#endif\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n vec2 unclamped = coord;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n #ifdef GL_EXT_shader_texture_lod\\n vec4 texSample = unclamped == coord\\n ? texture2D(uSampler, coord) \\n : texture2DLodEXT(uSampler, coord, 0);\\n #else\\n vec4 texSample = texture2D(uSampler, coord);\\n #endif\\n\\n gl_FragColor = texSample * uColor;\\n}\\n\";\n\nvar gl2VertexSrc = \"#version 300 es\\n#define SHADER_NAME Tiling-Sprite-300\\n\\nprecision lowp float;\\n\\nin vec2 aVertexPosition;\\nin vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTransform;\\n\\nout vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\\n}\\n\";\n\nvar gl2FragmentSrc = \"#version 300 es\\n#define SHADER_NAME Tiling-Sprite-100\\n\\nprecision lowp float;\\n\\nin vec2 vTextureCoord;\\n\\nout vec4 fragmentColor;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 uColor;\\nuniform mat3 uMapCoord;\\nuniform vec4 uClampFrame;\\nuniform vec2 uClampOffset;\\n\\nvoid main(void)\\n{\\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\\n vec2 unclamped = coord;\\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\\n\\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\\n\\n fragmentColor = texSample * uColor;\\n}\\n\";\n\nvar tempMat = new Matrix();\n/**\n * WebGL renderer plugin for tiling sprites\n * @class\n * @memberof PIXI\n * @extends PIXI.ObjectRenderer\n */\nvar TilingSpriteRenderer = /** @class */ (function (_super) {\n __extends(TilingSpriteRenderer, _super);\n /**\n * constructor for renderer\n * @param {PIXI.Renderer} renderer - The renderer this tiling awesomeness works for.\n */\n function TilingSpriteRenderer(renderer) {\n var _this = _super.call(this, renderer) || this;\n // WebGL version is not available during initialization!\n renderer.runners.contextChange.add(_this);\n _this.quad = new QuadUv();\n /**\n * The WebGL state in which this renderer will work.\n * @member {PIXI.State}\n * @readonly\n */\n _this.state = State.for2d();\n return _this;\n }\n /** Creates shaders when context is initialized. */\n TilingSpriteRenderer.prototype.contextChange = function () {\n var renderer = this.renderer;\n var uniforms = { globals: renderer.globalUniforms };\n this.simpleShader = Shader.from(gl1VertexSrc, fragmentSimpleSrc, uniforms);\n this.shader = renderer.context.webGLVersion > 1\n ? Shader.from(gl2VertexSrc, gl2FragmentSrc, uniforms)\n : Shader.from(gl1VertexSrc, gl1FragmentSrc, uniforms);\n };\n /**\n * @param {PIXI.TilingSprite} ts - tilingSprite to be rendered\n */\n TilingSpriteRenderer.prototype.render = function (ts) {\n var renderer = this.renderer;\n var quad = this.quad;\n var vertices = quad.vertices;\n vertices[0] = vertices[6] = (ts._width) * -ts.anchor.x;\n vertices[1] = vertices[3] = ts._height * -ts.anchor.y;\n vertices[2] = vertices[4] = (ts._width) * (1.0 - ts.anchor.x);\n vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);\n var anchorX = ts.uvRespectAnchor ? ts.anchor.x : 0;\n var anchorY = ts.uvRespectAnchor ? ts.anchor.y : 0;\n vertices = quad.uvs;\n vertices[0] = vertices[6] = -anchorX;\n vertices[1] = vertices[3] = -anchorY;\n vertices[2] = vertices[4] = 1.0 - anchorX;\n vertices[5] = vertices[7] = 1.0 - anchorY;\n quad.invalidate();\n var tex = ts._texture;\n var baseTex = tex.baseTexture;\n var premultiplied = baseTex.alphaMode > 0;\n var lt = ts.tileTransform.localTransform;\n var uv = ts.uvMatrix;\n var isSimple = baseTex.isPowerOfTwo\n && tex.frame.width === baseTex.width && tex.frame.height === baseTex.height;\n // auto, force repeat wrapMode for big tiling textures\n if (isSimple) {\n if (!baseTex._glTextures[renderer.CONTEXT_UID]) {\n if (baseTex.wrapMode === WRAP_MODES.CLAMP) {\n baseTex.wrapMode = WRAP_MODES.REPEAT;\n }\n }\n else {\n isSimple = baseTex.wrapMode !== WRAP_MODES.CLAMP;\n }\n }\n var shader = isSimple ? this.simpleShader : this.shader;\n var w = tex.width;\n var h = tex.height;\n var W = ts._width;\n var H = ts._height;\n tempMat.set(lt.a * w / W, lt.b * w / H, lt.c * h / W, lt.d * h / H, lt.tx / W, lt.ty / H);\n // that part is the same as above:\n // tempMat.identity();\n // tempMat.scale(tex.width, tex.height);\n // tempMat.prepend(lt);\n // tempMat.scale(1.0 / ts._width, 1.0 / ts._height);\n tempMat.invert();\n if (isSimple) {\n tempMat.prepend(uv.mapCoord);\n }\n else {\n shader.uniforms.uMapCoord = uv.mapCoord.toArray(true);\n shader.uniforms.uClampFrame = uv.uClampFrame;\n shader.uniforms.uClampOffset = uv.uClampOffset;\n }\n shader.uniforms.uTransform = tempMat.toArray(true);\n shader.uniforms.uColor = premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, premultiplied);\n shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);\n shader.uniforms.uSampler = tex;\n renderer.shader.bind(shader);\n renderer.geometry.bind(quad);\n this.state.blendMode = correctBlendMode(ts.blendMode, premultiplied);\n renderer.state.set(this.state);\n renderer.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);\n };\n /** @ignore */\n TilingSpriteRenderer.extension = {\n name: 'tilingSprite',\n type: ExtensionType.RendererPlugin,\n };\n return TilingSpriteRenderer;\n}(ObjectRenderer));\n\nexport { TilingSprite, TilingSpriteRenderer };\n//# sourceMappingURL=sprite-tiling.mjs.map\n","/*!\n * @pixi/mesh - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mesh is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { State, Program, TextureMatrix, Shader, Buffer, Geometry } from '@pixi/core';\nimport { Point, Polygon, Matrix } from '@pixi/math';\nimport { DRAW_MODES, TYPES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { settings } from '@pixi/settings';\nimport { premultiplyTintToRgba } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * Class controls cache for UV mapping from Texture normal space to BaseTexture normal space.\n * @memberof PIXI\n */\nvar MeshBatchUvs = /** @class */ (function () {\n /**\n * @param uvBuffer - Buffer with normalized uv's\n * @param uvMatrix - Material UV matrix\n */\n function MeshBatchUvs(uvBuffer, uvMatrix) {\n this.uvBuffer = uvBuffer;\n this.uvMatrix = uvMatrix;\n this.data = null;\n this._bufferUpdateId = -1;\n this._textureUpdateId = -1;\n this._updateID = 0;\n }\n /**\n * Updates\n * @param forceUpdate - force the update\n */\n MeshBatchUvs.prototype.update = function (forceUpdate) {\n if (!forceUpdate\n && this._bufferUpdateId === this.uvBuffer._updateID\n && this._textureUpdateId === this.uvMatrix._updateID) {\n return;\n }\n this._bufferUpdateId = this.uvBuffer._updateID;\n this._textureUpdateId = this.uvMatrix._updateID;\n var data = this.uvBuffer.data;\n if (!this.data || this.data.length !== data.length) {\n this.data = new Float32Array(data.length);\n }\n this.uvMatrix.multiplyUvs(data, this.data);\n this._updateID++;\n };\n return MeshBatchUvs;\n}());\n\nvar tempPoint = new Point();\nvar tempPolygon = new Polygon();\n/**\n * Base mesh class.\n *\n * This class empowers you to have maximum flexibility to render any kind of WebGL visuals you can think of.\n * This class assumes a certain level of WebGL knowledge.\n * If you know a bit this should abstract enough away to make your life easier!\n *\n * Pretty much ALL WebGL can be broken down into the following:\n * - Geometry - The structure and data for the mesh. This can include anything from positions, uvs, normals, colors etc..\n * - Shader - This is the shader that PixiJS will render the geometry with (attributes in the shader must match the geometry)\n * - State - This is the state of WebGL required to render the mesh.\n *\n * Through a combination of the above elements you can render anything you want, 2D or 3D!\n * @memberof PIXI\n */\nvar Mesh = /** @class */ (function (_super) {\n __extends(Mesh, _super);\n /**\n * @param geometry - The geometry the mesh will use.\n * @param {PIXI.MeshMaterial} shader - The shader the mesh will use.\n * @param state - The state that the WebGL context is required to be in to render the mesh\n * if no state is provided, uses {@link PIXI.State.for2d} to create a 2D state for PixiJS.\n * @param drawMode - The drawMode, can be any of the {@link PIXI.DRAW_MODES} constants.\n */\n function Mesh(geometry, shader, state, drawMode) {\n if (drawMode === void 0) { drawMode = DRAW_MODES.TRIANGLES; }\n var _this = _super.call(this) || this;\n _this.geometry = geometry;\n _this.shader = shader;\n _this.state = state || State.for2d();\n _this.drawMode = drawMode;\n _this.start = 0;\n _this.size = 0;\n _this.uvs = null;\n _this.indices = null;\n _this.vertexData = new Float32Array(1);\n _this.vertexDirty = -1;\n _this._transformID = -1;\n _this._roundPixels = settings.ROUND_PIXELS;\n _this.batchUvs = null;\n return _this;\n }\n Object.defineProperty(Mesh.prototype, \"geometry\", {\n /**\n * Includes vertex positions, face indices, normals, colors, UVs, and\n * custom attributes within buffers, reducing the cost of passing all\n * this data to the GPU. Can be shared between multiple Mesh objects.\n */\n get: function () {\n return this._geometry;\n },\n set: function (value) {\n if (this._geometry === value) {\n return;\n }\n if (this._geometry) {\n this._geometry.refCount--;\n if (this._geometry.refCount === 0) {\n this._geometry.dispose();\n }\n }\n this._geometry = value;\n if (this._geometry) {\n this._geometry.refCount++;\n }\n this.vertexDirty = -1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"uvBuffer\", {\n /**\n * To change mesh uv's, change its uvBuffer data and increment its _updateID.\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"verticesBuffer\", {\n /**\n * To change mesh vertices, change its uvBuffer data and increment its _updateID.\n * Incrementing _updateID is optional because most of Mesh objects do it anyway.\n * @readonly\n */\n get: function () {\n return this.geometry.buffers[0];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"material\", {\n get: function () {\n return this.shader;\n },\n /** Alias for {@link PIXI.Mesh#shader}. */\n set: function (value) {\n this.shader = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"blendMode\", {\n get: function () {\n return this.state.blendMode;\n },\n /**\n * The blend mode to be applied to the Mesh. Apply a value of\n * `PIXI.BLEND_MODES.NORMAL` to reset the blend mode.\n * @default PIXI.BLEND_MODES.NORMAL;\n */\n set: function (value) {\n this.state.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"roundPixels\", {\n get: function () {\n return this._roundPixels;\n },\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n * @default false\n */\n set: function (value) {\n if (this._roundPixels !== value) {\n this._transformID = -1;\n }\n this._roundPixels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"tint\", {\n /**\n * The multiply tint applied to the Mesh. This is a hex value. A value of\n * `0xFFFFFF` will remove any tint effect.\n *\n * Null for non-MeshMaterial shaders\n * @default 0xFFFFFF\n */\n get: function () {\n return 'tint' in this.shader ? this.shader.tint : null;\n },\n set: function (value) {\n this.shader.tint = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Mesh.prototype, \"texture\", {\n /** The texture that the Mesh uses. Null for non-MeshMaterial shaders */\n get: function () {\n return 'texture' in this.shader ? this.shader.texture : null;\n },\n set: function (value) {\n this.shader.texture = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Standard renderer draw.\n * @param renderer - Instance to renderer.\n */\n Mesh.prototype._render = function (renderer) {\n // set properties for batching..\n // TODO could use a different way to grab verts?\n var vertices = this.geometry.buffers[0].data;\n var shader = this.shader;\n // TODO benchmark check for attribute size..\n if (shader.batchable\n && this.drawMode === DRAW_MODES.TRIANGLES\n && vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n this._renderToBatch(renderer);\n }\n else {\n this._renderDefault(renderer);\n }\n };\n /**\n * Standard non-batching way of rendering.\n * @param renderer - Instance to renderer.\n */\n Mesh.prototype._renderDefault = function (renderer) {\n var shader = this.shader;\n shader.alpha = this.worldAlpha;\n if (shader.update) {\n shader.update();\n }\n renderer.batch.flush();\n // bind and sync uniforms..\n shader.uniforms.translationMatrix = this.transform.worldTransform.toArray(true);\n renderer.shader.bind(shader);\n // set state..\n renderer.state.set(this.state);\n // bind the geometry...\n renderer.geometry.bind(this.geometry, shader);\n // then render it\n renderer.geometry.draw(this.drawMode, this.size, this.start, this.geometry.instanceCount);\n };\n /**\n * Rendering by using the Batch system.\n * @param renderer - Instance to renderer.\n */\n Mesh.prototype._renderToBatch = function (renderer) {\n var geometry = this.geometry;\n var shader = this.shader;\n if (shader.uvMatrix) {\n shader.uvMatrix.update();\n this.calculateUvs();\n }\n // set properties for batching..\n this.calculateVertices();\n this.indices = geometry.indexBuffer.data;\n this._tintRGB = shader._tintRGB;\n this._texture = shader.texture;\n var pluginName = this.material.pluginName;\n renderer.batch.setObjectRenderer(renderer.plugins[pluginName]);\n renderer.plugins[pluginName].render(this);\n };\n /** Updates vertexData field based on transform and vertices. */\n Mesh.prototype.calculateVertices = function () {\n var geometry = this.geometry;\n var verticesBuffer = geometry.buffers[0];\n var vertices = verticesBuffer.data;\n var vertexDirtyId = verticesBuffer._updateID;\n if (vertexDirtyId === this.vertexDirty && this._transformID === this.transform._worldID) {\n return;\n }\n this._transformID = this.transform._worldID;\n if (this.vertexData.length !== vertices.length) {\n this.vertexData = new Float32Array(vertices.length);\n }\n var wt = this.transform.worldTransform;\n var a = wt.a;\n var b = wt.b;\n var c = wt.c;\n var d = wt.d;\n var tx = wt.tx;\n var ty = wt.ty;\n var vertexData = this.vertexData;\n for (var i = 0; i < vertexData.length / 2; i++) {\n var x = vertices[(i * 2)];\n var y = vertices[(i * 2) + 1];\n vertexData[(i * 2)] = (a * x) + (c * y) + tx;\n vertexData[(i * 2) + 1] = (b * x) + (d * y) + ty;\n }\n if (this._roundPixels) {\n var resolution = settings.RESOLUTION;\n for (var i = 0; i < vertexData.length; ++i) {\n vertexData[i] = Math.round((vertexData[i] * resolution | 0) / resolution);\n }\n }\n this.vertexDirty = vertexDirtyId;\n };\n /** Updates uv field based on from geometry uv's or batchUvs. */\n Mesh.prototype.calculateUvs = function () {\n var geomUvs = this.geometry.buffers[1];\n var shader = this.shader;\n if (!shader.uvMatrix.isSimple) {\n if (!this.batchUvs) {\n this.batchUvs = new MeshBatchUvs(geomUvs, shader.uvMatrix);\n }\n this.batchUvs.update();\n this.uvs = this.batchUvs.data;\n }\n else {\n this.uvs = geomUvs.data;\n }\n };\n /**\n * Updates the bounds of the mesh as a rectangle. The bounds calculation takes the worldTransform into account.\n * there must be a aVertexPosition attribute present in the geometry for bounds to be calculated correctly.\n */\n Mesh.prototype._calculateBounds = function () {\n this.calculateVertices();\n this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length);\n };\n /**\n * Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.\n * @param point - The point to test.\n * @returns - The result of the test.\n */\n Mesh.prototype.containsPoint = function (point) {\n if (!this.getBounds().contains(point.x, point.y)) {\n return false;\n }\n this.worldTransform.applyInverse(point, tempPoint);\n var vertices = this.geometry.getBuffer('aVertexPosition').data;\n var points = tempPolygon.points;\n var indices = this.geometry.getIndex().data;\n var len = indices.length;\n var step = this.drawMode === 4 ? 3 : 1;\n for (var i = 0; i + 2 < len; i += step) {\n var ind0 = indices[i] * 2;\n var ind1 = indices[i + 1] * 2;\n var ind2 = indices[i + 2] * 2;\n points[0] = vertices[ind0];\n points[1] = vertices[ind0 + 1];\n points[2] = vertices[ind1];\n points[3] = vertices[ind1 + 1];\n points[4] = vertices[ind2];\n points[5] = vertices[ind2 + 1];\n if (tempPolygon.contains(tempPoint.x, tempPoint.y)) {\n return true;\n }\n }\n return false;\n };\n Mesh.prototype.destroy = function (options) {\n _super.prototype.destroy.call(this, options);\n if (this._cachedTexture) {\n this._cachedTexture.destroy();\n this._cachedTexture = null;\n }\n this.geometry = null;\n this.shader = null;\n this.state = null;\n this.uvs = null;\n this.indices = null;\n this.vertexData = null;\n };\n /** The maximum number of vertices to consider batchable. Generally, the complexity of the geometry. */\n Mesh.BATCHABLE_SIZE = 100;\n return Mesh;\n}(Container));\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform vec4 uColor;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\\n}\\n\";\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 translationMatrix;\\nuniform mat3 uTextureMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n\\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\\n}\\n\";\n\n/**\n * Slightly opinionated default shader for PixiJS 2D objects.\n * @memberof PIXI\n */\nvar MeshMaterial = /** @class */ (function (_super) {\n __extends(MeshMaterial, _super);\n /**\n * @param uSampler - Texture that material uses to render.\n * @param options - Additional options\n * @param {number} [options.alpha=1] - Default alpha.\n * @param {number} [options.tint=0xFFFFFF] - Default tint.\n * @param {string} [options.pluginName='batch'] - Renderer plugin for batching.\n * @param {PIXI.Program} [options.program=0xFFFFFF] - Custom program.\n * @param {object} [options.uniforms] - Custom uniforms.\n */\n function MeshMaterial(uSampler, options) {\n var _this = this;\n var uniforms = {\n uSampler: uSampler,\n alpha: 1,\n uTextureMatrix: Matrix.IDENTITY,\n uColor: new Float32Array([1, 1, 1, 1]),\n };\n // Set defaults\n options = Object.assign({\n tint: 0xFFFFFF,\n alpha: 1,\n pluginName: 'batch',\n }, options);\n if (options.uniforms) {\n Object.assign(uniforms, options.uniforms);\n }\n _this = _super.call(this, options.program || Program.from(vertex, fragment), uniforms) || this;\n _this._colorDirty = false;\n _this.uvMatrix = new TextureMatrix(uSampler);\n _this.batchable = options.program === undefined;\n _this.pluginName = options.pluginName;\n _this.tint = options.tint;\n _this.alpha = options.alpha;\n return _this;\n }\n Object.defineProperty(MeshMaterial.prototype, \"texture\", {\n /** Reference to the texture being rendered. */\n get: function () {\n return this.uniforms.uSampler;\n },\n set: function (value) {\n if (this.uniforms.uSampler !== value) {\n if (!this.uniforms.uSampler.baseTexture.alphaMode !== !value.baseTexture.alphaMode) {\n this._colorDirty = true;\n }\n this.uniforms.uSampler = value;\n this.uvMatrix.texture = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"alpha\", {\n get: function () {\n return this._alpha;\n },\n /**\n * This gets automatically set by the object using this.\n * @default 1\n */\n set: function (value) {\n if (value === this._alpha)\n { return; }\n this._alpha = value;\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MeshMaterial.prototype, \"tint\", {\n get: function () {\n return this._tint;\n },\n /**\n * Multiply tint for the material.\n * @default 0xFFFFFF\n */\n set: function (value) {\n if (value === this._tint)\n { return; }\n this._tint = value;\n this._tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n this._colorDirty = true;\n },\n enumerable: false,\n configurable: true\n });\n /** Gets called automatically by the Mesh. Intended to be overridden for custom {@link MeshMaterial} objects. */\n MeshMaterial.prototype.update = function () {\n if (this._colorDirty) {\n this._colorDirty = false;\n var baseTexture = this.texture.baseTexture;\n premultiplyTintToRgba(this._tint, this._alpha, this.uniforms.uColor, baseTexture.alphaMode);\n }\n if (this.uvMatrix.update()) {\n this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord;\n }\n };\n return MeshMaterial;\n}(Shader));\n\n/**\n * Standard 2D geometry used in PixiJS.\n *\n * Geometry can be defined without passing in a style or data if required.\n *\n * ```js\n * const geometry = new PIXI.Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0,0,1,0,1,1,0,1], 2);\n * geometry.addIndex([0,1,2,1,3,2]);\n *\n * ```\n * @memberof PIXI\n */\nvar MeshGeometry = /** @class */ (function (_super) {\n __extends(MeshGeometry, _super);\n /**\n * @param {Float32Array|number[]} [vertices] - Positional data on geometry.\n * @param {Float32Array|number[]} [uvs] - Texture UVs.\n * @param {Uint16Array|number[]} [index] - IndexBuffer\n */\n function MeshGeometry(vertices, uvs, index) {\n var _this = _super.call(this) || this;\n var verticesBuffer = new Buffer(vertices);\n var uvsBuffer = new Buffer(uvs, true);\n var indexBuffer = new Buffer(index, true, true);\n _this.addAttribute('aVertexPosition', verticesBuffer, 2, false, TYPES.FLOAT)\n .addAttribute('aTextureCoord', uvsBuffer, 2, false, TYPES.FLOAT)\n .addIndex(indexBuffer);\n _this._updateId = -1;\n return _this;\n }\n Object.defineProperty(MeshGeometry.prototype, \"vertexDirtyId\", {\n /**\n * If the vertex position is updated.\n * @readonly\n * @private\n */\n get: function () {\n return this.buffers[0]._updateID;\n },\n enumerable: false,\n configurable: true\n });\n return MeshGeometry;\n}(Geometry));\n\nexport { Mesh, MeshBatchUvs, MeshGeometry, MeshMaterial };\n//# sourceMappingURL=mesh.mjs.map\n","/*!\n * @pixi/text-bitmap - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/text-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Rectangle, Point, ObservablePoint } from '@pixi/math';\nimport { settings } from '@pixi/settings';\nimport { MeshGeometry, MeshMaterial, Mesh } from '@pixi/mesh';\nimport { hex2rgb, string2hex, getResolutionOfUrl, removeItems } from '@pixi/utils';\nimport { BaseTexture, Texture, Program, ExtensionType } from '@pixi/core';\nimport { TEXT_GRADIENT, TextStyle, TextMetrics } from '@pixi/text';\nimport { ALPHA_MODES, MIPMAP_MODES, BLEND_MODES } from '@pixi/constants';\nimport { Container } from '@pixi/display';\nimport { LoaderResource } from '@pixi/loaders';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/* eslint-disable max-len */\n/**\n * Normalized parsed data from .fnt files.\n * @memberof PIXI\n */\nvar BitmapFontData = /** @class */ (function () {\n function BitmapFontData() {\n this.info = [];\n this.common = [];\n this.page = [];\n this.char = [];\n this.kerning = [];\n this.distanceField = [];\n }\n return BitmapFontData;\n}());\n\n/**\n * BitmapFont format that's Text-based.\n * @private\n */\nvar TextFormat = /** @class */ (function () {\n function TextFormat() {\n }\n /**\n * Check if resource refers to txt font data.\n * @param data\n * @returns - True if resource could be treated as font data, false otherwise.\n */\n TextFormat.test = function (data) {\n return typeof data === 'string' && data.indexOf('info face=') === 0;\n };\n /**\n * Convert text font data to a javascript object.\n * @param txt - Raw string data to be converted\n * @returns - Parsed font data\n */\n TextFormat.parse = function (txt) {\n // Retrieve data item\n var items = txt.match(/^[a-z]+\\s+.+$/gm);\n var rawData = {\n info: [],\n common: [],\n page: [],\n char: [],\n chars: [],\n kerning: [],\n kernings: [],\n distanceField: [],\n };\n for (var i in items) {\n // Extract item name\n var name = items[i].match(/^[a-z]+/gm)[0];\n // Extract item attribute list as string ex.: \"width=10\"\n var attributeList = items[i].match(/[a-zA-Z]+=([^\\s\"']+|\"([^\"]*)\")/gm);\n // Convert attribute list into an object\n var itemData = {};\n for (var i_1 in attributeList) {\n // Split key-value pairs\n var split = attributeList[i_1].split('=');\n var key = split[0];\n // Remove eventual quotes from value\n var strValue = split[1].replace(/\"/gm, '');\n // Try to convert value into float\n var floatValue = parseFloat(strValue);\n // Use string value case float value is NaN\n var value = isNaN(floatValue) ? strValue : floatValue;\n itemData[key] = value;\n }\n // Push current item to the resulting data\n rawData[name].push(itemData);\n }\n var font = new BitmapFontData();\n rawData.info.forEach(function (info) { return font.info.push({\n face: info.face,\n size: parseInt(info.size, 10),\n }); });\n rawData.common.forEach(function (common) { return font.common.push({\n lineHeight: parseInt(common.lineHeight, 10),\n }); });\n rawData.page.forEach(function (page) { return font.page.push({\n id: parseInt(page.id, 10),\n file: page.file,\n }); });\n rawData.char.forEach(function (char) { return font.char.push({\n id: parseInt(char.id, 10),\n page: parseInt(char.page, 10),\n x: parseInt(char.x, 10),\n y: parseInt(char.y, 10),\n width: parseInt(char.width, 10),\n height: parseInt(char.height, 10),\n xoffset: parseInt(char.xoffset, 10),\n yoffset: parseInt(char.yoffset, 10),\n xadvance: parseInt(char.xadvance, 10),\n }); });\n rawData.kerning.forEach(function (kerning) { return font.kerning.push({\n first: parseInt(kerning.first, 10),\n second: parseInt(kerning.second, 10),\n amount: parseInt(kerning.amount, 10),\n }); });\n rawData.distanceField.forEach(function (df) { return font.distanceField.push({\n distanceRange: parseInt(df.distanceRange, 10),\n fieldType: df.fieldType,\n }); });\n return font;\n };\n return TextFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n * @private\n */\nvar XMLFormat = /** @class */ (function () {\n function XMLFormat() {\n }\n /**\n * Check if resource refers to xml font data.\n * @param data\n * @returns - True if resource could be treated as font data, false otherwise.\n */\n XMLFormat.test = function (data) {\n return data instanceof XMLDocument\n && data.getElementsByTagName('page').length\n && data.getElementsByTagName('info')[0].getAttribute('face') !== null;\n };\n /**\n * Convert the XML into BitmapFontData that we can use.\n * @param xml\n * @returns - Data to use for BitmapFont\n */\n XMLFormat.parse = function (xml) {\n var data = new BitmapFontData();\n var info = xml.getElementsByTagName('info');\n var common = xml.getElementsByTagName('common');\n var page = xml.getElementsByTagName('page');\n var char = xml.getElementsByTagName('char');\n var kerning = xml.getElementsByTagName('kerning');\n var distanceField = xml.getElementsByTagName('distanceField');\n for (var i = 0; i < info.length; i++) {\n data.info.push({\n face: info[i].getAttribute('face'),\n size: parseInt(info[i].getAttribute('size'), 10),\n });\n }\n for (var i = 0; i < common.length; i++) {\n data.common.push({\n lineHeight: parseInt(common[i].getAttribute('lineHeight'), 10),\n });\n }\n for (var i = 0; i < page.length; i++) {\n data.page.push({\n id: parseInt(page[i].getAttribute('id'), 10) || 0,\n file: page[i].getAttribute('file'),\n });\n }\n for (var i = 0; i < char.length; i++) {\n var letter = char[i];\n data.char.push({\n id: parseInt(letter.getAttribute('id'), 10),\n page: parseInt(letter.getAttribute('page'), 10) || 0,\n x: parseInt(letter.getAttribute('x'), 10),\n y: parseInt(letter.getAttribute('y'), 10),\n width: parseInt(letter.getAttribute('width'), 10),\n height: parseInt(letter.getAttribute('height'), 10),\n xoffset: parseInt(letter.getAttribute('xoffset'), 10),\n yoffset: parseInt(letter.getAttribute('yoffset'), 10),\n xadvance: parseInt(letter.getAttribute('xadvance'), 10),\n });\n }\n for (var i = 0; i < kerning.length; i++) {\n data.kerning.push({\n first: parseInt(kerning[i].getAttribute('first'), 10),\n second: parseInt(kerning[i].getAttribute('second'), 10),\n amount: parseInt(kerning[i].getAttribute('amount'), 10),\n });\n }\n for (var i = 0; i < distanceField.length; i++) {\n data.distanceField.push({\n fieldType: distanceField[i].getAttribute('fieldType'),\n distanceRange: parseInt(distanceField[i].getAttribute('distanceRange'), 10),\n });\n }\n return data;\n };\n return XMLFormat;\n}());\n\n/**\n * BitmapFont format that's XML-based.\n * @private\n */\nvar XMLStringFormat = /** @class */ (function () {\n function XMLStringFormat() {\n }\n /**\n * Check if resource refers to text xml font data.\n * @param data\n * @returns - True if resource could be treated as font data, false otherwise.\n */\n XMLStringFormat.test = function (data) {\n if (typeof data === 'string' && data.indexOf('<font>') > -1) {\n var xml = new globalThis.DOMParser().parseFromString(data, 'text/xml');\n return XMLFormat.test(xml);\n }\n return false;\n };\n /**\n * Convert the text XML into BitmapFontData that we can use.\n * @param xmlTxt\n * @returns - Data to use for BitmapFont\n */\n XMLStringFormat.parse = function (xmlTxt) {\n var xml = new globalThis.DOMParser().parseFromString(xmlTxt, 'text/xml');\n return XMLFormat.parse(xml);\n };\n return XMLStringFormat;\n}());\n\n// Registered formats, maybe make this extensible in the future?\nvar formats = [\n TextFormat,\n XMLFormat,\n XMLStringFormat ];\n/**\n * Auto-detect BitmapFont parsing format based on data.\n * @private\n * @param {any} data - Data to detect format\n * @returns {any} Format or null\n */\nfunction autoDetectFormat(data) {\n for (var i = 0; i < formats.length; i++) {\n if (formats[i].test(data)) {\n return formats[i];\n }\n }\n return null;\n}\n\n// TODO: Prevent code duplication b/w generateFillStyle & Text#generateFillStyle\n/**\n * Generates the fill style. Can automatically generate a gradient based on the fill style being an array\n * @private\n * @param canvas\n * @param context\n * @param {object} style - The style.\n * @param resolution\n * @param {string[]} lines - The lines of text.\n * @param metrics\n * @returns {string|number|CanvasGradient} The fill style\n */\nfunction generateFillStyle(canvas, context, style, resolution, lines, metrics) {\n // TODO: Can't have different types for getter and setter. The getter shouldn't have the number type as\n // the setter converts to string. See this thread for more details:\n // https://github.com/microsoft/TypeScript/issues/2521\n var fillStyle = style.fill;\n if (!Array.isArray(fillStyle)) {\n return fillStyle;\n }\n else if (fillStyle.length === 1) {\n return fillStyle[0];\n }\n // the gradient will be evenly spaced out according to how large the array is.\n // ['#FF0000', '#00FF00', '#0000FF'] would created stops at 0.25, 0.5 and 0.75\n var gradient;\n // a dropshadow will enlarge the canvas and result in the gradient being\n // generated with the incorrect dimensions\n var dropShadowCorrection = (style.dropShadow) ? style.dropShadowDistance : 0;\n // should also take padding into account, padding can offset the gradient\n var padding = style.padding || 0;\n var width = (canvas.width / resolution) - dropShadowCorrection - (padding * 2);\n var height = (canvas.height / resolution) - dropShadowCorrection - (padding * 2);\n // make a copy of the style settings, so we can manipulate them later\n var fill = fillStyle.slice();\n var fillGradientStops = style.fillGradientStops.slice();\n // wanting to evenly distribute the fills. So an array of 4 colours should give fills of 0.25, 0.5 and 0.75\n if (!fillGradientStops.length) {\n var lengthPlus1 = fill.length + 1;\n for (var i = 1; i < lengthPlus1; ++i) {\n fillGradientStops.push(i / lengthPlus1);\n }\n }\n // stop the bleeding of the last gradient on the line above to the top gradient of the this line\n // by hard defining the first gradient colour at point 0, and last gradient colour at point 1\n fill.unshift(fillStyle[0]);\n fillGradientStops.unshift(0);\n fill.push(fillStyle[fillStyle.length - 1]);\n fillGradientStops.push(1);\n if (style.fillGradientType === TEXT_GRADIENT.LINEAR_VERTICAL) {\n // start the gradient at the top center of the canvas, and end at the bottom middle of the canvas\n gradient = context.createLinearGradient(width / 2, padding, width / 2, height + padding);\n // we need to repeat the gradient so that each individual line of text has the same vertical gradient effect\n // ['#FF0000', '#00FF00', '#0000FF'] over 2 lines would create stops at 0.125, 0.25, 0.375, 0.625, 0.75, 0.875\n // There's potential for floating point precision issues at the seams between gradient repeats.\n // The loop below generates the stops in order, so track the last generated one to prevent\n // floating point precision from making us go the teeniest bit backwards, resulting in\n // the first and last colors getting swapped.\n var lastIterationStop = 0;\n // Actual height of the text itself, not counting spacing for lineHeight/leading/dropShadow etc\n var textHeight = metrics.fontProperties.fontSize + style.strokeThickness;\n // textHeight, but as a 0-1 size in global gradient stop space\n var gradStopLineHeight = textHeight / height;\n for (var i = 0; i < lines.length; i++) {\n var thisLineTop = metrics.lineHeight * i;\n for (var j = 0; j < fill.length; j++) {\n // 0-1 stop point for the current line, multiplied to global space afterwards\n var lineStop = 0;\n if (typeof fillGradientStops[j] === 'number') {\n lineStop = fillGradientStops[j];\n }\n else {\n lineStop = j / fill.length;\n }\n var globalStop = (thisLineTop / height) + (lineStop * gradStopLineHeight);\n // Prevent color stop generation going backwards from floating point imprecision\n var clampedStop = Math.max(lastIterationStop, globalStop);\n clampedStop = Math.min(clampedStop, 1); // Cap at 1 as well for safety's sake to avoid a possible throw.\n gradient.addColorStop(clampedStop, fill[j]);\n lastIterationStop = clampedStop;\n }\n }\n }\n else {\n // start the gradient at the center left of the canvas, and end at the center right of the canvas\n gradient = context.createLinearGradient(padding, height / 2, width + padding, height / 2);\n // can just evenly space out the gradients in this case, as multiple lines makes no difference\n // to an even left to right gradient\n var totalIterations = fill.length + 1;\n var currentIteration = 1;\n for (var i = 0; i < fill.length; i++) {\n var stop = void 0;\n if (typeof fillGradientStops[i] === 'number') {\n stop = fillGradientStops[i];\n }\n else {\n stop = currentIteration / totalIterations;\n }\n gradient.addColorStop(stop, fill[i]);\n currentIteration++;\n }\n }\n return gradient;\n}\n\n// TODO: Prevent code duplication b/w drawGlyph & Text#updateText\n/**\n * Draws the glyph `metrics.text` on the given canvas.\n *\n * Ignored because not directly exposed.\n * @ignore\n * @param {HTMLCanvasElement} canvas\n * @param {CanvasRenderingContext2D} context\n * @param {TextMetrics} metrics\n * @param {number} x\n * @param {number} y\n * @param {number} resolution\n * @param {TextStyle} style\n */\nfunction drawGlyph(canvas, context, metrics, x, y, resolution, style) {\n var char = metrics.text;\n var fontProperties = metrics.fontProperties;\n context.translate(x, y);\n context.scale(resolution, resolution);\n var tx = style.strokeThickness / 2;\n var ty = -(style.strokeThickness / 2);\n context.font = style.toFontString();\n context.lineWidth = style.strokeThickness;\n context.textBaseline = style.textBaseline;\n context.lineJoin = style.lineJoin;\n context.miterLimit = style.miterLimit;\n // set canvas text styles\n context.fillStyle = generateFillStyle(canvas, context, style, resolution, [char], metrics);\n context.strokeStyle = style.stroke;\n if (style.dropShadow) {\n var dropShadowColor = style.dropShadowColor;\n var rgb = hex2rgb(typeof dropShadowColor === 'number' ? dropShadowColor : string2hex(dropShadowColor));\n var dropShadowBlur = style.dropShadowBlur * resolution;\n var dropShadowDistance = style.dropShadowDistance * resolution;\n context.shadowColor = \"rgba(\" + rgb[0] * 255 + \",\" + rgb[1] * 255 + \",\" + rgb[2] * 255 + \",\" + style.dropShadowAlpha + \")\";\n context.shadowBlur = dropShadowBlur;\n context.shadowOffsetX = Math.cos(style.dropShadowAngle) * dropShadowDistance;\n context.shadowOffsetY = Math.sin(style.dropShadowAngle) * dropShadowDistance;\n }\n else {\n context.shadowColor = 'black';\n context.shadowBlur = 0;\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n }\n if (style.stroke && style.strokeThickness) {\n context.strokeText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n if (style.fill) {\n context.fillText(char, tx, ty + metrics.lineHeight - fontProperties.descent);\n }\n context.setTransform(1, 0, 0, 1, 0, 0); // defaults needed for older browsers (e.g. Opera 29)\n context.fillStyle = 'rgba(0, 0, 0, 0)';\n}\n\n/**\n * Ponyfill for IE because it doesn't support `Array.from`\n * @param text\n * @private\n */\nfunction splitTextToCharacters(text) {\n return Array.from ? Array.from(text) : text.split('');\n}\n\n/**\n * Processes the passed character set data and returns a flattened array of all the characters.\n *\n * Ignored because not directly exposed.\n * @ignore\n * @param {string | string[] | string[][] } chars\n * @returns {string[]} the flattened array of characters\n */\nfunction resolveCharacters(chars) {\n // Split the chars string into individual characters\n if (typeof chars === 'string') {\n chars = [chars];\n }\n // Handle an array of characters+ranges\n var result = [];\n for (var i = 0, j = chars.length; i < j; i++) {\n var item = chars[i];\n // Handle range delimited by start/end chars\n if (Array.isArray(item)) {\n if (item.length !== 2) {\n throw new Error(\"[BitmapFont]: Invalid character range length, expecting 2 got \" + item.length + \".\");\n }\n var startCode = item[0].charCodeAt(0);\n var endCode = item[1].charCodeAt(0);\n if (endCode < startCode) {\n throw new Error('[BitmapFont]: Invalid character range.');\n }\n for (var i_1 = startCode, j_1 = endCode; i_1 <= j_1; i_1++) {\n result.push(String.fromCharCode(i_1));\n }\n }\n // Handle a character set string\n else {\n result.push.apply(result, splitTextToCharacters(item));\n }\n }\n if (result.length === 0) {\n throw new Error('[BitmapFont]: Empty set when resolving characters.');\n }\n return result;\n}\n\n/**\n * Ponyfill for IE because it doesn't support `codePointAt`\n * @param str\n * @private\n */\nfunction extractCharCode(str) {\n return str.codePointAt ? str.codePointAt(0) : str.charCodeAt(0);\n}\n\n/**\n * BitmapFont represents a typeface available for use with the BitmapText class. Use the `install`\n * method for adding a font to be used.\n * @memberof PIXI\n */\nvar BitmapFont = /** @class */ (function () {\n /**\n * @param data\n * @param textures\n * @param ownsTextures - Setting to `true` will destroy page textures\n * when the font is uninstalled.\n */\n function BitmapFont(data, textures, ownsTextures) {\n var _a, _b;\n var info = data.info[0];\n var common = data.common[0];\n var page = data.page[0];\n var distanceField = data.distanceField[0];\n var res = getResolutionOfUrl(page.file);\n var pageTextures = {};\n this._ownsTextures = ownsTextures;\n this.font = info.face;\n this.size = info.size;\n this.lineHeight = common.lineHeight / res;\n this.chars = {};\n this.pageTextures = pageTextures;\n // Convert the input Texture, Textures or object\n // into a page Texture lookup by \"id\"\n for (var i = 0; i < data.page.length; i++) {\n var _c = data.page[i], id = _c.id, file = _c.file;\n pageTextures[id] = textures instanceof Array\n ? textures[i] : textures[file];\n // only MSDF and SDF fonts need no-premultiplied-alpha\n if ((distanceField === null || distanceField === void 0 ? void 0 : distanceField.fieldType) && distanceField.fieldType !== 'none') {\n pageTextures[id].baseTexture.alphaMode = ALPHA_MODES.NO_PREMULTIPLIED_ALPHA;\n pageTextures[id].baseTexture.mipmap = MIPMAP_MODES.OFF;\n }\n }\n // parse letters\n for (var i = 0; i < data.char.length; i++) {\n var _d = data.char[i], id = _d.id, page_1 = _d.page;\n var _e = data.char[i], x = _e.x, y = _e.y, width = _e.width, height = _e.height, xoffset = _e.xoffset, yoffset = _e.yoffset, xadvance = _e.xadvance;\n x /= res;\n y /= res;\n width /= res;\n height /= res;\n xoffset /= res;\n yoffset /= res;\n xadvance /= res;\n var rect = new Rectangle(x + (pageTextures[page_1].frame.x / res), y + (pageTextures[page_1].frame.y / res), width, height);\n this.chars[id] = {\n xOffset: xoffset,\n yOffset: yoffset,\n xAdvance: xadvance,\n kerning: {},\n texture: new Texture(pageTextures[page_1].baseTexture, rect),\n page: page_1,\n };\n }\n // parse kernings\n for (var i = 0; i < data.kerning.length; i++) {\n var _f = data.kerning[i], first = _f.first, second = _f.second, amount = _f.amount;\n first /= res;\n second /= res;\n amount /= res;\n if (this.chars[second]) {\n this.chars[second].kerning[first] = amount;\n }\n }\n // Store distance field information\n this.distanceFieldRange = distanceField === null || distanceField === void 0 ? void 0 : distanceField.distanceRange;\n this.distanceFieldType = (_b = (_a = distanceField === null || distanceField === void 0 ? void 0 : distanceField.fieldType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : 'none';\n }\n /** Remove references to created glyph textures. */\n BitmapFont.prototype.destroy = function () {\n for (var id in this.chars) {\n this.chars[id].texture.destroy();\n this.chars[id].texture = null;\n }\n for (var id in this.pageTextures) {\n if (this._ownsTextures) {\n this.pageTextures[id].destroy(true);\n }\n this.pageTextures[id] = null;\n }\n // Set readonly null.\n this.chars = null;\n this.pageTextures = null;\n };\n /**\n * Register a new bitmap font.\n * @param data - The\n * characters map that could be provided as xml or raw string.\n * @param textures - List of textures for each page.\n * @param ownsTextures - Set to `true` to destroy page textures\n * when the font is uninstalled. By default fonts created with\n * `BitmapFont.from` or from the `BitmapFontLoader` are `true`.\n * @returns {PIXI.BitmapFont} Result font object with font, size, lineHeight\n * and char fields.\n */\n BitmapFont.install = function (data, textures, ownsTextures) {\n var fontData;\n if (data instanceof BitmapFontData) {\n fontData = data;\n }\n else {\n var format = autoDetectFormat(data);\n if (!format) {\n throw new Error('Unrecognized data format for font.');\n }\n fontData = format.parse(data);\n }\n // Single texture, convert to list\n if (textures instanceof Texture) {\n textures = [textures];\n }\n var font = new BitmapFont(fontData, textures, ownsTextures);\n BitmapFont.available[font.font] = font;\n return font;\n };\n /**\n * Remove bitmap font by name.\n * @param name - Name of the font to uninstall.\n */\n BitmapFont.uninstall = function (name) {\n var font = BitmapFont.available[name];\n if (!font) {\n throw new Error(\"No font found named '\" + name + \"'\");\n }\n font.destroy();\n delete BitmapFont.available[name];\n };\n /**\n * Generates a bitmap-font for the given style and character set. This does not support\n * kernings yet. With `style` properties, only the following non-layout properties are used:\n *\n * - {@link PIXI.TextStyle#dropShadow|dropShadow}\n * - {@link PIXI.TextStyle#dropShadowDistance|dropShadowDistance}\n * - {@link PIXI.TextStyle#dropShadowColor|dropShadowColor}\n * - {@link PIXI.TextStyle#dropShadowBlur|dropShadowBlur}\n * - {@link PIXI.TextStyle#dropShadowAngle|dropShadowAngle}\n * - {@link PIXI.TextStyle#fill|fill}\n * - {@link PIXI.TextStyle#fillGradientStops|fillGradientStops}\n * - {@link PIXI.TextStyle#fillGradientType|fillGradientType}\n * - {@link PIXI.TextStyle#fontFamily|fontFamily}\n * - {@link PIXI.TextStyle#fontSize|fontSize}\n * - {@link PIXI.TextStyle#fontVariant|fontVariant}\n * - {@link PIXI.TextStyle#fontWeight|fontWeight}\n * - {@link PIXI.TextStyle#lineJoin|lineJoin}\n * - {@link PIXI.TextStyle#miterLimit|miterLimit}\n * - {@link PIXI.TextStyle#stroke|stroke}\n * - {@link PIXI.TextStyle#strokeThickness|strokeThickness}\n * - {@link PIXI.TextStyle#textBaseline|textBaseline}\n * @param name - The name of the custom font to use with BitmapText.\n * @param textStyle - Style options to render with BitmapFont.\n * @param options - Setup options for font or name of the font.\n * @param {string|string[]|string[][]} [options.chars=PIXI.BitmapFont.ALPHANUMERIC] - characters included\n * in the font set. You can also use ranges. For example, `[['a', 'z'], ['A', 'Z'], \"!@#$%^&*()~{}[] \"]`.\n * Don't forget to include spaces ' ' in your character set!\n * @param {number} [options.resolution=1] - Render resolution for glyphs.\n * @param {number} [options.textureWidth=512] - Optional width of atlas, smaller values to reduce memory.\n * @param {number} [options.textureHeight=512] - Optional height of atlas, smaller values to reduce memory.\n * @param {number} [options.padding=4] - Padding between glyphs on texture atlas.\n * @returns Font generated by style options.\n * @example\n * PIXI.BitmapFont.from(\"TitleFont\", {\n * fontFamily: \"Arial\",\n * fontSize: 12,\n * strokeThickness: 2,\n * fill: \"purple\"\n * });\n *\n * const title = new PIXI.BitmapText(\"This is the title\", { fontName: \"TitleFont\" });\n */\n BitmapFont.from = function (name, textStyle, options) {\n if (!name) {\n throw new Error('[BitmapFont] Property `name` is required.');\n }\n var _a = Object.assign({}, BitmapFont.defaultOptions, options), chars = _a.chars, padding = _a.padding, resolution = _a.resolution, textureWidth = _a.textureWidth, textureHeight = _a.textureHeight;\n var charsList = resolveCharacters(chars);\n var style = textStyle instanceof TextStyle ? textStyle : new TextStyle(textStyle);\n var lineWidth = textureWidth;\n var fontData = new BitmapFontData();\n fontData.info[0] = {\n face: style.fontFamily,\n size: style.fontSize,\n };\n fontData.common[0] = {\n lineHeight: style.fontSize,\n };\n var positionX = 0;\n var positionY = 0;\n var canvas;\n var context;\n var baseTexture;\n var maxCharHeight = 0;\n var textures = [];\n for (var i = 0; i < charsList.length; i++) {\n if (!canvas) {\n canvas = settings.ADAPTER.createCanvas();\n canvas.width = textureWidth;\n canvas.height = textureHeight;\n context = canvas.getContext('2d');\n baseTexture = new BaseTexture(canvas, { resolution: resolution });\n textures.push(new Texture(baseTexture));\n fontData.page.push({\n id: textures.length - 1,\n file: '',\n });\n }\n // Measure glyph dimensions\n var character = charsList[i];\n var metrics = TextMetrics.measureText(character, style, false, canvas);\n var width = metrics.width;\n var height = Math.ceil(metrics.height);\n // This is ugly - but italics are given more space so they don't overlap\n var textureGlyphWidth = Math.ceil((style.fontStyle === 'italic' ? 2 : 1) * width);\n // Can't fit char anymore: next canvas please!\n if (positionY >= textureHeight - (height * resolution)) {\n if (positionY === 0) {\n // We don't want user debugging an infinite loop (or do we? :)\n throw new Error(\"[BitmapFont] textureHeight \" + textureHeight + \"px is too small \"\n + (\"(fontFamily: '\" + style.fontFamily + \"', fontSize: \" + style.fontSize + \"px, char: '\" + character + \"')\"));\n }\n --i;\n // Create new atlas once current has filled up\n canvas = null;\n context = null;\n baseTexture = null;\n positionY = 0;\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n maxCharHeight = Math.max(height + metrics.fontProperties.descent, maxCharHeight);\n // Wrap line once full row has been rendered\n if ((textureGlyphWidth * resolution) + positionX >= lineWidth) {\n if (positionX === 0) {\n // Avoid infinite loop (There can be some very wide char like '\\uFDFD'!)\n throw new Error(\"[BitmapFont] textureWidth \" + textureWidth + \"px is too small \"\n + (\"(fontFamily: '\" + style.fontFamily + \"', fontSize: \" + style.fontSize + \"px, char: '\" + character + \"')\"));\n }\n --i;\n positionY += maxCharHeight * resolution;\n positionY = Math.ceil(positionY);\n positionX = 0;\n maxCharHeight = 0;\n continue;\n }\n drawGlyph(canvas, context, metrics, positionX, positionY, resolution, style);\n // Unique (numeric) ID mapping to this glyph\n var id = extractCharCode(metrics.text);\n // Create a texture holding just the glyph\n fontData.char.push({\n id: id,\n page: textures.length - 1,\n x: positionX / resolution,\n y: positionY / resolution,\n width: textureGlyphWidth,\n height: height,\n xoffset: 0,\n yoffset: 0,\n xadvance: Math.ceil(width\n - (style.dropShadow ? style.dropShadowDistance : 0)\n - (style.stroke ? style.strokeThickness : 0)),\n });\n positionX += (textureGlyphWidth + (2 * padding)) * resolution;\n positionX = Math.ceil(positionX);\n }\n if (!(options === null || options === void 0 ? void 0 : options.skipKerning)) {\n // Brute-force kerning info, this can be expensive b/c it's an O(n²),\n // but we're using measureText which is native and fast.\n for (var i = 0, len = charsList.length; i < len; i++) {\n var first = charsList[i];\n for (var j = 0; j < len; j++) {\n var second = charsList[j];\n var c1 = context.measureText(first).width;\n var c2 = context.measureText(second).width;\n var total = context.measureText(first + second).width;\n var amount = total - (c1 + c2);\n if (amount) {\n fontData.kerning.push({\n first: extractCharCode(first),\n second: extractCharCode(second),\n amount: amount,\n });\n }\n }\n }\n }\n var font = new BitmapFont(fontData, textures, true);\n // Make it easier to replace a font\n if (BitmapFont.available[name] !== undefined) {\n BitmapFont.uninstall(name);\n }\n BitmapFont.available[name] = font;\n return font;\n };\n /**\n * This character set includes all the letters in the alphabet (both lower- and upper- case).\n * @type {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.ALPHA })\n */\n BitmapFont.ALPHA = [['a', 'z'], ['A', 'Z'], ' '];\n /**\n * This character set includes all decimal digits (from 0 to 9).\n * @type {string[][]}\n * @example\n * BitmapFont.from(\"ExampleFont\", style, { chars: BitmapFont.NUMERIC })\n */\n BitmapFont.NUMERIC = [['0', '9']];\n /**\n * This character set is the union of `BitmapFont.ALPHA` and `BitmapFont.NUMERIC`.\n * @type {string[][]}\n */\n BitmapFont.ALPHANUMERIC = [['a', 'z'], ['A', 'Z'], ['0', '9'], ' '];\n /**\n * This character set consists of all the ASCII table.\n * @member {string[][]}\n * @see http://www.asciitable.com/\n */\n BitmapFont.ASCII = [[' ', '~']];\n /**\n * Collection of default options when using `BitmapFont.from`.\n * @property {number} [resolution=1] -\n * @property {number} [textureWidth=512] -\n * @property {number} [textureHeight=512] -\n * @property {number} [padding=4] -\n * @property {string|string[]|string[][]} chars = PIXI.BitmapFont.ALPHANUMERIC\n */\n BitmapFont.defaultOptions = {\n resolution: 1,\n textureWidth: 512,\n textureHeight: 512,\n padding: 4,\n chars: BitmapFont.ALPHANUMERIC,\n };\n /** Collection of available/installed fonts. */\n BitmapFont.available = {};\n return BitmapFont;\n}());\n\nvar msdfFrag = \"// Pixi texture info\\r\\nvarying vec2 vTextureCoord;\\r\\nuniform sampler2D uSampler;\\r\\n\\r\\n// Tint\\r\\nuniform vec4 uColor;\\r\\n\\r\\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\\r\\nuniform float uFWidth;\\r\\n\\r\\nvoid main(void) {\\r\\n\\r\\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\\r\\n vec4 texColor = texture2D(uSampler, vTextureCoord);\\r\\n\\r\\n // MSDF\\r\\n float median = texColor.r + texColor.g + texColor.b -\\r\\n min(texColor.r, min(texColor.g, texColor.b)) -\\r\\n max(texColor.r, max(texColor.g, texColor.b));\\r\\n // SDF\\r\\n median = min(median, texColor.a);\\r\\n\\r\\n float screenPxDistance = uFWidth * (median - 0.5);\\r\\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\\r\\n if (median < 0.01) {\\r\\n alpha = 0.0;\\r\\n } else if (median > 0.99) {\\r\\n alpha = 1.0;\\r\\n }\\r\\n\\r\\n // NPM Textures, NPM outputs\\r\\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\\r\\n\\r\\n}\\r\\n\";\n\nvar msdfVert = \"// Mesh material default fragment\\r\\nattribute vec2 aVertexPosition;\\r\\nattribute vec2 aTextureCoord;\\r\\n\\r\\nuniform mat3 projectionMatrix;\\r\\nuniform mat3 translationMatrix;\\r\\nuniform mat3 uTextureMatrix;\\r\\n\\r\\nvarying vec2 vTextureCoord;\\r\\n\\r\\nvoid main(void)\\r\\n{\\r\\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\r\\n\\r\\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\\r\\n}\\r\\n\";\n\n// If we ever need more than two pools, please make a Dict or something better.\nvar pageMeshDataDefaultPageMeshData = [];\nvar pageMeshDataMSDFPageMeshData = [];\nvar charRenderDataPool = [];\n/**\n * A BitmapText object will create a line or multiple lines of text using bitmap font.\n *\n * The primary advantage of this class over Text is that all of your textures are pre-generated and loading,\n * meaning that rendering is fast, and changing text has no performance implications.\n *\n * Supporting character sets other than latin, such as CJK languages, may be impractical due to the number of characters.\n *\n * To split a line you can use '\\n', '\\r' or '\\r\\n' in your string.\n *\n * PixiJS can auto-generate fonts on-the-fly using BitmapFont or use fnt files provided by:\n * http://www.angelcode.com/products/bmfont/ for Windows or\n * http://www.bmglyph.com/ for Mac.\n *\n * You can also use SDF, MSDF and MTSDF BitmapFonts for vector-like scaling appearance provided by:\n * https://github.com/soimy/msdf-bmfont-xml for SDF and MSDF fnt files or\n * https://github.com/Chlumsky/msdf-atlas-gen for SDF, MSDF and MTSDF json files\n *\n * A BitmapText can only be created when the font is loaded.\n *\n * ```js\n * // in this case the font is in a file called 'desyrel.fnt'\n * let bitmapText = new PIXI.BitmapText(\"text using a fancy font!\", {\n * fontName: \"Desyrel\",\n * fontSize: 35,\n * align: \"right\"\n * });\n * ```\n * @memberof PIXI\n */\nvar BitmapText = /** @class */ (function (_super) {\n __extends(BitmapText, _super);\n /**\n * @param text - A string that you would like the text to display.\n * @param style - The style parameters.\n * @param {string} style.fontName - The installed BitmapFont name.\n * @param {number} [style.fontSize] - The size of the font in pixels, e.g. 24. If undefined,\n *. this will default to the BitmapFont size.\n * @param {string} [style.align='left'] - Alignment for multiline text ('left', 'center', 'right' or 'justify'),\n * does not affect single line text.\n * @param {number} [style.tint=0xFFFFFF] - The tint color.\n * @param {number} [style.letterSpacing=0] - The amount of spacing between letters.\n * @param {number} [style.maxWidth=0] - The max width of the text before line wrapping.\n */\n function BitmapText(text, style) {\n if (style === void 0) { style = {}; }\n var _this = _super.call(this) || this;\n /**\n * Private tracker for the current tint.\n * @private\n */\n _this._tint = 0xFFFFFF;\n // Apply the defaults\n var _a = Object.assign({}, BitmapText.styleDefaults, style), align = _a.align, tint = _a.tint, maxWidth = _a.maxWidth, letterSpacing = _a.letterSpacing, fontName = _a.fontName, fontSize = _a.fontSize;\n if (!BitmapFont.available[fontName]) {\n throw new Error(\"Missing BitmapFont \\\"\" + fontName + \"\\\"\");\n }\n _this._activePagesMeshData = [];\n _this._textWidth = 0;\n _this._textHeight = 0;\n _this._align = align;\n _this._tint = tint;\n _this._font = undefined;\n _this._fontName = fontName;\n _this._fontSize = fontSize;\n _this.text = text;\n _this._maxWidth = maxWidth;\n _this._maxLineHeight = 0;\n _this._letterSpacing = letterSpacing;\n _this._anchor = new ObservablePoint(function () { _this.dirty = true; }, _this, 0, 0);\n _this._roundPixels = settings.ROUND_PIXELS;\n _this.dirty = true;\n _this._resolution = settings.RESOLUTION;\n _this._autoResolution = true;\n _this._textureCache = {};\n return _this;\n }\n /** Renders text and updates it when needed. This should only be called if the BitmapFont is regenerated. */\n BitmapText.prototype.updateText = function () {\n var _a;\n var data = BitmapFont.available[this._fontName];\n var fontSize = this.fontSize;\n var scale = fontSize / data.size;\n var pos = new Point();\n var chars = [];\n var lineWidths = [];\n var lineSpaces = [];\n var text = this._text.replace(/(?:\\r\\n|\\r)/g, '\\n') || ' ';\n var charsInput = splitTextToCharacters(text);\n var maxWidth = this._maxWidth * data.size / fontSize;\n var pageMeshDataPool = data.distanceFieldType === 'none'\n ? pageMeshDataDefaultPageMeshData : pageMeshDataMSDFPageMeshData;\n var prevCharCode = null;\n var lastLineWidth = 0;\n var maxLineWidth = 0;\n var line = 0;\n var lastBreakPos = -1;\n var lastBreakWidth = 0;\n var spacesRemoved = 0;\n var maxLineHeight = 0;\n var spaceCount = 0;\n for (var i = 0; i < charsInput.length; i++) {\n var char = charsInput[i];\n var charCode = extractCharCode(char);\n if ((/(?:\\s)/).test(char)) {\n lastBreakPos = i;\n lastBreakWidth = lastLineWidth;\n spaceCount++;\n }\n if (char === '\\r' || char === '\\n') {\n lineWidths.push(lastLineWidth);\n lineSpaces.push(-1);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n ++line;\n ++spacesRemoved;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n spaceCount = 0;\n continue;\n }\n var charData = data.chars[charCode];\n if (!charData) {\n continue;\n }\n if (prevCharCode && charData.kerning[prevCharCode]) {\n pos.x += charData.kerning[prevCharCode];\n }\n var charRenderData = charRenderDataPool.pop() || {\n texture: Texture.EMPTY,\n line: 0,\n charCode: 0,\n prevSpaces: 0,\n position: new Point(),\n };\n charRenderData.texture = charData.texture;\n charRenderData.line = line;\n charRenderData.charCode = charCode;\n charRenderData.position.x = pos.x + charData.xOffset + (this._letterSpacing / 2);\n charRenderData.position.y = pos.y + charData.yOffset;\n charRenderData.prevSpaces = spaceCount;\n chars.push(charRenderData);\n lastLineWidth = charRenderData.position.x\n + Math.max(charData.xAdvance - charData.xOffset, charData.texture.orig.width);\n pos.x += charData.xAdvance + this._letterSpacing;\n maxLineHeight = Math.max(maxLineHeight, (charData.yOffset + charData.texture.height));\n prevCharCode = charCode;\n if (lastBreakPos !== -1 && maxWidth > 0 && pos.x > maxWidth) {\n ++spacesRemoved;\n removeItems(chars, 1 + lastBreakPos - spacesRemoved, 1 + i - lastBreakPos);\n i = lastBreakPos;\n lastBreakPos = -1;\n lineWidths.push(lastBreakWidth);\n lineSpaces.push(chars.length > 0 ? chars[chars.length - 1].prevSpaces : 0);\n maxLineWidth = Math.max(maxLineWidth, lastBreakWidth);\n line++;\n pos.x = 0;\n pos.y += data.lineHeight;\n prevCharCode = null;\n spaceCount = 0;\n }\n }\n var lastChar = charsInput[charsInput.length - 1];\n if (lastChar !== '\\r' && lastChar !== '\\n') {\n if ((/(?:\\s)/).test(lastChar)) {\n lastLineWidth = lastBreakWidth;\n }\n lineWidths.push(lastLineWidth);\n maxLineWidth = Math.max(maxLineWidth, lastLineWidth);\n lineSpaces.push(-1);\n }\n var lineAlignOffsets = [];\n for (var i = 0; i <= line; i++) {\n var alignOffset = 0;\n if (this._align === 'right') {\n alignOffset = maxLineWidth - lineWidths[i];\n }\n else if (this._align === 'center') {\n alignOffset = (maxLineWidth - lineWidths[i]) / 2;\n }\n else if (this._align === 'justify') {\n alignOffset = lineSpaces[i] < 0 ? 0 : (maxLineWidth - lineWidths[i]) / lineSpaces[i];\n }\n lineAlignOffsets.push(alignOffset);\n }\n var lenChars = chars.length;\n var pagesMeshData = {};\n var newPagesMeshData = [];\n var activePagesMeshData = this._activePagesMeshData;\n pageMeshDataPool.push.apply(pageMeshDataPool, activePagesMeshData);\n for (var i = 0; i < lenChars; i++) {\n var texture = chars[i].texture;\n var baseTextureUid = texture.baseTexture.uid;\n if (!pagesMeshData[baseTextureUid]) {\n var pageMeshData = pageMeshDataPool.pop();\n if (!pageMeshData) {\n var geometry = new MeshGeometry();\n var material = void 0;\n var meshBlendMode = void 0;\n if (data.distanceFieldType === 'none') {\n material = new MeshMaterial(Texture.EMPTY);\n meshBlendMode = BLEND_MODES.NORMAL;\n }\n else {\n material = new MeshMaterial(Texture.EMPTY, { program: Program.from(msdfVert, msdfFrag), uniforms: { uFWidth: 0 } });\n meshBlendMode = BLEND_MODES.NORMAL_NPM;\n }\n var mesh = new Mesh(geometry, material);\n mesh.blendMode = meshBlendMode;\n pageMeshData = {\n index: 0,\n indexCount: 0,\n vertexCount: 0,\n uvsCount: 0,\n total: 0,\n mesh: mesh,\n vertices: null,\n uvs: null,\n indices: null,\n };\n }\n // reset data..\n pageMeshData.index = 0;\n pageMeshData.indexCount = 0;\n pageMeshData.vertexCount = 0;\n pageMeshData.uvsCount = 0;\n pageMeshData.total = 0;\n // TODO need to get page texture here somehow..\n var _textureCache = this._textureCache;\n _textureCache[baseTextureUid] = _textureCache[baseTextureUid] || new Texture(texture.baseTexture);\n pageMeshData.mesh.texture = _textureCache[baseTextureUid];\n pageMeshData.mesh.tint = this._tint;\n newPagesMeshData.push(pageMeshData);\n pagesMeshData[baseTextureUid] = pageMeshData;\n }\n pagesMeshData[baseTextureUid].total++;\n }\n // lets find any previously active pageMeshDatas that are no longer required for\n // the updated text (if any), removed and return them to the pool.\n for (var i = 0; i < activePagesMeshData.length; i++) {\n if (newPagesMeshData.indexOf(activePagesMeshData[i]) === -1) {\n this.removeChild(activePagesMeshData[i].mesh);\n }\n }\n // next lets add any new meshes, that have not yet been added to this BitmapText\n // we only add if its not already a child of this BitmapObject\n for (var i = 0; i < newPagesMeshData.length; i++) {\n if (newPagesMeshData[i].mesh.parent !== this) {\n this.addChild(newPagesMeshData[i].mesh);\n }\n }\n // active page mesh datas are set to be the new pages added.\n this._activePagesMeshData = newPagesMeshData;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n var total = pageMeshData.total;\n // lets only allocate new buffers if we can fit the new text in the current ones..\n // unless that is, we will be batching. Currently batching dose not respect the size property of mesh\n if (!(((_a = pageMeshData.indices) === null || _a === void 0 ? void 0 : _a.length) > 6 * total) || pageMeshData.vertices.length < Mesh.BATCHABLE_SIZE * 2) {\n pageMeshData.vertices = new Float32Array(4 * 2 * total);\n pageMeshData.uvs = new Float32Array(4 * 2 * total);\n pageMeshData.indices = new Uint16Array(6 * total);\n }\n else {\n var total_1 = pageMeshData.total;\n var vertices = pageMeshData.vertices;\n // Clear the garbage at the end of the vertices buffer. This will prevent the bounds miscalculation.\n for (var i_1 = total_1 * 4 * 2; i_1 < vertices.length; i_1++) {\n vertices[i_1] = 0;\n }\n }\n // as a buffer maybe bigger than the current word, we set the size of the meshMaterial\n // to match the number of letters needed\n pageMeshData.mesh.size = 6 * total;\n }\n for (var i = 0; i < lenChars; i++) {\n var char = chars[i];\n var offset = char.position.x + (lineAlignOffsets[char.line] * (this._align === 'justify' ? char.prevSpaces : 1));\n if (this._roundPixels) {\n offset = Math.round(offset);\n }\n var xPos = offset * scale;\n var yPos = char.position.y * scale;\n var texture = char.texture;\n var pageMesh = pagesMeshData[texture.baseTexture.uid];\n var textureFrame = texture.frame;\n var textureUvs = texture._uvs;\n var index = pageMesh.index++;\n pageMesh.indices[(index * 6) + 0] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 1] = 1 + (index * 4);\n pageMesh.indices[(index * 6) + 2] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 3] = 0 + (index * 4);\n pageMesh.indices[(index * 6) + 4] = 2 + (index * 4);\n pageMesh.indices[(index * 6) + 5] = 3 + (index * 4);\n pageMesh.vertices[(index * 8) + 0] = xPos;\n pageMesh.vertices[(index * 8) + 1] = yPos;\n pageMesh.vertices[(index * 8) + 2] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 3] = yPos;\n pageMesh.vertices[(index * 8) + 4] = xPos + (textureFrame.width * scale);\n pageMesh.vertices[(index * 8) + 5] = yPos + (textureFrame.height * scale);\n pageMesh.vertices[(index * 8) + 6] = xPos;\n pageMesh.vertices[(index * 8) + 7] = yPos + (textureFrame.height * scale);\n pageMesh.uvs[(index * 8) + 0] = textureUvs.x0;\n pageMesh.uvs[(index * 8) + 1] = textureUvs.y0;\n pageMesh.uvs[(index * 8) + 2] = textureUvs.x1;\n pageMesh.uvs[(index * 8) + 3] = textureUvs.y1;\n pageMesh.uvs[(index * 8) + 4] = textureUvs.x2;\n pageMesh.uvs[(index * 8) + 5] = textureUvs.y2;\n pageMesh.uvs[(index * 8) + 6] = textureUvs.x3;\n pageMesh.uvs[(index * 8) + 7] = textureUvs.y3;\n }\n this._textWidth = maxLineWidth * scale;\n this._textHeight = (pos.y + data.lineHeight) * scale;\n for (var i in pagesMeshData) {\n var pageMeshData = pagesMeshData[i];\n // apply anchor\n if (this.anchor.x !== 0 || this.anchor.y !== 0) {\n var vertexCount = 0;\n var anchorOffsetX = this._textWidth * this.anchor.x;\n var anchorOffsetY = this._textHeight * this.anchor.y;\n for (var i_2 = 0; i_2 < pageMeshData.total; i_2++) {\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetX;\n pageMeshData.vertices[vertexCount++] -= anchorOffsetY;\n }\n }\n this._maxLineHeight = maxLineHeight * scale;\n var vertexBuffer = pageMeshData.mesh.geometry.getBuffer('aVertexPosition');\n var textureBuffer = pageMeshData.mesh.geometry.getBuffer('aTextureCoord');\n var indexBuffer = pageMeshData.mesh.geometry.getIndex();\n vertexBuffer.data = pageMeshData.vertices;\n textureBuffer.data = pageMeshData.uvs;\n indexBuffer.data = pageMeshData.indices;\n vertexBuffer.update();\n textureBuffer.update();\n indexBuffer.update();\n }\n for (var i = 0; i < chars.length; i++) {\n charRenderDataPool.push(chars[i]);\n }\n this._font = data;\n this.dirty = false;\n };\n BitmapText.prototype.updateTransform = function () {\n this.validate();\n this.containerUpdateTransform();\n };\n BitmapText.prototype._render = function (renderer) {\n if (this._autoResolution && this._resolution !== renderer.resolution) {\n this._resolution = renderer.resolution;\n this.dirty = true;\n }\n // Update the uniform\n var _a = BitmapFont.available[this._fontName], distanceFieldRange = _a.distanceFieldRange, distanceFieldType = _a.distanceFieldType, size = _a.size;\n if (distanceFieldType !== 'none') {\n // Inject the shader code with the correct value\n var _b = this.worldTransform, a = _b.a, b = _b.b, c = _b.c, d = _b.d;\n var dx = Math.sqrt((a * a) + (b * b));\n var dy = Math.sqrt((c * c) + (d * d));\n var worldScale = (Math.abs(dx) + Math.abs(dy)) / 2;\n var fontScale = this.fontSize / size;\n for (var _i = 0, _c = this._activePagesMeshData; _i < _c.length; _i++) {\n var mesh = _c[_i];\n mesh.mesh.shader.uniforms.uFWidth = worldScale * distanceFieldRange * fontScale * this._resolution;\n }\n }\n _super.prototype._render.call(this, renderer);\n };\n /**\n * Validates text before calling parent's getLocalBounds\n * @returns - The rectangular bounding area\n */\n BitmapText.prototype.getLocalBounds = function () {\n this.validate();\n return _super.prototype.getLocalBounds.call(this);\n };\n /**\n * Updates text when needed\n * @private\n */\n BitmapText.prototype.validate = function () {\n var font = BitmapFont.available[this._fontName];\n if (!font) {\n throw new Error(\"Missing BitmapFont \\\"\" + this._fontName + \"\\\"\");\n }\n if (this._font !== font) {\n this.dirty = true;\n }\n if (this.dirty) {\n this.updateText();\n }\n };\n Object.defineProperty(BitmapText.prototype, \"tint\", {\n /**\n * The tint of the BitmapText object.\n * @default 0xffffff\n */\n get: function () {\n return this._tint;\n },\n set: function (value) {\n if (this._tint === value)\n { return; }\n this._tint = value;\n for (var i = 0; i < this._activePagesMeshData.length; i++) {\n this._activePagesMeshData[i].mesh.tint = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"align\", {\n /**\n * The alignment of the BitmapText object.\n * @member {string}\n * @default 'left'\n */\n get: function () {\n return this._align;\n },\n set: function (value) {\n if (this._align !== value) {\n this._align = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontName\", {\n /** The name of the BitmapFont. */\n get: function () {\n return this._fontName;\n },\n set: function (value) {\n if (!BitmapFont.available[value]) {\n throw new Error(\"Missing BitmapFont \\\"\" + value + \"\\\"\");\n }\n if (this._fontName !== value) {\n this._fontName = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"fontSize\", {\n /** The size of the font to display. */\n get: function () {\n var _a;\n return (_a = this._fontSize) !== null && _a !== void 0 ? _a : BitmapFont.available[this._fontName].size;\n },\n set: function (value) {\n if (this._fontSize !== value) {\n this._fontSize = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"anchor\", {\n /**\n * The anchor sets the origin point of the text.\n *\n * The default is `(0,0)`, this means the text's origin is the top left.\n *\n * Setting the anchor to `(0.5,0.5)` means the text's origin is centered.\n *\n * Setting the anchor to `(1,1)` would mean the text's origin point will be the bottom right corner.\n */\n get: function () {\n return this._anchor;\n },\n set: function (value) {\n if (typeof value === 'number') {\n this._anchor.set(value);\n }\n else {\n this._anchor.copyFrom(value);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"text\", {\n /** The text of the BitmapText object. */\n get: function () {\n return this._text;\n },\n set: function (text) {\n text = String(text === null || text === undefined ? '' : text);\n if (this._text === text) {\n return;\n }\n this._text = text;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxWidth\", {\n /**\n * The max width of this bitmap text in pixels. If the text provided is longer than the\n * value provided, line breaks will be automatically inserted in the last whitespace.\n * Disable by setting the value to 0.\n */\n get: function () {\n return this._maxWidth;\n },\n set: function (value) {\n if (this._maxWidth === value) {\n return;\n }\n this._maxWidth = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"maxLineHeight\", {\n /**\n * The max line height. This is useful when trying to use the total height of the Text,\n * i.e. when trying to vertically align.\n * @readonly\n */\n get: function () {\n this.validate();\n return this._maxLineHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textWidth\", {\n /**\n * The width of the overall text, different from fontSize,\n * which is defined in the style object.\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textWidth;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"letterSpacing\", {\n /** Additional space between characters. */\n get: function () {\n return this._letterSpacing;\n },\n set: function (value) {\n if (this._letterSpacing !== value) {\n this._letterSpacing = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"roundPixels\", {\n /**\n * If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation.\n * Advantages can include sharper image quality (like text) and faster rendering on canvas.\n * The main disadvantage is movement of objects may appear less smooth.\n * To set the global default, change {@link PIXI.settings.ROUND_PIXELS}\n * @default PIXI.settings.ROUND_PIXELS\n */\n get: function () {\n return this._roundPixels;\n },\n set: function (value) {\n if (value !== this._roundPixels) {\n this._roundPixels = value;\n this.dirty = true;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"textHeight\", {\n /**\n * The height of the overall text, different from fontSize,\n * which is defined in the style object.\n * @readonly\n */\n get: function () {\n this.validate();\n return this._textHeight;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BitmapText.prototype, \"resolution\", {\n /**\n * The resolution / device pixel ratio of the canvas.\n *\n * This is set to automatically match the renderer resolution by default, but can be overridden by setting manually.\n * @default 1\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._autoResolution = false;\n if (this._resolution === value) {\n return;\n }\n this._resolution = value;\n this.dirty = true;\n },\n enumerable: false,\n configurable: true\n });\n BitmapText.prototype.destroy = function (options) {\n var _textureCache = this._textureCache;\n var data = BitmapFont.available[this._fontName];\n var pageMeshDataPool = data.distanceFieldType === 'none'\n ? pageMeshDataDefaultPageMeshData : pageMeshDataMSDFPageMeshData;\n pageMeshDataPool.push.apply(pageMeshDataPool, this._activePagesMeshData);\n for (var _i = 0, _a = this._activePagesMeshData; _i < _a.length; _i++) {\n var pageMeshData = _a[_i];\n this.removeChild(pageMeshData.mesh);\n }\n this._activePagesMeshData = [];\n // Release references to any cached textures in page pool\n pageMeshDataPool\n .filter(function (page) { return _textureCache[page.mesh.texture.baseTexture.uid]; })\n .forEach(function (page) {\n page.mesh.texture = Texture.EMPTY;\n });\n for (var id in _textureCache) {\n var texture = _textureCache[id];\n texture.destroy();\n delete _textureCache[id];\n }\n this._font = null;\n this._textureCache = null;\n _super.prototype.destroy.call(this, options);\n };\n BitmapText.styleDefaults = {\n align: 'left',\n tint: 0xFFFFFF,\n maxWidth: 0,\n letterSpacing: 0,\n };\n return BitmapText;\n}(Container));\n\n/**\n * {@link PIXI.Loader Loader} middleware for loading\n * bitmap-based fonts suitable for using with {@link PIXI.BitmapText}.\n * @memberof PIXI\n */\nvar BitmapFontLoader = /** @class */ (function () {\n function BitmapFontLoader() {\n }\n /**\n * Called when the plugin is installed.\n * @see PIXI.extensions.add\n */\n BitmapFontLoader.add = function () {\n LoaderResource.setExtensionXhrType('fnt', LoaderResource.XHR_RESPONSE_TYPE.TEXT);\n };\n /**\n * Called after a resource is loaded.\n * @see PIXI.Loader.loaderMiddleware\n * @param this\n * @param {PIXI.LoaderResource} resource\n * @param {Function} next\n */\n BitmapFontLoader.use = function (resource, next) {\n var format = autoDetectFormat(resource.data);\n // Resource was not recognised as any of the expected font data format\n if (!format) {\n next();\n return;\n }\n var baseUrl = BitmapFontLoader.getBaseUrl(this, resource);\n var data = format.parse(resource.data);\n var textures = {};\n // Handle completed, when the number of textures\n // load is the same number as references in the fnt file\n var completed = function (page) {\n textures[page.metadata.pageFile] = page.texture;\n if (Object.keys(textures).length === data.page.length) {\n resource.bitmapFont = BitmapFont.install(data, textures, true);\n next();\n }\n };\n for (var i = 0; i < data.page.length; ++i) {\n var pageFile = data.page[i].file;\n var url = baseUrl + pageFile;\n var exists = false;\n // incase the image is loaded outside\n // using the same loader, resource will be available\n for (var name in this.resources) {\n var bitmapResource = this.resources[name];\n if (bitmapResource.url === url) {\n bitmapResource.metadata.pageFile = pageFile;\n if (bitmapResource.texture) {\n completed(bitmapResource);\n }\n else {\n bitmapResource.onAfterMiddleware.add(completed);\n }\n exists = true;\n break;\n }\n }\n // texture is not loaded, we'll attempt to add\n // it to the load and add the texture to the list\n if (!exists) {\n // Standard loading options for images\n var options = {\n crossOrigin: resource.crossOrigin,\n loadType: LoaderResource.LOAD_TYPE.IMAGE,\n metadata: Object.assign({ pageFile: pageFile }, resource.metadata.imageMetadata),\n parentResource: resource,\n };\n this.add(url, options, completed);\n }\n }\n };\n /**\n * Get folder path from a resource.\n * @param loader\n * @param resource\n */\n BitmapFontLoader.getBaseUrl = function (loader, resource) {\n var resUrl = !resource.isDataUrl ? BitmapFontLoader.dirname(resource.url) : '';\n if (resource.isDataUrl) {\n if (resUrl === '.') {\n resUrl = '';\n }\n if (loader.baseUrl && resUrl) {\n // if baseurl has a trailing slash then add one to resUrl so the replace works below\n if (loader.baseUrl.charAt(loader.baseUrl.length - 1) === '/') {\n resUrl += '/';\n }\n }\n }\n // remove baseUrl from resUrl\n resUrl = resUrl.replace(loader.baseUrl, '');\n // if there is an resUrl now, it needs a trailing slash. Ensure that it does if the string isn't empty.\n if (resUrl && resUrl.charAt(resUrl.length - 1) !== '/') {\n resUrl += '/';\n }\n return resUrl;\n };\n /**\n * Replacement for NodeJS's path.dirname\n * @param {string} url - Path to get directory for\n */\n BitmapFontLoader.dirname = function (url) {\n var dir = url\n .replace(/\\\\/g, '/') // convert windows notation to UNIX notation, URL-safe because it's a forbidden character\n .replace(/\\/$/, '') // replace trailing slash\n .replace(/\\/[^\\/]*$/, ''); // remove everything after the last\n // File request is relative, use current directory\n if (dir === url) {\n return '.';\n }\n // Started with a slash\n else if (dir === '') {\n return '/';\n }\n return dir;\n };\n /** @ignore */\n BitmapFontLoader.extension = ExtensionType.Loader;\n return BitmapFontLoader;\n}());\n\nexport { BitmapFont, BitmapFontData, BitmapFontLoader, BitmapText, TextFormat, XMLFormat, XMLStringFormat, autoDetectFormat };\n//# sourceMappingURL=text-bitmap.mjs.map\n","/*!\n * @pixi/filter-alpha - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-alpha is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\\n}\\n\";\n\n/**\n * Simplest filter - applies alpha.\n *\n * Use this instead of Container's alpha property to avoid visual layering of individual elements.\n * AlphaFilter applies alpha evenly across the entire display object and any opaque elements it contains.\n * If elements are not opaque, they will blend with each other anyway.\n *\n * Very handy if you want to use common features of all filters:\n *\n * 1. Assign a blendMode to this filter, blend all elements inside display object with background.\n *\n * 2. To use clipping in display coordinates, assign a filterArea to the same container that has this filter.\n * @memberof PIXI.filters\n */\nvar AlphaFilter = /** @class */ (function (_super) {\n __extends(AlphaFilter, _super);\n /**\n * @param alpha - Amount of alpha from 0 to 1, where 0 is transparent\n */\n function AlphaFilter(alpha) {\n if (alpha === void 0) { alpha = 1.0; }\n var _this = _super.call(this, defaultVertex, fragment, { uAlpha: 1 }) || this;\n _this.alpha = alpha;\n return _this;\n }\n Object.defineProperty(AlphaFilter.prototype, \"alpha\", {\n /**\n * Coefficient for alpha multiplication\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return AlphaFilter;\n}(Filter));\n\nexport { AlphaFilter };\n//# sourceMappingURL=filter-alpha.mjs.map\n","/*!\n * @pixi/filter-blur - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { CLEAR_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertTemplate = \"\\n attribute vec2 aVertexPosition;\\n\\n uniform mat3 projectionMatrix;\\n\\n uniform float strength;\\n\\n varying vec2 vBlurTexCoords[%size%];\\n\\n uniform vec4 inputSize;\\n uniform vec4 outputFrame;\\n\\n vec4 filterVertexPosition( void )\\n {\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n }\\n\\n vec2 filterTextureCoord( void )\\n {\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n }\\n\\n void main(void)\\n {\\n gl_Position = filterVertexPosition();\\n\\n vec2 textureCoord = filterTextureCoord();\\n %blur%\\n }\";\nfunction generateBlurVertSource(kernelSize, x) {\n var halfLength = Math.ceil(kernelSize / 2);\n var vertSource = vertTemplate;\n var blurLoop = '';\n var template;\n if (x) {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);';\n }\n else {\n template = 'vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);';\n }\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n blur = blur.replace('%sampleIndex%', i - (halfLength - 1) + \".0\");\n blurLoop += blur;\n blurLoop += '\\n';\n }\n vertSource = vertSource.replace('%blur%', blurLoop);\n vertSource = vertSource.replace('%size%', kernelSize.toString());\n return vertSource;\n}\n\nvar GAUSSIAN_VALUES = {\n 5: [0.153388, 0.221461, 0.250301],\n 7: [0.071303, 0.131514, 0.189879, 0.214607],\n 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],\n 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],\n 13: [0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641],\n 15: [0.000489, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697, 0.197448],\n};\nvar fragTemplate = [\n 'varying vec2 vBlurTexCoords[%size%];',\n 'uniform sampler2D uSampler;',\n 'void main(void)',\n '{',\n ' gl_FragColor = vec4(0.0);',\n ' %blur%',\n '}' ].join('\\n');\nfunction generateBlurFragSource(kernelSize) {\n var kernel = GAUSSIAN_VALUES[kernelSize];\n var halfLength = kernel.length;\n var fragSource = fragTemplate;\n var blurLoop = '';\n var template = 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;';\n var value;\n for (var i = 0; i < kernelSize; i++) {\n var blur = template.replace('%index%', i.toString());\n value = i;\n if (i >= halfLength) {\n value = kernelSize - i - 1;\n }\n blur = blur.replace('%value%', kernel[value].toString());\n blurLoop += blur;\n blurLoop += '\\n';\n }\n fragSource = fragSource.replace('%blur%', blurLoop);\n fragSource = fragSource.replace('%size%', kernelSize.toString());\n return fragSource;\n}\n\n/**\n * The BlurFilterPass applies a horizontal or vertical Gaussian blur to an object.\n * @memberof PIXI.filters\n */\nvar BlurFilterPass = /** @class */ (function (_super) {\n __extends(BlurFilterPass, _super);\n /**\n * @param horizontal - Do pass along the x-axis (`true`) or y-axis (`false`).\n * @param strength - The strength of the blur filter.\n * @param quality - The quality of the blur filter.\n * @param resolution - The resolution of the blur filter.\n * @param kernelSize - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilterPass(horizontal, strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = this;\n var vertSrc = generateBlurVertSource(kernelSize, horizontal);\n var fragSrc = generateBlurFragSource(kernelSize);\n _this = _super.call(this, \n // vertex shader\n vertSrc, \n // fragment shader\n fragSrc) || this;\n _this.horizontal = horizontal;\n _this.resolution = resolution;\n _this._quality = 0;\n _this.quality = quality;\n _this.blur = strength;\n return _this;\n }\n /**\n * Applies the filter.\n * @param filterManager - The manager.\n * @param input - The input target.\n * @param output - The output target.\n * @param clearMode - How to clear\n */\n BlurFilterPass.prototype.apply = function (filterManager, input, output, clearMode) {\n if (output) {\n if (this.horizontal) {\n this.uniforms.strength = (1 / output.width) * (output.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / output.height) * (output.height / input.height);\n }\n }\n else {\n if (this.horizontal) // eslint-disable-line\n {\n this.uniforms.strength = (1 / filterManager.renderer.width) * (filterManager.renderer.width / input.width);\n }\n else {\n this.uniforms.strength = (1 / filterManager.renderer.height) * (filterManager.renderer.height / input.height); // eslint-disable-line\n }\n }\n // screen space!\n this.uniforms.strength *= this.strength;\n this.uniforms.strength /= this.passes;\n if (this.passes === 1) {\n filterManager.applyFilter(this, input, output, clearMode);\n }\n else {\n var renderTarget = filterManager.getFilterTexture();\n var renderer = filterManager.renderer;\n var flip = input;\n var flop = renderTarget;\n this.state.blend = false;\n filterManager.applyFilter(this, flip, flop, CLEAR_MODES.CLEAR);\n for (var i = 1; i < this.passes - 1; i++) {\n filterManager.bindAndClear(flip, CLEAR_MODES.BLIT);\n this.uniforms.uSampler = flop;\n var temp = flop;\n flop = flip;\n flip = temp;\n renderer.shader.bind(this);\n renderer.geometry.draw(5);\n }\n this.state.blend = true;\n filterManager.applyFilter(this, flop, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n };\n Object.defineProperty(BlurFilterPass.prototype, \"blur\", {\n /**\n * Sets the strength of both the blur.\n * @default 16\n */\n get: function () {\n return this.strength;\n },\n set: function (value) {\n this.padding = 1 + (Math.abs(value) * 2);\n this.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilterPass.prototype, \"quality\", {\n /**\n * Sets the quality of the blur by modifying the number of passes. More passes means higher\n * quality bluring but the lower the performance.\n * @default 4\n */\n get: function () {\n return this._quality;\n },\n set: function (value) {\n this._quality = value;\n this.passes = value;\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilterPass;\n}(Filter));\n\n/**\n * The BlurFilter applies a Gaussian blur to an object.\n *\n * The strength of the blur can be set for the x-axis and y-axis separately.\n * @memberof PIXI.filters\n */\nvar BlurFilter = /** @class */ (function (_super) {\n __extends(BlurFilter, _super);\n /**\n * @param strength - The strength of the blur filter.\n * @param quality - The quality of the blur filter.\n * @param [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blur filter.\n * @param kernelSize - The kernelSize of the blur filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BlurFilter(strength, quality, resolution, kernelSize) {\n if (strength === void 0) { strength = 8; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = _super.call(this) || this;\n _this.blurXFilter = new BlurFilterPass(true, strength, quality, resolution, kernelSize);\n _this.blurYFilter = new BlurFilterPass(false, strength, quality, resolution, kernelSize);\n _this.resolution = resolution;\n _this.quality = quality;\n _this.blur = strength;\n _this.repeatEdgePixels = false;\n return _this;\n }\n /**\n * Applies the filter.\n * @param filterManager - The manager.\n * @param input - The input target.\n * @param output - The output target.\n * @param clearMode - How to clear\n */\n BlurFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var xStrength = Math.abs(this.blurXFilter.strength);\n var yStrength = Math.abs(this.blurYFilter.strength);\n if (xStrength && yStrength) {\n var renderTarget = filterManager.getFilterTexture();\n this.blurXFilter.apply(filterManager, input, renderTarget, CLEAR_MODES.CLEAR);\n this.blurYFilter.apply(filterManager, renderTarget, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n }\n else if (yStrength) {\n this.blurYFilter.apply(filterManager, input, output, clearMode);\n }\n else {\n this.blurXFilter.apply(filterManager, input, output, clearMode);\n }\n };\n BlurFilter.prototype.updatePadding = function () {\n if (this._repeatEdgePixels) {\n this.padding = 0;\n }\n else {\n this.padding = Math.max(Math.abs(this.blurXFilter.strength), Math.abs(this.blurYFilter.strength)) * 2;\n }\n };\n Object.defineProperty(BlurFilter.prototype, \"blur\", {\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"quality\", {\n /**\n * Sets the number of passes for blur. More passes means higher quality bluring.\n * @default 1\n */\n get: function () {\n return this.blurXFilter.quality;\n },\n set: function (value) {\n this.blurXFilter.quality = this.blurYFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurX\", {\n /**\n * Sets the strength of the blurX property\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blurY\", {\n /**\n * Sets the strength of the blurY property\n * @default 2\n */\n get: function () {\n return this.blurYFilter.blur;\n },\n set: function (value) {\n this.blurYFilter.blur = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"blendMode\", {\n /**\n * Sets the blendmode of the filter\n * @default PIXI.BLEND_MODES.NORMAL\n */\n get: function () {\n return this.blurYFilter.blendMode;\n },\n set: function (value) {\n this.blurYFilter.blendMode = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BlurFilter.prototype, \"repeatEdgePixels\", {\n /**\n * If set to true the edge of the target will be clamped\n * @default false\n */\n get: function () {\n return this._repeatEdgePixels;\n },\n set: function (value) {\n this._repeatEdgePixels = value;\n this.updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n return BlurFilter;\n}(Filter));\n\nexport { BlurFilter, BlurFilterPass };\n//# sourceMappingURL=filter-blur.mjs.map\n","/*!\n * @pixi/filter-color-matrix - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-color-matrix is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float m[20];\\nuniform float uAlpha;\\n\\nvoid main(void)\\n{\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n if (uAlpha == 0.0) {\\n gl_FragColor = c;\\n return;\\n }\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (c.a > 0.0) {\\n c.rgb /= c.a;\\n }\\n\\n vec4 result;\\n\\n result.r = (m[0] * c.r);\\n result.r += (m[1] * c.g);\\n result.r += (m[2] * c.b);\\n result.r += (m[3] * c.a);\\n result.r += m[4];\\n\\n result.g = (m[5] * c.r);\\n result.g += (m[6] * c.g);\\n result.g += (m[7] * c.b);\\n result.g += (m[8] * c.a);\\n result.g += m[9];\\n\\n result.b = (m[10] * c.r);\\n result.b += (m[11] * c.g);\\n result.b += (m[12] * c.b);\\n result.b += (m[13] * c.a);\\n result.b += m[14];\\n\\n result.a = (m[15] * c.r);\\n result.a += (m[16] * c.g);\\n result.a += (m[17] * c.b);\\n result.a += (m[18] * c.a);\\n result.a += m[19];\\n\\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\\n\\n // Premultiply alpha again.\\n rgb *= result.a;\\n\\n gl_FragColor = vec4(rgb, result.a);\\n}\\n\";\n\n/**\n * The ColorMatrixFilter class lets you apply a 5x4 matrix transformation on the RGBA\n * color and alpha values of every pixel on your displayObject to produce a result\n * with a new set of RGBA color and alpha values. It's pretty powerful!\n *\n * ```js\n * let colorMatrix = new PIXI.filters.ColorMatrixFilter();\n * container.filters = [colorMatrix];\n * colorMatrix.contrast(2);\n * ```\n * @author Clément Chenebault <clement@goodboydigital.com>\n * @memberof PIXI.filters\n */\nvar ColorMatrixFilter = /** @class */ (function (_super) {\n __extends(ColorMatrixFilter, _super);\n function ColorMatrixFilter() {\n var _this = this;\n var uniforms = {\n m: new Float32Array([1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0]),\n uAlpha: 1,\n };\n _this = _super.call(this, defaultFilterVertex, fragment, uniforms) || this;\n _this.alpha = 1;\n return _this;\n }\n /**\n * Transforms current matrix and set the new one\n * @param {number[]} matrix - 5x4 matrix\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype._loadMatrix = function (matrix, multiply) {\n if (multiply === void 0) { multiply = false; }\n var newMatrix = matrix;\n if (multiply) {\n this._multiply(newMatrix, this.uniforms.m, matrix);\n newMatrix = this._colorMatrix(newMatrix);\n }\n // set the new matrix\n this.uniforms.m = newMatrix;\n };\n /**\n * Multiplies two mat5's\n * @private\n * @param out - 5x4 matrix the receiving matrix\n * @param a - 5x4 matrix the first operand\n * @param b - 5x4 matrix the second operand\n * @returns {number[]} 5x4 matrix\n */\n ColorMatrixFilter.prototype._multiply = function (out, a, b) {\n // Red Channel\n out[0] = (a[0] * b[0]) + (a[1] * b[5]) + (a[2] * b[10]) + (a[3] * b[15]);\n out[1] = (a[0] * b[1]) + (a[1] * b[6]) + (a[2] * b[11]) + (a[3] * b[16]);\n out[2] = (a[0] * b[2]) + (a[1] * b[7]) + (a[2] * b[12]) + (a[3] * b[17]);\n out[3] = (a[0] * b[3]) + (a[1] * b[8]) + (a[2] * b[13]) + (a[3] * b[18]);\n out[4] = (a[0] * b[4]) + (a[1] * b[9]) + (a[2] * b[14]) + (a[3] * b[19]) + a[4];\n // Green Channel\n out[5] = (a[5] * b[0]) + (a[6] * b[5]) + (a[7] * b[10]) + (a[8] * b[15]);\n out[6] = (a[5] * b[1]) + (a[6] * b[6]) + (a[7] * b[11]) + (a[8] * b[16]);\n out[7] = (a[5] * b[2]) + (a[6] * b[7]) + (a[7] * b[12]) + (a[8] * b[17]);\n out[8] = (a[5] * b[3]) + (a[6] * b[8]) + (a[7] * b[13]) + (a[8] * b[18]);\n out[9] = (a[5] * b[4]) + (a[6] * b[9]) + (a[7] * b[14]) + (a[8] * b[19]) + a[9];\n // Blue Channel\n out[10] = (a[10] * b[0]) + (a[11] * b[5]) + (a[12] * b[10]) + (a[13] * b[15]);\n out[11] = (a[10] * b[1]) + (a[11] * b[6]) + (a[12] * b[11]) + (a[13] * b[16]);\n out[12] = (a[10] * b[2]) + (a[11] * b[7]) + (a[12] * b[12]) + (a[13] * b[17]);\n out[13] = (a[10] * b[3]) + (a[11] * b[8]) + (a[12] * b[13]) + (a[13] * b[18]);\n out[14] = (a[10] * b[4]) + (a[11] * b[9]) + (a[12] * b[14]) + (a[13] * b[19]) + a[14];\n // Alpha Channel\n out[15] = (a[15] * b[0]) + (a[16] * b[5]) + (a[17] * b[10]) + (a[18] * b[15]);\n out[16] = (a[15] * b[1]) + (a[16] * b[6]) + (a[17] * b[11]) + (a[18] * b[16]);\n out[17] = (a[15] * b[2]) + (a[16] * b[7]) + (a[17] * b[12]) + (a[18] * b[17]);\n out[18] = (a[15] * b[3]) + (a[16] * b[8]) + (a[17] * b[13]) + (a[18] * b[18]);\n out[19] = (a[15] * b[4]) + (a[16] * b[9]) + (a[17] * b[14]) + (a[18] * b[19]) + a[19];\n return out;\n };\n /**\n * Create a Float32 Array and normalize the offset component to 0-1\n * @param {number[]} matrix - 5x4 matrix\n * @returns {number[]} 5x4 matrix with all values between 0-1\n */\n ColorMatrixFilter.prototype._colorMatrix = function (matrix) {\n // Create a Float32 Array and normalize the offset component to 0-1\n var m = new Float32Array(matrix);\n m[4] /= 255;\n m[9] /= 255;\n m[14] /= 255;\n m[19] /= 255;\n return m;\n };\n /**\n * Adjusts brightness\n * @param b - value of the brigthness (0-1, where 0 is black)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.brightness = function (b, multiply) {\n var matrix = [\n b, 0, 0, 0, 0,\n 0, b, 0, 0, 0,\n 0, 0, b, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Sets each channel on the diagonal of the color matrix.\n * This can be used to achieve a tinting effect on Containers similar to the tint field of some\n * display objects like Sprite, Text, Graphics, and Mesh.\n * @param color - Color of the tint. This is a hex value.\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.tint = function (color, multiply) {\n var r = (color >> 16) & 0xff;\n var g = (color >> 8) & 0xff;\n var b = color & 0xff;\n var matrix = [\n r / 255, 0, 0, 0, 0,\n 0, g / 255, 0, 0, 0,\n 0, 0, b / 255, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the matrices in grey scales\n * @param scale - value of the grey (0-1, where 0 is black)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.greyscale = function (scale, multiply) {\n var matrix = [\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n scale, scale, scale, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the black and white matrice.\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.blackAndWhite = function (multiply) {\n var matrix = [\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0.3, 0.6, 0.1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the hue property of the color\n * @param rotation - in degrees\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.hue = function (rotation, multiply) {\n rotation = (rotation || 0) / 180 * Math.PI;\n var cosR = Math.cos(rotation);\n var sinR = Math.sin(rotation);\n var sqrt = Math.sqrt;\n /* a good approximation for hue rotation\n This matrix is far better than the versions with magic luminance constants\n formerly used here, but also used in the starling framework (flash) and known from this\n old part of the internet: quasimondo.com/archives/000565.php\n\n This new matrix is based on rgb cube rotation in space. Look here for a more descriptive\n implementation as a shader not a general matrix:\n https://github.com/evanw/glfx.js/blob/58841c23919bd59787effc0333a4897b43835412/src/filters/adjust/huesaturation.js\n\n This is the source for the code:\n see http://stackoverflow.com/questions/8507885/shift-hue-of-an-rgb-color/8510751#8510751\n */\n var w = 1 / 3;\n var sqrW = sqrt(w); // weight is\n var a00 = cosR + ((1.0 - cosR) * w);\n var a01 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a02 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a10 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a11 = cosR + (w * (1.0 - cosR));\n var a12 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a20 = (w * (1.0 - cosR)) - (sqrW * sinR);\n var a21 = (w * (1.0 - cosR)) + (sqrW * sinR);\n var a22 = cosR + (w * (1.0 - cosR));\n var matrix = [\n a00, a01, a02, 0, 0,\n a10, a11, a12, 0, 0,\n a20, a21, a22, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the contrast matrix, increase the separation between dark and bright\n * Increase contrast : shadows darker and highlights brighter\n * Decrease contrast : bring the shadows up and the highlights down\n * @param amount - value of the contrast (0-1)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.contrast = function (amount, multiply) {\n var v = (amount || 0) + 1;\n var o = -0.5 * (v - 1);\n var matrix = [\n v, 0, 0, 0, o,\n 0, v, 0, 0, o,\n 0, 0, v, 0, o,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Set the saturation matrix, increase the separation between colors\n * Increase saturation : increase contrast, brightness, and sharpness\n * @param amount - The saturation amount (0-1)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.saturate = function (amount, multiply) {\n if (amount === void 0) { amount = 0; }\n var x = (amount * 2 / 3) + 1;\n var y = ((x - 1) * -0.5);\n var matrix = [\n x, y, y, 0, 0,\n y, x, y, 0, 0,\n y, y, x, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /** Desaturate image (remove color) Call the saturate function */\n ColorMatrixFilter.prototype.desaturate = function () {\n this.saturate(-1);\n };\n /**\n * Negative image (inverse of classic rgb matrix)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.negative = function (multiply) {\n var matrix = [\n -1, 0, 0, 1, 0,\n 0, -1, 0, 1, 0,\n 0, 0, -1, 1, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Sepia image\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.sepia = function (multiply) {\n var matrix = [\n 0.393, 0.7689999, 0.18899999, 0, 0,\n 0.349, 0.6859999, 0.16799999, 0, 0,\n 0.272, 0.5339999, 0.13099999, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color motion picture process invented in 1916 (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.technicolor = function (multiply) {\n var matrix = [\n 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337,\n -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398,\n -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Polaroid filter\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.polaroid = function (multiply) {\n var matrix = [\n 1.438, -0.062, -0.062, 0, 0,\n -0.122, 1.378, -0.122, 0, 0,\n -0.016, -0.016, 1.483, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Filter who transforms : Red -> Blue and Blue -> Red\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.toBGR = function (multiply) {\n var matrix = [\n 0, 0, 1, 0, 0,\n 0, 1, 0, 0, 0,\n 1, 0, 0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Color reversal film introduced by Eastman Kodak in 1935. (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.kodachrome = function (multiply) {\n var matrix = [\n 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502,\n -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203,\n -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Brown delicious browni filter (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.browni = function (multiply) {\n var matrix = [\n 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873,\n -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127,\n 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Vintage filter (thanks Dominic Szablewski)\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.vintage = function (multiply) {\n var matrix = [\n 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123,\n 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591,\n 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * We don't know exactly what it does, kind of gradient map, but funny to play with!\n * @param desaturation - Tone values.\n * @param toned - Tone values.\n * @param lightColor - Tone values, example: `0xFFE580`\n * @param darkColor - Tone values, example: `0xFFE580`\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.colorTone = function (desaturation, toned, lightColor, darkColor, multiply) {\n desaturation = desaturation || 0.2;\n toned = toned || 0.15;\n lightColor = lightColor || 0xFFE580;\n darkColor = darkColor || 0x338000;\n var lR = ((lightColor >> 16) & 0xFF) / 255;\n var lG = ((lightColor >> 8) & 0xFF) / 255;\n var lB = (lightColor & 0xFF) / 255;\n var dR = ((darkColor >> 16) & 0xFF) / 255;\n var dG = ((darkColor >> 8) & 0xFF) / 255;\n var dB = (darkColor & 0xFF) / 255;\n var matrix = [\n 0.3, 0.59, 0.11, 0, 0,\n lR, lG, lB, desaturation, 0,\n dR, dG, dB, toned, 0,\n lR - dR, lG - dG, lB - dB, 0, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Night effect\n * @param intensity - The intensity of the night effect.\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.night = function (intensity, multiply) {\n intensity = intensity || 0.1;\n var matrix = [\n intensity * (-2.0), -intensity, 0, 0, 0,\n -intensity, 0, intensity, 0, 0,\n 0, intensity, intensity * 2.0, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * Predator effect\n *\n * Erase the current matrix by setting a new indepent one\n * @param amount - how much the predator feels his future victim\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.predator = function (amount, multiply) {\n var matrix = [\n // row 1\n 11.224130630493164 * amount,\n -4.794486999511719 * amount,\n -2.8746118545532227 * amount,\n 0 * amount,\n 0.40342438220977783 * amount,\n // row 2\n -3.6330697536468506 * amount,\n 9.193157196044922 * amount,\n -2.951810836791992 * amount,\n 0 * amount,\n -1.316135048866272 * amount,\n // row 3\n -3.2184197902679443 * amount,\n -4.2375030517578125 * amount,\n 7.476448059082031 * amount,\n 0 * amount,\n 0.8044459223747253 * amount,\n // row 4\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /**\n * LSD effect\n *\n * Multiply the current matrix\n * @param multiply - if true, current matrix and matrix are multiplied. If false,\n * just set the current matrix with @param matrix\n */\n ColorMatrixFilter.prototype.lsd = function (multiply) {\n var matrix = [\n 2, -0.4, 0.5, 0, 0,\n -0.5, 2, -0.4, 0, 0,\n -0.4, -0.5, 3, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, multiply);\n };\n /** Erase the current matrix by setting the default one. */\n ColorMatrixFilter.prototype.reset = function () {\n var matrix = [\n 1, 0, 0, 0, 0,\n 0, 1, 0, 0, 0,\n 0, 0, 1, 0, 0,\n 0, 0, 0, 1, 0 ];\n this._loadMatrix(matrix, false);\n };\n Object.defineProperty(ColorMatrixFilter.prototype, \"matrix\", {\n /**\n * The matrix of the color matrix filter\n * @member {number[]}\n * @default [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]\n */\n get: function () {\n return this.uniforms.m;\n },\n set: function (value) {\n this.uniforms.m = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMatrixFilter.prototype, \"alpha\", {\n /**\n * The opacity value to use when mixing the original and resultant colors.\n *\n * When the value is 0, the original color is used without modification.\n * When the value is 1, the result color is used.\n * When in the range (0, 1) the color is interpolated between the original and result by this amount.\n * @default 1\n */\n get: function () {\n return this.uniforms.uAlpha;\n },\n set: function (value) {\n this.uniforms.uAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorMatrixFilter;\n}(Filter));\n// Americanized alias\nColorMatrixFilter.prototype.grayscale = ColorMatrixFilter.prototype.greyscale;\n\nexport { ColorMatrixFilter };\n//# sourceMappingURL=filter-color-matrix.mjs.map\n","/*!\n * @pixi/filter-displacement - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-displacement is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Matrix, Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"varying vec2 vFilterCoord;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 scale;\\nuniform mat2 rotation;\\nuniform sampler2D uSampler;\\nuniform sampler2D mapSampler;\\n\\nuniform highp vec4 inputSize;\\nuniform vec4 inputClamp;\\n\\nvoid main(void)\\n{\\n vec4 map = texture2D(mapSampler, vFilterCoord);\\n\\n map -= 0.5;\\n map.xy = scale * inputSize.zw * (rotation * map.xy);\\n\\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\\n}\\n\";\n\nvar vertex = \"attribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\nuniform mat3 filterMatrix;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec2 vFilterCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvec2 filterTextureCoord( void )\\n{\\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\\n}\\n\\nvoid main(void)\\n{\\n\\tgl_Position = filterVertexPosition();\\n\\tvTextureCoord = filterTextureCoord();\\n\\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\\n}\\n\";\n\n/**\n * The DisplacementFilter class uses the pixel values from the specified texture\n * (called the displacement map) to perform a displacement of an object.\n *\n * You can use this filter to apply all manor of crazy warping effects.\n * Currently the `r` property of the texture is used to offset the `x`\n * and the `g` property of the texture is used to offset the `y`.\n *\n * The way it works is it uses the values of the displacement map to look up the\n * correct pixels to output. This means it's not technically moving the original.\n * Instead, it's starting at the output and asking \"which pixel from the original goes here\".\n * For example, if a displacement map pixel has `red = 1` and the filter scale is `20`,\n * this filter will output the pixel approximately 20 pixels to the right of the original.\n * @memberof PIXI.filters\n */\nvar DisplacementFilter = /** @class */ (function (_super) {\n __extends(DisplacementFilter, _super);\n /**\n * @param {PIXI.Sprite} sprite - The sprite used for the displacement map. (make sure its added to the scene!)\n * @param scale - The scale of the displacement\n */\n function DisplacementFilter(sprite, scale) {\n var _this = this;\n var maskMatrix = new Matrix();\n sprite.renderable = false;\n _this = _super.call(this, vertex, fragment, {\n mapSampler: sprite._texture,\n filterMatrix: maskMatrix,\n scale: { x: 1, y: 1 },\n rotation: new Float32Array([1, 0, 0, 1]),\n }) || this;\n _this.maskSprite = sprite;\n _this.maskMatrix = maskMatrix;\n if (scale === null || scale === undefined) {\n scale = 20;\n }\n /**\n * scaleX, scaleY for displacements\n * @member {PIXI.Point}\n */\n _this.scale = new Point(scale, scale);\n return _this;\n }\n /**\n * Applies the filter.\n * @param filterManager - The manager.\n * @param input - The input target.\n * @param output - The output target.\n * @param clearMode - clearMode.\n */\n DisplacementFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n // fill maskMatrix with _normalized sprite texture coords_\n this.uniforms.filterMatrix = filterManager.calculateSpriteMatrix(this.maskMatrix, this.maskSprite);\n this.uniforms.scale.x = this.scale.x;\n this.uniforms.scale.y = this.scale.y;\n // Extract rotation from world transform\n var wt = this.maskSprite.worldTransform;\n var lenX = Math.sqrt((wt.a * wt.a) + (wt.b * wt.b));\n var lenY = Math.sqrt((wt.c * wt.c) + (wt.d * wt.d));\n if (lenX !== 0 && lenY !== 0) {\n this.uniforms.rotation[0] = wt.a / lenX;\n this.uniforms.rotation[1] = wt.b / lenX;\n this.uniforms.rotation[2] = wt.c / lenY;\n this.uniforms.rotation[3] = wt.d / lenY;\n }\n // draw the filter...\n filterManager.applyFilter(this, input, output, clearMode);\n };\n Object.defineProperty(DisplacementFilter.prototype, \"map\", {\n /** The texture used for the displacement map. Must be power of 2 sized texture. */\n get: function () {\n return this.uniforms.mapSampler;\n },\n set: function (value) {\n this.uniforms.mapSampler = value;\n },\n enumerable: false,\n configurable: true\n });\n return DisplacementFilter;\n}(Filter));\n\nexport { DisplacementFilter };\n//# sourceMappingURL=filter-displacement.mjs.map\n","/*!\n * @pixi/filter-fxaa - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-fxaa is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"\\nattribute vec2 aVertexPosition;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\n\\nuniform vec4 inputSize;\\nuniform vec4 outputFrame;\\n\\nvec4 filterVertexPosition( void )\\n{\\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\\n\\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\\n}\\n\\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\\n out vec2 v_rgbNW, out vec2 v_rgbNE,\\n out vec2 v_rgbSW, out vec2 v_rgbSE,\\n out vec2 v_rgbM) {\\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\\n v_rgbM = vec2(fragCoord * inverseVP);\\n}\\n\\nvoid main(void) {\\n\\n gl_Position = filterVertexPosition();\\n\\n vFragCoord = aVertexPosition * outputFrame.zw;\\n\\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n}\\n\";\n\nvar fragment = \"varying vec2 v_rgbNW;\\nvarying vec2 v_rgbNE;\\nvarying vec2 v_rgbSW;\\nvarying vec2 v_rgbSE;\\nvarying vec2 v_rgbM;\\n\\nvarying vec2 vFragCoord;\\nuniform sampler2D uSampler;\\nuniform highp vec4 inputSize;\\n\\n\\n/**\\n Basic FXAA implementation based on the code on geeks3d.com with the\\n modification that the texture2DLod stuff was removed since it's\\n unsupported by WebGL.\\n\\n --\\n\\n From:\\n https://github.com/mitsuhiko/webgl-meincraft\\n\\n Copyright (c) 2011 by Armin Ronacher.\\n\\n Some rights reserved.\\n\\n Redistribution and use in source and binary forms, with or without\\n modification, are permitted provided that the following conditions are\\n met:\\n\\n * Redistributions of source code must retain the above copyright\\n notice, this list of conditions and the following disclaimer.\\n\\n * Redistributions in binary form must reproduce the above\\n copyright notice, this list of conditions and the following\\n disclaimer in the documentation and/or other materials provided\\n with the distribution.\\n\\n * The names of the contributors may not be used to endorse or\\n promote products derived from this software without specific\\n prior written permission.\\n\\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\n \\\"AS IS\\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\n */\\n\\n#ifndef FXAA_REDUCE_MIN\\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\\n#endif\\n#ifndef FXAA_REDUCE_MUL\\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\\n#endif\\n#ifndef FXAA_SPAN_MAX\\n#define FXAA_SPAN_MAX 8.0\\n#endif\\n\\n//optimized version for mobile, where dependent\\n//texture reads can be a bottleneck\\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\\n vec2 v_rgbNW, vec2 v_rgbNE,\\n vec2 v_rgbSW, vec2 v_rgbSE,\\n vec2 v_rgbM) {\\n vec4 color;\\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\\n vec4 texColor = texture2D(tex, v_rgbM);\\n vec3 rgbM = texColor.xyz;\\n vec3 luma = vec3(0.299, 0.587, 0.114);\\n float lumaNW = dot(rgbNW, luma);\\n float lumaNE = dot(rgbNE, luma);\\n float lumaSW = dot(rgbSW, luma);\\n float lumaSE = dot(rgbSE, luma);\\n float lumaM = dot(rgbM, luma);\\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\\n\\n mediump vec2 dir;\\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\\n\\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\\n\\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\\n dir * rcpDirMin)) * inverseVP;\\n\\n vec3 rgbA = 0.5 * (\\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\\n\\n float lumaB = dot(rgbB, luma);\\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\\n color = vec4(rgbA, texColor.a);\\n else\\n color = vec4(rgbB, texColor.a);\\n return color;\\n}\\n\\nvoid main() {\\n\\n vec4 color;\\n\\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * Basic FXAA (Fast Approximate Anti-Aliasing) implementation based on the code on geeks3d.com\n * with the modification that the texture2DLod stuff was removed since it is unsupported by WebGL.\n * @see https://github.com/mitsuhiko/webgl-meincraft\n * @memberof PIXI.filters\n */\nvar FXAAFilter = /** @class */ (function (_super) {\n __extends(FXAAFilter, _super);\n function FXAAFilter() {\n // TODO - needs work\n return _super.call(this, vertex, fragment) || this;\n }\n return FXAAFilter;\n}(Filter));\n\nexport { FXAAFilter };\n//# sourceMappingURL=filter-fxaa.mjs.map\n","/*!\n * @pixi/filter-noise - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/filter-noise is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { defaultFilterVertex, Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar fragment = \"precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform float uNoise;\\nuniform float uSeed;\\nuniform sampler2D uSampler;\\n\\nfloat rand(vec2 co)\\n{\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float randomValue = rand(gl_FragCoord.xy * uSeed);\\n float diff = (randomValue - 0.5) * uNoise;\\n\\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n }\\n\\n color.r += diff;\\n color.g += diff;\\n color.b += diff;\\n\\n // Premultiply alpha again.\\n color.rgb *= color.a;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * A Noise effect filter.\n *\n * original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/adjust/noise.js\n * @memberof PIXI.filters\n * @author Vico @vicocotea\n */\nvar NoiseFilter = /** @class */ (function (_super) {\n __extends(NoiseFilter, _super);\n /**\n * @param {number} [noise=0.5] - The noise intensity, should be a normalized value in the range [0, 1].\n * @param {number} [seed] - A random seed for the noise generation. Default is `Math.random()`.\n */\n function NoiseFilter(noise, seed) {\n if (noise === void 0) { noise = 0.5; }\n if (seed === void 0) { seed = Math.random(); }\n var _this = _super.call(this, defaultFilterVertex, fragment, {\n uNoise: 0,\n uSeed: 0,\n }) || this;\n _this.noise = noise;\n _this.seed = seed;\n return _this;\n }\n Object.defineProperty(NoiseFilter.prototype, \"noise\", {\n /**\n * The amount of noise to apply, this value should be in the range (0, 1].\n * @default 0.5\n */\n get: function () {\n return this.uniforms.uNoise;\n },\n set: function (value) {\n this.uniforms.uNoise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NoiseFilter.prototype, \"seed\", {\n /** A seed value to apply to the random noise generation. `Math.random()` is a good value to use. */\n get: function () {\n return this.uniforms.uSeed;\n },\n set: function (value) {\n this.uniforms.uSeed = value;\n },\n enumerable: false,\n configurable: true\n });\n return NoiseFilter;\n}(Filter));\n\nexport { NoiseFilter };\n//# sourceMappingURL=filter-noise.mjs.map\n","/*!\n * @pixi/mixin-cache-as-bitmap - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mixin-cache-as-bitmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { RenderTexture, BaseTexture, Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { DisplayObject } from '@pixi/display';\nimport { Matrix } from '@pixi/math';\nimport { uid } from '@pixi/utils';\nimport { settings } from '@pixi/settings';\nimport { MSAA_QUALITY } from '@pixi/constants';\n\nvar _tempMatrix = new Matrix();\nDisplayObject.prototype._cacheAsBitmap = false;\nDisplayObject.prototype._cacheData = null;\nDisplayObject.prototype._cacheAsBitmapResolution = null;\nDisplayObject.prototype._cacheAsBitmapMultisample = MSAA_QUALITY.NONE;\n// figured there's no point adding ALL the extra variables to prototype.\n// this model can hold the information needed. This can also be generated on demand as\n// most objects are not cached as bitmaps.\n/**\n * @class\n * @ignore\n * @private\n */\nvar CacheData = /** @class */ (function () {\n function CacheData() {\n this.textureCacheId = null;\n this.originalRender = null;\n this.originalRenderCanvas = null;\n this.originalCalculateBounds = null;\n this.originalGetLocalBounds = null;\n this.originalUpdateTransform = null;\n this.originalDestroy = null;\n this.originalMask = null;\n this.originalFilterArea = null;\n this.originalContainsPoint = null;\n this.sprite = null;\n }\n return CacheData;\n}());\nObject.defineProperties(DisplayObject.prototype, {\n /**\n * The resolution to use for cacheAsBitmap. By default this will use the renderer's resolution\n * but can be overriden for performance. Lower values will reduce memory usage at the expense\n * of render quality. A falsey value of `null` or `0` will default to the renderer's resolution.\n * If `cacheAsBitmap` is set to `true`, this will re-render with the new resolution.\n * @member {number} cacheAsBitmapResolution\n * @memberof PIXI.DisplayObject#\n * @default null\n */\n cacheAsBitmapResolution: {\n get: function () {\n return this._cacheAsBitmapResolution;\n },\n set: function (resolution) {\n if (resolution === this._cacheAsBitmapResolution) {\n return;\n }\n this._cacheAsBitmapResolution = resolution;\n if (this.cacheAsBitmap) {\n // Toggle to re-render at the new resolution\n this.cacheAsBitmap = false;\n this.cacheAsBitmap = true;\n }\n },\n },\n /**\n * The number of samples to use for cacheAsBitmap. If set to `null`, the renderer's\n * sample count is used.\n * If `cacheAsBitmap` is set to `true`, this will re-render with the new number of samples.\n * @member {number} cacheAsBitmapMultisample\n * @memberof PIXI.DisplayObject#\n * @default PIXI.MSAA_QUALITY.NONE\n */\n cacheAsBitmapMultisample: {\n get: function () {\n return this._cacheAsBitmapMultisample;\n },\n set: function (multisample) {\n if (multisample === this._cacheAsBitmapMultisample) {\n return;\n }\n this._cacheAsBitmapMultisample = multisample;\n if (this.cacheAsBitmap) {\n // Toggle to re-render with new multisample\n this.cacheAsBitmap = false;\n this.cacheAsBitmap = true;\n }\n },\n },\n /**\n * Set this to true if you want this display object to be cached as a bitmap.\n * This basically takes a snap shot of the display object as it is at that moment. It can\n * provide a performance benefit for complex static displayObjects.\n * To remove simply set this property to `false`\n *\n * IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true\n * as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.\n * @member {boolean}\n * @memberof PIXI.DisplayObject#\n */\n cacheAsBitmap: {\n get: function () {\n return this._cacheAsBitmap;\n },\n set: function (value) {\n if (this._cacheAsBitmap === value) {\n return;\n }\n this._cacheAsBitmap = value;\n var data;\n if (value) {\n if (!this._cacheData) {\n this._cacheData = new CacheData();\n }\n data = this._cacheData;\n data.originalRender = this.render;\n data.originalRenderCanvas = this.renderCanvas;\n data.originalUpdateTransform = this.updateTransform;\n data.originalCalculateBounds = this.calculateBounds;\n data.originalGetLocalBounds = this.getLocalBounds;\n data.originalDestroy = this.destroy;\n data.originalContainsPoint = this.containsPoint;\n data.originalMask = this._mask;\n data.originalFilterArea = this.filterArea;\n this.render = this._renderCached;\n this.renderCanvas = this._renderCachedCanvas;\n this.destroy = this._cacheAsBitmapDestroy;\n }\n else {\n data = this._cacheData;\n if (data.sprite) {\n this._destroyCachedDisplayObject();\n }\n this.render = data.originalRender;\n this.renderCanvas = data.originalRenderCanvas;\n this.calculateBounds = data.originalCalculateBounds;\n this.getLocalBounds = data.originalGetLocalBounds;\n this.destroy = data.originalDestroy;\n this.updateTransform = data.originalUpdateTransform;\n this.containsPoint = data.originalContainsPoint;\n this._mask = data.originalMask;\n this.filterArea = data.originalFilterArea;\n }\n },\n },\n});\n/**\n * Renders a cached version of the sprite with WebGL\n * @private\n * @method _renderCached\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._renderCached = function _renderCached(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObject(renderer);\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._render(renderer);\n};\n/**\n * Prepares the WebGL renderer to cache the sprite\n * @private\n * @method _initCachedDisplayObject\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Renderer} renderer - the WebGL renderer\n */\nDisplayObject.prototype._initCachedDisplayObject = function _initCachedDisplayObject(renderer) {\n var _a;\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // make sure alpha is set to 1 otherwise it will get rendered as invisible!\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n // first we flush anything left in the renderer (otherwise it would get rendered to the cached texture)\n renderer.batch.flush();\n // this.filters= [];\n // next we find the dimensions of the untransformed object\n // this function also calls updatetransform on all its children as part of the measuring.\n // This means we don't need to update the transform again in this function\n // TODO pass an object to clone too? saves having to create a new one each time!\n var bounds = this.getLocalBounds(null, true).clone();\n // add some padding!\n if (this.filters && this.filters.length) {\n var padding = this.filters[0].padding;\n bounds.pad(padding);\n }\n bounds.ceil(settings.RESOLUTION);\n // for now we cache the current renderTarget that the WebGL renderer is currently using.\n // this could be more elegant..\n var cachedRenderTexture = renderer.renderTexture.current;\n var cachedSourceFrame = renderer.renderTexture.sourceFrame.clone();\n var cachedDestinationFrame = renderer.renderTexture.destinationFrame.clone();\n var cachedProjectionTransform = renderer.projection.transform;\n // We also store the filter stack - I will definitely look to change how this works a little later down the line.\n // const stack = renderer.filterManager.filterStack;\n // this renderTexture will be used to store the cached DisplayObject\n var renderTexture = RenderTexture.create({\n width: bounds.width,\n height: bounds.height,\n resolution: this.cacheAsBitmapResolution || renderer.resolution,\n multisample: (_a = this.cacheAsBitmapMultisample) !== null && _a !== void 0 ? _a : renderer.multisample,\n });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = this.transform.localTransform.copyTo(_tempMatrix).invert().translate(-bounds.x, -bounds.y);\n // set all properties to there original so we can render to a texture\n this.render = this._cacheData.originalRender;\n renderer.render(this, { renderTexture: renderTexture, clear: true, transform: m, skipUpdateTransform: false });\n renderer.framebuffer.blit();\n // now restore the state be setting the new properties\n renderer.projection.transform = cachedProjectionTransform;\n renderer.renderTexture.bind(cachedRenderTexture, cachedSourceFrame, cachedDestinationFrame);\n // renderer.filterManager.filterStack = stack;\n this.render = this._renderCached;\n // the rest is the same as for Canvas\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n this.alpha = cacheAlpha;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.enableTempParent();\n this.updateTransform();\n this.disableTempParent(null);\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Renders a cached version of the sprite with canvas\n * @private\n * @method _renderCachedCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._renderCachedCanvas = function _renderCachedCanvas(renderer) {\n if (!this.visible || this.worldAlpha <= 0 || !this.renderable) {\n return;\n }\n this._initCachedDisplayObjectCanvas(renderer);\n this._cacheData.sprite.worldAlpha = this.worldAlpha;\n this._cacheData.sprite._renderCanvas(renderer);\n};\n// TODO this can be the same as the WebGL version.. will need to do a little tweaking first though..\n/**\n * Prepares the Canvas renderer to cache the sprite\n * @private\n * @method _initCachedDisplayObjectCanvas\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.CanvasRenderer} renderer - The canvas renderer\n */\nDisplayObject.prototype._initCachedDisplayObjectCanvas = function _initCachedDisplayObjectCanvas(renderer) {\n if (this._cacheData && this._cacheData.sprite) {\n return;\n }\n // get bounds actually transforms the object for us already!\n var bounds = this.getLocalBounds(null, true);\n var cacheAlpha = this.alpha;\n this.alpha = 1;\n var cachedRenderTarget = renderer.context;\n var cachedProjectionTransform = renderer._projTransform;\n bounds.ceil(settings.RESOLUTION);\n var renderTexture = RenderTexture.create({ width: bounds.width, height: bounds.height });\n var textureCacheId = \"cacheAsBitmap_\" + uid();\n this._cacheData.textureCacheId = textureCacheId;\n BaseTexture.addToCache(renderTexture.baseTexture, textureCacheId);\n Texture.addToCache(renderTexture, textureCacheId);\n // need to set //\n var m = _tempMatrix;\n this.transform.localTransform.copyTo(m);\n m.invert();\n m.tx -= bounds.x;\n m.ty -= bounds.y;\n // m.append(this.transform.worldTransform.)\n // set all properties to there original so we can render to a texture\n this.renderCanvas = this._cacheData.originalRenderCanvas;\n renderer.render(this, { renderTexture: renderTexture, clear: true, transform: m, skipUpdateTransform: false });\n // now restore the state be setting the new properties\n renderer.context = cachedRenderTarget;\n renderer._projTransform = cachedProjectionTransform;\n this.renderCanvas = this._renderCachedCanvas;\n // the rest is the same as for WebGL\n this.updateTransform = this.displayObjectUpdateTransform;\n this.calculateBounds = this._calculateCachedBounds;\n this.getLocalBounds = this._getCachedLocalBounds;\n this._mask = null;\n this.filterArea = null;\n this.alpha = cacheAlpha;\n // create our cached sprite\n var cachedSprite = new Sprite(renderTexture);\n cachedSprite.transform.worldTransform = this.transform.worldTransform;\n cachedSprite.anchor.x = -(bounds.x / bounds.width);\n cachedSprite.anchor.y = -(bounds.y / bounds.height);\n cachedSprite.alpha = cacheAlpha;\n cachedSprite._bounds = this._bounds;\n this._cacheData.sprite = cachedSprite;\n this.transform._parentID = -1;\n // restore the transform of the cached sprite to avoid the nasty flicker..\n if (!this.parent) {\n this.parent = renderer._tempDisplayObjectParent;\n this.updateTransform();\n this.parent = null;\n }\n else {\n this.updateTransform();\n }\n // map the hit test..\n this.containsPoint = cachedSprite.containsPoint.bind(cachedSprite);\n};\n/**\n * Calculates the bounds of the cached sprite\n * @private\n * @method\n */\nDisplayObject.prototype._calculateCachedBounds = function _calculateCachedBounds() {\n this._bounds.clear();\n this._cacheData.sprite.transform._worldID = this.transform._worldID;\n this._cacheData.sprite._calculateBounds();\n this._bounds.updateID = this._boundsID;\n};\n/**\n * Gets the bounds of the cached sprite.\n * @private\n * @method\n * @returns {Rectangle} The local bounds.\n */\nDisplayObject.prototype._getCachedLocalBounds = function _getCachedLocalBounds() {\n return this._cacheData.sprite.getLocalBounds(null);\n};\n/**\n * Destroys the cached sprite.\n * @private\n * @method\n */\nDisplayObject.prototype._destroyCachedDisplayObject = function _destroyCachedDisplayObject() {\n this._cacheData.sprite._texture.destroy(true);\n this._cacheData.sprite = null;\n BaseTexture.removeFromCache(this._cacheData.textureCacheId);\n Texture.removeFromCache(this._cacheData.textureCacheId);\n this._cacheData.textureCacheId = null;\n};\n/**\n * Destroys the cached object.\n * @private\n * @method\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * Used when destroying containers, see the Container.destroy method.\n */\nDisplayObject.prototype._cacheAsBitmapDestroy = function _cacheAsBitmapDestroy(options) {\n this.cacheAsBitmap = false;\n this.destroy(options);\n};\n\nexport { CacheData };\n//# sourceMappingURL=mixin-cache-as-bitmap.mjs.map\n","/*!\n * @pixi/mixin-get-child-by-name - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mixin-get-child-by-name is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject, Container } from '@pixi/display';\n\n/**\n * The instance name of the object.\n * @memberof PIXI.DisplayObject#\n * @member {string} name\n */\nDisplayObject.prototype.name = null;\n/**\n * Returns the display object in the container.\n *\n * Recursive searches are done in a preorder traversal.\n * @method getChildByName\n * @memberof PIXI.Container#\n * @param {string} name - Instance name.\n * @param {boolean}[deep=false] - Whether to search recursively\n * @returns {PIXI.DisplayObject} The child with the specified name.\n */\nContainer.prototype.getChildByName = function getChildByName(name, deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n if (this.children[i].name === name) {\n return this.children[i];\n }\n }\n if (deep) {\n for (var i = 0, j = this.children.length; i < j; i++) {\n var child = this.children[i];\n if (!child.getChildByName) {\n continue;\n }\n var target = child.getChildByName(name, true);\n if (target) {\n return target;\n }\n }\n }\n return null;\n};\n//# sourceMappingURL=mixin-get-child-by-name.mjs.map\n","/*!\n * @pixi/mixin-get-global-position - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mixin-get-global-position is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { DisplayObject } from '@pixi/display';\nimport { Point } from '@pixi/math';\n\n/**\n * Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.\n * @method getGlobalPosition\n * @memberof PIXI.DisplayObject#\n * @param {PIXI.Point} [point=new PIXI.Point()] - The point to write the global value to.\n * @param {boolean} [skipUpdate=false] - Setting to true will stop the transforms of the scene graph from\n * being updated. This means the calculation returned MAY be out of date BUT will give you a\n * nice performance boost.\n * @returns {PIXI.Point} The updated point.\n */\nDisplayObject.prototype.getGlobalPosition = function getGlobalPosition(point, skipUpdate) {\n if (point === void 0) { point = new Point(); }\n if (skipUpdate === void 0) { skipUpdate = false; }\n if (this.parent) {\n this.parent.toGlobal(this.position, point, skipUpdate);\n }\n else {\n point.x = this.position.x;\n point.y = this.position.y;\n }\n return point;\n};\n//# sourceMappingURL=mixin-get-global-position.mjs.map\n","/*!\n * @pixi/app - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/app is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { ExtensionType, extensions, autoDetectRenderer } from '@pixi/core';\nimport { Container } from '@pixi/display';\nimport { deprecation } from '@pixi/utils';\n\n/**\n * Middleware for for Application's resize functionality\n * @private\n * @class\n */\nvar ResizePlugin = /** @class */ (function () {\n function ResizePlugin() {\n }\n /**\n * Initialize the plugin with scope of application instance\n * @static\n * @private\n * @param {object} [options] - See application options\n */\n ResizePlugin.init = function (options) {\n var _this = this;\n Object.defineProperty(this, 'resizeTo', \n /**\n * The HTML element or window to automatically resize the\n * renderer's view element to match width and height.\n * @member {Window|HTMLElement}\n * @name resizeTo\n * @memberof PIXI.Application#\n */\n {\n set: function (dom) {\n globalThis.removeEventListener('resize', this.queueResize);\n this._resizeTo = dom;\n if (dom) {\n globalThis.addEventListener('resize', this.queueResize);\n this.resize();\n }\n },\n get: function () {\n return this._resizeTo;\n },\n });\n /**\n * Resize is throttled, so it's safe to call this multiple times per frame and it'll\n * only be called once.\n * @memberof PIXI.Application#\n * @method queueResize\n * @private\n */\n this.queueResize = function () {\n if (!_this._resizeTo) {\n return;\n }\n _this.cancelResize();\n // // Throttle resize events per raf\n _this._resizeId = requestAnimationFrame(function () { return _this.resize(); });\n };\n /**\n * Cancel the resize queue.\n * @memberof PIXI.Application#\n * @method cancelResize\n * @private\n */\n this.cancelResize = function () {\n if (_this._resizeId) {\n cancelAnimationFrame(_this._resizeId);\n _this._resizeId = null;\n }\n };\n /**\n * Execute an immediate resize on the renderer, this is not\n * throttled and can be expensive to call many times in a row.\n * Will resize only if `resizeTo` property is set.\n * @memberof PIXI.Application#\n * @method resize\n */\n this.resize = function () {\n if (!_this._resizeTo) {\n return;\n }\n // clear queue resize\n _this.cancelResize();\n var width;\n var height;\n // Resize to the window\n if (_this._resizeTo === globalThis.window) {\n width = globalThis.innerWidth;\n height = globalThis.innerHeight;\n }\n // Resize to other HTML entities\n else {\n var _a = _this._resizeTo, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;\n width = clientWidth;\n height = clientHeight;\n }\n _this.renderer.resize(width, height);\n };\n // On resize\n this._resizeId = null;\n this._resizeTo = null;\n this.resizeTo = options.resizeTo || null;\n };\n /**\n * Clean up the ticker, scoped to application\n * @static\n * @private\n */\n ResizePlugin.destroy = function () {\n globalThis.removeEventListener('resize', this.queueResize);\n this.cancelResize();\n this.cancelResize = null;\n this.queueResize = null;\n this.resizeTo = null;\n this.resize = null;\n };\n /** @ignore */\n ResizePlugin.extension = ExtensionType.Application;\n return ResizePlugin;\n}());\n\n/**\n * Convenience class to create a new PIXI application.\n *\n * This class automatically creates the renderer, ticker and root container.\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.from('something.png'));\n * @class\n * @memberof PIXI\n */\nvar Application = /** @class */ (function () {\n /**\n * @param {PIXI.IApplicationOptions} [options] - The optional application and renderer parameters.\n * @param {boolean} [options.antialias=false] -\n * **WebGL Only.** Whether to enable anti-aliasing. This may affect performance.\n * @param {boolean} [options.autoDensity=false] -\n * Whether the CSS dimensions of the renderer's view should be resized automatically.\n * @param {boolean} [options.autoStart=true] - Automatically starts the rendering after the construction.\n * **Note**: Setting this parameter to false does NOT stop the shared ticker even if you set\n * `options.sharedTicker` to `true` in case that it is already started. Stop it by your own.\n * @param {number} [options.backgroundAlpha=1] -\n * Transparency of the background color, value from `0` (fully transparent) to `1` (fully opaque).\n * @param {number} [options.backgroundColor=0x000000] -\n * The background color used to clear the canvas. It accepts hex numbers (e.g. `0xff0000`).\n * @param {boolean} [options.clearBeforeRender=true] - Whether to clear the canvas before new render passes.\n * @param {PIXI.IRenderingContext} [options.context] - **WebGL Only.** User-provided WebGL rendering context object.\n * @param {boolean} [options.forceCanvas=false] -\n * Force using {@link PIXI.CanvasRenderer}, even if WebGL is available. This option only is available when\n * using **pixi.js-legacy** or **@pixi/canvas-renderer** packages, otherwise it is ignored.\n * @param {number} [options.height=600] - The height of the renderer's view.\n * @param {string} [options.powerPreference] -\n * **WebGL Only.** A hint indicating what configuration of GPU is suitable for the WebGL context,\n * can be `'default'`, `'high-performance'` or `'low-power'`.\n * Setting to `'high-performance'` will prioritize rendering performance over power consumption,\n * while setting to `'low-power'` will prioritize power saving over rendering performance.\n * @param {boolean} [options.premultipliedAlpha=true] -\n * **WebGL Only.** Whether the compositor will assume the drawing buffer contains colors with premultiplied alpha.\n * @param {boolean} [options.preserveDrawingBuffer=false] -\n * **WebGL Only.** Whether to enable drawing buffer preservation. If enabled, the drawing buffer will preserve\n * its value until cleared or overwritten. Enable this if you need to call `toDataUrl` on the WebGL context.\n * @param {Window|HTMLElement} [options.resizeTo] - Element to automatically resize stage to.\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] -\n * The resolution / device pixel ratio of the renderer.\n * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.Loader.shared, `false` to create new Loader.\n * @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.Ticker.shared, `false` to create new ticker.\n * If set to `false`, you cannot register a handler to occur before anything that runs on the shared ticker.\n * The system ticker will always run before both the shared ticker and the app ticker.\n * @param {boolean} [options.transparent] -\n * **Deprecated since 6.0.0, Use `backgroundAlpha` instead.** \\\n * `true` sets `backgroundAlpha` to `0`, `false` sets `backgroundAlpha` to `1`.\n * @param {boolean|'notMultiplied'} [options.useContextAlpha=true] -\n * Pass-through value for canvas' context attribute `alpha`. This option is for cases where the\n * canvas needs to be opaque, possibly for performance reasons on some older devices.\n * If you want to set transparency, please use `backgroundAlpha`. \\\n * **WebGL Only:** When set to `'notMultiplied'`, the canvas' context attribute `alpha` will be\n * set to `true` and `premultipliedAlpha` will be to `false`.\n * @param {HTMLCanvasElement} [options.view=null] -\n * The canvas to use as the view. If omitted, a new canvas will be created.\n * @param {number} [options.width=800] - The width of the renderer's view.\n */\n function Application(options) {\n var _this = this;\n /**\n * The root display container that's rendered.\n * @member {PIXI.Container}\n */\n this.stage = new Container();\n // The default options\n options = Object.assign({\n forceCanvas: false,\n }, options);\n this.renderer = autoDetectRenderer(options);\n // install plugins here\n Application._plugins.forEach(function (plugin) {\n plugin.init.call(_this, options);\n });\n }\n /**\n * Use the {@link PIXI.extensions.add} API to register plugins.\n * @deprecated since 6.5.0\n * @static\n * @param {PIXI.IApplicationPlugin} plugin - Plugin being installed\n */\n Application.registerPlugin = function (plugin) {\n deprecation('6.5.0', 'Application.registerPlugin() is deprecated, use extensions.add()');\n extensions.add({\n type: ExtensionType.Application,\n ref: plugin,\n });\n };\n /** Render the current stage. */\n Application.prototype.render = function () {\n this.renderer.render(this.stage);\n };\n Object.defineProperty(Application.prototype, \"view\", {\n /**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */\n get: function () {\n return this.renderer.view;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Application.prototype, \"screen\", {\n /**\n * Reference to the renderer's screen rectangle. Its safe to use as `filterArea` or `hitArea` for the whole screen.\n * @member {PIXI.Rectangle}\n * @readonly\n */\n get: function () {\n return this.renderer.screen;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Destroy and don't use after this.\n * @param {boolean} [removeView=false] - Automatically remove canvas from DOM.\n * @param {object|boolean} [stageOptions] - Options parameter. A boolean will act as if all options\n * have been set to that value\n * @param {boolean} [stageOptions.children=false] - if set to true, all the children will have their destroy\n * method called as well. 'stageOptions' will be passed on to those calls.\n * @param {boolean} [stageOptions.texture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the texture of the child sprite\n * @param {boolean} [stageOptions.baseTexture=false] - Only used for child Sprites if stageOptions.children is set\n * to true. Should it destroy the base texture of the child sprite\n */\n Application.prototype.destroy = function (removeView, stageOptions) {\n var _this = this;\n // Destroy plugins in the opposite order\n // which they were constructed\n var plugins = Application._plugins.slice(0);\n plugins.reverse();\n plugins.forEach(function (plugin) {\n plugin.destroy.call(_this);\n });\n this.stage.destroy(stageOptions);\n this.stage = null;\n this.renderer.destroy(removeView);\n this.renderer = null;\n };\n /** Collection of installed plugins. */\n Application._plugins = [];\n return Application;\n}());\nextensions.handleByList(ExtensionType.Application, Application._plugins);\n\nextensions.add(ResizePlugin);\n\nexport { Application, ResizePlugin };\n//# sourceMappingURL=app.mjs.map\n","/*!\n * @pixi/mesh-extras - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/mesh-extras is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { MeshGeometry, Mesh, MeshMaterial } from '@pixi/mesh';\nimport { WRAP_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * @memberof PIXI\n */\nvar PlaneGeometry = /** @class */ (function (_super) {\n __extends(PlaneGeometry, _super);\n /**\n * @param width - The width of the plane.\n * @param height - The height of the plane.\n * @param segWidth - Number of horizontal segments.\n * @param segHeight - Number of vertical segments.\n */\n function PlaneGeometry(width, height, segWidth, segHeight) {\n if (width === void 0) { width = 100; }\n if (height === void 0) { height = 100; }\n if (segWidth === void 0) { segWidth = 10; }\n if (segHeight === void 0) { segHeight = 10; }\n var _this = _super.call(this) || this;\n _this.segWidth = segWidth;\n _this.segHeight = segHeight;\n _this.width = width;\n _this.height = height;\n _this.build();\n return _this;\n }\n /**\n * Refreshes plane coordinates\n * @private\n */\n PlaneGeometry.prototype.build = function () {\n var total = this.segWidth * this.segHeight;\n var verts = [];\n var uvs = [];\n var indices = [];\n var segmentsX = this.segWidth - 1;\n var segmentsY = this.segHeight - 1;\n var sizeX = (this.width) / segmentsX;\n var sizeY = (this.height) / segmentsY;\n for (var i = 0; i < total; i++) {\n var x = (i % this.segWidth);\n var y = ((i / this.segWidth) | 0);\n verts.push(x * sizeX, y * sizeY);\n uvs.push(x / segmentsX, y / segmentsY);\n }\n var totalSub = segmentsX * segmentsY;\n for (var i = 0; i < totalSub; i++) {\n var xpos = i % segmentsX;\n var ypos = (i / segmentsX) | 0;\n var value = (ypos * this.segWidth) + xpos;\n var value2 = (ypos * this.segWidth) + xpos + 1;\n var value3 = ((ypos + 1) * this.segWidth) + xpos;\n var value4 = ((ypos + 1) * this.segWidth) + xpos + 1;\n indices.push(value, value2, value3, value2, value4, value3);\n }\n this.buffers[0].data = new Float32Array(verts);\n this.buffers[1].data = new Float32Array(uvs);\n this.indexBuffer.data = new Uint16Array(indices);\n // ensure that the changes are uploaded\n this.buffers[0].update();\n this.buffers[1].update();\n this.indexBuffer.update();\n };\n return PlaneGeometry;\n}(MeshGeometry));\n\n/**\n * RopeGeometry allows you to draw a geometry across several points and then manipulate these points.\n *\n * ```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * const rope = new PIXI.RopeGeometry(100, points);\n * ```\n * @memberof PIXI\n */\nvar RopeGeometry = /** @class */ (function (_super) {\n __extends(RopeGeometry, _super);\n /**\n * @param width - The width (i.e., thickness) of the rope.\n * @param points - An array of {@link PIXI.Point} objects to construct this rope.\n * @param textureScale - By default the rope texture will be stretched to match\n * rope length. If textureScale is positive this value will be treated as a scaling\n * factor and the texture will preserve its aspect ratio instead. To create a tiling rope\n * set baseTexture.wrapMode to {@link PIXI.WRAP_MODES.REPEAT} and use a power of two texture,\n * then set textureScale=1 to keep the original texture pixel size.\n * In order to reduce alpha channel artifacts provide a larger texture and downsample -\n * i.e. set textureScale=0.5 to scale it down twice.\n */\n function RopeGeometry(width, points, textureScale) {\n if (width === void 0) { width = 200; }\n if (textureScale === void 0) { textureScale = 0; }\n var _this = _super.call(this, new Float32Array(points.length * 4), new Float32Array(points.length * 4), new Uint16Array((points.length - 1) * 6)) || this;\n _this.points = points;\n _this._width = width;\n _this.textureScale = textureScale;\n _this.build();\n return _this;\n }\n Object.defineProperty(RopeGeometry.prototype, \"width\", {\n /**\n * The width (i.e., thickness) of the rope.\n * @readonly\n */\n get: function () {\n return this._width;\n },\n enumerable: false,\n configurable: true\n });\n /** Refreshes Rope indices and uvs */\n RopeGeometry.prototype.build = function () {\n var points = this.points;\n if (!points)\n { return; }\n var vertexBuffer = this.getBuffer('aVertexPosition');\n var uvBuffer = this.getBuffer('aTextureCoord');\n var indexBuffer = this.getIndex();\n // if too little points, or texture hasn't got UVs set yet just move on.\n if (points.length < 1) {\n return;\n }\n // if the number of points has changed we will need to recreate the arraybuffers\n if (vertexBuffer.data.length / 4 !== points.length) {\n vertexBuffer.data = new Float32Array(points.length * 4);\n uvBuffer.data = new Float32Array(points.length * 4);\n indexBuffer.data = new Uint16Array((points.length - 1) * 6);\n }\n var uvs = uvBuffer.data;\n var indices = indexBuffer.data;\n uvs[0] = 0;\n uvs[1] = 0;\n uvs[2] = 0;\n uvs[3] = 1;\n var amount = 0;\n var prev = points[0];\n var textureWidth = this._width * this.textureScale;\n var total = points.length; // - 1;\n for (var i = 0; i < total; i++) {\n // time to do some smart drawing!\n var index = i * 4;\n if (this.textureScale > 0) {\n // calculate pixel distance from previous point\n var dx = prev.x - points[i].x;\n var dy = prev.y - points[i].y;\n var distance = Math.sqrt((dx * dx) + (dy * dy));\n prev = points[i];\n amount += distance / textureWidth;\n }\n else {\n // stretch texture\n amount = i / (total - 1);\n }\n uvs[index] = amount;\n uvs[index + 1] = 0;\n uvs[index + 2] = amount;\n uvs[index + 3] = 1;\n }\n var indexCount = 0;\n for (var i = 0; i < total - 1; i++) {\n var index = i * 2;\n indices[indexCount++] = index;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 2;\n indices[indexCount++] = index + 1;\n indices[indexCount++] = index + 3;\n }\n // ensure that the changes are uploaded\n uvBuffer.update();\n indexBuffer.update();\n this.updateVertices();\n };\n /** refreshes vertices of Rope mesh */\n RopeGeometry.prototype.updateVertices = function () {\n var points = this.points;\n if (points.length < 1) {\n return;\n }\n var lastPoint = points[0];\n var nextPoint;\n var perpX = 0;\n var perpY = 0;\n var vertices = this.buffers[0].data;\n var total = points.length;\n for (var i = 0; i < total; i++) {\n var point = points[i];\n var index = i * 4;\n if (i < points.length - 1) {\n nextPoint = points[i + 1];\n }\n else {\n nextPoint = point;\n }\n perpY = -(nextPoint.x - lastPoint.x);\n perpX = nextPoint.y - lastPoint.y;\n var perpLength = Math.sqrt((perpX * perpX) + (perpY * perpY));\n var num = this.textureScale > 0 ? this.textureScale * this._width / 2 : this._width / 2;\n perpX /= perpLength;\n perpY /= perpLength;\n perpX *= num;\n perpY *= num;\n vertices[index] = point.x + perpX;\n vertices[index + 1] = point.y + perpY;\n vertices[index + 2] = point.x - perpX;\n vertices[index + 3] = point.y - perpY;\n lastPoint = point;\n }\n this.buffers[0].update();\n };\n RopeGeometry.prototype.update = function () {\n if (this.textureScale > 0) {\n this.build(); // we need to update UVs\n }\n else {\n this.updateVertices();\n }\n };\n return RopeGeometry;\n}(MeshGeometry));\n\n/**\n * The rope allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let rope = new PIXI.SimpleRope(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n * @memberof PIXI\n */\nvar SimpleRope = /** @class */ (function (_super) {\n __extends(SimpleRope, _super);\n /**\n * @param texture - The texture to use on the rope.\n * @param points - An array of {@link PIXI.Point} objects to construct this rope.\n * @param {number} textureScale - Optional. Positive values scale rope texture\n * keeping its aspect ratio. You can reduce alpha channel artifacts by providing a larger texture\n * and downsampling here. If set to zero, texture will be stretched instead.\n */\n function SimpleRope(texture, points, textureScale) {\n if (textureScale === void 0) { textureScale = 0; }\n var _this = this;\n var ropeGeometry = new RopeGeometry(texture.height, points, textureScale);\n var meshMaterial = new MeshMaterial(texture);\n if (textureScale > 0) {\n // attempt to set UV wrapping, will fail on non-power of two textures\n texture.baseTexture.wrapMode = WRAP_MODES.REPEAT;\n }\n _this = _super.call(this, ropeGeometry, meshMaterial) || this;\n /**\n * re-calculate vertices by rope points each frame\n * @member {boolean}\n */\n _this.autoUpdate = true;\n return _this;\n }\n SimpleRope.prototype._render = function (renderer) {\n var geometry = this.geometry;\n if (this.autoUpdate || geometry._width !== this.shader.texture.height) {\n geometry._width = this.shader.texture.height;\n geometry.update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleRope;\n}(Mesh));\n\n/**\n * The SimplePlane allows you to draw a texture across several points and then manipulate these points\n *\n *```js\n * for (let i = 0; i < 20; i++) {\n * points.push(new PIXI.Point(i * 50, 0));\n * };\n * let SimplePlane = new PIXI.SimplePlane(PIXI.Texture.from(\"snake.png\"), points);\n * ```\n * @memberof PIXI\n */\nvar SimplePlane = /** @class */ (function (_super) {\n __extends(SimplePlane, _super);\n /**\n * @param texture - The texture to use on the SimplePlane.\n * @param verticesX - The number of vertices in the x-axis\n * @param verticesY - The number of vertices in the y-axis\n */\n function SimplePlane(texture, verticesX, verticesY) {\n var _this = this;\n var planeGeometry = new PlaneGeometry(texture.width, texture.height, verticesX, verticesY);\n var meshMaterial = new MeshMaterial(Texture.WHITE);\n _this = _super.call(this, planeGeometry, meshMaterial) || this;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n _this.autoResize = true;\n return _this;\n }\n /**\n * Method used for overrides, to do something in case texture frame was changed.\n * Meshes based on plane can override it and change more details based on texture.\n */\n SimplePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n var geometry = this.geometry;\n var _a = this.shader.texture, width = _a.width, height = _a.height;\n if (this.autoResize && (geometry.width !== width || geometry.height !== height)) {\n geometry.width = this.shader.texture.width;\n geometry.height = this.shader.texture.height;\n geometry.build();\n }\n };\n Object.defineProperty(SimplePlane.prototype, \"texture\", {\n get: function () {\n return this.shader.texture;\n },\n set: function (value) {\n // Track texture same way sprite does.\n // For generated meshes like NineSlicePlane it can change the geometry.\n // Unfortunately, this method might not work if you directly change texture in material.\n if (this.shader.texture === value) {\n return;\n }\n this.shader.texture = value;\n this._textureID = -1;\n if (value.baseTexture.valid) {\n this.textureUpdated();\n }\n else {\n value.once('update', this.textureUpdated, this);\n }\n },\n enumerable: false,\n configurable: true\n });\n SimplePlane.prototype._render = function (renderer) {\n if (this._textureID !== this.shader.texture._updateID) {\n this.textureUpdated();\n }\n _super.prototype._render.call(this, renderer);\n };\n SimplePlane.prototype.destroy = function (options) {\n this.shader.texture.off('update', this.textureUpdated, this);\n _super.prototype.destroy.call(this, options);\n };\n return SimplePlane;\n}(Mesh));\n\n/**\n * The Simple Mesh class mimics Mesh in PixiJS v4, providing easy-to-use constructor arguments.\n * For more robust customization, use {@link PIXI.Mesh}.\n * @memberof PIXI\n */\nvar SimpleMesh = /** @class */ (function (_super) {\n __extends(SimpleMesh, _super);\n /**\n * @param texture - The texture to use\n * @param {Float32Array} [vertices] - if you want to specify the vertices\n * @param {Float32Array} [uvs] - if you want to specify the uvs\n * @param {Uint16Array} [indices] - if you want to specify the indices\n * @param drawMode - the drawMode, can be any of the Mesh.DRAW_MODES consts\n */\n function SimpleMesh(texture, vertices, uvs, indices, drawMode) {\n if (texture === void 0) { texture = Texture.EMPTY; }\n var _this = this;\n var geometry = new MeshGeometry(vertices, uvs, indices);\n geometry.getBuffer('aVertexPosition').static = false;\n var meshMaterial = new MeshMaterial(texture);\n _this = _super.call(this, geometry, meshMaterial, null, drawMode) || this;\n _this.autoUpdate = true;\n return _this;\n }\n Object.defineProperty(SimpleMesh.prototype, \"vertices\", {\n /**\n * Collection of vertices data.\n * @type {Float32Array}\n */\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n SimpleMesh.prototype._render = function (renderer) {\n if (this.autoUpdate) {\n this.geometry.getBuffer('aVertexPosition').update();\n }\n _super.prototype._render.call(this, renderer);\n };\n return SimpleMesh;\n}(Mesh));\n\nvar DEFAULT_BORDER_SIZE = 10;\n/**\n * The NineSlicePlane allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n *```js\n * let Plane9 = new PIXI.NineSlicePlane(PIXI.Texture.from('BoxWithRoundedCorners.png'), 15, 15, 15, 15);\n * ```\n * <pre>\n * A B\n * +---+----------------------+---+\n * C | 1 | 2 | 3 |\n * +---+----------------------+---+\n * | | | |\n * | 4 | 5 | 6 |\n * | | | |\n * +---+----------------------+---+\n * D | 7 | 8 | 9 |\n * +---+----------------------+---+\n * When changing this objects width and/or height:\n * areas 1 3 7 and 9 will remain unscaled.\n * areas 2 and 8 will be stretched horizontally\n * areas 4 and 6 will be stretched vertically\n * area 5 will be stretched both horizontally and vertically\n * </pre>\n * @memberof PIXI\n */\nvar NineSlicePlane = /** @class */ (function (_super) {\n __extends(NineSlicePlane, _super);\n /**\n * @param texture - The texture to use on the NineSlicePlane.\n * @param {number} [leftWidth=10] - size of the left vertical bar (A)\n * @param {number} [topHeight=10] - size of the top horizontal bar (C)\n * @param {number} [rightWidth=10] - size of the right vertical bar (B)\n * @param {number} [bottomHeight=10] - size of the bottom horizontal bar (D)\n */\n function NineSlicePlane(texture, leftWidth, topHeight, rightWidth, bottomHeight) {\n if (leftWidth === void 0) { leftWidth = DEFAULT_BORDER_SIZE; }\n if (topHeight === void 0) { topHeight = DEFAULT_BORDER_SIZE; }\n if (rightWidth === void 0) { rightWidth = DEFAULT_BORDER_SIZE; }\n if (bottomHeight === void 0) { bottomHeight = DEFAULT_BORDER_SIZE; }\n var _this = _super.call(this, Texture.WHITE, 4, 4) || this;\n _this._origWidth = texture.orig.width;\n _this._origHeight = texture.orig.height;\n /** The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n _this._width = _this._origWidth;\n /** The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n _this._height = _this._origHeight;\n _this._leftWidth = leftWidth;\n _this._rightWidth = rightWidth;\n _this._topHeight = topHeight;\n _this._bottomHeight = bottomHeight;\n // lets call the setter to ensure all necessary updates are performed\n _this.texture = texture;\n return _this;\n }\n NineSlicePlane.prototype.textureUpdated = function () {\n this._textureID = this.shader.texture._updateID;\n this._refresh();\n };\n Object.defineProperty(NineSlicePlane.prototype, \"vertices\", {\n get: function () {\n return this.geometry.getBuffer('aVertexPosition').data;\n },\n set: function (value) {\n this.geometry.getBuffer('aVertexPosition').data = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Updates the horizontal vertices. */\n NineSlicePlane.prototype.updateHorizontalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[9] = vertices[11] = vertices[13] = vertices[15] = this._topHeight * scale;\n vertices[17] = vertices[19] = vertices[21] = vertices[23] = this._height - (this._bottomHeight * scale);\n vertices[25] = vertices[27] = vertices[29] = vertices[31] = this._height;\n };\n /** Updates the vertical vertices. */\n NineSlicePlane.prototype.updateVerticalVertices = function () {\n var vertices = this.vertices;\n var scale = this._getMinScale();\n vertices[2] = vertices[10] = vertices[18] = vertices[26] = this._leftWidth * scale;\n vertices[4] = vertices[12] = vertices[20] = vertices[28] = this._width - (this._rightWidth * scale);\n vertices[6] = vertices[14] = vertices[22] = vertices[30] = this._width;\n };\n /**\n * Returns the smaller of a set of vertical and horizontal scale of nine slice corners.\n * @returns Smaller number of vertical and horizontal scale.\n */\n NineSlicePlane.prototype._getMinScale = function () {\n var w = this._leftWidth + this._rightWidth;\n var scaleW = this._width > w ? 1.0 : this._width / w;\n var h = this._topHeight + this._bottomHeight;\n var scaleH = this._height > h ? 1.0 : this._height / h;\n var scale = Math.min(scaleW, scaleH);\n return scale;\n };\n Object.defineProperty(NineSlicePlane.prototype, \"width\", {\n /** The width of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n get: function () {\n return this._width;\n },\n set: function (value) {\n this._width = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"height\", {\n /** The height of the NineSlicePlane, setting this will actually modify the vertices and UV's of this plane. */\n get: function () {\n return this._height;\n },\n set: function (value) {\n this._height = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"leftWidth\", {\n /** The width of the left column. */\n get: function () {\n return this._leftWidth;\n },\n set: function (value) {\n this._leftWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"rightWidth\", {\n /** The width of the right column. */\n get: function () {\n return this._rightWidth;\n },\n set: function (value) {\n this._rightWidth = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"topHeight\", {\n /** The height of the top row. */\n get: function () {\n return this._topHeight;\n },\n set: function (value) {\n this._topHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NineSlicePlane.prototype, \"bottomHeight\", {\n /** The height of the bottom row. */\n get: function () {\n return this._bottomHeight;\n },\n set: function (value) {\n this._bottomHeight = value;\n this._refresh();\n },\n enumerable: false,\n configurable: true\n });\n /** Refreshes NineSlicePlane coords. All of them. */\n NineSlicePlane.prototype._refresh = function () {\n var texture = this.texture;\n var uvs = this.geometry.buffers[1].data;\n this._origWidth = texture.orig.width;\n this._origHeight = texture.orig.height;\n var _uvw = 1.0 / this._origWidth;\n var _uvh = 1.0 / this._origHeight;\n uvs[0] = uvs[8] = uvs[16] = uvs[24] = 0;\n uvs[1] = uvs[3] = uvs[5] = uvs[7] = 0;\n uvs[6] = uvs[14] = uvs[22] = uvs[30] = 1;\n uvs[25] = uvs[27] = uvs[29] = uvs[31] = 1;\n uvs[2] = uvs[10] = uvs[18] = uvs[26] = _uvw * this._leftWidth;\n uvs[4] = uvs[12] = uvs[20] = uvs[28] = 1 - (_uvw * this._rightWidth);\n uvs[9] = uvs[11] = uvs[13] = uvs[15] = _uvh * this._topHeight;\n uvs[17] = uvs[19] = uvs[21] = uvs[23] = 1 - (_uvh * this._bottomHeight);\n this.updateHorizontalVertices();\n this.updateVerticalVertices();\n this.geometry.buffers[0].update();\n this.geometry.buffers[1].update();\n };\n return NineSlicePlane;\n}(SimplePlane));\n\nexport { NineSlicePlane, PlaneGeometry, RopeGeometry, SimpleMesh, SimplePlane, SimpleRope };\n//# sourceMappingURL=mesh-extras.mjs.map\n","/*!\n * @pixi/sprite-animated - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * @pixi/sprite-animated is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture } from '@pixi/core';\nimport { Sprite } from '@pixi/sprite';\nimport { Ticker, UPDATE_PRIORITY } from '@pixi/ticker';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * An AnimatedSprite is a simple way to display an animation depicted by a list of textures.\n *\n * ```js\n * let alienImages = [\"image_sequence_01.png\",\"image_sequence_02.png\",\"image_sequence_03.png\",\"image_sequence_04.png\"];\n * let textureArray = [];\n *\n * for (let i=0; i < 4; i++)\n * {\n * let texture = PIXI.Texture.from(alienImages[i]);\n * textureArray.push(texture);\n * };\n *\n * let animatedSprite = new PIXI.AnimatedSprite(textureArray);\n * ```\n *\n * The more efficient and simpler way to create an animated sprite is using a {@link PIXI.Spritesheet}\n * containing the animation definitions:\n *\n * ```js\n * PIXI.Loader.shared.add(\"assets/spritesheet.json\").load(setup);\n *\n * function setup() {\n * let sheet = PIXI.Loader.shared.resources[\"assets/spritesheet.json\"].spritesheet;\n * animatedSprite = new PIXI.AnimatedSprite(sheet.animations[\"image_sequence\"]);\n * ...\n * }\n * ```\n * @memberof PIXI\n */\nvar AnimatedSprite = /** @class */ (function (_super) {\n __extends(AnimatedSprite, _super);\n /**\n * @param textures - An array of {@link PIXI.Texture} or frame\n * objects that make up the animation.\n * @param {boolean} [autoUpdate=true] - Whether to use PIXI.Ticker.shared to auto update animation time.\n */\n function AnimatedSprite(textures, autoUpdate) {\n if (autoUpdate === void 0) { autoUpdate = true; }\n var _this = _super.call(this, textures[0] instanceof Texture ? textures[0] : textures[0].texture) || this;\n _this._textures = null;\n _this._durations = null;\n _this._autoUpdate = autoUpdate;\n _this._isConnectedToTicker = false;\n _this.animationSpeed = 1;\n _this.loop = true;\n _this.updateAnchor = false;\n _this.onComplete = null;\n _this.onFrameChange = null;\n _this.onLoop = null;\n _this._currentTime = 0;\n _this._playing = false;\n _this._previousFrame = null;\n _this.textures = textures;\n return _this;\n }\n /** Stops the AnimatedSprite. */\n AnimatedSprite.prototype.stop = function () {\n if (!this._playing) {\n return;\n }\n this._playing = false;\n if (this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n };\n /** Plays the AnimatedSprite. */\n AnimatedSprite.prototype.play = function () {\n if (this._playing) {\n return;\n }\n this._playing = true;\n if (this._autoUpdate && !this._isConnectedToTicker) {\n Ticker.shared.add(this.update, this, UPDATE_PRIORITY.HIGH);\n this._isConnectedToTicker = true;\n }\n };\n /**\n * Stops the AnimatedSprite and goes to a specific frame.\n * @param frameNumber - Frame index to stop at.\n */\n AnimatedSprite.prototype.gotoAndStop = function (frameNumber) {\n this.stop();\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n };\n /**\n * Goes to a specific frame and begins playing the AnimatedSprite.\n * @param frameNumber - Frame index to start at.\n */\n AnimatedSprite.prototype.gotoAndPlay = function (frameNumber) {\n var previousFrame = this.currentFrame;\n this._currentTime = frameNumber;\n if (previousFrame !== this.currentFrame) {\n this.updateTexture();\n }\n this.play();\n };\n /**\n * Updates the object transform for rendering.\n * @param deltaTime - Time since last tick.\n */\n AnimatedSprite.prototype.update = function (deltaTime) {\n if (!this._playing) {\n return;\n }\n var elapsed = this.animationSpeed * deltaTime;\n var previousFrame = this.currentFrame;\n if (this._durations !== null) {\n var lag = this._currentTime % 1 * this._durations[this.currentFrame];\n lag += elapsed / 60 * 1000;\n while (lag < 0) {\n this._currentTime--;\n lag += this._durations[this.currentFrame];\n }\n var sign = Math.sign(this.animationSpeed * deltaTime);\n this._currentTime = Math.floor(this._currentTime);\n while (lag >= this._durations[this.currentFrame]) {\n lag -= this._durations[this.currentFrame] * sign;\n this._currentTime += sign;\n }\n this._currentTime += lag / this._durations[this.currentFrame];\n }\n else {\n this._currentTime += elapsed;\n }\n if (this._currentTime < 0 && !this.loop) {\n this.gotoAndStop(0);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (this._currentTime >= this._textures.length && !this.loop) {\n this.gotoAndStop(this._textures.length - 1);\n if (this.onComplete) {\n this.onComplete();\n }\n }\n else if (previousFrame !== this.currentFrame) {\n if (this.loop && this.onLoop) {\n if (this.animationSpeed > 0 && this.currentFrame < previousFrame) {\n this.onLoop();\n }\n else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) {\n this.onLoop();\n }\n }\n this.updateTexture();\n }\n };\n /** Updates the displayed texture to match the current frame index. */\n AnimatedSprite.prototype.updateTexture = function () {\n var currentFrame = this.currentFrame;\n if (this._previousFrame === currentFrame) {\n return;\n }\n this._previousFrame = currentFrame;\n this._texture = this._textures[currentFrame];\n this._textureID = -1;\n this._textureTrimmedID = -1;\n this._cachedTint = 0xFFFFFF;\n this.uvs = this._texture._uvs.uvsFloat32;\n if (this.updateAnchor) {\n this._anchor.copyFrom(this._texture.defaultAnchor);\n }\n if (this.onFrameChange) {\n this.onFrameChange(this.currentFrame);\n }\n };\n /**\n * Stops the AnimatedSprite and destroys it.\n * @param {object|boolean} [options] - Options parameter. A boolean will act as if all options\n * have been set to that value.\n * @param {boolean} [options.children=false] - If set to true, all the children will have their destroy\n * method called as well. 'options' will be passed on to those calls.\n * @param {boolean} [options.texture=false] - Should it destroy the current texture of the sprite as well.\n * @param {boolean} [options.baseTexture=false] - Should it destroy the base texture of the sprite as well.\n */\n AnimatedSprite.prototype.destroy = function (options) {\n this.stop();\n _super.prototype.destroy.call(this, options);\n this.onComplete = null;\n this.onFrameChange = null;\n this.onLoop = null;\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of frame ids.\n * @param frames - The array of frames ids the AnimatedSprite will use as its texture frames.\n * @returns - The new animated sprite with the specified frames.\n */\n AnimatedSprite.fromFrames = function (frames) {\n var textures = [];\n for (var i = 0; i < frames.length; ++i) {\n textures.push(Texture.from(frames[i]));\n }\n return new AnimatedSprite(textures);\n };\n /**\n * A short hand way of creating an AnimatedSprite from an array of image ids.\n * @param images - The array of image urls the AnimatedSprite will use as its texture frames.\n * @returns The new animate sprite with the specified images as frames.\n */\n AnimatedSprite.fromImages = function (images) {\n var textures = [];\n for (var i = 0; i < images.length; ++i) {\n textures.push(Texture.from(images[i]));\n }\n return new AnimatedSprite(textures);\n };\n Object.defineProperty(AnimatedSprite.prototype, \"totalFrames\", {\n /**\n * The total number of frames in the AnimatedSprite. This is the same as number of textures\n * assigned to the AnimatedSprite.\n * @readonly\n * @default 0\n */\n get: function () {\n return this._textures.length;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"textures\", {\n /** The array of textures used for this AnimatedSprite. */\n get: function () {\n return this._textures;\n },\n set: function (value) {\n if (value[0] instanceof Texture) {\n this._textures = value;\n this._durations = null;\n }\n else {\n this._textures = [];\n this._durations = [];\n for (var i = 0; i < value.length; i++) {\n this._textures.push(value[i].texture);\n this._durations.push(value[i].time);\n }\n }\n this._previousFrame = null;\n this.gotoAndStop(0);\n this.updateTexture();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"currentFrame\", {\n /**\n * The AnimatedSprites current frame index.\n * @readonly\n */\n get: function () {\n var currentFrame = Math.floor(this._currentTime) % this._textures.length;\n if (currentFrame < 0) {\n currentFrame += this._textures.length;\n }\n return currentFrame;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"playing\", {\n /**\n * Indicates if the AnimatedSprite is currently playing.\n * @readonly\n */\n get: function () {\n return this._playing;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AnimatedSprite.prototype, \"autoUpdate\", {\n /** Whether to use PIXI.Ticker.shared to auto update animation time. */\n get: function () {\n return this._autoUpdate;\n },\n set: function (value) {\n if (value !== this._autoUpdate) {\n this._autoUpdate = value;\n if (!this._autoUpdate && this._isConnectedToTicker) {\n Ticker.shared.remove(this.update, this);\n this._isConnectedToTicker = false;\n }\n else if (this._autoUpdate && !this._isConnectedToTicker && this._playing) {\n Ticker.shared.add(this.update, this);\n this._isConnectedToTicker = true;\n }\n }\n },\n enumerable: false,\n configurable: true\n });\n return AnimatedSprite;\n}(Sprite));\n\nexport { AnimatedSprite };\n//# sourceMappingURL=sprite-animated.mjs.map\n","/*!\n * pixi.js - v6.5.10\n * Compiled Thu, 06 Jul 2023 15:25:11 UTC\n *\n * pixi.js is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport '@pixi/polyfill';\nimport * as utils from '@pixi/utils';\nexport { utils };\nimport { AccessibilityManager } from '@pixi/accessibility';\nexport * from '@pixi/accessibility';\nimport { InteractionManager } from '@pixi/interaction';\nexport * from '@pixi/interaction';\nimport { extensions, BatchRenderer } from '@pixi/core';\nexport * from '@pixi/core';\nimport { Extract } from '@pixi/extract';\nexport * from '@pixi/extract';\nimport { AppLoaderPlugin } from '@pixi/loaders';\nexport * from '@pixi/loaders';\nimport { CompressedTextureLoader, DDSLoader, KTXLoader } from '@pixi/compressed-textures';\nexport * from '@pixi/compressed-textures';\nimport { ParticleRenderer } from '@pixi/particle-container';\nexport * from '@pixi/particle-container';\nimport { Prepare } from '@pixi/prepare';\nexport * from '@pixi/prepare';\nimport { SpritesheetLoader } from '@pixi/spritesheet';\nexport * from '@pixi/spritesheet';\nimport { TilingSpriteRenderer } from '@pixi/sprite-tiling';\nexport * from '@pixi/sprite-tiling';\nimport { BitmapFontLoader } from '@pixi/text-bitmap';\nexport * from '@pixi/text-bitmap';\nimport { TickerPlugin } from '@pixi/ticker';\nexport * from '@pixi/ticker';\nimport { AlphaFilter } from '@pixi/filter-alpha';\nimport { BlurFilter, BlurFilterPass } from '@pixi/filter-blur';\nimport { ColorMatrixFilter } from '@pixi/filter-color-matrix';\nimport { DisplacementFilter } from '@pixi/filter-displacement';\nimport { FXAAFilter } from '@pixi/filter-fxaa';\nimport { NoiseFilter } from '@pixi/filter-noise';\nimport '@pixi/mixin-cache-as-bitmap';\nimport '@pixi/mixin-get-child-by-name';\nimport '@pixi/mixin-get-global-position';\nexport * from '@pixi/app';\nexport * from '@pixi/constants';\nexport * from '@pixi/display';\nexport * from '@pixi/graphics';\nexport * from '@pixi/math';\nexport * from '@pixi/mesh';\nexport * from '@pixi/mesh-extras';\nexport * from '@pixi/runner';\nexport * from '@pixi/sprite';\nexport * from '@pixi/sprite-animated';\nexport * from '@pixi/text';\nexport * from '@pixi/settings';\n\nextensions.add(\n// Install renderer plugins\nAccessibilityManager, Extract, InteractionManager, ParticleRenderer, Prepare, BatchRenderer, TilingSpriteRenderer, \n// Install loader plugins\nBitmapFontLoader, CompressedTextureLoader, DDSLoader, KTXLoader, SpritesheetLoader, \n// Install application plugins\nTickerPlugin, AppLoaderPlugin);\n/**\n * This namespace contains WebGL-only display filters that can be applied\n * to DisplayObjects using the {@link PIXI.DisplayObject#filters filters} property.\n *\n * Since PixiJS only had a handful of built-in filters, additional filters\n * can be downloaded {@link https://github.com/pixijs/pixi-filters here} from the\n * PixiJS Filters repository.\n *\n * All filters must extend {@link PIXI.Filter}.\n * @example\n * // Create a new application\n * const app = new PIXI.Application();\n *\n * // Draw a green rectangle\n * const rect = new PIXI.Graphics()\n * .beginFill(0x00ff00)\n * .drawRect(40, 40, 200, 200);\n *\n * // Add a blur filter\n * rect.filters = [new PIXI.filters.BlurFilter()];\n *\n * // Display rectangle\n * app.stage.addChild(rect);\n * document.body.appendChild(app.view);\n * @namespace PIXI.filters\n */\nvar filters = {\n AlphaFilter: AlphaFilter,\n BlurFilter: BlurFilter,\n BlurFilterPass: BlurFilterPass,\n ColorMatrixFilter: ColorMatrixFilter,\n DisplacementFilter: DisplacementFilter,\n FXAAFilter: FXAAFilter,\n NoiseFilter: NoiseFilter,\n};\n\nexport { filters };\n//# sourceMappingURL=pixi.mjs.map\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","/*!\n * @pixi/filter-old-film - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-old-film is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\n\\nuniform float sepia;\\nuniform float noise;\\nuniform float noiseSize;\\nuniform float scratch;\\nuniform float scratchDensity;\\nuniform float scratchWidth;\\nuniform float vignetting;\\nuniform float vignettingAlpha;\\nuniform float vignettingBlur;\\nuniform float seed;\\n\\nconst float SQRT_2 = 1.414213;\\nconst vec3 SEPIA_RGB = vec3(112.0 / 255.0, 66.0 / 255.0, 20.0 / 255.0);\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvec3 Overlay(vec3 src, vec3 dst)\\n{\\n // if (dst <= 0.5) then: 2 * src * dst\\n // if (dst > 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\\n}\\n\\n\\nvoid main()\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n vec3 color = gl_FragColor.rgb;\\n\\n if (sepia > 0.0)\\n {\\n float gray = (color.x + color.y + color.z) / 3.0;\\n vec3 grayscale = vec3(gray);\\n\\n color = Overlay(SEPIA_RGB, grayscale);\\n\\n color = grayscale + sepia * (color - grayscale);\\n }\\n\\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\\n\\n if (vignetting > 0.0)\\n {\\n float outter = SQRT_2 - vignetting * SQRT_2;\\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\\n dir.y *= dimensions.y / dimensions.x;\\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\\n }\\n\\n if (scratchDensity > seed && scratch != 0.0)\\n {\\n float phase = seed * 256.0;\\n float s = mod(floor(phase), 2.0);\\n float dist = 1.0 / scratchDensity;\\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\\n if (d < seed * 0.6 + 0.4)\\n {\\n highp float period = scratchDensity * 10.0;\\n\\n float xx = coord.x * period + phase;\\n float aa = abs(mod(xx, 0.5) * 4.0);\\n float bb = mod(floor(xx / 0.5), 2.0);\\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\\n\\n float kk = 2.0 * period;\\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\\n float dh = dw * kk;\\n\\n float tine = (yy - (2.0 - dh));\\n\\n if (tine > 0.0) {\\n float _sign = sign(scratch);\\n\\n tine = s * tine / period + scratch + 0.1;\\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\\n\\n color.rgb *= tine;\\n }\\n }\\n }\\n\\n if (noise > 0.0 && noiseSize > 0.0)\\n {\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\\n // float _noise = snoise(d) * 0.5;\\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\\n color += _noise * noise;\\n }\\n\\n gl_FragColor.rgb = color;\\n}\\n\";\n\n/**\n * The OldFilmFilter applies a Old film effect to an object.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/old-film.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-old-film|@pixi/filter-old-film}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar OldFilmFilter = /** @class */ (function (_super) {\n __extends(OldFilmFilter, _super);\n /**\n * @param {object|number} [options] - The optional parameters of old film effect.\n * When options is a number , it will be `seed`\n * @param {number} [options.sepia=0.3] - The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less, and a value of\n * `0` produces no sepia effect\n * @param {number} [options.noise=0.3] - Opacity/intensity of the noise effect between `0` and `1`\n * @param {number} [options.noiseSize=1.0] - The size of the noise particles\n * @param {number} [options.scratch=0.5] - How often scratches appear\n * @param {number} [options.scratchDensity=0.3] - The density of the number of scratches\n * @param {number} [options.scratchWidth=1.0] - The width of the scratches\n * @param {number} [options.vignetting=0.3] - The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @param {number} [options.vignettingAlpha=1.0] - Amount of opacity of vignette\n * @param {number} [options.vignettingBlur=0.3] - Blur intensity of the vignette\n * @param {number} [seed=0] - A see value to apply to the random noise generation\n */\n function OldFilmFilter(options, seed) {\n if (seed === void 0) { seed = 0; }\n var _this = _super.call(this, vertex, fragment) || this;\n /** A see value to apply to the random noise generation */\n _this.seed = 0;\n _this.uniforms.dimensions = new Float32Array(2);\n if (typeof options === 'number') {\n _this.seed = options;\n options = undefined;\n }\n else {\n _this.seed = seed;\n }\n Object.assign(_this, OldFilmFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n OldFilmFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a, _b;\n this.uniforms.dimensions[0] = (_a = input.filterFrame) === null || _a === void 0 ? void 0 : _a.width;\n this.uniforms.dimensions[1] = (_b = input.filterFrame) === null || _b === void 0 ? void 0 : _b.height;\n // named `seed` because in the most programming languages,\n // `random` used for \"the function for generating random value\".\n this.uniforms.seed = this.seed;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(OldFilmFilter.prototype, \"sepia\", {\n get: function () {\n return this.uniforms.sepia;\n },\n /**\n * The amount of saturation of sepia effect,\n * a value of `1` is more saturation and closer to `0` is less,\n * and a value of `0` produces no sepia effect\n * @default 0\n */\n set: function (value) {\n this.uniforms.sepia = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"noise\", {\n get: function () {\n return this.uniforms.noise;\n },\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0\n */\n set: function (value) {\n this.uniforms.noise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"noiseSize\", {\n get: function () {\n return this.uniforms.noiseSize;\n },\n /**\n * The size of the noise particles\n * @default 0\n */\n set: function (value) {\n this.uniforms.noiseSize = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"scratch\", {\n get: function () {\n return this.uniforms.scratch;\n },\n /**\n * How often scratches appear\n * @default 0\n */\n set: function (value) {\n this.uniforms.scratch = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"scratchDensity\", {\n get: function () {\n return this.uniforms.scratchDensity;\n },\n /**\n * The density of the number of scratches\n * @default 0\n */\n set: function (value) {\n this.uniforms.scratchDensity = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"scratchWidth\", {\n get: function () {\n return this.uniforms.scratchWidth;\n },\n /**\n * The width of the scratches\n * @default 0\n */\n set: function (value) {\n this.uniforms.scratchWidth = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"vignetting\", {\n get: function () {\n return this.uniforms.vignetting;\n },\n /**\n * The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignetting = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"vignettingAlpha\", {\n get: function () {\n return this.uniforms.vignettingAlpha;\n },\n /**\n * Amount of opacity of vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OldFilmFilter.prototype, \"vignettingBlur\", {\n get: function () {\n return this.uniforms.vignettingBlur;\n },\n /**\n * Blur intensity of the vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options */\n OldFilmFilter.defaults = {\n sepia: 0.3,\n noise: 0.3,\n noiseSize: 1.0,\n scratch: 0.5,\n scratchDensity: 0.3,\n scratchWidth: 1.0,\n vignetting: 0.3,\n vignettingAlpha: 1.0,\n vignettingBlur: 0.3,\n };\n return OldFilmFilter;\n}(Filter));\n\nexport { OldFilmFilter };\n//# sourceMappingURL=filter-old-film.esm.mjs.map\n","/*!\n * @pixi/filter-dot - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-dot is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform vec4 filterArea;\\nuniform sampler2D uSampler;\\n\\nuniform float angle;\\nuniform float scale;\\n\\nfloat pattern()\\n{\\n float s = sin(angle), c = cos(angle);\\n vec2 tex = vTextureCoord * filterArea.xy;\\n vec2 point = vec2(\\n c * tex.x - s * tex.y,\\n s * tex.x + c * tex.y\\n ) * scale;\\n return (sin(point.x) * sin(point.y)) * 4.0;\\n}\\n\\nvoid main()\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float average = (color.r + color.g + color.b) / 3.0;\\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\\n}\\n\";\n\n// @author Mat Groves http://matgroves.com/ @Doormat23\n// original filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js\n/**\n * This filter applies a dotscreen effect making display objects appear to be made out of\n * black and white halftone dots like an old printer.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/dot.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-dot|@pixi/filter-dot}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar DotFilter = /** @class */ (function (_super) {\n __extends(DotFilter, _super);\n /**\n * @param {number} [scale=1] - The scale of the effect.\n * @param {number} [angle=5] - The radius of the effect.\n */\n function DotFilter(scale, angle) {\n if (scale === void 0) { scale = 1; }\n if (angle === void 0) { angle = 5; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.scale = scale;\n _this.angle = angle;\n return _this;\n }\n Object.defineProperty(DotFilter.prototype, \"scale\", {\n /**\n * The scale of the effect.\n * @default 1\n */\n get: function () {\n return this.uniforms.scale;\n },\n set: function (value) {\n this.uniforms.scale = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DotFilter.prototype, \"angle\", {\n /**\n * The radius of the effect.\n * @default 5\n */\n get: function () {\n return this.uniforms.angle;\n },\n set: function (value) {\n this.uniforms.angle = value;\n },\n enumerable: false,\n configurable: true\n });\n return DotFilter;\n}(Filter));\n\nexport { DotFilter };\n//# sourceMappingURL=filter-dot.esm.mjs.map\n","/*!\n * @pixi/filter-reflection - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-reflection is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\n\\nuniform bool mirror;\\nuniform float boundary;\\nuniform vec2 amplitude;\\nuniform vec2 waveLength;\\nuniform vec2 alpha;\\nuniform float time;\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main(void)\\n{\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n vec2 coord = pixelCoord / dimensions;\\n\\n if (coord.y < boundary) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n\\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\\n float areaY = boundary * dimensions.y / filterArea.y;\\n float v = areaY + areaY - vTextureCoord.y;\\n float y = mirror ? v : vTextureCoord.y;\\n\\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\\n\\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\\n x = clamp(x, filterClamp.x, filterClamp.z);\\n\\n vec4 color = texture2D(uSampler, vec2(x, y));\\n\\n gl_FragColor = color * _alpha;\\n}\\n\";\n\n/**\n * Applies a reflection effect to simulate the reflection on water with waves.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/reflection.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-reflection|@pixi/filter-reflection}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ReflectionFilter = /** @class */ (function (_super) {\n __extends(ReflectionFilter, _super);\n /**\n * @param {object} [options] - The optional parameters of Reflection effect.\n * @param {number} [options.mirror=true] - `true` to reflect the image, `false` for waves-only\n * @param {number} [options.boundary=0.5] - Vertical position of the reflection point, default is 50% (middle)\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection.\n * @param {number} [options.amplitude=[0, 20]] - Starting and ending amplitude of waves\n * @param {number} [options.waveLength=[30, 100]] - Starting and ending length of waves\n * @param {number} [options.alpha=[1, 1]] - Starting and ending alpha values\n * @param {number} [options.time=0] - Time for animating position of waves\n */\n function ReflectionFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** Time for animating position of waves */\n _this.time = 0;\n _this.uniforms.amplitude = new Float32Array(2);\n _this.uniforms.waveLength = new Float32Array(2);\n _this.uniforms.alpha = new Float32Array(2);\n _this.uniforms.dimensions = new Float32Array(2);\n Object.assign(_this, ReflectionFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n ReflectionFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a, _b;\n this.uniforms.dimensions[0] = (_a = input.filterFrame) === null || _a === void 0 ? void 0 : _a.width;\n this.uniforms.dimensions[1] = (_b = input.filterFrame) === null || _b === void 0 ? void 0 : _b.height;\n this.uniforms.time = this.time;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(ReflectionFilter.prototype, \"mirror\", {\n get: function () {\n return this.uniforms.mirror;\n },\n /**\n * `true` to reflect the image, `false` for waves-only\n * @default true\n */\n set: function (value) {\n this.uniforms.mirror = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"boundary\", {\n get: function () {\n return this.uniforms.boundary;\n },\n /**\n * Vertical position of the reflection point, default is 50% (middle)\n * smaller numbers produce a larger reflection, larger numbers produce a smaller reflection.\n * @default 0.5\n */\n set: function (value) {\n this.uniforms.boundary = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"amplitude\", {\n get: function () {\n return this.uniforms.amplitude;\n },\n /**\n * Starting and ending amplitude of waves\n * @member {number[]}\n * @default [0, 20]\n */\n set: function (value) {\n this.uniforms.amplitude[0] = value[0];\n this.uniforms.amplitude[1] = value[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"waveLength\", {\n get: function () {\n return this.uniforms.waveLength;\n },\n /**\n * Starting and ending length of waves\n * @member {number[]}\n * @default [30, 100]\n */\n set: function (value) {\n this.uniforms.waveLength[0] = value[0];\n this.uniforms.waveLength[1] = value[1];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ReflectionFilter.prototype, \"alpha\", {\n get: function () {\n return this.uniforms.alpha;\n },\n /**\n * Starting and ending alpha values\n * @member {number[]}\n * @default [1, 1]\n */\n set: function (value) {\n this.uniforms.alpha[0] = value[0];\n this.uniforms.alpha[1] = value[1];\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options */\n ReflectionFilter.defaults = {\n mirror: true,\n boundary: 0.5,\n amplitude: [0, 20],\n waveLength: [30, 100],\n alpha: [1, 1],\n time: 0,\n };\n return ReflectionFilter;\n}(Filter));\n\nexport { ReflectionFilter };\n//# sourceMappingURL=filter-reflection.esm.mjs.map\n","/*!\n * @pixi/filter-glitch - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-glitch is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, Filter } from '@pixi/core';\nimport { SCALE_MODES } from '@pixi/constants';\nimport { DEG_TO_RAD } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"// precision highp float;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\nuniform float aspect;\\n\\nuniform sampler2D displacementMap;\\nuniform float offset;\\nuniform float sinDir;\\nuniform float cosDir;\\nuniform int fillMode;\\n\\nuniform float seed;\\nuniform vec2 red;\\nuniform vec2 green;\\nuniform vec2 blue;\\n\\nconst int TRANSPARENT = 0;\\nconst int ORIGINAL = 1;\\nconst int LOOP = 2;\\nconst int CLAMP = 3;\\nconst int MIRROR = 4;\\n\\nvoid main(void)\\n{\\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\\n\\n if (coord.x > 1.0 || coord.y > 1.0) {\\n return;\\n }\\n\\n float cx = coord.x - 0.5;\\n float cy = (coord.y - 0.5) * aspect;\\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\\n\\n // displacementMap: repeat\\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\\n\\n // displacementMap: mirror\\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\\n\\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\\n\\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\\n\\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\\n\\n if (fillMode == CLAMP) {\\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n } else {\\n if( coord.x > filterClamp.z ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.x -= filterClamp.z;\\n } else if (fillMode == MIRROR) {\\n coord.x = filterClamp.z * 2.0 - coord.x;\\n }\\n } else if( coord.x < filterClamp.x ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.x += filterClamp.z;\\n } else if (fillMode == MIRROR) {\\n coord.x *= -filterClamp.z;\\n }\\n }\\n\\n if( coord.y > filterClamp.w ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.y -= filterClamp.w;\\n } else if (fillMode == MIRROR) {\\n coord.y = filterClamp.w * 2.0 - coord.y;\\n }\\n } else if( coord.y < filterClamp.y ) {\\n if (fillMode == TRANSPARENT) {\\n discard;\\n } else if (fillMode == LOOP) {\\n coord.y += filterClamp.w;\\n } else if (fillMode == MIRROR) {\\n coord.y *= -filterClamp.w;\\n }\\n }\\n }\\n\\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\\n gl_FragColor.a = texture2D(uSampler, coord).a;\\n}\\n\";\n\n/**\n * The GlitchFilter applies a glitch effect to an object.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/glitch.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-glitch|@pixi/filter-glitch}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar GlitchFilter = /** @class */ (function (_super) {\n __extends(GlitchFilter, _super);\n /**\n * @param {object} [options] - The more optional parameters of the filter.\n * @param {number} [options.slices=5] - The maximum number of slices.\n * @param {number} [options.offset=100] - The maximum offset amount of slices.\n * @param {number} [options.direction=0] - The angle in degree of the offset of slices.\n * @param {number} [options.fillMode=0] - The fill mode of the space after the offset. Acceptable values:\n * - `0` {@link PIXI.filters.GlitchFilter.TRANSPARENT TRANSPARENT}\n * - `1` {@link PIXI.filters.GlitchFilter.ORIGINAL ORIGINAL}\n * - `2` {@link PIXI.filters.GlitchFilter.LOOP LOOP}\n * - `3` {@link PIXI.filters.GlitchFilter.CLAMP CLAMP}\n * - `4` {@link PIXI.filters.GlitchFilter.MIRROR MIRROR}\n * @param {number} [options.seed=0] - A seed value for randomizing glitch effect.\n * @param {boolean} [options.average=false] - `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n * @param {number} [options.minSize=8] - Minimum size of individual slice. Segment of total `sampleSize`\n * @param {number} [options.sampleSize=512] - The resolution of the displacement map texture.\n * @param {number[]} [options.red=[0,0]] - Red channel offset\n * @param {number[]} [options.green=[0,0]] - Green channel offset.\n * @param {number[]} [options.blue=[0,0]] - Blue channel offset.\n */\n function GlitchFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** The maximum offset value for each of the slices. */\n _this.offset = 100;\n /** The fill mode of the space after the offset. */\n _this.fillMode = GlitchFilter.TRANSPARENT;\n /**\n * `true` will divide the bands roughly based on equal amounts\n * where as setting to `false` will vary the band sizes dramatically (more random looking).\n */\n _this.average = false;\n /**\n * A seed value for randomizing color offset. Animating\n * this value to `Math.random()` produces a twitching effect.\n */\n _this.seed = 0;\n /** Minimum size of slices as a portion of the `sampleSize` */\n _this.minSize = 8;\n /** Height of the displacement map canvas. */\n _this.sampleSize = 512;\n /** Internal number of slices */\n _this._slices = 0;\n _this._offsets = new Float32Array(1);\n _this._sizes = new Float32Array(1);\n /** direction is actually a setter for uniform.cosDir and uniform.sinDir.\n * Must be initialized to something different than the default value.\n */\n _this._direction = -1;\n _this.uniforms.dimensions = new Float32Array(2);\n _this._canvas = document.createElement('canvas');\n _this._canvas.width = 4;\n _this._canvas.height = _this.sampleSize;\n _this.texture = Texture.from(_this._canvas, { scaleMode: SCALE_MODES.NEAREST });\n Object.assign(_this, GlitchFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n GlitchFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n this.uniforms.aspect = height / width;\n this.uniforms.seed = this.seed;\n this.uniforms.offset = this.offset;\n this.uniforms.fillMode = this.fillMode;\n filterManager.applyFilter(this, input, output, clear);\n };\n /**\n * Randomize the slices size (heights).\n *\n * @private\n */\n GlitchFilter.prototype._randomizeSizes = function () {\n var arr = this._sizes;\n var last = this._slices - 1;\n var size = this.sampleSize;\n var min = Math.min(this.minSize / size, 0.9 / this._slices);\n if (this.average) {\n var count = this._slices;\n var rest = 1;\n for (var i = 0; i < last; i++) {\n var averageWidth = rest / (count - i);\n var w = Math.max(averageWidth * (1 - (Math.random() * 0.6)), min);\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n else {\n var rest = 1;\n var ratio = Math.sqrt(1 / this._slices);\n for (var i = 0; i < last; i++) {\n var w = Math.max(ratio * rest * Math.random(), min);\n arr[i] = w;\n rest -= w;\n }\n arr[last] = rest;\n }\n this.shuffle();\n };\n /**\n * Shuffle the sizes of the slices, advanced usage.\n */\n GlitchFilter.prototype.shuffle = function () {\n var arr = this._sizes;\n var last = this._slices - 1;\n // shuffle\n for (var i = last; i > 0; i--) {\n var rand = (Math.random() * i) >> 0;\n var temp = arr[i];\n arr[i] = arr[rand];\n arr[rand] = temp;\n }\n };\n /**\n * Randomize the values for offset from -1 to 1\n *\n * @private\n */\n GlitchFilter.prototype._randomizeOffsets = function () {\n for (var i = 0; i < this._slices; i++) {\n this._offsets[i] = Math.random() * (Math.random() < 0.5 ? -1 : 1);\n }\n };\n /**\n * Regenerating random size, offsets for slices.\n */\n GlitchFilter.prototype.refresh = function () {\n this._randomizeSizes();\n this._randomizeOffsets();\n this.redraw();\n };\n /**\n * Redraw displacement bitmap texture, advanced usage.\n */\n GlitchFilter.prototype.redraw = function () {\n var size = this.sampleSize;\n var texture = this.texture;\n var ctx = this._canvas.getContext('2d');\n ctx.clearRect(0, 0, 8, size);\n var offset;\n var y = 0;\n for (var i = 0; i < this._slices; i++) {\n offset = Math.floor(this._offsets[i] * 256);\n var height = this._sizes[i] * size;\n var red = offset > 0 ? offset : 0;\n var green = offset < 0 ? -offset : 0;\n ctx.fillStyle = \"rgba(\" + red + \", \" + green + \", 0, 1)\";\n ctx.fillRect(0, y >> 0, size, height + 1 >> 0);\n y += height;\n }\n texture.baseTexture.update();\n this.uniforms.displacementMap = texture;\n };\n Object.defineProperty(GlitchFilter.prototype, \"sizes\", {\n get: function () {\n return this._sizes;\n },\n /**\n * Manually custom slices size (height) of displacement bitmap\n *\n * @member {number[]|Float32Array}\n */\n set: function (sizes) {\n var len = Math.min(this._slices, sizes.length);\n for (var i = 0; i < len; i++) {\n this._sizes[i] = sizes[i];\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"offsets\", {\n get: function () {\n return this._offsets;\n },\n /**\n * Manually set custom slices offset of displacement bitmap, this is\n * a collection of values from -1 to 1. To change the max offset value\n * set `offset`.\n *\n * @member {number[]|Float32Array}\n */\n set: function (offsets) {\n var len = Math.min(this._slices, offsets.length);\n for (var i = 0; i < len; i++) {\n this._offsets[i] = offsets[i];\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"slices\", {\n /**\n * The count of slices.\n * @default 5\n */\n get: function () {\n return this._slices;\n },\n set: function (value) {\n if (this._slices === value) {\n return;\n }\n this._slices = value;\n this.uniforms.slices = value;\n this._sizes = this.uniforms.slicesWidth = new Float32Array(value);\n this._offsets = this.uniforms.slicesOffset = new Float32Array(value);\n this.refresh();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"direction\", {\n /**\n * The angle in degree of the offset of slices.\n * @default 0\n */\n get: function () {\n return this._direction;\n },\n set: function (value) {\n if (this._direction === value) {\n return;\n }\n this._direction = value;\n var radians = value * DEG_TO_RAD;\n this.uniforms.sinDir = Math.sin(radians);\n this.uniforms.cosDir = Math.cos(radians);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"red\", {\n /**\n * Red channel offset.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.red;\n },\n set: function (value) {\n this.uniforms.red = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"green\", {\n /**\n * Green channel offset.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.green;\n },\n set: function (value) {\n this.uniforms.green = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlitchFilter.prototype, \"blue\", {\n /**\n * Blue offset.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.blue;\n },\n set: function (value) {\n this.uniforms.blue = value;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Removes all references\n */\n GlitchFilter.prototype.destroy = function () {\n var _a;\n (_a = this.texture) === null || _a === void 0 ? void 0 : _a.destroy(true);\n this.texture\n = this._canvas\n = this.red\n = this.green\n = this.blue\n = this._sizes\n = this._offsets = null;\n };\n /** Default constructor options. */\n GlitchFilter.defaults = {\n slices: 5,\n offset: 100,\n direction: 0,\n fillMode: 0,\n average: false,\n seed: 0,\n red: [0, 0],\n green: [0, 0],\n blue: [0, 0],\n minSize: 8,\n sampleSize: 512,\n };\n /** Fill mode as transparent */\n GlitchFilter.TRANSPARENT = 0;\n /** Fill mode as original */\n GlitchFilter.ORIGINAL = 1;\n /** Fill mode as loop */\n GlitchFilter.LOOP = 2;\n /** Fill mode as clamp */\n GlitchFilter.CLAMP = 3;\n /** Fill mode as mirror */\n GlitchFilter.MIRROR = 4;\n return GlitchFilter;\n}(Filter));\n\nexport { GlitchFilter };\n//# sourceMappingURL=filter-glitch.esm.mjs.map\n","/*!\n * @pixi/filter-rgb-split - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-rgb-split is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec2 red;\\nuniform vec2 green;\\nuniform vec2 blue;\\n\\nvoid main(void)\\n{\\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\\n}\\n\";\n\n/**\n * An RGB Split Filter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/rgb.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-rgb-split|@pixi/filter-rgb-split}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar RGBSplitFilter = /** @class */ (function (_super) {\n __extends(RGBSplitFilter, _super);\n /**\n * @param {PIXI.Point | number[]} [red=[-10,0]] - Red channel offset\n * @param {PIXI.Point | number[]} [green=[0, 10]] - Green channel offset\n * @param {PIXI.Point | number[]} [blue=[0, 0]] - Blue channel offset\n */\n function RGBSplitFilter(red, green, blue) {\n if (red === void 0) { red = [-10, 0]; }\n if (green === void 0) { green = [0, 10]; }\n if (blue === void 0) { blue = [0, 0]; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.red = red;\n _this.green = green;\n _this.blue = blue;\n return _this;\n }\n Object.defineProperty(RGBSplitFilter.prototype, \"red\", {\n /**\n * Red channel offset.\n *\n * @member {PIXI.Point | number[]}\n */\n get: function () {\n return this.uniforms.red;\n },\n set: function (value) {\n this.uniforms.red = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RGBSplitFilter.prototype, \"green\", {\n /**\n * Green channel offset.\n *\n * @member {PIXI.Point | number[]}\n */\n get: function () {\n return this.uniforms.green;\n },\n set: function (value) {\n this.uniforms.green = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RGBSplitFilter.prototype, \"blue\", {\n /**\n * Blue offset.\n *\n * @member {PIXI.Point | number[]}\n */\n get: function () {\n return this.uniforms.blue;\n },\n set: function (value) {\n this.uniforms.blue = value;\n },\n enumerable: false,\n configurable: true\n });\n return RGBSplitFilter;\n}(Filter));\n\nexport { RGBSplitFilter };\n//# sourceMappingURL=filter-rgb-split.esm.mjs.map\n","/*!\n * @pixi/filter-godray - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-godray is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point, DEG_TO_RAD } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar perlin = \"vec3 mod289(vec3 x)\\n{\\n return x - floor(x * (1.0 / 289.0)) * 289.0;\\n}\\nvec4 mod289(vec4 x)\\n{\\n return x - floor(x * (1.0 / 289.0)) * 289.0;\\n}\\nvec4 permute(vec4 x)\\n{\\n return mod289(((x * 34.0) + 1.0) * x);\\n}\\nvec4 taylorInvSqrt(vec4 r)\\n{\\n return 1.79284291400159 - 0.85373472095314 * r;\\n}\\nvec3 fade(vec3 t)\\n{\\n return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);\\n}\\n// Classic Perlin noise, periodic variant\\nfloat pnoise(vec3 P, vec3 rep)\\n{\\n vec3 Pi0 = mod(floor(P), rep); // Integer part, modulo period\\n vec3 Pi1 = mod(Pi0 + vec3(1.0), rep); // Integer part + 1, mod period\\n Pi0 = mod289(Pi0);\\n Pi1 = mod289(Pi1);\\n vec3 Pf0 = fract(P); // Fractional part for interpolation\\n vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0\\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\\n vec4 iz0 = Pi0.zzzz;\\n vec4 iz1 = Pi1.zzzz;\\n vec4 ixy = permute(permute(ix) + iy);\\n vec4 ixy0 = permute(ixy + iz0);\\n vec4 ixy1 = permute(ixy + iz1);\\n vec4 gx0 = ixy0 * (1.0 / 7.0);\\n vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5;\\n gx0 = fract(gx0);\\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\\n vec4 sz0 = step(gz0, vec4(0.0));\\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\\n vec4 gx1 = ixy1 * (1.0 / 7.0);\\n vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5;\\n gx1 = fract(gx1);\\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\\n vec4 sz1 = step(gz1, vec4(0.0));\\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\\n vec3 g000 = vec3(gx0.x, gy0.x, gz0.x);\\n vec3 g100 = vec3(gx0.y, gy0.y, gz0.y);\\n vec3 g010 = vec3(gx0.z, gy0.z, gz0.z);\\n vec3 g110 = vec3(gx0.w, gy0.w, gz0.w);\\n vec3 g001 = vec3(gx1.x, gy1.x, gz1.x);\\n vec3 g101 = vec3(gx1.y, gy1.y, gz1.y);\\n vec3 g011 = vec3(gx1.z, gy1.z, gz1.z);\\n vec3 g111 = vec3(gx1.w, gy1.w, gz1.w);\\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\\n g000 *= norm0.x;\\n g010 *= norm0.y;\\n g100 *= norm0.z;\\n g110 *= norm0.w;\\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\\n g001 *= norm1.x;\\n g011 *= norm1.y;\\n g101 *= norm1.z;\\n g111 *= norm1.w;\\n float n000 = dot(g000, Pf0);\\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\\n float n111 = dot(g111, Pf1);\\n vec3 fade_xyz = fade(Pf0);\\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\\n return 2.2 * n_xyz;\\n}\\nfloat turb(vec3 P, vec3 rep, float lacunarity, float gain)\\n{\\n float sum = 0.0;\\n float sc = 1.0;\\n float totalgain = 1.0;\\n for (float i = 0.0; i < 6.0; i++)\\n {\\n sum += totalgain * pnoise(P * sc, rep);\\n sc *= lacunarity;\\n totalgain *= gain;\\n }\\n return abs(sum);\\n}\\n\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\n\\nuniform vec2 light;\\nuniform bool parallel;\\nuniform float aspect;\\n\\nuniform float gain;\\nuniform float lacunarity;\\nuniform float time;\\nuniform float alpha;\\n\\n${perlin}\\n\\nvoid main(void) {\\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\\n\\n float d;\\n\\n if (parallel) {\\n float _cos = light.x;\\n float _sin = light.y;\\n d = (_cos * coord.x) + (_sin * coord.y * aspect);\\n } else {\\n float dx = coord.x - light.x / dimensions.x;\\n float dy = (coord.y - light.y / dimensions.y) * aspect;\\n float dis = sqrt(dx * dx + dy * dy) + 0.00001;\\n d = dy / dis;\\n }\\n\\n vec3 dir = vec3(d, d, 0.0);\\n\\n float noise = turb(dir + vec3(time, 0.0, 62.1 + time) * 0.05, vec3(480.0, 320.0, 480.0), lacunarity, gain);\\n noise = mix(noise, 0.0, 0.3);\\n //fade vertically.\\n vec4 mist = vec4(noise, noise, noise, 1.0) * (1.0 - coord.y);\\n mist.a = 1.0;\\n // apply user alpha\\n mist *= alpha;\\n\\n gl_FragColor = texture2D(uSampler, vTextureCoord) + mist;\\n\\n}\\n\";\n\n/**\n * GordayFilter, {@link https://codepen.io/alaingalvan originally} by Alain Galvan\n *\n *\n *\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/godray.gif)\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-godray|@pixi/filter-godray}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * displayObject.filters = [new GodrayFilter()];\n */\nvar GodrayFilter = /** @class */ (function (_super) {\n __extends(GodrayFilter, _super);\n /**\n * @param {object} [options] - Filter options\n * @param {number} [options.angle=30] - Angle/Light-source of the rays.\n * @param {number} [options.gain=0.5] - General intensity of the effect.\n * @param {number} [options.lacunarity=2.5] - The density of the fractal noise.\n * @param {boolean} [options.parallel=true] - `true` to use `angle`, `false` to use `center`\n * @param {number} [options.time=0] - The current time position.\n * @param {PIXI.Point|number[]} [options.center=[0,0]] - Focal point for non-parallel rays,\n * to use this `parallel` must be set to `false`.\n * @param {number} [options.alpha=1.0] - the alpha, defaults to 1, affects transparency of rays\n */\n function GodrayFilter(options) {\n var _this = _super.call(this, vertex, fragment.replace('${perlin}', perlin)) || this;\n /**\n * `true` if light rays are parallel (uses angle),\n * `false` to use the focal `center` point\n */\n _this.parallel = true;\n /** The current time. */\n _this.time = 0;\n _this._angle = 0;\n _this.uniforms.dimensions = new Float32Array(2);\n var opts = Object.assign(GodrayFilter.defaults, options);\n _this._angleLight = new Point();\n _this.angle = opts.angle;\n _this.gain = opts.gain;\n _this.lacunarity = opts.lacunarity;\n _this.alpha = opts.alpha;\n _this.parallel = opts.parallel;\n _this.center = opts.center;\n _this.time = opts.time;\n return _this;\n }\n /**\n * Applies the filter.\n * @private\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n GodrayFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.light = this.parallel ? this._angleLight : this.center;\n this.uniforms.parallel = this.parallel;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n this.uniforms.aspect = height / width;\n this.uniforms.time = this.time;\n this.uniforms.alpha = this.alpha;\n // draw the filter...\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(GodrayFilter.prototype, \"angle\", {\n /**\n * The angle/light-source of the rays in degrees. For instance, a value of 0 is vertical rays,\n * values of 90 or -90 produce horizontal rays.\n * @default 30\n */\n get: function () {\n return this._angle;\n },\n set: function (value) {\n this._angle = value;\n var radians = value * DEG_TO_RAD;\n this._angleLight.x = Math.cos(radians);\n this._angleLight.y = Math.sin(radians);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GodrayFilter.prototype, \"gain\", {\n /**\n * General intensity of the effect. A value closer to 1 will produce a more intense effect,\n * where a value closer to 0 will produce a subtler effect.\n * @default 0.5\n */\n get: function () {\n return this.uniforms.gain;\n },\n set: function (value) {\n this.uniforms.gain = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GodrayFilter.prototype, \"lacunarity\", {\n /**\n * The density of the fractal noise. A higher amount produces more rays and a smaller amound\n * produces fewer waves.\n * @default 2.5\n */\n get: function () {\n return this.uniforms.lacunarity;\n },\n set: function (value) {\n this.uniforms.lacunarity = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GodrayFilter.prototype, \"alpha\", {\n /**\n * The alpha (opacity) of the rays. 0 is fully transparent, 1 is fully opaque.\n * @default 1\n */\n get: function () {\n return this.uniforms.alpha;\n },\n set: function (value) {\n this.uniforms.alpha = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default for constructior options. */\n GodrayFilter.defaults = {\n angle: 30,\n gain: 0.5,\n lacunarity: 2.5,\n time: 0,\n parallel: true,\n center: [0, 0],\n alpha: 1,\n };\n return GodrayFilter;\n}(Filter));\n\nexport { GodrayFilter };\n//# sourceMappingURL=filter-godray.esm.mjs.map\n","/*!\n * @pixi/filter-adjustment - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-adjustment is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform float gamma;\\nuniform float contrast;\\nuniform float saturation;\\nuniform float brightness;\\nuniform float red;\\nuniform float green;\\nuniform float blue;\\nuniform float alpha;\\n\\nvoid main(void)\\n{\\n vec4 c = texture2D(uSampler, vTextureCoord);\\n\\n if (c.a > 0.0) {\\n c.rgb /= c.a;\\n\\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\\n rgb.r *= red;\\n rgb.g *= green;\\n rgb.b *= blue;\\n c.rgb = rgb * brightness;\\n\\n c.rgb *= c.a;\\n }\\n\\n gl_FragColor = c * alpha;\\n}\\n\";\n\n/**\n * The ability to adjust gamma, contrast, saturation, brightness, alpha or color-channel shift.\n * This is a faster and much simpler to use than\n * {@link http://pixijs.download/release/docs/PIXI.filters.ColorMatrixFilter.html ColorMatrixFilter}\n * because it does not use a matrix.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/adjustment.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-adjustment|@pixi/filter-adjustment}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar AdjustmentFilter = /** @class */ (function (_super) {\n __extends(AdjustmentFilter, _super);\n /**\n * @param {object|number} [options] - The optional parameters of the filter.\n * @param {number} [options.gamma=1] - The amount of luminance\n * @param {number} [options.saturation=1] - The amount of color saturation\n * @param {number} [options.contrast=1] - The amount of contrast\n * @param {number} [options.brightness=1] - The overall brightness\n * @param {number} [options.red=1] - The multipled red channel\n * @param {number} [options.green=1] - The multipled green channel\n * @param {number} [options.blue=1] - The multipled blue channel\n * @param {number} [options.alpha=1] - The overall alpha amount\n */\n function AdjustmentFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** The amount of luminance */\n _this.gamma = 1;\n /** The amount of saturation */\n _this.saturation = 1;\n /** The amount of contrast */\n _this.contrast = 1;\n /** The amount of brightness */\n _this.brightness = 1;\n /** The amount of red channel */\n _this.red = 1;\n /** The amount of green channel */\n _this.green = 1;\n /** The amount of blue channel */\n _this.blue = 1;\n /** The amount of alpha channel */\n _this.alpha = 1;\n Object.assign(_this, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @ignore\n */\n AdjustmentFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms.gamma = Math.max(this.gamma, 0.0001);\n this.uniforms.saturation = this.saturation;\n this.uniforms.contrast = this.contrast;\n this.uniforms.brightness = this.brightness;\n this.uniforms.red = this.red;\n this.uniforms.green = this.green;\n this.uniforms.blue = this.blue;\n this.uniforms.alpha = this.alpha;\n filterManager.applyFilter(this, input, output, clear);\n };\n return AdjustmentFilter;\n}(Filter));\n\nexport { AdjustmentFilter };\n//# sourceMappingURL=filter-adjustment.esm.mjs.map\n","/*!\n * @pixi/filter-kawase-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-kawase-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 uOffset;\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n\\n // Sample top left pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\\n\\n // Sample top right pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\\n\\n // Sample bottom right pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\\n\\n // Sample bottom left pixel\\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\\n\\n // Average\\n color *= 0.25;\\n\\n gl_FragColor = color;\\n}\";\n\nvar fragmentClamp = \"\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 uOffset;\\nuniform vec4 filterClamp;\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n\\n // Sample top left pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample top right pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample bottom right pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Sample bottom left pixel\\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\\n\\n // Average\\n color *= 0.25;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * A much faster blur than Gaussian blur, but more complicated to use.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/kawase-blur.png)\n *\n * @see https://software.intel.com/en-us/blogs/2014/07/15/an-investigation-of-fast-real-time-gpu-based-image-blur-algorithms\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-kawase-blur|@pixi/filter-kawase-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar KawaseBlurFilter = /** @class */ (function (_super) {\n __extends(KawaseBlurFilter, _super);\n /**\n * @param {number|number[]} [blur=4] - The blur of the filter. Should be greater than `0`. If\n * value is an Array, setting kernels.\n * @param {number} [quality=3] - The quality of the filter. Should be an integer greater than `1`.\n * @param {boolean} [clamp=false] - Clamp edges, useful for removing dark edges\n * from fullscreen filters or bleeding to the edge of filterArea.\n */\n function KawaseBlurFilter(blur, quality, clamp) {\n if (blur === void 0) { blur = 4; }\n if (quality === void 0) { quality = 3; }\n if (clamp === void 0) { clamp = false; }\n var _this = _super.call(this, vertex, clamp ? fragmentClamp : fragment) || this;\n _this._kernels = [];\n _this._blur = 4;\n _this._quality = 3;\n _this.uniforms.uOffset = new Float32Array(2);\n _this._pixelSize = new Point();\n _this.pixelSize = 1;\n _this._clamp = clamp;\n // if `blur` is array , as kernels\n if (Array.isArray(blur)) {\n _this.kernels = blur;\n }\n else {\n _this._blur = blur;\n _this.quality = quality;\n }\n return _this;\n }\n /**\n * Overrides apply\n * @private\n */\n KawaseBlurFilter.prototype.apply = function (filterManager, input, output, clear) {\n var uvX = this._pixelSize.x / input._frame.width;\n var uvY = this._pixelSize.y / input._frame.height;\n var offset;\n if (this._quality === 1 || this._blur === 0) {\n offset = this._kernels[0] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, input, output, clear);\n }\n else {\n var renderTarget = filterManager.getFilterTexture();\n var source = input;\n var target = renderTarget;\n var tmp = void 0;\n var last = this._quality - 1;\n for (var i = 0; i < last; i++) {\n offset = this._kernels[i] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, source, target, 1);\n tmp = source;\n source = target;\n target = tmp;\n }\n offset = this._kernels[last] + 0.5;\n this.uniforms.uOffset[0] = offset * uvX;\n this.uniforms.uOffset[1] = offset * uvY;\n filterManager.applyFilter(this, source, output, clear);\n filterManager.returnFilterTexture(renderTarget);\n }\n };\n KawaseBlurFilter.prototype._updatePadding = function () {\n this.padding = Math.ceil(this._kernels.reduce(function (acc, v) { return acc + v + 0.5; }, 0));\n };\n /**\n * Auto generate kernels by blur & quality\n * @private\n */\n KawaseBlurFilter.prototype._generateKernels = function () {\n var blur = this._blur;\n var quality = this._quality;\n var kernels = [blur];\n if (blur > 0) {\n var k = blur;\n var step = blur / quality;\n for (var i = 1; i < quality; i++) {\n k -= step;\n kernels.push(k);\n }\n }\n this._kernels = kernels;\n this._updatePadding();\n };\n Object.defineProperty(KawaseBlurFilter.prototype, \"kernels\", {\n /**\n * The kernel size of the blur filter, for advanced usage.\n * @default [0]\n */\n get: function () {\n return this._kernels;\n },\n set: function (value) {\n if (Array.isArray(value) && value.length > 0) {\n this._kernels = value;\n this._quality = value.length;\n this._blur = Math.max.apply(Math, value);\n }\n else {\n // if value is invalid , set default value\n this._kernels = [0];\n this._quality = 1;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"clamp\", {\n /**\n * Get the if the filter is clampped.\n *\n * @readonly\n * @default false\n */\n get: function () {\n return this._clamp;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"pixelSize\", {\n get: function () {\n return this._pixelSize;\n },\n /**\n * Sets the pixel size of the filter. Large size is blurrier. For advanced usage.\n *\n * @member {PIXI.Point|number[]}\n * @default [1, 1]\n */\n set: function (value) {\n if (typeof value === 'number') {\n this._pixelSize.x = value;\n this._pixelSize.y = value;\n }\n else if (Array.isArray(value)) {\n this._pixelSize.x = value[0];\n this._pixelSize.y = value[1];\n }\n else if (value instanceof Point) {\n this._pixelSize.x = value.x;\n this._pixelSize.y = value.y;\n }\n else {\n // if value is invalid , set default value\n this._pixelSize.x = 1;\n this._pixelSize.y = 1;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"quality\", {\n /**\n * The quality of the filter, integer greater than `1`.\n * @default 3\n */\n get: function () {\n return this._quality;\n },\n set: function (value) {\n this._quality = Math.max(1, Math.round(value));\n this._generateKernels();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(KawaseBlurFilter.prototype, \"blur\", {\n /**\n * The amount of blur, value greater than `0`.\n * @default 4\n */\n get: function () {\n return this._blur;\n },\n set: function (value) {\n this._blur = value;\n this._generateKernels();\n },\n enumerable: false,\n configurable: true\n });\n return KawaseBlurFilter;\n}(Filter));\n\nexport { KawaseBlurFilter };\n//# sourceMappingURL=filter-kawase-blur.esm.mjs.map\n","/*!\n * @pixi/filter-advanced-bloom - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-advanced-bloom is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { KawaseBlurFilter } from '@pixi/filter-kawase-blur';\nimport { settings } from '@pixi/settings';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"\\nuniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform float threshold;\\n\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n // A simple & fast algorithm for getting brightness.\\n // It's inaccuracy , but good enought for this feature.\\n float _max = max(max(color.r, color.g), color.b);\\n float _min = min(min(color.r, color.g), color.b);\\n float brightness = (_max + _min) * 0.5;\\n\\n if(brightness > threshold) {\\n gl_FragColor = color;\\n } else {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\\n }\\n}\\n\";\n\n/**\n * Internal filter for AdvancedBloomFilter to get brightness.\n * @class\n * @private\n */\nvar ExtractBrightnessFilter = /** @class */ (function (_super) {\n __extends(ExtractBrightnessFilter, _super);\n /**\n * @param {number} [threshold] - Defines how bright a color needs to be extracted.\n */\n function ExtractBrightnessFilter(threshold) {\n if (threshold === void 0) { threshold = 0.5; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.threshold = threshold;\n return _this;\n }\n Object.defineProperty(ExtractBrightnessFilter.prototype, \"threshold\", {\n /**\n * Defines how bright a color needs to be extracted.\n *\n * @default 0.5\n */\n get: function () {\n return this.uniforms.threshold;\n },\n set: function (value) {\n this.uniforms.threshold = value;\n },\n enumerable: false,\n configurable: true\n });\n return ExtractBrightnessFilter;\n}(Filter));\n\nvar fragment$1 = \"uniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D bloomTexture;\\nuniform float bloomScale;\\nuniform float brightness;\\n\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n color.rgb *= brightness;\\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\\n bloomColor.rgb *= bloomScale;\\n gl_FragColor = color + bloomColor;\\n}\\n\";\n\n/**\n * The AdvancedBloomFilter applies a Bloom Effect to an object. Unlike the normal BloomFilter\n * this had some advanced controls for adjusting the look of the bloom. Note: this filter\n * is slower than normal BloomFilter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/advanced-bloom.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-advanced-bloom|@pixi/filter-advanced-bloom}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar AdvancedBloomFilter = /** @class */ (function (_super) {\n __extends(AdvancedBloomFilter, _super);\n /**\n * @param {object|number} [options] - The optional parameters of advanced bloom filter.\n * When options is a number , it will be `options.threshold`.\n * @param {number} [options.threshold=0.5] - Defines how bright a color needs to be to affect bloom.\n * @param {number} [options.bloomScale=1.0] - To adjust the strength of the bloom. Higher values is\n * more intense brightness.\n * @param {number} [options.brightness=1.0] - The brightness, lower value is more subtle brightness,\n * higher value is blown-out.\n * @param {number} [options.blur=8] - Sets the strength of the Blur properties simultaneously\n * @param {number} [options.quality=4] - The quality of the Blur filter.\n * @param {number[]} [options.kernels=null] - The kernels of the Blur filter.\n * @param {number|number[]|PIXI.Point} [options.pixelSize=1] - the pixelSize of the Blur filter.\n * @param {number} [options.resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the Blur filter.\n */\n function AdvancedBloomFilter(options) {\n var _this = _super.call(this, vertex, fragment$1) || this;\n /** To adjust the strength of the bloom. Higher values is more intense brightness. */\n _this.bloomScale = 1;\n /** The brightness, lower value is more subtle brightness, higher value is blown-out. */\n _this.brightness = 1;\n _this._resolution = settings.FILTER_RESOLUTION;\n if (typeof options === 'number') {\n options = { threshold: options };\n }\n var opt = Object.assign(AdvancedBloomFilter.defaults, options);\n _this.bloomScale = opt.bloomScale;\n _this.brightness = opt.brightness;\n var kernels = opt.kernels, blur = opt.blur, quality = opt.quality, pixelSize = opt.pixelSize, resolution = opt.resolution;\n _this._extractFilter = new ExtractBrightnessFilter(opt.threshold);\n _this._extractFilter.resolution = resolution;\n _this._blurFilter = kernels\n ? new KawaseBlurFilter(kernels)\n : new KawaseBlurFilter(blur, quality);\n _this.pixelSize = pixelSize;\n _this.resolution = resolution;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n *\n * @private\n */\n AdvancedBloomFilter.prototype.apply = function (filterManager, input, output, clear, currentState) {\n var brightTarget = filterManager.getFilterTexture();\n this._extractFilter.apply(filterManager, input, brightTarget, 1, currentState);\n var bloomTarget = filterManager.getFilterTexture();\n this._blurFilter.apply(filterManager, brightTarget, bloomTarget, 1);\n this.uniforms.bloomScale = this.bloomScale;\n this.uniforms.brightness = this.brightness;\n this.uniforms.bloomTexture = bloomTarget;\n filterManager.applyFilter(this, input, output, clear);\n filterManager.returnFilterTexture(bloomTarget);\n filterManager.returnFilterTexture(brightTarget);\n };\n Object.defineProperty(AdvancedBloomFilter.prototype, \"resolution\", {\n /**\n * The resolution of the filter.\n * @ignore\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._resolution = value;\n if (this._extractFilter) {\n this._extractFilter.resolution = value;\n }\n if (this._blurFilter) {\n this._blurFilter.resolution = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"threshold\", {\n /**\n * Defines how bright a color needs to be to affect bloom.\n *\n * @default 0.5\n */\n get: function () {\n return this._extractFilter.threshold;\n },\n set: function (value) {\n this._extractFilter.threshold = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"kernels\", {\n /**\n * Sets the kernels of the Blur Filter\n */\n get: function () {\n return this._blurFilter.kernels;\n },\n set: function (value) {\n this._blurFilter.kernels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"blur\", {\n /**\n * Sets the strength of the Blur properties simultaneously\n *\n * @default 2\n */\n get: function () {\n return this._blurFilter.blur;\n },\n set: function (value) {\n this._blurFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"quality\", {\n /**\n * Sets the quality of the Blur Filter\n *\n * @default 4\n */\n get: function () {\n return this._blurFilter.quality;\n },\n set: function (value) {\n this._blurFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AdvancedBloomFilter.prototype, \"pixelSize\", {\n /**\n * Sets the pixelSize of the Kawase Blur filter\n *\n * @member {number|number[]|PIXI.Point}\n * @default 1\n */\n get: function () {\n return this._blurFilter.pixelSize;\n },\n set: function (value) {\n this._blurFilter.pixelSize = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default construction options. */\n AdvancedBloomFilter.defaults = {\n threshold: 0.5,\n bloomScale: 1.0,\n brightness: 1.0,\n kernels: null,\n blur: 8,\n quality: 4,\n pixelSize: 1,\n resolution: settings.FILTER_RESOLUTION,\n };\n return AdvancedBloomFilter;\n}(Filter));\n\nexport { AdvancedBloomFilter };\n//# sourceMappingURL=filter-advanced-bloom.esm.mjs.map\n","/*!\n * @pixi/filter-ascii - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-ascii is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform vec4 filterArea;\\nuniform float pixelSize;\\nuniform sampler2D uSampler;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 pixelate(vec2 coord, vec2 size)\\n{\\n return floor( coord / size ) * size;\\n}\\n\\nvec2 getMod(vec2 coord, vec2 size)\\n{\\n return mod( coord , size) / size;\\n}\\n\\nfloat character(float n, vec2 p)\\n{\\n p = floor(p*vec2(4.0, -4.0) + 2.5);\\n\\n if (clamp(p.x, 0.0, 4.0) == p.x)\\n {\\n if (clamp(p.y, 0.0, 4.0) == p.y)\\n {\\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\\n }\\n }\\n return 0.0;\\n}\\n\\nvoid main()\\n{\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n // get the rounded color..\\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\\n pixCoord = unmapCoord(pixCoord);\\n\\n vec4 color = texture2D(uSampler, pixCoord);\\n\\n // determine the character to use\\n float gray = (color.r + color.g + color.b) / 3.0;\\n\\n float n = 65536.0; // .\\n if (gray > 0.2) n = 65600.0; // :\\n if (gray > 0.3) n = 332772.0; // *\\n if (gray > 0.4) n = 15255086.0; // o\\n if (gray > 0.5) n = 23385164.0; // &\\n if (gray > 0.6) n = 15252014.0; // 8\\n if (gray > 0.7) n = 13199452.0; // @\\n if (gray > 0.8) n = 11512810.0; // #\\n\\n // get the mod..\\n vec2 modd = getMod(coord, vec2(pixelSize));\\n\\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\\n\\n}\\n\";\n\n// TODO (cengler) - The Y is flipped in this shader for some reason.\n// @author Vico @vicocotea\n// original shader : https://www.shadertoy.com/view/lssGDj by @movAX13h\n/**\n * An ASCII filter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/ascii.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-ascii|@pixi/filter-ascii}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar AsciiFilter = /** @class */ (function (_super) {\n __extends(AsciiFilter, _super);\n /**\n * @param {number} [size=8] - Size of the font\n */\n function AsciiFilter(size) {\n if (size === void 0) { size = 8; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.size = size;\n return _this;\n }\n Object.defineProperty(AsciiFilter.prototype, \"size\", {\n /**\n * The pixel size used by the filter.\n */\n get: function () {\n return this.uniforms.pixelSize;\n },\n set: function (value) {\n this.uniforms.pixelSize = value;\n },\n enumerable: false,\n configurable: true\n });\n return AsciiFilter;\n}(Filter));\n\nexport { AsciiFilter };\n//# sourceMappingURL=filter-ascii.esm.mjs.map\n","/*!\n * @pixi/filter-bevel - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-bevel is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { DEG_TO_RAD } from '@pixi/math';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform float transformX;\\nuniform float transformY;\\nuniform vec3 lightColor;\\nuniform float lightAlpha;\\nuniform vec3 shadowColor;\\nuniform float shadowAlpha;\\n\\nvoid main(void) {\\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n float light = texture2D(uSampler, vTextureCoord - transform).a;\\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\\n\\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\\n gl_FragColor = vec4(color.rgb * color.a, color.a);\\n}\\n\";\n\n/**\n * Bevel Filter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bevel.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-bevel|@pixi/filter-bevel}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar BevelFilter = /** @class */ (function (_super) {\n __extends(BevelFilter, _super);\n /**\n * @param {object} [options] - The optional parameters of the filter.\n * @param {number} [options.rotation = 45] - The angle of the light in degrees.\n * @param {number} [options.thickness = 2] - The tickness of the bevel.\n * @param {number} [options.lightColor = 0xffffff] - Color of the light.\n * @param {number} [options.lightAlpha = 0.7] - Alpha of the light.\n * @param {number} [options.shadowColor = 0x000000] - Color of the shadow.\n * @param {number} [options.shadowAlpha = 0.7] - Alpha of the shadow.\n */\n function BevelFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n _this._thickness = 2;\n _this._angle = 0;\n _this.uniforms.lightColor = new Float32Array(3);\n _this.uniforms.shadowColor = new Float32Array(3);\n Object.assign(_this, {\n rotation: 45,\n thickness: 2,\n lightColor: 0xffffff,\n lightAlpha: 0.7,\n shadowColor: 0x000000,\n shadowAlpha: 0.7,\n }, options);\n // Workaround: https://github.com/pixijs/filters/issues/230\n // applies correctly only if there is at least a single-pixel padding with alpha=0 around an image\n // To solve this problem, a padding of 1 put on the filter should suffice\n _this.padding = 1;\n return _this;\n }\n /**\n * Update the transform matrix of offset angle.\n * @private\n */\n BevelFilter.prototype._updateTransform = function () {\n this.uniforms.transformX = this._thickness * Math.cos(this._angle);\n this.uniforms.transformY = this._thickness * Math.sin(this._angle);\n };\n Object.defineProperty(BevelFilter.prototype, \"rotation\", {\n /**\n * The angle of the light in degrees.\n * @default 45\n */\n get: function () {\n return this._angle / DEG_TO_RAD;\n },\n set: function (value) {\n this._angle = value * DEG_TO_RAD;\n this._updateTransform();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"thickness\", {\n /**\n * The tickness of the bevel.\n * @default 2\n */\n get: function () {\n return this._thickness;\n },\n set: function (value) {\n this._thickness = value;\n this._updateTransform();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"lightColor\", {\n /**\n * Color of the light.\n * @default 0xffffff\n */\n get: function () {\n return rgb2hex(this.uniforms.lightColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.lightColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"lightAlpha\", {\n /**\n * Alpha of the light.\n * @default 0.7\n */\n get: function () {\n return this.uniforms.lightAlpha;\n },\n set: function (value) {\n this.uniforms.lightAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"shadowColor\", {\n /**\n * Color of the shadow.\n * @default 0x000000\n */\n get: function () {\n return rgb2hex(this.uniforms.shadowColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.shadowColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BevelFilter.prototype, \"shadowAlpha\", {\n /**\n * Alpha of the shadow.\n * @default 0.7\n */\n get: function () {\n return this.uniforms.shadowAlpha;\n },\n set: function (value) {\n this.uniforms.shadowAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return BevelFilter;\n}(Filter));\n\nexport { BevelFilter };\n//# sourceMappingURL=filter-bevel.esm.mjs.map\n","/*!\n * @pixi/filter-bloom - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-bloom is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { BLEND_MODES } from '@pixi/constants';\nimport { AlphaFilter } from '@pixi/filter-alpha';\nimport { BlurFilterPass } from '@pixi/filter-blur';\nimport { settings } from '@pixi/settings';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\n * The BloomFilter applies a Gaussian blur to an object.\n * The strength of the blur can be set for x- and y-axis separately.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bloom.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-bloom|@pixi/filter-bloom}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar BloomFilter = /** @class */ (function (_super) {\n __extends(BloomFilter, _super);\n /**\n * @param {number|PIXI.Point|number[]} [blur=2] - Sets the strength of both the blurX and blurY properties simultaneously\n * @param {number} [quality=4] - The quality of the blurX & blurY filter.\n * @param {number} [resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the blurX & blurY filter.\n * @param {number} [kernelSize=5] - The kernelSize of the blurX & blurY filter.Options: 5, 7, 9, 11, 13, 15.\n */\n function BloomFilter(blur, quality, resolution, kernelSize) {\n if (blur === void 0) { blur = 2; }\n if (quality === void 0) { quality = 4; }\n if (resolution === void 0) { resolution = settings.FILTER_RESOLUTION; }\n if (kernelSize === void 0) { kernelSize = 5; }\n var _this = _super.call(this) || this;\n var blurX;\n var blurY;\n if (typeof blur === 'number') {\n blurX = blur;\n blurY = blur;\n }\n else if (blur instanceof Point) {\n blurX = blur.x;\n blurY = blur.y;\n }\n else if (Array.isArray(blur)) {\n blurX = blur[0];\n blurY = blur[1];\n }\n _this.blurXFilter = new BlurFilterPass(true, blurX, quality, resolution, kernelSize);\n _this.blurYFilter = new BlurFilterPass(false, blurY, quality, resolution, kernelSize);\n _this.blurYFilter.blendMode = BLEND_MODES.SCREEN;\n _this.defaultFilter = new AlphaFilter();\n return _this;\n }\n BloomFilter.prototype.apply = function (filterManager, input, output, clear) {\n var renderTarget = filterManager.getFilterTexture();\n // TODO - copyTexSubImage2D could be used here?\n this.defaultFilter.apply(filterManager, input, output, clear);\n this.blurXFilter.apply(filterManager, input, renderTarget, 1);\n this.blurYFilter.apply(filterManager, renderTarget, output, 0);\n filterManager.returnFilterTexture(renderTarget);\n };\n Object.defineProperty(BloomFilter.prototype, \"blur\", {\n /**\n * Sets the strength of both the blurX and blurY properties simultaneously\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = this.blurYFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BloomFilter.prototype, \"blurX\", {\n /**\n * Sets the strength of the blurX property\n * @default 2\n */\n get: function () {\n return this.blurXFilter.blur;\n },\n set: function (value) {\n this.blurXFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BloomFilter.prototype, \"blurY\", {\n /**\n * Sets the strength of the blurY property\n * @default 2\n */\n get: function () {\n return this.blurYFilter.blur;\n },\n set: function (value) {\n this.blurYFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n return BloomFilter;\n}(Filter));\n\nexport { BloomFilter };\n//# sourceMappingURL=filter-bloom.esm.mjs.map\n","/*!\n * @pixi/filter-bulge-pinch - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-bulge-pinch is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"uniform float radius;\\nuniform float strength;\\nuniform vec2 center;\\nuniform sampler2D uSampler;\\nvarying vec2 vTextureCoord;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform vec2 dimensions;\\n\\nvoid main()\\n{\\n vec2 coord = vTextureCoord * filterArea.xy;\\n coord -= center * dimensions.xy;\\n float distance = length(coord);\\n if (distance < radius) {\\n float percent = distance / radius;\\n if (strength > 0.0) {\\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\\n } else {\\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\\n }\\n }\\n coord += center * dimensions.xy;\\n coord /= filterArea.xy;\\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n vec4 color = texture2D(uSampler, clampedCoord);\\n if (coord != clampedCoord) {\\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\\n }\\n\\n gl_FragColor = color;\\n}\\n\";\n\n// @author Julien CLEREL @JuloxRox\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/warp/bulgepinch.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * Bulges or pinches the image in a circle.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/bulge-pinch.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-bulge-pinch|@pixi/filter-bulge-pinch}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar BulgePinchFilter = /** @class */ (function (_super) {\n __extends(BulgePinchFilter, _super);\n /**\n * @param {object} [options] - Options to use for filter.\n * @param {PIXI.Point|Array<number>} [options.center=[0,0]] - The x and y coordinates of the center\n * of the circle of effect.\n * @param {number} [options.radius=100] - The radius of the circle of effect.\n * @param {number} [options.strength=1] - -1 to 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n */\n function BulgePinchFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n _this.uniforms.dimensions = new Float32Array(2);\n Object.assign(_this, BulgePinchFilter.defaults, options);\n return _this;\n }\n BulgePinchFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(BulgePinchFilter.prototype, \"radius\", {\n /**\n * The radius of the circle of effect.\n */\n get: function () {\n return this.uniforms.radius;\n },\n set: function (value) {\n this.uniforms.radius = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BulgePinchFilter.prototype, \"strength\", {\n /**\n * The strength of the effect. -1 to 1 (-1 is strong pinch, 0 is no effect, 1 is strong bulge)\n */\n get: function () {\n return this.uniforms.strength;\n },\n set: function (value) {\n this.uniforms.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BulgePinchFilter.prototype, \"center\", {\n /**\n * The x and y coordinates of the center of the circle of effect.\n *\n * @member {PIXI.Point | Array<number>}\n */\n get: function () {\n return this.uniforms.center;\n },\n set: function (value) {\n this.uniforms.center = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n BulgePinchFilter.defaults = {\n center: [0.5, 0.5],\n radius: 100,\n strength: 1,\n };\n return BulgePinchFilter;\n}(Filter));\n\nexport { BulgePinchFilter };\n//# sourceMappingURL=filter-bulge-pinch.esm.mjs.map\n","/*!\n * @pixi/filter-color-map - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-color-map is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Texture, Filter } from '@pixi/core';\nimport { MIPMAP_MODES, SCALE_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform sampler2D colorMap;\\nuniform float _mix;\\nuniform float _size;\\nuniform float _sliceSize;\\nuniform float _slicePixelSize;\\nuniform float _sliceInnerSize;\\nvoid main() {\\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\\n\\n vec4 adjusted;\\n if (color.a > 0.0) {\\n color.rgb /= color.a;\\n float innerWidth = _size - 1.0;\\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\\n float s0 = xOffset + (zSlice0 * _sliceSize);\\n float s1 = xOffset + (zSlice1 * _sliceSize);\\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\\n float zOffset = fract(color.b * innerWidth);\\n adjusted = mix(slice0Color, slice1Color, zOffset);\\n\\n color.rgb *= color.a;\\n }\\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\\n\\n}\";\n\n/**\n * The ColorMapFilter applies a color-map effect to an object.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/color-map.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-color-map|@pixi/filter-color-map}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ColorMapFilter = /** @class */ (function (_super) {\n __extends(ColorMapFilter, _super);\n /**\n * @param {HTMLImageElement|HTMLCanvasElement|PIXI.BaseTexture|PIXI.Texture} [colorMap] - The\n * colorMap texture of the filter.\n * @param {boolean} [nearest=false] - Whether use NEAREST for colorMap texture.\n * @param {number} [mix=1] - The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image.\n */\n function ColorMapFilter(colorMap, nearest, mix) {\n if (nearest === void 0) { nearest = false; }\n if (mix === void 0) { mix = 1; }\n var _this = _super.call(this, vertex, fragment) || this;\n /** The mix from 0 to 1, where 0 is the original image and 1 is the color mapped image. */\n _this.mix = 1;\n _this._size = 0;\n _this._sliceSize = 0;\n _this._slicePixelSize = 0;\n _this._sliceInnerSize = 0;\n _this._nearest = false;\n _this._scaleMode = null;\n _this._colorMap = null;\n _this._scaleMode = null;\n _this.nearest = nearest;\n _this.mix = mix;\n _this.colorMap = colorMap;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n ColorMapFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms._mix = this.mix;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(ColorMapFilter.prototype, \"colorSize\", {\n /**\n * The size of one color slice\n * @readonly\n */\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMapFilter.prototype, \"colorMap\", {\n /**\n * the colorMap texture\n * @member {PIXI.Texture}\n */\n get: function () {\n return this._colorMap;\n },\n set: function (colorMap) {\n var _a;\n if (!colorMap) {\n return;\n }\n if (!(colorMap instanceof Texture)) {\n colorMap = Texture.from(colorMap);\n }\n if ((_a = colorMap) === null || _a === void 0 ? void 0 : _a.baseTexture) {\n colorMap.baseTexture.scaleMode = this._scaleMode;\n colorMap.baseTexture.mipmap = MIPMAP_MODES.OFF;\n this._size = colorMap.height;\n this._sliceSize = 1 / this._size;\n this._slicePixelSize = this._sliceSize / this._size;\n this._sliceInnerSize = this._slicePixelSize * (this._size - 1);\n this.uniforms._size = this._size;\n this.uniforms._sliceSize = this._sliceSize;\n this.uniforms._slicePixelSize = this._slicePixelSize;\n this.uniforms._sliceInnerSize = this._sliceInnerSize;\n this.uniforms.colorMap = colorMap;\n }\n this._colorMap = colorMap;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorMapFilter.prototype, \"nearest\", {\n /**\n * Whether use NEAREST for colorMap texture.\n */\n get: function () {\n return this._nearest;\n },\n set: function (nearest) {\n this._nearest = nearest;\n this._scaleMode = nearest ? SCALE_MODES.NEAREST : SCALE_MODES.LINEAR;\n var texture = this._colorMap;\n if (texture && texture.baseTexture) {\n texture.baseTexture._glTextures = {};\n texture.baseTexture.scaleMode = this._scaleMode;\n texture.baseTexture.mipmap = MIPMAP_MODES.OFF;\n texture._updateID++;\n texture.baseTexture.emit('update', texture.baseTexture);\n }\n },\n enumerable: false,\n configurable: true\n });\n /**\n * If the colorMap is based on canvas , and the content of canvas has changed,\n * then call `updateColorMap` for update texture.\n */\n ColorMapFilter.prototype.updateColorMap = function () {\n var texture = this._colorMap;\n if (texture && texture.baseTexture) {\n texture._updateID++;\n texture.baseTexture.emit('update', texture.baseTexture);\n this.colorMap = texture;\n }\n };\n /**\n * Destroys this filter\n *\n * @param {boolean} [destroyBase=false] - Whether to destroy the base texture of colorMap as well\n */\n ColorMapFilter.prototype.destroy = function (destroyBase) {\n if (destroyBase === void 0) { destroyBase = false; }\n if (this._colorMap) {\n this._colorMap.destroy(destroyBase);\n }\n _super.prototype.destroy.call(this);\n };\n return ColorMapFilter;\n}(Filter));\n\nexport { ColorMapFilter };\n//# sourceMappingURL=filter-color-map.esm.mjs.map\n","/*!\n * @pixi/filter-color-overlay - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-color-overlay is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec3 color;\\nuniform float alpha;\\n\\nvoid main(void) {\\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\\n gl_FragColor = vec4(mix(currentColor.rgb, color.rgb, currentColor.a * alpha), currentColor.a);\\n}\\n\";\n\n/**\n * Replace all colors within a source graphic with a single color.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/color-overlay.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-color-replace|@pixi/filter-color-replace}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * // replaces red with blue\n * someSprite.filters = [new ColorOverlayFilter(\n * [1, 0, 0],\n * [0, 0, 1],\n * 0.001\n * )];\n *\n */\nvar ColorOverlayFilter = /** @class */ (function (_super) {\n __extends(ColorOverlayFilter, _super);\n /**\n * @param {number|Array<number>} [color=0x000000] - The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @param {number} [alpha=1] - The alpha value of the color\n */\n function ColorOverlayFilter(color, alpha) {\n if (color === void 0) { color = 0x000000; }\n if (alpha === void 0) { alpha = 1; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._color = 0x0;\n _this._alpha = 1;\n _this.uniforms.color = new Float32Array(3);\n _this.color = color;\n _this.alpha = alpha;\n return _this;\n }\n Object.defineProperty(ColorOverlayFilter.prototype, \"color\", {\n get: function () {\n return this._color;\n },\n /**\n * The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @member {number|Array<number>|Float32Array}\n * @default 0x000000\n */\n set: function (value) {\n var arr = this.uniforms.color;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._color = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n this._color = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorOverlayFilter.prototype, \"alpha\", {\n get: function () {\n return this._alpha;\n },\n /**\n * The alpha value of the color\n * @default 0\n */\n set: function (value) {\n this.uniforms.alpha = value;\n this._alpha = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorOverlayFilter;\n}(Filter));\n\nexport { ColorOverlayFilter };\n//# sourceMappingURL=filter-color-overlay.esm.mjs.map\n","/*!\n * @pixi/filter-color-replace - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-color-replace is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec3 originalColor;\\nuniform vec3 newColor;\\nuniform float epsilon;\\nvoid main(void) {\\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\\n float colorDistance = length(colorDiff);\\n float doReplace = step(colorDistance, epsilon);\\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\\n}\\n\";\n\n/**\n * ColorReplaceFilter, originally by mishaa, updated by timetocode\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/color-replace.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-color-replace|@pixi/filter-color-replace}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * // replaces true red with true blue\n * someSprite.filters = [new ColorReplaceFilter(\n * [1, 0, 0],\n * [0, 0, 1],\n * 0.001\n * )];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter(\n * [220/255.0, 220/255.0, 220/255.0],\n * [225/255.0, 200/255.0, 215/255.0],\n * 0.001\n * )];\n * // replaces the RGB color 220, 220, 220 with the RGB color 225, 200, 215\n * someOtherSprite.filters = [new ColorReplaceFilter(0xdcdcdc, 0xe1c8d7, 0.001)];\n *\n */\nvar ColorReplaceFilter = /** @class */ (function (_super) {\n __extends(ColorReplaceFilter, _super);\n /**\n * @param {number|Array<number>|Float32Array} [originalColor=0xFF0000] - The color that will be changed,\n * as a 3 component RGB e.g. `[1.0, 1.0, 1.0]`\n * @param {number|Array<number>|Float32Array} [newColor=0x000000] - The resulting color, as a 3 component\n * RGB e.g. `[1.0, 0.5, 1.0]`\n * @param {number} [epsilon=0.4] - Tolerance/sensitivity of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n */\n function ColorReplaceFilter(originalColor, newColor, epsilon) {\n if (originalColor === void 0) { originalColor = 0xFF0000; }\n if (newColor === void 0) { newColor = 0x000000; }\n if (epsilon === void 0) { epsilon = 0.4; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._originalColor = 0xff0000;\n _this._newColor = 0x0;\n _this.uniforms.originalColor = new Float32Array(3);\n _this.uniforms.newColor = new Float32Array(3);\n _this.originalColor = originalColor;\n _this.newColor = newColor;\n _this.epsilon = epsilon;\n return _this;\n }\n Object.defineProperty(ColorReplaceFilter.prototype, \"originalColor\", {\n get: function () {\n return this._originalColor;\n },\n /**\n * The color that will be changed, as a 3 component RGB e.g. [1.0, 1.0, 1.0]\n * @member {number|Array<number>|Float32Array}\n * @default 0xFF0000\n */\n set: function (value) {\n var arr = this.uniforms.originalColor;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._originalColor = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n this._originalColor = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorReplaceFilter.prototype, \"newColor\", {\n get: function () {\n return this._newColor;\n },\n /**\n * The resulting color, as a 3 component RGB e.g. [1.0, 0.5, 1.0]\n * @member {number|Array<number>|Float32Array}\n * @default 0x000000\n */\n set: function (value) {\n var arr = this.uniforms.newColor;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._newColor = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n this._newColor = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ColorReplaceFilter.prototype, \"epsilon\", {\n get: function () {\n return this.uniforms.epsilon;\n },\n /**\n * Tolerance/sensitivity of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.4\n */\n set: function (value) {\n this.uniforms.epsilon = value;\n },\n enumerable: false,\n configurable: true\n });\n return ColorReplaceFilter;\n}(Filter));\n\nexport { ColorReplaceFilter };\n//# sourceMappingURL=filter-color-replace.esm.mjs.map\n","/*!\n * @pixi/filter-convolution - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-convolution is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying mediump vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform vec2 texelSize;\\nuniform float matrix[9];\\n\\nvoid main(void)\\n{\\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\\n\\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\\n\\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\\n\\n gl_FragColor =\\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\\n\\n gl_FragColor.a = c22.a;\\n}\\n\";\n\n/**\n * The ConvolutionFilter class applies a matrix convolution filter effect.\n * A convolution combines pixels in the input image with neighboring pixels to produce a new image.\n * A wide variety of image effects can be achieved through convolutions, including blurring, edge\n * detection, sharpening, embossing, and beveling. The matrix should be specified as a 9 point Array.\n * See https://docs.gimp.org/2.10/en/gimp-filter-convolution-matrix.html for more info.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/convolution.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-convolution|@pixi/filter-convolution}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ConvolutionFilter = /** @class */ (function (_super) {\n __extends(ConvolutionFilter, _super);\n /**\n * @param {number[]} [matrix=[0,0,0,0,0,0,0,0,0]] - An array of values used for matrix transformation.\n * Specified as a 9 point Array.\n * @param {number} [width=200] - Width of the object you are transforming\n * @param {number} [height=200] - Height of the object you are transforming\n */\n function ConvolutionFilter(matrix, width, height) {\n if (width === void 0) { width = 200; }\n if (height === void 0) { height = 200; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.uniforms.texelSize = new Float32Array(2);\n _this.uniforms.matrix = new Float32Array(9);\n if (matrix !== undefined) {\n _this.matrix = matrix;\n }\n _this.width = width;\n _this.height = height;\n return _this;\n }\n Object.defineProperty(ConvolutionFilter.prototype, \"matrix\", {\n /**\n * An array of values used for matrix transformation. Specified as a 9 point Array.\n */\n get: function () {\n return this.uniforms.matrix;\n },\n set: function (matrix) {\n var _this = this;\n matrix.forEach(function (v, i) {\n _this.uniforms.matrix[i] = v;\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ConvolutionFilter.prototype, \"width\", {\n /**\n * Width of the object you are transforming\n */\n get: function () {\n return 1 / this.uniforms.texelSize[0];\n },\n set: function (value) {\n this.uniforms.texelSize[0] = 1 / value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ConvolutionFilter.prototype, \"height\", {\n /**\n * Height of the object you are transforming\n */\n get: function () {\n return 1 / this.uniforms.texelSize[1];\n },\n set: function (value) {\n this.uniforms.texelSize[1] = 1 / value;\n },\n enumerable: false,\n configurable: true\n });\n return ConvolutionFilter;\n}(Filter));\n\nexport { ConvolutionFilter };\n//# sourceMappingURL=filter-convolution.esm.mjs.map\n","/*!\n * @pixi/filter-cross-hatch - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-cross-hatch is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\n\\nvoid main(void)\\n{\\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\\n\\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\\n\\n if (lum < 1.00)\\n {\\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.75)\\n {\\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.50)\\n {\\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n\\n if (lum < 0.3)\\n {\\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\\n {\\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\\n }\\n }\\n}\\n\";\n\n/**\n * A Cross Hatch effect filter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/cross-hatch.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-cross-hatch|@pixi/filter-cross-hatch}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar CrossHatchFilter = /** @class */ (function (_super) {\n __extends(CrossHatchFilter, _super);\n function CrossHatchFilter() {\n return _super.call(this, vertex, fragment) || this;\n }\n return CrossHatchFilter;\n}(Filter));\n\nexport { CrossHatchFilter };\n//# sourceMappingURL=filter-cross-hatch.esm.mjs.map\n","/*!\n * @pixi/filter-crt - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-crt is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\n\\nconst float SQRT_2 = 1.414213;\\n\\nconst float light = 1.0;\\n\\nuniform float curvature;\\nuniform float lineWidth;\\nuniform float lineContrast;\\nuniform bool verticalLine;\\nuniform float noise;\\nuniform float noiseSize;\\n\\nuniform float vignetting;\\nuniform float vignettingAlpha;\\nuniform float vignettingBlur;\\n\\nuniform float seed;\\nuniform float time;\\n\\nfloat rand(vec2 co) {\\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\\n}\\n\\nvoid main(void)\\n{\\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\\n vec2 dir = vec2(vTextureCoord.xy * filterArea.xy / dimensions - vec2(0.5, 0.5));\\n \\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n vec3 rgb = gl_FragColor.rgb;\\n\\n if (noise > 0.0 && noiseSize > 0.0)\\n {\\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\\n rgb += _noise * noise;\\n }\\n\\n if (lineWidth > 0.0)\\n {\\n float _c = curvature > 0. ? curvature : 1.;\\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\\n vec2 uv = dir * k;\\n\\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\\n rgb *= j;\\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\\n rgb *= 0.99 + ceil(segment) * 0.015;\\n }\\n\\n if (vignetting > 0.0)\\n {\\n float outter = SQRT_2 - vignetting * SQRT_2;\\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\\n }\\n\\n gl_FragColor.rgb = rgb;\\n}\\n\";\n\n/**\n * The CRTFilter applies a CRT effect to an object.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/crt.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-crt|@pixi/filter-crt}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar CRTFilter = /** @class */ (function (_super) {\n __extends(CRTFilter, _super);\n /**\n * @param {object} [options] - The optional parameters of CRT effect\n * @param {number} [options.curvature=1.0] - Bent of interlaced lines, higher value means more bend\n * @param {number} [options.lineWidth=1.0] - Width of the interlaced lines\n * @param {number} [options.lineContrast=0.25] - Contrast of interlaced lines\n * @param {number} [options.verticalLine=false] - `true` is vertical lines, `false` is horizontal\n * @param {number} [options.noise=0.3] - Opacity/intensity of the noise effect between `0` and `1`\n * @param {number} [options.noiseSize=1.0] - The size of the noise particles\n * @param {number} [options.seed=0] - A seed value to apply to the random noise generation\n * @param {number} [options.vignetting=0.3] - The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @param {number} [options.vignettingAlpha=1.0] - Amount of opacity of vignette\n * @param {number} [options.vignettingBlur=0.3] - Blur intensity of the vignette\n * @param {number} [options.time=0] - For animating interlaced lines\n */\n function CRTFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n /** For animating interlaced lines */\n _this.time = 0;\n /** A seed value to apply to the random noise generation */\n _this.seed = 0;\n _this.uniforms.dimensions = new Float32Array(2);\n Object.assign(_this, CRTFilter.defaults, options);\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n CRTFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = input.filterFrame, width = _a.width, height = _a.height;\n this.uniforms.dimensions[0] = width;\n this.uniforms.dimensions[1] = height;\n this.uniforms.seed = this.seed;\n this.uniforms.time = this.time;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(CRTFilter.prototype, \"curvature\", {\n get: function () {\n return this.uniforms.curvature;\n },\n /**\n * Bent of interlaced lines, higher value means more bend\n * @default 1\n */\n set: function (value) {\n this.uniforms.curvature = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"lineWidth\", {\n get: function () {\n return this.uniforms.lineWidth;\n },\n /**\n * Width of interlaced lines\n * @default 1\n */\n set: function (value) {\n this.uniforms.lineWidth = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"lineContrast\", {\n get: function () {\n return this.uniforms.lineContrast;\n },\n /**\n * Contrast of interlaced lines\n * @default 0.25\n */\n set: function (value) {\n this.uniforms.lineContrast = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"verticalLine\", {\n get: function () {\n return this.uniforms.verticalLine;\n },\n /**\n * `true` for vertical lines, `false` for horizontal lines\n * @default false\n */\n set: function (value) {\n this.uniforms.verticalLine = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"noise\", {\n get: function () {\n return this.uniforms.noise;\n },\n /**\n * Opacity/intensity of the noise effect between `0` and `1`\n * @default 0\n */\n set: function (value) {\n this.uniforms.noise = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"noiseSize\", {\n get: function () {\n return this.uniforms.noiseSize;\n },\n /**\n * The size of the noise particles\n * @default 0\n */\n set: function (value) {\n this.uniforms.noiseSize = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"vignetting\", {\n get: function () {\n return this.uniforms.vignetting;\n },\n /**\n * The radius of the vignette effect, smaller\n * values produces a smaller vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignetting = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"vignettingAlpha\", {\n get: function () {\n return this.uniforms.vignettingAlpha;\n },\n /**\n * Amount of opacity of vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingAlpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(CRTFilter.prototype, \"vignettingBlur\", {\n get: function () {\n return this.uniforms.vignettingBlur;\n },\n /**\n * Blur intensity of the vignette\n * @default 0\n */\n set: function (value) {\n this.uniforms.vignettingBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options */\n CRTFilter.defaults = {\n curvature: 1.0,\n lineWidth: 1.0,\n lineContrast: 0.25,\n verticalLine: false,\n noise: 0.0,\n noiseSize: 1.0,\n seed: 0.0,\n vignetting: 0.3,\n vignettingAlpha: 1.0,\n vignettingBlur: 0.3,\n time: 0.0,\n };\n return CRTFilter;\n}(Filter));\n\nexport { CRTFilter };\n//# sourceMappingURL=filter-crt.esm.mjs.map\n","/*!\n * @pixi/filter-drop-shadow - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-drop-shadow is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { KawaseBlurFilter } from '@pixi/filter-kawase-blur';\nimport { Filter } from '@pixi/core';\nimport { settings } from '@pixi/settings';\nimport { DEG_TO_RAD, Point } from '@pixi/math';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\n var arguments$1 = arguments;\n\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments$1[i];\r\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p)) { t[p] = s[p]; } }\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform float alpha;\\nuniform vec3 color;\\n\\nuniform vec2 shift;\\nuniform vec4 inputSize;\\n\\nvoid main(void){\\n vec4 sample = texture2D(uSampler, vTextureCoord - shift * inputSize.zw);\\n\\n // Premultiply alpha\\n sample.rgb = color.rgb * sample.a;\\n\\n // alpha user alpha\\n sample *= alpha;\\n\\n gl_FragColor = sample;\\n}\";\n\n/**\n * Drop shadow filter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/drop-shadow.png)\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-drop-shadow|@pixi/filter-drop-shadow}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar DropShadowFilter = /** @class */ (function (_super) {\n __extends(DropShadowFilter, _super);\n /**\n * @param {object} [options] - Filter options\n * @param {number} [options.rotation=45] - The angle of the shadow in degrees.\n * @param {number} [options.distance=5] - Distance of shadow\n * @param {number} [options.color=0x000000] - Color of the shadow\n * @param {number} [options.alpha=0.5] - Alpha of the shadow\n * @param {boolean} [options.shadowOnly=false] - Whether render shadow only\n * @param {number} [options.blur=2] - Sets the strength of the Blur properties simultaneously\n * @param {number} [options.quality=3] - The quality of the Blur filter.\n * @param {number[]} [options.kernels=null] - The kernels of the Blur filter.\n * @param {number|number[]|PIXI.Point} [options.pixelSize=1] - the pixelSize of the Blur filter.\n * @param {number} [options.resolution=PIXI.settings.FILTER_RESOLUTION] - The resolution of the Blur filter.\n */\n function DropShadowFilter(options) {\n var _this = _super.call(this) || this;\n /** Angle of the shadow in degrees. */\n _this.angle = 45;\n _this._distance = 5;\n _this._resolution = settings.FILTER_RESOLUTION;\n var opt = options\n ? __assign(__assign({}, DropShadowFilter.defaults), options) : DropShadowFilter.defaults;\n var kernels = opt.kernels, blur = opt.blur, quality = opt.quality, pixelSize = opt.pixelSize, resolution = opt.resolution;\n _this._tintFilter = new Filter(vertex, fragment);\n _this._tintFilter.uniforms.color = new Float32Array(4);\n _this._tintFilter.uniforms.shift = new Point();\n _this._tintFilter.resolution = resolution;\n _this._blurFilter = kernels\n ? new KawaseBlurFilter(kernels)\n : new KawaseBlurFilter(blur, quality);\n _this.pixelSize = pixelSize;\n _this.resolution = resolution;\n var shadowOnly = opt.shadowOnly, rotation = opt.rotation, distance = opt.distance, alpha = opt.alpha, color = opt.color;\n _this.shadowOnly = shadowOnly;\n _this.rotation = rotation;\n _this.distance = distance;\n _this.alpha = alpha;\n _this.color = color;\n _this._updatePadding();\n return _this;\n }\n DropShadowFilter.prototype.apply = function (filterManager, input, output, clear) {\n var target = filterManager.getFilterTexture();\n this._tintFilter.apply(filterManager, input, target, 1);\n this._blurFilter.apply(filterManager, target, output, clear);\n if (this.shadowOnly !== true) {\n filterManager.applyFilter(this, input, output, 0);\n }\n filterManager.returnFilterTexture(target);\n };\n /**\n * Recalculate the proper padding amount.\n * @private\n */\n DropShadowFilter.prototype._updatePadding = function () {\n this.padding = this.distance + (this.blur * 2);\n };\n /**\n * Update the transform matrix of offset angle.\n * @private\n */\n DropShadowFilter.prototype._updateShift = function () {\n this._tintFilter.uniforms.shift.set(this.distance * Math.cos(this.angle), this.distance * Math.sin(this.angle));\n };\n Object.defineProperty(DropShadowFilter.prototype, \"resolution\", {\n /**\n * The resolution of the filter.\n * @default PIXI.settings.FILTER_RESOLUTION\n */\n get: function () {\n return this._resolution;\n },\n set: function (value) {\n this._resolution = value;\n if (this._tintFilter) {\n this._tintFilter.resolution = value;\n }\n if (this._blurFilter) {\n this._blurFilter.resolution = value;\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"distance\", {\n /**\n * Distance offset of the shadow\n * @default 5\n */\n get: function () {\n return this._distance;\n },\n set: function (value) {\n this._distance = value;\n this._updatePadding();\n this._updateShift();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"rotation\", {\n /**\n * The angle of the shadow in degrees\n * @default 2\n */\n get: function () {\n return this.angle / DEG_TO_RAD;\n },\n set: function (value) {\n this.angle = value * DEG_TO_RAD;\n this._updateShift();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"alpha\", {\n /**\n * The alpha of the shadow\n * @default 1\n */\n get: function () {\n return this._tintFilter.uniforms.alpha;\n },\n set: function (value) {\n this._tintFilter.uniforms.alpha = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"color\", {\n /**\n * The color of the shadow.\n * @default 0x000000\n */\n get: function () {\n return rgb2hex(this._tintFilter.uniforms.color);\n },\n set: function (value) {\n hex2rgb(value, this._tintFilter.uniforms.color);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"kernels\", {\n /**\n * Sets the kernels of the Blur Filter\n */\n get: function () {\n return this._blurFilter.kernels;\n },\n set: function (value) {\n this._blurFilter.kernels = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"blur\", {\n /**\n * The blur of the shadow\n * @default 2\n */\n get: function () {\n return this._blurFilter.blur;\n },\n set: function (value) {\n this._blurFilter.blur = value;\n this._updatePadding();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"quality\", {\n /**\n * Sets the quality of the Blur Filter\n * @default 4\n */\n get: function () {\n return this._blurFilter.quality;\n },\n set: function (value) {\n this._blurFilter.quality = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DropShadowFilter.prototype, \"pixelSize\", {\n /**\n * Sets the pixelSize of the Kawase Blur filter\n *\n * @member {number|number[]|PIXI.Point}\n * @default 1\n */\n get: function () {\n return this._blurFilter.pixelSize;\n },\n set: function (value) {\n this._blurFilter.pixelSize = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n DropShadowFilter.defaults = {\n rotation: 45,\n distance: 5,\n color: 0x000000,\n alpha: 0.5,\n shadowOnly: false,\n kernels: null,\n blur: 2,\n quality: 3,\n pixelSize: 1,\n resolution: settings.FILTER_RESOLUTION,\n };\n return DropShadowFilter;\n}(Filter));\n\nexport { DropShadowFilter };\n//# sourceMappingURL=filter-drop-shadow.esm.mjs.map\n","/*!\n * @pixi/filter-emboss - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-emboss is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float strength;\\nuniform vec4 filterArea;\\n\\n\\nvoid main(void)\\n{\\n\\tvec2 onePixel = vec2(1.0 / filterArea);\\n\\n\\tvec4 color;\\n\\n\\tcolor.rgb = vec3(0.5);\\n\\n\\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\\n\\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\\n\\n\\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\\n\\n\\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\\n\\n\\tgl_FragColor = vec4(color.rgb * alpha, alpha);\\n}\\n\";\n\n/**\n * An RGB Split Filter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/emboss.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-emboss|@pixi/filter-emboss}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar EmbossFilter = /** @class */ (function (_super) {\n __extends(EmbossFilter, _super);\n /**\n * @param {number} [strength=5] - Strength of the emboss.\n */\n function EmbossFilter(strength) {\n if (strength === void 0) { strength = 5; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.strength = strength;\n return _this;\n }\n Object.defineProperty(EmbossFilter.prototype, \"strength\", {\n /**\n * Strength of emboss.\n */\n get: function () {\n return this.uniforms.strength;\n },\n set: function (value) {\n this.uniforms.strength = value;\n },\n enumerable: false,\n configurable: true\n });\n return EmbossFilter;\n}(Filter));\n\nexport { EmbossFilter };\n//# sourceMappingURL=filter-emboss.esm.mjs.map\n","/*!\n * @pixi/filter-glow - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-glow is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nvarying vec4 vColor;\\n\\nuniform sampler2D uSampler;\\n\\nuniform float outerStrength;\\nuniform float innerStrength;\\n\\nuniform vec4 glowColor;\\n\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\nuniform bool knockout;\\n\\nconst float PI = 3.14159265358979323846264;\\n\\nconst float DIST = __DIST__;\\nconst float ANGLE_STEP_SIZE = min(__ANGLE_STEP_SIZE__, PI * 2.0);\\nconst float ANGLE_STEP_NUM = ceil(PI * 2.0 / ANGLE_STEP_SIZE);\\n\\nconst float MAX_TOTAL_ALPHA = ANGLE_STEP_NUM * DIST * (DIST + 1.0) / 2.0;\\n\\nvoid main(void) {\\n vec2 px = vec2(1.0 / filterArea.x, 1.0 / filterArea.y);\\n\\n float totalAlpha = 0.0;\\n\\n vec2 direction;\\n vec2 displaced;\\n vec4 curColor;\\n\\n for (float angle = 0.0; angle < PI * 2.0; angle += ANGLE_STEP_SIZE) {\\n direction = vec2(cos(angle), sin(angle)) * px;\\n\\n for (float curDistance = 0.0; curDistance < DIST; curDistance++) {\\n displaced = clamp(vTextureCoord + direction * \\n (curDistance + 1.0), filterClamp.xy, filterClamp.zw);\\n\\n curColor = texture2D(uSampler, displaced);\\n\\n totalAlpha += (DIST - curDistance) * curColor.a;\\n }\\n }\\n \\n curColor = texture2D(uSampler, vTextureCoord);\\n\\n float alphaRatio = (totalAlpha / MAX_TOTAL_ALPHA);\\n\\n float innerGlowAlpha = (1.0 - alphaRatio) * innerStrength * curColor.a;\\n float innerGlowStrength = min(1.0, innerGlowAlpha);\\n \\n vec4 innerColor = mix(curColor, glowColor, innerGlowStrength);\\n\\n float outerGlowAlpha = alphaRatio * outerStrength * (1. - curColor.a);\\n float outerGlowStrength = min(1.0 - innerColor.a, outerGlowAlpha);\\n\\n vec4 outerGlowColor = outerGlowStrength * glowColor.rgba;\\n \\n if (knockout) {\\n float resultAlpha = outerGlowAlpha + innerGlowAlpha;\\n gl_FragColor = vec4(glowColor.rgb * resultAlpha, resultAlpha);\\n }\\n else {\\n gl_FragColor = innerColor + outerGlowColor;\\n }\\n}\\n\";\n\n/**\n * GlowFilter, originally by mishaa\n * [codepen]{@link http://codepen.io/mishaa/pen/raKzrm}.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/glow.png)\n * @class\n *\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-glow|@pixi/filter-glow}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * someSprite.filters = [\n * new GlowFilter({ distance: 15, outerStrength: 2 })\n * ];\n */\nvar GlowFilter = /** @class */ (function (_super) {\n __extends(GlowFilter, _super);\n /**\n * @param {number} [options] - Options for glow.\n * @param {number} [options.distance=10] - The distance of the glow. Make it 2 times more for resolution=2.\n * It can't be changed after filter creation.\n * @param {number} [options.outerStrength=4] - The strength of the glow outward from the edge of the sprite.\n * @param {number} [options.innerStrength=0] - The strength of the glow inward from the edge of the sprite.\n * @param {number} [options.color=0xffffff] - The color of the glow.\n * @param {number} [options.quality=0.1] - A number between 0 and 1 that describes the quality of the glow.\n * The higher the number the less performant.\n * @param {boolean} [options.knockout=false] - Toggle to hide the contents and only show glow.\n */\n function GlowFilter(options) {\n var _this = this;\n var opts = Object.assign({}, GlowFilter.defaults, options);\n var outerStrength = opts.outerStrength, innerStrength = opts.innerStrength, color = opts.color, knockout = opts.knockout, quality = opts.quality;\n var distance = Math.round(opts.distance);\n _this = _super.call(this, vertex, fragment\n .replace(/__ANGLE_STEP_SIZE__/gi, \"\" + (1 / quality / distance).toFixed(7))\n .replace(/__DIST__/gi, distance.toFixed(0) + \".0\")) || this;\n _this.uniforms.glowColor = new Float32Array([0, 0, 0, 1]);\n Object.assign(_this, {\n color: color,\n outerStrength: outerStrength,\n innerStrength: innerStrength,\n padding: distance,\n knockout: knockout,\n });\n return _this;\n }\n Object.defineProperty(GlowFilter.prototype, \"color\", {\n /**\n * The color of the glow.\n * @default 0xFFFFFF\n */\n get: function () {\n return rgb2hex(this.uniforms.glowColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.glowColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlowFilter.prototype, \"outerStrength\", {\n /**\n * The strength of the glow outward from the edge of the sprite.\n * @default 4\n */\n get: function () {\n return this.uniforms.outerStrength;\n },\n set: function (value) {\n this.uniforms.outerStrength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlowFilter.prototype, \"innerStrength\", {\n /**\n * The strength of the glow inward from the edge of the sprite.\n * @default 0\n */\n get: function () {\n return this.uniforms.innerStrength;\n },\n set: function (value) {\n this.uniforms.innerStrength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(GlowFilter.prototype, \"knockout\", {\n /**\n * Only draw the glow, not the texture itself\n * @default false\n */\n get: function () {\n return this.uniforms.knockout;\n },\n set: function (value) {\n this.uniforms.knockout = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default values for options. */\n GlowFilter.defaults = {\n distance: 10,\n outerStrength: 4,\n innerStrength: 0,\n color: 0xffffff,\n quality: 0.1,\n knockout: false,\n };\n return GlowFilter;\n}(Filter));\n\nexport { GlowFilter };\n//# sourceMappingURL=filter-glow.esm.mjs.map\n","/*!\n * @pixi/filter-motion-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-motion-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { ObservablePoint } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform vec2 uVelocity;\\nuniform int uKernelSize;\\nuniform float uOffset;\\n\\nconst int MAX_KERNEL_SIZE = 2048;\\n\\n// Notice:\\n// the perfect way:\\n// int kernelSize = min(uKernelSize, MAX_KERNELSIZE);\\n// BUT in real use-case , uKernelSize < MAX_KERNELSIZE almost always.\\n// So use uKernelSize directly.\\n\\nvoid main(void)\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n if (uKernelSize == 0)\\n {\\n gl_FragColor = color;\\n return;\\n }\\n\\n vec2 velocity = uVelocity / filterArea.xy;\\n float offset = -uOffset / length(uVelocity) - 0.5;\\n int k = uKernelSize - 1;\\n\\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\\n if (i == k) {\\n break;\\n }\\n vec2 bias = velocity * (float(i) / float(k) + offset);\\n color += texture2D(uSampler, vTextureCoord + bias);\\n }\\n gl_FragColor = color / float(uKernelSize);\\n}\\n\";\n\n/**\n * The MotionBlurFilter applies a Motion blur to an object.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/motion-blur.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-motion-blur|@pixi/filter-motion-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar MotionBlurFilter = /** @class */ (function (_super) {\n __extends(MotionBlurFilter, _super);\n /**\n * @param {PIXI.ObservablePoint|PIXI.Point|number[]} [velocity=[0, 0]] - Sets the velocity of the motion for blur effect.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 5\n * @param {number} [offset=0] - The offset of the blur filter.\n */\n function MotionBlurFilter(velocity, kernelSize, offset) {\n if (velocity === void 0) { velocity = [0, 0]; }\n if (kernelSize === void 0) { kernelSize = 5; }\n if (offset === void 0) { offset = 0; }\n var _this = _super.call(this, vertex, fragment) || this;\n /**\n * The kernelSize of the blur, higher values are slower but look better.\n * Use odd value greater than 5.\n */\n _this.kernelSize = 5;\n _this.uniforms.uVelocity = new Float32Array(2);\n _this._velocity = new ObservablePoint(_this.velocityChanged, _this);\n _this.setVelocity(velocity);\n _this.kernelSize = kernelSize;\n _this.offset = offset;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n MotionBlurFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a = this.velocity, x = _a.x, y = _a.y;\n this.uniforms.uKernelSize = (x !== 0 || y !== 0) ? this.kernelSize : 0;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(MotionBlurFilter.prototype, \"velocity\", {\n get: function () {\n return this._velocity;\n },\n /**\n * Sets the velocity of the motion for blur effect.\n *\n * @member {PIXI.ObservablePoint|PIXI.Point|number[]}\n */\n set: function (value) {\n this.setVelocity(value);\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Set velocity with more broad types\n */\n MotionBlurFilter.prototype.setVelocity = function (value) {\n if (Array.isArray(value)) {\n var x = value[0], y = value[1];\n this._velocity.set(x, y);\n }\n else {\n this._velocity.copyFrom(value);\n }\n };\n /**\n * Handle velocity changed\n * @private\n */\n MotionBlurFilter.prototype.velocityChanged = function () {\n this.uniforms.uVelocity[0] = this._velocity.x;\n this.uniforms.uVelocity[1] = this._velocity.y;\n // The padding will be increased as the velocity and intern the blur size is changed\n this.padding = (Math.max(Math.abs(this._velocity.x), Math.abs(this._velocity.y)) >> 0) + 1;\n };\n Object.defineProperty(MotionBlurFilter.prototype, \"offset\", {\n get: function () {\n return this.uniforms.uOffset;\n },\n /**\n * The offset of the blur filter.\n * @default 0\n */\n set: function (value) {\n this.uniforms.uOffset = value;\n },\n enumerable: false,\n configurable: true\n });\n return MotionBlurFilter;\n}(Filter));\n\nexport { MotionBlurFilter };\n//# sourceMappingURL=filter-motion-blur.esm.mjs.map\n","/*!\n * @pixi/filter-multi-color-replace - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-multi-color-replace is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform float epsilon;\\n\\nconst int MAX_COLORS = %maxColors%;\\n\\nuniform vec3 originalColors[MAX_COLORS];\\nuniform vec3 targetColors[MAX_COLORS];\\n\\nvoid main(void)\\n{\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n\\n float alpha = gl_FragColor.a;\\n if (alpha < 0.0001)\\n {\\n return;\\n }\\n\\n vec3 color = gl_FragColor.rgb / alpha;\\n\\n for(int i = 0; i < MAX_COLORS; i++)\\n {\\n vec3 origColor = originalColors[i];\\n if (origColor.r < 0.0)\\n {\\n break;\\n }\\n vec3 colorDiff = origColor - color;\\n if (length(colorDiff) < epsilon)\\n {\\n vec3 targetColor = targetColors[i];\\n gl_FragColor = vec4((targetColor + colorDiff) * alpha, alpha);\\n return;\\n }\\n }\\n}\\n\";\n\n/**\n * Filter for replacing a color with another color. Similar to ColorReplaceFilter, but support multiple\n * colors.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/multi-color-replace.png)\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-multi-color-replace|@pixi/filter-multi-color-replace}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n *\n * @example\n * // replaces pure red with pure blue, and replaces pure green with pure white\n * someSprite.filters = [new MultiColorReplaceFilter(\n * [\n * [0xFF0000, 0x0000FF],\n * [0x00FF00, 0xFFFFFF]\n * ],\n * 0.001\n * )];\n *\n * You also could use [R, G, B] as the color\n * someOtherSprite.filters = [new MultiColorReplaceFilter(\n * [\n * [ [1,0,0], [0,0,1] ],\n * [ [0,1,0], [1,1,1] ]\n * ],\n * 0.001\n * )];\n *\n */\nvar MultiColorReplaceFilter = /** @class */ (function (_super) {\n __extends(MultiColorReplaceFilter, _super);\n /**\n * @param {Array<Array>} replacements - The collection of replacement items. Each item is color-pair\n * (an array length is 2). In the pair, the first value is original color , the second value\n * is target color.\n * @param {number} [epsilon=0.05] - Tolerance of the floating-point comparison between colors\n * (lower = more exact, higher = more inclusive)\n * @param {number} [maxColors] - The maximum number of replacements filter is able to use. Because the\n * fragment is only compiled once, this cannot be changed after construction.\n * If omitted, the default value is the length of `replacements`.\n */\n function MultiColorReplaceFilter(replacements, epsilon, maxColors) {\n if (epsilon === void 0) { epsilon = 0.05; }\n if (maxColors === void 0) { maxColors = replacements.length; }\n var _this = _super.call(this, vertex, fragment.replace(/%maxColors%/g, (maxColors).toFixed(0))) || this;\n _this._replacements = [];\n _this._maxColors = 0;\n _this.epsilon = epsilon;\n _this._maxColors = maxColors;\n _this.uniforms.originalColors = new Float32Array(maxColors * 3);\n _this.uniforms.targetColors = new Float32Array(maxColors * 3);\n _this.replacements = replacements;\n return _this;\n }\n Object.defineProperty(MultiColorReplaceFilter.prototype, \"replacements\", {\n get: function () {\n return this._replacements;\n },\n /**\n * The source and target colors for replacement. See constructor for information on the format.\n *\n * @member {Array<Array>}\n */\n set: function (replacements) {\n var originals = this.uniforms.originalColors;\n var targets = this.uniforms.targetColors;\n var colorCount = replacements.length;\n if (colorCount > this._maxColors) {\n throw new Error(\"Length of replacements (\" + colorCount + \") exceeds the maximum colors length (\" + this._maxColors + \")\");\n }\n // Fill with negative values\n originals[colorCount * 3] = -1;\n for (var i = 0; i < colorCount; i++) {\n var pair = replacements[i];\n // for original colors\n var color = pair[0];\n if (typeof color === 'number') {\n color = hex2rgb(color);\n }\n else {\n pair[0] = rgb2hex(color);\n }\n originals[i * 3] = color[0];\n originals[(i * 3) + 1] = color[1];\n originals[(i * 3) + 2] = color[2];\n // for target colors\n var targetColor = pair[1];\n if (typeof targetColor === 'number') {\n targetColor = hex2rgb(targetColor);\n }\n else {\n pair[1] = rgb2hex(targetColor);\n }\n targets[i * 3] = targetColor[0];\n targets[(i * 3) + 1] = targetColor[1];\n targets[(i * 3) + 2] = targetColor[2];\n }\n this._replacements = replacements;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Should be called after changing any of the contents of the replacements.\n * This is a convenience method for resetting the `replacements`.\n */\n MultiColorReplaceFilter.prototype.refresh = function () {\n this.replacements = this._replacements;\n };\n Object.defineProperty(MultiColorReplaceFilter.prototype, \"maxColors\", {\n /**\n * The maximum number of color replacements supported by this filter. Can be changed\n * _only_ during construction.\n * @readonly\n */\n get: function () {\n return this._maxColors;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MultiColorReplaceFilter.prototype, \"epsilon\", {\n get: function () {\n return this.uniforms.epsilon;\n },\n /**\n * Tolerance of the floating-point comparison between colors (lower = more exact, higher = more inclusive)\n * @default 0.05\n */\n set: function (value) {\n this.uniforms.epsilon = value;\n },\n enumerable: false,\n configurable: true\n });\n return MultiColorReplaceFilter;\n}(Filter));\n\nexport { MultiColorReplaceFilter };\n//# sourceMappingURL=filter-multi-color-replace.esm.mjs.map\n","/*!\n * @pixi/filter-outline - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-outline is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\n\\nuniform vec2 thickness;\\nuniform vec4 outlineColor;\\nuniform vec4 filterClamp;\\n\\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\\n\\nvoid main(void) {\\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\\n vec4 curColor;\\n float maxAlpha = 0.;\\n vec2 displaced;\\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\\n maxAlpha = max(maxAlpha, curColor.a);\\n }\\n float resultAlpha = max(maxAlpha, ownColor.a);\\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\\n}\\n\";\n\n/**\n * OutlineFilter, originally by mishaa\n * http://www.html5gamedevs.com/topic/10640-outline-a-sprite-change-certain-colors/?p=69966\n * http://codepen.io/mishaa/pen/emGNRB<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/outline.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-outline|@pixi/filter-outline}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters} *\n * @example\n * someSprite.filters = [new OutlineFilter(2, 0x99ff99)];\n */\nvar OutlineFilter = /** @class */ (function (_super) {\n __extends(OutlineFilter, _super);\n /**\n * @param {number} [thickness=1] - The tickness of the outline. Make it 2 times more for resolution 2\n * @param {number} [color=0x000000] - The color of the outline.\n * @param {number} [quality=0.1] - The quality of the outline from `0` to `1`, using a higher quality\n * setting will result in slower performance and more accuracy.\n */\n function OutlineFilter(thickness, color, quality) {\n if (thickness === void 0) { thickness = 1; }\n if (color === void 0) { color = 0x000000; }\n if (quality === void 0) { quality = 0.1; }\n var _this = _super.call(this, vertex, fragment.replace(/\\$\\{angleStep\\}/, OutlineFilter.getAngleStep(quality))) || this;\n _this._thickness = 1;\n _this.uniforms.thickness = new Float32Array([0, 0]);\n _this.uniforms.outlineColor = new Float32Array([0, 0, 0, 1]);\n Object.assign(_this, { thickness: thickness, color: color, quality: quality });\n return _this;\n }\n /**\n * Get the angleStep by quality\n * @private\n */\n OutlineFilter.getAngleStep = function (quality) {\n var samples = Math.max(quality * OutlineFilter.MAX_SAMPLES, OutlineFilter.MIN_SAMPLES);\n return (Math.PI * 2 / samples).toFixed(7);\n };\n OutlineFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms.thickness[0] = this._thickness / input._frame.width;\n this.uniforms.thickness[1] = this._thickness / input._frame.height;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(OutlineFilter.prototype, \"color\", {\n /**\n * The color of the glow.\n * @default 0x000000\n */\n get: function () {\n return rgb2hex(this.uniforms.outlineColor);\n },\n set: function (value) {\n hex2rgb(value, this.uniforms.outlineColor);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(OutlineFilter.prototype, \"thickness\", {\n /**\n * The thickness of the outline.\n * @default 1\n */\n get: function () {\n return this._thickness;\n },\n set: function (value) {\n this._thickness = value;\n this.padding = value;\n },\n enumerable: false,\n configurable: true\n });\n /** The minimum number of samples for rendering outline. */\n OutlineFilter.MIN_SAMPLES = 1;\n /** The maximum number of samples for rendering outline. */\n OutlineFilter.MAX_SAMPLES = 100;\n return OutlineFilter;\n}(Filter));\n\nexport { OutlineFilter };\n//# sourceMappingURL=filter-outline.esm.mjs.map\n","/*!\n * @pixi/filter-pixelate - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-pixelate is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"precision mediump float;\\n\\nvarying vec2 vTextureCoord;\\n\\nuniform vec2 size;\\nuniform sampler2D uSampler;\\n\\nuniform vec4 filterArea;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 pixelate(vec2 coord, vec2 size)\\n{\\n\\treturn floor( coord / size ) * size;\\n}\\n\\nvoid main(void)\\n{\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n coord = pixelate(coord, size);\\n\\n coord = unmapCoord(coord);\\n\\n gl_FragColor = texture2D(uSampler, coord);\\n}\\n\";\n\n/**\n * This filter applies a pixelate effect making display objects appear 'blocky'.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/pixelate.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-pixelate|@pixi/filter-pixelate}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar PixelateFilter = /** @class */ (function (_super) {\n __extends(PixelateFilter, _super);\n /**\n * @param {PIXI.Point|Array<number>|number} [size=10] - Either the width/height of the size of the pixels, or square size\n */\n function PixelateFilter(size) {\n if (size === void 0) { size = 10; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.size = size;\n return _this;\n }\n Object.defineProperty(PixelateFilter.prototype, \"size\", {\n /**\n * This a point that describes the size of the blocks.\n * x is the width of the block and y is the height.\n *\n * @member {PIXI.Point|Array<number>|number}\n * @default 10\n */\n get: function () {\n return this.uniforms.size;\n },\n set: function (value) {\n if (typeof value === 'number') {\n value = [value, value];\n }\n this.uniforms.size = value;\n },\n enumerable: false,\n configurable: true\n });\n return PixelateFilter;\n}(Filter));\n\nexport { PixelateFilter };\n//# sourceMappingURL=filter-pixelate.esm.mjs.map\n","/*!\n * @pixi/filter-radial-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-radial-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform float uRadian;\\nuniform vec2 uCenter;\\nuniform float uRadius;\\nuniform int uKernelSize;\\n\\nconst int MAX_KERNEL_SIZE = 2048;\\n\\nvoid main(void)\\n{\\n vec4 color = texture2D(uSampler, vTextureCoord);\\n\\n if (uKernelSize == 0)\\n {\\n gl_FragColor = color;\\n return;\\n }\\n\\n float aspect = filterArea.y / filterArea.x;\\n vec2 center = uCenter.xy / filterArea.xy;\\n float gradient = uRadius / filterArea.x * 0.3;\\n float radius = uRadius / filterArea.x - gradient * 0.5;\\n int k = uKernelSize - 1;\\n\\n vec2 coord = vTextureCoord;\\n vec2 dir = vec2(center - coord);\\n float dist = length(vec2(dir.x, dir.y * aspect));\\n\\n float radianStep = uRadian;\\n if (radius >= 0.0 && dist > radius) {\\n float delta = dist - radius;\\n float gap = gradient;\\n float scale = 1.0 - abs(delta / gap);\\n if (scale <= 0.0) {\\n gl_FragColor = color;\\n return;\\n }\\n radianStep *= scale;\\n }\\n radianStep /= float(k);\\n\\n float s = sin(radianStep);\\n float c = cos(radianStep);\\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\\n\\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\\n if (i == k) {\\n break;\\n }\\n\\n coord -= center;\\n coord.y *= aspect;\\n coord = rotationMatrix * coord;\\n coord.y /= aspect;\\n coord += center;\\n\\n vec4 sample = texture2D(uSampler, coord);\\n\\n // switch to pre-multiplied alpha to correctly blur transparent images\\n // sample.rgb *= sample.a;\\n\\n color += sample;\\n }\\n\\n gl_FragColor = color / float(uKernelSize);\\n}\\n\";\n\n/**\n * The RadialBlurFilter applies a Motion blur to an object.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/radial-blur.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-radial-blur|@pixi/filter-radial-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar RadialBlurFilter = /** @class */ (function (_super) {\n __extends(RadialBlurFilter, _super);\n /**\n * @param {number} [angle=0] - Sets the angle of the motion for blur effect.\n * @param {PIXI.Point|number[]} [center=[0,0]] - The center of the radial.\n * @param {number} [kernelSize=5] - The kernelSize of the blur filter. Must be odd number >= 3\n * @param {number} [radius=-1] - The maximum size of the blur radius, `-1` is infinite\n */\n function RadialBlurFilter(angle, center, kernelSize, radius) {\n if (angle === void 0) { angle = 0; }\n if (center === void 0) { center = [0, 0]; }\n if (kernelSize === void 0) { kernelSize = 5; }\n if (radius === void 0) { radius = -1; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._angle = 0;\n _this.angle = angle;\n _this.center = center;\n _this.kernelSize = kernelSize;\n _this.radius = radius;\n return _this;\n }\n /**\n * Override existing apply method in PIXI.Filter\n * @private\n */\n RadialBlurFilter.prototype.apply = function (filterManager, input, output, clear) {\n this.uniforms.uKernelSize = this._angle !== 0 ? this.kernelSize : 0;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(RadialBlurFilter.prototype, \"angle\", {\n get: function () {\n return this._angle;\n },\n /**\n * Sets the angle in degrees of the motion for blur effect.\n * @default 0\n */\n set: function (value) {\n this._angle = value;\n this.uniforms.uRadian = value * Math.PI / 180;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RadialBlurFilter.prototype, \"center\", {\n /**\n * Center of the effect.\n *\n * @member {PIXI.Point|number[]}\n * @default [0, 0]\n */\n get: function () {\n return this.uniforms.uCenter;\n },\n set: function (value) {\n this.uniforms.uCenter = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(RadialBlurFilter.prototype, \"radius\", {\n /**\n * Outer radius of the effect. The default value of `-1` is infinite.\n * @default -1\n */\n get: function () {\n return this.uniforms.uRadius;\n },\n set: function (value) {\n if (value < 0 || value === Infinity) {\n value = -1;\n }\n this.uniforms.uRadius = value;\n },\n enumerable: false,\n configurable: true\n });\n return RadialBlurFilter;\n}(Filter));\n\nexport { RadialBlurFilter };\n//# sourceMappingURL=filter-radial-blur.esm.mjs.map\n","/*!\n * @pixi/filter-shockwave - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-shockwave is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\nuniform vec4 filterClamp;\\n\\nuniform vec2 center;\\n\\nuniform float amplitude;\\nuniform float wavelength;\\n// uniform float power;\\nuniform float brightness;\\nuniform float speed;\\nuniform float radius;\\n\\nuniform float time;\\n\\nconst float PI = 3.14159;\\n\\nvoid main()\\n{\\n float halfWavelength = wavelength * 0.5 / filterArea.x;\\n float maxRadius = radius / filterArea.x;\\n float currentRadius = time * speed / filterArea.x;\\n\\n float fade = 1.0;\\n\\n if (maxRadius > 0.0) {\\n if (currentRadius > maxRadius) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\\n }\\n\\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\\n dir.y *= filterArea.y / filterArea.x;\\n float dist = length(dir);\\n\\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n\\n vec2 diffUV = normalize(dir);\\n\\n float diff = (dist - currentRadius) / halfWavelength;\\n\\n float p = 1.0 - pow(abs(diff), 2.0);\\n\\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\\n\\n vec2 offset = diffUV * powDiff / filterArea.xy;\\n\\n // Do clamp :\\n vec2 coord = vTextureCoord + offset;\\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\\n vec4 color = texture2D(uSampler, clampedCoord);\\n if (coord != clampedCoord) {\\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\\n }\\n\\n // No clamp :\\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\\n\\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * The ShockwaveFilter class lets you apply a shockwave effect.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/shockwave.gif)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-shockwave|@pixi/filter-shockwave}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ShockwaveFilter = /** @class */ (function (_super) {\n __extends(ShockwaveFilter, _super);\n /**\n * @param {PIXI.Point|number[]} [center=[0.5, 0.5]] - See `center` property.\n * @param {object} [options] - The optional parameters of shockwave filter.\n * @param {number} [options.amplitude=0.5] - See `amplitude`` property.\n * @param {number} [options.wavelength=1.0] - See `wavelength` property.\n * @param {number} [options.speed=500.0] - See `speed` property.\n * @param {number} [options.brightness=8] - See `brightness` property.\n * @param {number} [options.radius=4] - See `radius` property.\n * @param {number} [time=0] - See `time` property.\n */\n function ShockwaveFilter(center, options, time) {\n if (center === void 0) { center = [0, 0]; }\n if (time === void 0) { time = 0; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.center = center;\n Object.assign(_this, ShockwaveFilter.defaults, options);\n _this.time = time;\n return _this;\n }\n ShockwaveFilter.prototype.apply = function (filterManager, input, output, clear) {\n // There is no set/get of `time`, for performance.\n // Because in the most real cases, `time` will be changed in ever game tick.\n // Use set/get will take more function-call.\n this.uniforms.time = this.time;\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(ShockwaveFilter.prototype, \"center\", {\n /**\n * Sets the center of the shockwave in normalized screen coords. That is\n * (0,0) is the top-left and (1,1) is the bottom right.\n *\n * @member {PIXI.Point|number[]}\n */\n get: function () {\n return this.uniforms.center;\n },\n set: function (value) {\n this.uniforms.center = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"amplitude\", {\n /**\n * The amplitude of the shockwave.\n */\n get: function () {\n return this.uniforms.amplitude;\n },\n set: function (value) {\n this.uniforms.amplitude = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"wavelength\", {\n /**\n * The wavelength of the shockwave.\n */\n get: function () {\n return this.uniforms.wavelength;\n },\n set: function (value) {\n this.uniforms.wavelength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"brightness\", {\n /**\n * The brightness of the shockwave.\n */\n get: function () {\n return this.uniforms.brightness;\n },\n set: function (value) {\n this.uniforms.brightness = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"speed\", {\n /**\n * The speed about the shockwave ripples out.\n * The unit is `pixel/second`\n */\n get: function () {\n return this.uniforms.speed;\n },\n set: function (value) {\n this.uniforms.speed = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ShockwaveFilter.prototype, \"radius\", {\n /**\n * The maximum radius of shockwave.\n * `< 0.0` means it's infinity.\n */\n get: function () {\n return this.uniforms.radius;\n },\n set: function (value) {\n this.uniforms.radius = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n ShockwaveFilter.defaults = {\n amplitude: 30.0,\n wavelength: 160.0,\n brightness: 1.0,\n speed: 500.0,\n radius: -1.0,\n };\n return ShockwaveFilter;\n}(Filter));\n\nexport { ShockwaveFilter };\n//# sourceMappingURL=filter-shockwave.esm.mjs.map\n","/*!\n * @pixi/filter-simple-lightmap - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-simple-lightmap is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { hex2rgb, rgb2hex } from '@pixi/utils';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform sampler2D uLightmap;\\nuniform vec4 filterArea;\\nuniform vec2 dimensions;\\nuniform vec4 ambientColor;\\nvoid main() {\\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\\n vec4 light = texture2D(uLightmap, lightCoord);\\n vec3 ambient = ambientColor.rgb * ambientColor.a;\\n vec3 intensity = ambient + light.rgb;\\n vec3 finalColor = diffuseColor.rgb * intensity;\\n gl_FragColor = vec4(finalColor, diffuseColor.a);\\n}\\n\";\n\n/**\n* SimpleLightmap, originally by Oza94\n* http://www.html5gamedevs.com/topic/20027-pixijs-simple-lightmapping/\n* http://codepen.io/Oza94/pen/EPoRxj\n*\n* You have to specify filterArea, or suffer consequences.\n* You may have to use it with `filter.dontFit = true`,\n* until we rewrite this using same approach as for DisplacementFilter.\n*\n* ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/simple-lightmap.png)\n* @class\n* @extends PIXI.Filter\n* @memberof PIXI.filters\n* @see {@link https://www.npmjs.com/package/@pixi/filter-simple-lightmap|@pixi/filter-simple-lightmap}\n* @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n*\n* @example\n* displayObject.filters = [new SimpleLightmapFilter(texture, 0x666666)];\n*/\nvar SimpleLightmapFilter = /** @class */ (function (_super) {\n __extends(SimpleLightmapFilter, _super);\n /**\n * @param {PIXI.Texture} texture - a texture where your lightmap is rendered\n * @param {Array<number>|number} [color=0x000000] - An RGBA array of the ambient color\n * @param {number} [alpha=1] - Default alpha set independent of color (if it's a number, not array).\n */\n function SimpleLightmapFilter(texture, color, alpha) {\n if (color === void 0) { color = 0x000000; }\n if (alpha === void 0) { alpha = 1; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this._color = 0x0;\n _this.uniforms.dimensions = new Float32Array(2);\n _this.uniforms.ambientColor = new Float32Array([0, 0, 0, alpha]);\n _this.texture = texture;\n _this.color = color;\n return _this;\n }\n /**\n * Applies the filter.\n * @private\n * @param {PIXI.FilterManager} filterManager - The manager.\n * @param {PIXI.RenderTarget} input - The input target.\n * @param {PIXI.RenderTarget} output - The output target.\n */\n SimpleLightmapFilter.prototype.apply = function (filterManager, input, output, clear) {\n var _a, _b;\n this.uniforms.dimensions[0] = (_a = input.filterFrame) === null || _a === void 0 ? void 0 : _a.width;\n this.uniforms.dimensions[1] = (_b = input.filterFrame) === null || _b === void 0 ? void 0 : _b.height;\n // draw the filter...\n filterManager.applyFilter(this, input, output, clear);\n };\n Object.defineProperty(SimpleLightmapFilter.prototype, \"texture\", {\n /**\n * a texture where your lightmap is rendered\n * @member {PIXI.Texture}\n */\n get: function () {\n return this.uniforms.uLightmap;\n },\n set: function (value) {\n this.uniforms.uLightmap = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SimpleLightmapFilter.prototype, \"color\", {\n get: function () {\n return this._color;\n },\n /**\n * An RGBA array of the ambient color or a hex color without alpha\n * @member {Array<number>|number}\n */\n set: function (value) {\n var arr = this.uniforms.ambientColor;\n if (typeof value === 'number') {\n hex2rgb(value, arr);\n this._color = value;\n }\n else {\n arr[0] = value[0];\n arr[1] = value[1];\n arr[2] = value[2];\n arr[3] = value[3];\n this._color = rgb2hex(arr);\n }\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(SimpleLightmapFilter.prototype, \"alpha\", {\n /**\n * When setting `color` as hex, this can be used to set alpha independently.\n */\n get: function () {\n return this.uniforms.ambientColor[3];\n },\n set: function (value) {\n this.uniforms.ambientColor[3] = value;\n },\n enumerable: false,\n configurable: true\n });\n return SimpleLightmapFilter;\n}(Filter));\n\nexport { SimpleLightmapFilter };\n//# sourceMappingURL=filter-simple-lightmap.esm.mjs.map\n","/*!\n * @pixi/filter-tilt-shift - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-tilt-shift is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float blur;\\nuniform float gradientBlur;\\nuniform vec2 start;\\nuniform vec2 end;\\nuniform vec2 delta;\\nuniform vec2 texSize;\\n\\nfloat random(vec3 scale, float seed)\\n{\\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\\n}\\n\\nvoid main(void)\\n{\\n vec4 color = vec4(0.0);\\n float total = 0.0;\\n\\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\\n\\n for (float t = -30.0; t <= 30.0; t++)\\n {\\n float percent = (t + offset - 0.5) / 30.0;\\n float weight = 1.0 - abs(percent);\\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\\n sample.rgb *= sample.a;\\n color += sample * weight;\\n total += weight;\\n }\\n\\n color /= total;\\n color.rgb /= color.a + 0.00001;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShiftAxisFilter.\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @private\n */\nvar TiltShiftAxisFilter = /** @class */ (function (_super) {\n __extends(TiltShiftAxisFilter, _super);\n function TiltShiftAxisFilter(blur, gradientBlur, start, end) {\n if (blur === void 0) { blur = 100; }\n if (gradientBlur === void 0) { gradientBlur = 600; }\n var _this = _super.call(this, vertex, fragment) || this;\n _this.uniforms.blur = blur;\n _this.uniforms.gradientBlur = gradientBlur;\n _this.uniforms.start = start || new Point(0, window.innerHeight / 2);\n _this.uniforms.end = end || new Point(600, window.innerHeight / 2);\n _this.uniforms.delta = new Point(30, 30);\n _this.uniforms.texSize = new Point(window.innerWidth, window.innerHeight);\n _this.updateDelta();\n return _this;\n }\n /**\n * Updates the filter delta values.\n * This is overridden in the X and Y filters, does nothing for this class.\n *\n */\n TiltShiftAxisFilter.prototype.updateDelta = function () {\n this.uniforms.delta.x = 0;\n this.uniforms.delta.y = 0;\n };\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"blur\", {\n /**\n * The strength of the blur.\n *\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.blur;\n },\n set: function (value) {\n this.uniforms.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"gradientBlur\", {\n /**\n * The strength of the gradient blur.\n *\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.gradientBlur;\n },\n set: function (value) {\n this.uniforms.gradientBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"start\", {\n /**\n * The X value to start the effect at.\n *\n * @member {PIXI.Point}\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.start;\n },\n set: function (value) {\n this.uniforms.start = value;\n this.updateDelta();\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftAxisFilter.prototype, \"end\", {\n /**\n * The X value to end the effect at.\n *\n * @member {PIXI.Point}\n * @memberof PIXI.filters.TiltShiftAxisFilter#\n */\n get: function () {\n return this.uniforms.end;\n },\n set: function (value) {\n this.uniforms.end = value;\n this.updateDelta();\n },\n enumerable: false,\n configurable: true\n });\n return TiltShiftAxisFilter;\n}(Filter));\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShiftXFilter.\n *\n * @class\n * @extends PIXI.TiltShiftAxisFilter\n * @memberof PIXI.filters\n * @private\n */\nvar TiltShiftXFilter = /** @class */ (function (_super) {\n __extends(TiltShiftXFilter, _super);\n function TiltShiftXFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates the filter delta values.\n */\n TiltShiftXFilter.prototype.updateDelta = function () {\n var dx = this.uniforms.end.x - this.uniforms.start.x;\n var dy = this.uniforms.end.y - this.uniforms.start.y;\n var d = Math.sqrt((dx * dx) + (dy * dy));\n this.uniforms.delta.x = dx / d;\n this.uniforms.delta.y = dy / d;\n };\n return TiltShiftXFilter;\n}(TiltShiftAxisFilter));\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShiftYFilter.\n *\n * @class\n * @extends PIXI.TiltShiftAxisFilter\n * @memberof PIXI.filters\n * @private\n */\nvar TiltShiftYFilter = /** @class */ (function (_super) {\n __extends(TiltShiftYFilter, _super);\n function TiltShiftYFilter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates the filter delta values.\n */\n TiltShiftYFilter.prototype.updateDelta = function () {\n var dx = this.uniforms.end.x - this.uniforms.start.x;\n var dy = this.uniforms.end.y - this.uniforms.start.y;\n var d = Math.sqrt((dx * dx) + (dy * dy));\n this.uniforms.delta.x = -dy / d;\n this.uniforms.delta.y = dx / d;\n };\n return TiltShiftYFilter;\n}(TiltShiftAxisFilter));\n\n// @author Vico @vicocotea\n// original filter https://github.com/evanw/glfx.js/blob/master/src/filters/blur/tiltshift.js\n// by Evan Wallace : http://madebyevan.com/\n/**\n * A TiltShift Filter. Manages the pass of both a TiltShiftXFilter and TiltShiftYFilter.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/tilt-shift.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-tilt-shift|@pixi/filter-tilt-shift}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar TiltShiftFilter = /** @class */ (function (_super) {\n __extends(TiltShiftFilter, _super);\n /**\n * @param {number} [blur=100] - The strength of the blur.\n * @param {number} [gradientBlur=600] - The strength of the gradient blur.\n * @param {PIXI.Point} [start=null] - The Y value to start the effect at.\n * @param {PIXI.Point} [end=null] - The Y value to end the effect at.\n */\n function TiltShiftFilter(blur, gradientBlur, start, end) {\n if (blur === void 0) { blur = 100; }\n if (gradientBlur === void 0) { gradientBlur = 600; }\n var _this = _super.call(this) || this;\n _this.tiltShiftXFilter = new TiltShiftXFilter(blur, gradientBlur, start, end);\n _this.tiltShiftYFilter = new TiltShiftYFilter(blur, gradientBlur, start, end);\n return _this;\n }\n TiltShiftFilter.prototype.apply = function (filterManager, input, output, clearMode) {\n var renderTarget = filterManager.getFilterTexture();\n this.tiltShiftXFilter.apply(filterManager, input, renderTarget, 1);\n this.tiltShiftYFilter.apply(filterManager, renderTarget, output, clearMode);\n filterManager.returnFilterTexture(renderTarget);\n };\n Object.defineProperty(TiltShiftFilter.prototype, \"blur\", {\n /**\n * The strength of the blur.\n */\n get: function () {\n return this.tiltShiftXFilter.blur;\n },\n set: function (value) {\n this.tiltShiftXFilter.blur = this.tiltShiftYFilter.blur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftFilter.prototype, \"gradientBlur\", {\n /**\n * The strength of the gradient blur.\n */\n get: function () {\n return this.tiltShiftXFilter.gradientBlur;\n },\n set: function (value) {\n this.tiltShiftXFilter.gradientBlur = this.tiltShiftYFilter.gradientBlur = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftFilter.prototype, \"start\", {\n /**\n * The Y value to start the effect at.\n *\n * @member {PIXI.Point}\n */\n get: function () {\n return this.tiltShiftXFilter.start;\n },\n set: function (value) {\n this.tiltShiftXFilter.start = this.tiltShiftYFilter.start = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TiltShiftFilter.prototype, \"end\", {\n /**\n * The Y value to end the effect at.\n *\n * @member {PIXI.Point}\n */\n get: function () {\n return this.tiltShiftXFilter.end;\n },\n set: function (value) {\n this.tiltShiftXFilter.end = this.tiltShiftYFilter.end = value;\n },\n enumerable: false,\n configurable: true\n });\n return TiltShiftFilter;\n}(Filter));\n\nexport { TiltShiftAxisFilter, TiltShiftFilter, TiltShiftXFilter, TiltShiftYFilter };\n//# sourceMappingURL=filter-tilt-shift.esm.mjs.map\n","/*!\n * @pixi/filter-twist - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-twist is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\nimport { Point } from '@pixi/math';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\n\\nuniform sampler2D uSampler;\\nuniform float radius;\\nuniform float angle;\\nuniform vec2 offset;\\nuniform vec4 filterArea;\\n\\nvec2 mapCoord( vec2 coord )\\n{\\n coord *= filterArea.xy;\\n coord += filterArea.zw;\\n\\n return coord;\\n}\\n\\nvec2 unmapCoord( vec2 coord )\\n{\\n coord -= filterArea.zw;\\n coord /= filterArea.xy;\\n\\n return coord;\\n}\\n\\nvec2 twist(vec2 coord)\\n{\\n coord -= offset;\\n\\n float dist = length(coord);\\n\\n if (dist < radius)\\n {\\n float ratioDist = (radius - dist) / radius;\\n float angleMod = ratioDist * ratioDist * angle;\\n float s = sin(angleMod);\\n float c = cos(angleMod);\\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\\n }\\n\\n coord += offset;\\n\\n return coord;\\n}\\n\\nvoid main(void)\\n{\\n\\n vec2 coord = mapCoord(vTextureCoord);\\n\\n coord = twist(coord);\\n\\n coord = unmapCoord(coord);\\n\\n gl_FragColor = texture2D(uSampler, coord );\\n\\n}\\n\";\n\n/**\n * This filter applies a twist effect making display objects appear twisted in the given direction.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/twist.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-twist|@pixi/filter-twist}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar TwistFilter = /** @class */ (function (_super) {\n __extends(TwistFilter, _super);\n /**\n * @param {object} [options] - Object object to use.\n * @param {number} [options.radius=200] - The radius of the twist.\n * @param {number} [options.angle=4] - The angle of the twist.\n * @param {number} [options.padding=20] - Padding for filter area.\n * @param {PIXI.Point} [options.offset] - Center of twist, in local, pixel coordinates.\n */\n function TwistFilter(options) {\n var _this = _super.call(this, vertex, fragment) || this;\n Object.assign(_this, TwistFilter.defaults, options);\n return _this;\n }\n Object.defineProperty(TwistFilter.prototype, \"offset\", {\n /**\n * This point describes the the offset of the twist.\n *\n * @member {PIXI.Point}\n */\n get: function () {\n return this.uniforms.offset;\n },\n set: function (value) {\n this.uniforms.offset = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TwistFilter.prototype, \"radius\", {\n /**\n * The radius of the twist.\n */\n get: function () {\n return this.uniforms.radius;\n },\n set: function (value) {\n this.uniforms.radius = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TwistFilter.prototype, \"angle\", {\n /**\n * The angle of the twist.\n */\n get: function () {\n return this.uniforms.angle;\n },\n set: function (value) {\n this.uniforms.angle = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n TwistFilter.defaults = {\n radius: 200,\n angle: 4,\n padding: 20,\n offset: new Point(),\n };\n return TwistFilter;\n}(Filter));\n\nexport { TwistFilter };\n//# sourceMappingURL=filter-twist.esm.mjs.map\n","/*!\n * @pixi/filter-zoom-blur - v4.2.0\n * Compiled Fri, 05 Aug 2022 19:53:35 UTC\n *\n * @pixi/filter-zoom-blur is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n */\nimport { Filter } from '@pixi/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) { if (Object.prototype.hasOwnProperty.call(b, p)) { d[p] = b[p]; } } };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n { t[p] = s[p]; } }\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n { for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n { t[p[i]] = s[p[i]]; }\r\n } }\r\n return t;\r\n}\n\nvar vertex = \"attribute vec2 aVertexPosition;\\nattribute vec2 aTextureCoord;\\n\\nuniform mat3 projectionMatrix;\\n\\nvarying vec2 vTextureCoord;\\n\\nvoid main(void)\\n{\\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\\n vTextureCoord = aTextureCoord;\\n}\";\n\nvar fragment = \"varying vec2 vTextureCoord;\\nuniform sampler2D uSampler;\\nuniform vec4 filterArea;\\n\\nuniform vec2 uCenter;\\nuniform float uStrength;\\nuniform float uInnerRadius;\\nuniform float uRadius;\\n\\nconst float MAX_KERNEL_SIZE = ${maxKernelSize};\\n\\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\\nhighp float rand(vec2 co, float seed) {\\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\\n return fract(sin(sn) * c + seed);\\n}\\n\\nvoid main() {\\n\\n float minGradient = uInnerRadius * 0.3;\\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\\n\\n float gradient = uRadius * 0.3;\\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\\n\\n float countLimit = MAX_KERNEL_SIZE;\\n\\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\\n\\n float strength = uStrength;\\n\\n float delta = 0.0;\\n float gap;\\n if (dist < innerRadius) {\\n delta = innerRadius - dist;\\n gap = minGradient;\\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\\n delta = dist - radius;\\n gap = gradient;\\n }\\n\\n if (delta > 0.0) {\\n float normalCount = gap / filterArea.x;\\n delta = (normalCount - delta) / normalCount;\\n countLimit *= delta;\\n strength *= delta;\\n if (countLimit < 1.0)\\n {\\n gl_FragColor = texture2D(uSampler, vTextureCoord);\\n return;\\n }\\n }\\n\\n // randomize the lookup values to hide the fixed number of samples\\n float offset = rand(vTextureCoord, 0.0);\\n\\n float total = 0.0;\\n vec4 color = vec4(0.0);\\n\\n dir *= strength;\\n\\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\\n float percent = (t + offset) / MAX_KERNEL_SIZE;\\n float weight = 4.0 * (percent - percent * percent);\\n vec2 p = vTextureCoord + dir * percent;\\n vec4 sample = texture2D(uSampler, p);\\n\\n // switch to pre-multiplied alpha to correctly blur transparent images\\n // sample.rgb *= sample.a;\\n\\n color += sample * weight;\\n total += weight;\\n\\n if (t > countLimit){\\n break;\\n }\\n }\\n\\n color /= total;\\n // switch back from pre-multiplied alpha\\n // color.rgb /= color.a + 0.00001;\\n\\n gl_FragColor = color;\\n}\\n\";\n\n/**\n * The ZoomFilter applies a Zoom blur to an object.<br>\n * ![original](../tools/screenshots/dist/original.png)![filter](../tools/screenshots/dist/zoom-blur.png)\n *\n * @class\n * @extends PIXI.Filter\n * @memberof PIXI.filters\n * @see {@link https://www.npmjs.com/package/@pixi/filter-zoom-blur|@pixi/filter-zoom-blur}\n * @see {@link https://www.npmjs.com/package/pixi-filters|pixi-filters}\n */\nvar ZoomBlurFilter = /** @class */ (function (_super) {\n __extends(ZoomBlurFilter, _super);\n /**\n * @param {object} [options] - Filter options to use.\n * @param {number} [options.strength=0.1] - Sets the strength of the zoom blur effect\n * @param {PIXI.Point|number[]} [options.center=[0,0]] - The center of the zoom.\n * @param {number} [options.innerRadius=0] - The inner radius of zoom. The part in inner circle won't apply\n * zoom blur effect.\n * @param {number} [options.radius=-1] - See `radius` property.\n * @param {number} [options.maxKernelSize=32] - On older iOS devices, it's better to not go above `13.0`.\n * Decreasing this value will produce a lower-quality blur effect with more dithering.\n */\n function ZoomBlurFilter(options) {\n var _this = this;\n var _a = Object.assign(ZoomBlurFilter.defaults, options), maxKernelSize = _a.maxKernelSize, rest = __rest(_a, [\"maxKernelSize\"]);\n _this = _super.call(this, vertex, fragment.replace('${maxKernelSize}', maxKernelSize.toFixed(1))) || this;\n Object.assign(_this, rest);\n return _this;\n }\n Object.defineProperty(ZoomBlurFilter.prototype, \"center\", {\n /**\n * Center of the effect.\n *\n * @member {PIXI.Point|number[]}\n * @default [0, 0]\n */\n get: function () {\n return this.uniforms.uCenter;\n },\n set: function (value) {\n this.uniforms.uCenter = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ZoomBlurFilter.prototype, \"strength\", {\n /**\n * Intensity of the zoom effect.\n * @default 0.1\n */\n get: function () {\n return this.uniforms.uStrength;\n },\n set: function (value) {\n this.uniforms.uStrength = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ZoomBlurFilter.prototype, \"innerRadius\", {\n /**\n * Radius of the inner region not effected by blur.\n * @default 0\n */\n get: function () {\n return this.uniforms.uInnerRadius;\n },\n set: function (value) {\n this.uniforms.uInnerRadius = value;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ZoomBlurFilter.prototype, \"radius\", {\n /**\n * Outer radius of the effect. The default value is `-1`.\n * `< 0.0` means it's infinity.\n * @default -1\n */\n get: function () {\n return this.uniforms.uRadius;\n },\n set: function (value) {\n if (value < 0 || value === Infinity) {\n value = -1;\n }\n this.uniforms.uRadius = value;\n },\n enumerable: false,\n configurable: true\n });\n /** Default constructor options. */\n ZoomBlurFilter.defaults = {\n strength: 0.1,\n center: [0, 0],\n innerRadius: 0,\n radius: -1,\n maxKernelSize: 32,\n };\n return ZoomBlurFilter;\n}(Filter));\n\nexport { ZoomBlurFilter };\n//# sourceMappingURL=filter-zoom-blur.esm.mjs.map\n","import { WebGALPixiContainer } from '@/Core/controller/stage/pixi/WebGALPixiContainer';\nimport { ShockwaveFilter } from 'pixi-filters';\n\nconst FILTER_NAME = 'shockwaveFilter';\n\nexport function getOrCreateShockwaveFilterImpl(container: WebGALPixiContainer, createMode: boolean) {\n const shockwaveFilterFromMap = container.containerFilters.get(FILTER_NAME);\n if (shockwaveFilterFromMap) {\n return shockwaveFilterFromMap;\n } else {\n if (createMode) {\n const shockwaveFilter = new ShockwaveFilter([1280, 720]);\n shockwaveFilter.time = 0;\n container.addFilter(shockwaveFilter);\n container.containerFilters.set(FILTER_NAME, shockwaveFilter);\n return shockwaveFilter;\n }\n }\n}\n\nexport function getShockwaveFilter(container: WebGALPixiContainer) {\n if (container.getOrCreateShockwaveFilter(false)) {\n const shockwaveFilter = container.getOrCreateShockwaveFilter() as ShockwaveFilter;\n return shockwaveFilter.time;\n }\n return 0;\n}\n\nexport function setShockwaveFilter(container: WebGALPixiContainer, value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n container.removeFilter(FILTER_NAME);\n } else {\n const shockwaveFilter = container.getOrCreateShockwaveFilter() as ShockwaveFilter;\n if (shockwaveFilter) shockwaveFilter.time = value;\n }\n}\n","import * as PIXI from 'pixi.js';\nimport { WebGALPixiContainer } from '@/Core/controller/stage/pixi/WebGALPixiContainer';\n\nconst INIT_RAD = 0;\nconst FILTER_NAME = 'radiusAlphaFilter';\n\nclass RadiusAlphaFilter extends PIXI.Filter {\n public constructor(center: PIXI.Point, radius: number) {\n const fragmentShader = `\n// 半径透明度的fragment shader\nprecision mediump float;\n\nuniform sampler2D uSampler; // 输入纹理\nvarying vec2 vTextureCoord; // 当前片元的纹理坐标\nuniform vec2 center; // 圆心坐标\nuniform float radius; // 圆的半径\n\nvoid main(void) {\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n // 计算屏幕宽高比\n float aspect = 16.0 / 9.0;\n\n // 根据宽高比校正纹理坐标\n vec2 aspectCorrectCoord = vTextureCoord;\n aspectCorrectCoord.x *= aspect;\n\n // 计算片元到圆心的距离\n float dist = distance(aspectCorrectCoord, center * vec2(aspect, 1.0));\n\n // 使用smoothstep函数计算alpha值,实现边缘羽化效果\n float alpha = smoothstep(radius, radius + 0.05, dist);\n\n // 输出最终颜色\n gl_FragColor = color * (1.0 - alpha);\n}\n `; // 填入上面的fragment shader代码\n super(null as any, fragmentShader);\n this.uniforms.center = [center.x, center.y];\n this.uniforms.radius = radius;\n }\n\n public set center(value: PIXI.Point) {\n this.uniforms.center = [value.x, value.y];\n }\n\n public get center(): PIXI.Point {\n return new PIXI.Point(this.uniforms.center[0], this.uniforms.center[1]);\n }\n\n public set radius(value: number) {\n this.uniforms.radius = value;\n }\n\n public get radius(): number {\n return this.uniforms.radius;\n }\n}\n\nexport function getOrCreateRadiusAlphaFilterImpl(container: WebGALPixiContainer, createMode: boolean) {\n const shockwaveFilterFromMap = container.containerFilters.get(FILTER_NAME);\n if (shockwaveFilterFromMap) {\n return shockwaveFilterFromMap;\n } else {\n if (createMode) {\n const shockwaveFilter = new RadiusAlphaFilter(new PIXI.Point(0.5, 0.5), INIT_RAD);\n shockwaveFilter.radius = INIT_RAD;\n container.addFilter(shockwaveFilter);\n container.containerFilters.set(FILTER_NAME, shockwaveFilter);\n return shockwaveFilter;\n }\n }\n}\n\nexport function getRadiusAlphaFilter(container: WebGALPixiContainer) {\n if (container.getOrCreateShockwaveFilter(false)) {\n const shockwaveFilter = container.getOrCreateRadiusAlphaFilter() as RadiusAlphaFilter;\n return shockwaveFilter.radius;\n }\n return INIT_RAD;\n}\n\nexport function setRadiusAlphaFilter(container: WebGALPixiContainer, value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n container.removeFilter(FILTER_NAME);\n } else {\n const shockwaveFilter = container.getOrCreateRadiusAlphaFilter() as RadiusAlphaFilter;\n if (shockwaveFilter) shockwaveFilter.radius = value;\n }\n}\n","import { OldFilmFilter } from '@pixi/filter-old-film';\nimport { DotFilter } from '@pixi/filter-dot';\nimport { ReflectionFilter } from '@pixi/filter-reflection';\nimport { GlitchFilter } from '@pixi/filter-glitch';\nimport { RGBSplitFilter } from '@pixi/filter-rgb-split';\nimport { GodrayFilter } from '@pixi/filter-godray';\nimport * as PIXI from 'pixi.js';\nimport {\n getOrCreateShockwaveFilterImpl,\n getShockwaveFilter,\n setShockwaveFilter,\n} from '@/Core/controller/stage/pixi/filters/ShockwaveFilter';\nimport {\n getOrCreateRadiusAlphaFilterImpl,\n getRadiusAlphaFilter,\n setRadiusAlphaFilter,\n} from '@/Core/controller/stage/pixi/shaders/RadiusAlphaFilter';\n\nexport class WebGALPixiContainer extends PIXI.Container {\n public containerFilters = new Map<string, PIXI.Filter>();\n private baseX = 0;\n private baseY = 0;\n\n private alphaFilter = new PIXI.filters.AlphaFilter(1);\n\n public constructor() {\n super();\n this.addFilter(this.alphaFilter);\n }\n\n public get alphaFilterVal() {\n return this.alphaFilter.alpha;\n }\n\n public set alphaFilterVal(value: number) {\n this.alphaFilter.alpha = value;\n }\n\n public addFilter(filter: PIXI.Filter) {\n if (this.filters) {\n this.filters.push(filter);\n } else {\n this.filters = [filter];\n }\n }\n\n public removeFilter(name: string) {\n const filter = this.containerFilters.get(name);\n if (filter) {\n const index = (this?.filters ?? []).findIndex((e) => e === filter);\n if (this.filters) {\n this.filters.splice(index, 1);\n this.containerFilters.delete(name);\n }\n }\n }\n\n public get blur(): number {\n // @ts-ignore\n return this.getOrCreateBlurFilter().blur as number;\n }\n\n public set blur(value: number) {\n // @ts-ignore\n this.getOrCreateBlurFilter().blur = value;\n }\n\n public get x() {\n const rX = super.position?.x ?? 0;\n return rX - this.baseX;\n }\n\n public set x(value) {\n if (!super.position) {\n return;\n }\n super.position.x = value + this.baseX;\n }\n\n public get y() {\n const rY = super.position?.y ?? 0;\n return rY - this.baseY;\n }\n\n public set y(value) {\n if (!super.position) {\n return;\n }\n super.position.y = value + this.baseY;\n }\n\n public setBaseX(x: number) {\n const originalX = this.x;\n this.baseX = x;\n this.x = originalX;\n }\n\n public setBaseY(y: number) {\n const originalY = this.y;\n this.baseY = y;\n this.y = originalY;\n }\n\n public getOrCreateBlurFilter() {\n const blurFilterFromMap = this.containerFilters.get('blur');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n const blurFilter = new PIXI.filters.BlurFilter();\n // 默认的 blur 是8,覆盖掉\n blurFilter.blur = 0;\n this.addFilter(blurFilter);\n this.containerFilters.set('blur', blurFilter);\n return blurFilter;\n }\n }\n\n /**\n * old film filter\n * @public\n */\n public getOrCreateOldFilmFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('oldFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const oldFilm = new OldFilmFilter();\n this.addFilter(oldFilm);\n this.containerFilters.set('oldFilm', oldFilm);\n return oldFilm;\n } else return null;\n }\n }\n public get oldFilm(): number {\n if (this.getOrCreateOldFilmFilter(false)) return 1;\n return 0;\n }\n\n public set oldFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('oldFilm');\n } else this.getOrCreateOldFilmFilter();\n }\n\n /**\n * dot film filter\n * @public\n */\n public getOrCreateDotFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('dotFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const dotFilm = new DotFilter();\n this.addFilter(dotFilm);\n this.containerFilters.set('dotFilm', dotFilm);\n return dotFilm;\n } else return null;\n }\n }\n public get dotFilm(): number {\n if (this.getOrCreateDotFilter(false)) return 1;\n return 0;\n }\n\n public set dotFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('dotFilm');\n } else this.getOrCreateDotFilter();\n }\n\n /**\n * reflection film filter\n * @public\n */\n public getOrCreateReflectionFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('reflectionFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const reflectionFilm = new ReflectionFilter();\n this.addFilter(reflectionFilm);\n this.containerFilters.set('reflectionFilm', reflectionFilm);\n return reflectionFilm;\n } else return null;\n }\n }\n public get reflectionFilm(): number {\n if (this.getOrCreateReflectionFilter(false)) return 1;\n return 0;\n }\n\n public set reflectionFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('reflectionFilm');\n } else this.getOrCreateReflectionFilter();\n }\n\n /**\n * glitchFilter film filter\n * @public\n */\n public getOrCreateGlitchFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('glitchFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const glitchFilm = new GlitchFilter();\n this.addFilter(glitchFilm);\n this.containerFilters.set('glitchFilm', glitchFilm);\n return glitchFilm;\n } else return null;\n }\n }\n public get glitchFilm(): number {\n if (this.getOrCreateGlitchFilter(false)) return 1;\n return 0;\n }\n\n public set glitchFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('glitchFilm');\n } else this.getOrCreateGlitchFilter();\n }\n\n /**\n * rgbSplitFilter film filter\n * @public\n */\n public getOrCreateRGBSplitFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('rgbFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const rgbFilm = new RGBSplitFilter();\n this.addFilter(rgbFilm);\n this.containerFilters.set('rgbFilm', rgbFilm);\n return rgbFilm;\n }\n }\n }\n public get rgbFilm(): number {\n if (this.getOrCreateRGBSplitFilter(false)) return 1;\n return 0;\n }\n\n public set rgbFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('rgbFilm');\n } else this.getOrCreateRGBSplitFilter();\n }\n\n /**\n * godrayFilter film filter\n * @public\n */\n public getOrCreateGodrayFilter(createMode = true) {\n const blurFilterFromMap = this.containerFilters.get('godrayFilm');\n if (blurFilterFromMap) {\n return blurFilterFromMap;\n } else {\n if (createMode) {\n const godrayFilm = new GodrayFilter();\n this.addFilter(godrayFilm);\n this.containerFilters.set('godrayFilm', godrayFilm);\n return godrayFilm;\n }\n }\n }\n public get godrayFilm(): number {\n if (this.getOrCreateGodrayFilter(false)) return 1;\n return 0;\n }\n\n public set godrayFilm(value: number) {\n /**\n * 如果是0,就移除这个滤镜\n */\n if (value === 0) {\n this.removeFilter('godrayFilm');\n } else this.getOrCreateGodrayFilter();\n }\n\n /**\n * ShockwaveFilter\n */\n\n public getOrCreateShockwaveFilter(createMode = true) {\n return getOrCreateShockwaveFilterImpl(this, createMode);\n }\n public get shockwaveFilter(): number {\n return getShockwaveFilter(this);\n }\n public set shockwaveFilter(value: number) {\n setShockwaveFilter(this, value);\n }\n\n /**\n * RadiusAlphaFilter\n */\n\n public getOrCreateRadiusAlphaFilter(createMode = true) {\n return getOrCreateRadiusAlphaFilterImpl(this, createMode);\n }\n public get radiusAlphaFilter(): number {\n return getRadiusAlphaFilter(this);\n }\n public set radiusAlphaFilter(value: number) {\n setRadiusAlphaFilter(this, value);\n }\n}\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/base - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:29 UTC\n *\n * @pixi-spine/base is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev <ivan.popelyshev@gmail.com>, All Rights Reserved\n */\nimport { SCALE_MODES, MIPMAP_MODES, ALPHA_MODES, DRAW_MODES } from '@pixi/constants';\nimport { Texture } from '@pixi/core';\nimport { Rectangle, Transform, Polygon } from '@pixi/math';\nimport { Container } from '@pixi/display';\nimport { Sprite } from '@pixi/sprite';\nimport { SimpleMesh } from '@pixi/mesh-extras';\nimport { Graphics } from '@pixi/graphics';\nimport { rgb2hex, hex2rgb } from '@pixi/utils';\n\n/**\r\n * @public\r\n */\r\nvar AttachmentType;\r\n(function (AttachmentType) {\r\n AttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\r\n AttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\r\n AttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\r\n AttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\r\n AttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\r\n AttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\r\n AttachmentType[AttachmentType[\"Clipping\"] = 6] = \"Clipping\";\r\n})(AttachmentType || (AttachmentType = {}));\n\n/**\r\n * @public\r\n */\r\nvar BinaryInput = /** @class */ (function () {\r\n function BinaryInput(data, strings, index, buffer) {\r\n if (strings === void 0) { strings = new Array(); }\r\n if (index === void 0) { index = 0; }\r\n if (buffer === void 0) { buffer = new DataView(data.buffer); }\r\n this.strings = strings;\r\n this.index = index;\r\n this.buffer = buffer;\r\n }\r\n BinaryInput.prototype.readByte = function () {\r\n return this.buffer.getInt8(this.index++);\r\n };\r\n BinaryInput.prototype.readUnsignedByte = function () {\r\n return this.buffer.getUint8(this.index++);\r\n };\r\n BinaryInput.prototype.readShort = function () {\r\n var value = this.buffer.getInt16(this.index);\r\n this.index += 2;\r\n return value;\r\n };\r\n BinaryInput.prototype.readInt32 = function () {\r\n var value = this.buffer.getInt32(this.index);\r\n this.index += 4;\r\n return value;\r\n };\r\n BinaryInput.prototype.readInt = function (optimizePositive) {\r\n var b = this.readByte();\r\n var result = b & 0x7F;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 7;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 14;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 21;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 28;\r\n }\r\n }\r\n }\r\n }\r\n return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\r\n };\r\n BinaryInput.prototype.readStringRef = function () {\r\n var index = this.readInt(true);\r\n return index == 0 ? null : this.strings[index - 1];\r\n };\r\n BinaryInput.prototype.readString = function () {\r\n var byteCount = this.readInt(true);\r\n switch (byteCount) {\r\n case 0:\r\n return null;\r\n case 1:\r\n return \"\";\r\n }\r\n byteCount--;\r\n var chars = \"\";\r\n for (var i = 0; i < byteCount;) {\r\n var b = this.readUnsignedByte();\r\n switch (b >> 4) {\r\n case 12:\r\n case 13:\r\n chars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\r\n i += 2;\r\n break;\r\n case 14:\r\n chars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\r\n i += 3;\r\n break;\r\n default:\r\n chars += String.fromCharCode(b);\r\n i++;\r\n }\r\n }\r\n return chars;\r\n };\r\n BinaryInput.prototype.readFloat = function () {\r\n var value = this.buffer.getFloat32(this.index);\r\n this.index += 4;\r\n return value;\r\n };\r\n BinaryInput.prototype.readBoolean = function () {\r\n return this.readByte() != 0;\r\n };\r\n return BinaryInput;\r\n}());\n\n// Those enums were moved from Animation.ts of spine 3.8 and 4.0\r\n/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`\r\n * < 1.\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @public\r\n * */\r\nvar MixBlend;\r\n(function (MixBlend) {\r\n /** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup\r\n * value is set. */\r\n MixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\r\n /** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to\r\n * the setup value. Timelines which perform instant transitions, such as DrawOrderTimeline or\r\n * AttachmentTimeline, use the setup value before the first key.\r\n *\r\n * `first` is intended for the first animations applied, not for animations layered on top of those. */\r\n MixBlend[MixBlend[\"first\"] = 1] = \"first\";\r\n /** Transitions from the current value to the timeline value. No change is made before the first key (the current value is\r\n * kept until the first key).\r\n *\r\n * `replace` is intended for animations layered on top of others, not for the first animations applied. */\r\n MixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\r\n /** Transitions from the current value to the current value plus the timeline value. No change is made before the first key\r\n * (the current value is kept until the first key).\r\n *\r\n * `add` is intended for animations layered on top of others, not for the first animations applied. Properties\r\n * keyed by additive animations must be set manually or by another animation before applying the additive animations, else\r\n * the property values will increase continually. */\r\n MixBlend[MixBlend[\"add\"] = 3] = \"add\";\r\n})(MixBlend || (MixBlend = {}));\r\n/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or\r\n * mixing in toward 1 (the timeline's value).\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @public\r\n * */\r\nvar MixDirection;\r\n(function (MixDirection) {\r\n MixDirection[MixDirection[\"mixIn\"] = 0] = \"mixIn\";\r\n MixDirection[MixDirection[\"mixOut\"] = 1] = \"mixOut\";\r\n})(MixDirection || (MixDirection = {}));\n\n// These enums were moved from PathConstraintData.ts of spine 3.7, 3.8 and 4.0\r\n/** Controls how the first bone is positioned along the path.\r\n *\r\n * See [Position mode](http://esotericsoftware.com/spine-path-constraints#Position-mode) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar PositionMode;\r\n(function (PositionMode) {\r\n PositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\r\n PositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\r\n})(PositionMode || (PositionMode = {}));\r\n/** Controls how bones are rotated, translated, and scaled to match the path.\r\n *\r\n * [Rotate mode](http://esotericsoftware.com/spine-path-constraints#Rotate-mod) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar RotateMode;\r\n(function (RotateMode) {\r\n RotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\r\n RotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\r\n RotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\r\n})(RotateMode || (RotateMode = {}));\n\n// This enum was moved from BoneData.ts of spine 3.7, 3.8 and 4.0\r\n/** Determines how a bone inherits world transforms from parent bones.\r\n * @public\r\n * */\r\nvar TransformMode;\r\n(function (TransformMode) {\r\n TransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\r\n TransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\r\n TransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\r\n TransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\r\n TransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\r\n})(TransformMode || (TransformMode = {}));\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nfunction filterFromString(text) {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(\"Unknown texture filter \" + text);\r\n }\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction wrapFromString(text) {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(\"Unknown texture wrap \" + text);\r\n }\r\n}\r\n/**\r\n * @public\r\n */\r\nvar TextureFilter;\r\n(function (TextureFilter) {\r\n TextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\r\n TextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\r\n TextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\r\n TextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\r\n TextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\r\n TextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\r\n TextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\"; // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\r\n})(TextureFilter || (TextureFilter = {}));\r\n/**\r\n * @public\r\n */\r\nvar TextureWrap;\r\n(function (TextureWrap) {\r\n TextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\r\n TextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\r\n TextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\"; // WebGLRenderingContext.REPEAT\r\n})(TextureWrap || (TextureWrap = {}));\r\n/**\r\n * @public\r\n */\r\nvar TextureRegion = /** @class */ (function () {\r\n function TextureRegion() {\r\n //thats for overrides\r\n this.size = null;\r\n this.names = null;\r\n this.values = null;\r\n this.renderObject = null;\r\n }\r\n Object.defineProperty(TextureRegion.prototype, \"width\", {\r\n get: function () {\r\n var tex = this.texture;\r\n if (tex.trim) {\r\n return tex.trim.width;\r\n }\r\n return tex.orig.width;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"height\", {\r\n get: function () {\r\n var tex = this.texture;\r\n if (tex.trim) {\r\n return tex.trim.height;\r\n }\r\n return tex.orig.height;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"u\", {\r\n get: function () {\r\n return this.texture._uvs.x0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"v\", {\r\n get: function () {\r\n return this.texture._uvs.y0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"u2\", {\r\n get: function () {\r\n return this.texture._uvs.x2;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"v2\", {\r\n get: function () {\r\n return this.texture._uvs.y2;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"offsetX\", {\r\n get: function () {\r\n var tex = this.texture;\r\n return tex.trim ? tex.trim.x : 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"offsetY\", {\r\n get: function () {\r\n // console.warn(\"Deprecation Warning: @Hackerham: I guess, if you are using PIXI-SPINE ATLAS region.offsetY, you want a texture, right? Use region.texture from now on.\");\r\n return this.spineOffsetY;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"pixiOffsetY\", {\r\n get: function () {\r\n var tex = this.texture;\r\n return tex.trim ? tex.trim.y : 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"spineOffsetY\", {\r\n get: function () {\r\n var tex = this.texture;\r\n return this.originalHeight - this.height - (tex.trim ? tex.trim.y : 0);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"originalWidth\", {\r\n get: function () {\r\n return this.texture.orig.width;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"originalHeight\", {\r\n get: function () {\r\n return this.texture.orig.height;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"x\", {\r\n get: function () {\r\n return this.texture.frame.x;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"y\", {\r\n get: function () {\r\n return this.texture.frame.y;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"rotate\", {\r\n get: function () {\r\n return this.texture.rotate !== 0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TextureRegion.prototype, \"degrees\", {\r\n get: function () {\r\n return (360 - this.texture.rotate * 45) % 360;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return TextureRegion;\r\n}());\n\nvar RegionFields = /** @class */ (function () {\r\n function RegionFields() {\r\n this.x = 0;\r\n this.y = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n this.offsetX = 0;\r\n this.offsetY = 0;\r\n this.originalWidth = 0;\r\n this.originalHeight = 0;\r\n this.rotate = 0;\r\n this.index = 0;\r\n }\r\n return RegionFields;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlas = /** @class */ (function () {\r\n function TextureAtlas(atlasText, textureLoader, callback) {\r\n this.pages = new Array();\r\n this.regions = new Array();\r\n if (atlasText) {\r\n this.addSpineAtlas(atlasText, textureLoader, callback);\r\n }\r\n }\r\n TextureAtlas.prototype.addTexture = function (name, texture) {\r\n var pages = this.pages;\r\n var page = null;\r\n for (var i = 0; i < pages.length; i++) {\r\n if (pages[i].baseTexture === texture.baseTexture) {\r\n page = pages[i];\r\n break;\r\n }\r\n }\r\n if (page === null) {\r\n page = new TextureAtlasPage();\r\n page.name = 'texturePage';\r\n var baseTexture = texture.baseTexture;\r\n page.width = baseTexture.realWidth;\r\n page.height = baseTexture.realHeight;\r\n page.baseTexture = baseTexture;\r\n //those fields are not relevant in Pixi\r\n page.minFilter = page.magFilter = TextureFilter.Nearest;\r\n page.uWrap = TextureWrap.ClampToEdge;\r\n page.vWrap = TextureWrap.ClampToEdge;\r\n pages.push(page);\r\n }\r\n var region = new TextureAtlasRegion();\r\n region.name = name;\r\n region.page = page;\r\n region.texture = texture;\r\n region.index = -1;\r\n this.regions.push(region);\r\n return region;\r\n };\r\n TextureAtlas.prototype.addTextureHash = function (textures, stripExtension) {\r\n for (var key in textures) {\r\n if (textures.hasOwnProperty(key)) {\r\n this.addTexture(stripExtension && key.indexOf('.') !== -1 ? key.substr(0, key.lastIndexOf('.')) : key, textures[key]);\r\n }\r\n }\r\n };\r\n TextureAtlas.prototype.addSpineAtlas = function (atlasText, textureLoader, callback) {\r\n return this.load(atlasText, textureLoader, callback);\r\n };\r\n TextureAtlas.prototype.load = function (atlasText, textureLoader, callback) {\r\n var _this = this;\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n var reader = new TextureAtlasReader(atlasText);\r\n var entry = new Array(4);\r\n var page = null;\r\n var pageFields = {};\r\n var region = null;\r\n pageFields[\"size\"] = function () {\r\n page.width = parseInt(entry[1]);\r\n page.height = parseInt(entry[2]);\r\n };\r\n pageFields[\"format\"] = function () {\r\n // page.format = Format[tuple[0]]; we don't need format in WebGL\r\n };\r\n pageFields[\"filter\"] = function () {\r\n page.minFilter = filterFromString(entry[1]);\r\n page.magFilter = filterFromString(entry[2]);\r\n };\r\n pageFields[\"repeat\"] = function () {\r\n if (entry[1].indexOf('x') != -1)\r\n page.uWrap = TextureWrap.Repeat;\r\n if (entry[1].indexOf('y') != -1)\r\n page.vWrap = TextureWrap.Repeat;\r\n };\r\n pageFields[\"pma\"] = function () {\r\n page.pma = entry[1] == \"true\";\r\n };\r\n var regionFields = {};\r\n regionFields[\"xy\"] = function () {\r\n region.x = parseInt(entry[1]);\r\n region.y = parseInt(entry[2]);\r\n };\r\n regionFields[\"size\"] = function () {\r\n region.width = parseInt(entry[1]);\r\n region.height = parseInt(entry[2]);\r\n };\r\n regionFields[\"bounds\"] = function () {\r\n region.x = parseInt(entry[1]);\r\n region.y = parseInt(entry[2]);\r\n region.width = parseInt(entry[3]);\r\n region.height = parseInt(entry[4]);\r\n };\r\n regionFields[\"offset\"] = function () {\r\n region.offsetX = parseInt(entry[1]);\r\n region.offsetY = parseInt(entry[2]);\r\n };\r\n regionFields[\"orig\"] = function () {\r\n region.originalWidth = parseInt(entry[1]);\r\n region.originalHeight = parseInt(entry[2]);\r\n };\r\n regionFields[\"offsets\"] = function () {\r\n region.offsetX = parseInt(entry[1]);\r\n region.offsetY = parseInt(entry[2]);\r\n region.originalWidth = parseInt(entry[3]);\r\n region.originalHeight = parseInt(entry[4]);\r\n };\r\n regionFields[\"rotate\"] = function () {\r\n var rotateValue = entry[1];\r\n var rotate = 0;\r\n if (rotateValue.toLocaleLowerCase() == \"true\") {\r\n rotate = 6;\r\n }\r\n else if (rotateValue.toLocaleLowerCase() == \"false\") {\r\n rotate = 0;\r\n }\r\n else {\r\n rotate = ((720 - parseFloat(rotateValue)) % 360) / 45;\r\n }\r\n region.rotate = rotate;\r\n };\r\n regionFields[\"index\"] = function () {\r\n region.index = parseInt(entry[1]);\r\n };\r\n var line = reader.readLine();\r\n // Ignore empty lines before first entry.\r\n while (line != null && line.trim().length == 0)\r\n line = reader.readLine();\r\n // Header entries.\r\n while (true) {\r\n if (line == null || line.trim().length == 0)\r\n break;\r\n if (reader.readEntry(entry, line) == 0)\r\n break; // Silently ignore all header fields.\r\n line = reader.readLine();\r\n }\r\n var iterateParser = function () {\r\n while (true) {\r\n if (line == null) {\r\n return callback && callback(_this);\r\n }\r\n if (line.trim().length == 0) {\r\n page = null;\r\n line = reader.readLine();\r\n }\r\n else if (page === null) {\r\n page = new TextureAtlasPage();\r\n page.name = line.trim();\r\n while (true) {\r\n if (reader.readEntry(entry, line = reader.readLine()) == 0)\r\n break;\r\n var field = pageFields[entry[0]];\r\n if (field)\r\n field();\r\n }\r\n _this.pages.push(page);\r\n textureLoader(page.name, function (texture) {\r\n if (texture === null) {\r\n _this.pages.splice(_this.pages.indexOf(page), 1);\r\n return callback && callback(null);\r\n }\r\n page.baseTexture = texture;\r\n //TODO: set scaleMode and mipmapMode from spine\r\n if (page.pma) {\r\n texture.alphaMode = ALPHA_MODES.PMA;\r\n }\r\n if (!texture.valid) {\r\n texture.setSize(page.width, page.height);\r\n }\r\n page.setFilters();\r\n if (!page.width || !page.height) {\r\n page.width = texture.realWidth;\r\n page.height = texture.realHeight;\r\n if (!page.width || !page.height) {\r\n console.log(\"ERROR spine atlas page \" + page.name + \": meshes wont work if you dont specify size in atlas (http://www.html5gamedevs.com/topic/18888-pixi-spines-and-meshes/?p=107121)\");\r\n }\r\n }\r\n iterateParser();\r\n });\r\n break;\r\n }\r\n else {\r\n region = new RegionFields();\r\n var atlasRegion = new TextureAtlasRegion();\r\n atlasRegion.name = line;\r\n atlasRegion.page = page;\r\n var names = null;\r\n var values = null;\r\n while (true) {\r\n var count = reader.readEntry(entry, line = reader.readLine());\r\n if (count == 0)\r\n break;\r\n var field = regionFields[entry[0]];\r\n if (field)\r\n field();\r\n else {\r\n if (names == null) {\r\n names = [];\r\n values = [];\r\n }\r\n names.push(entry[0]);\r\n var entryValues = [];\r\n for (var i = 0; i < count; i++)\r\n entryValues.push(parseInt(entry[i + 1]));\r\n values.push(entryValues);\r\n }\r\n }\r\n if (region.originalWidth == 0 && region.originalHeight == 0) {\r\n region.originalWidth = region.width;\r\n region.originalHeight = region.height;\r\n }\r\n var resolution = page.baseTexture.resolution;\r\n region.x /= resolution;\r\n region.y /= resolution;\r\n region.width /= resolution;\r\n region.height /= resolution;\r\n region.originalWidth /= resolution;\r\n region.originalHeight /= resolution;\r\n region.offsetX /= resolution;\r\n region.offsetY /= resolution;\r\n var swapWH = region.rotate % 4 !== 0;\r\n var frame = new Rectangle(region.x, region.y, swapWH ? region.height : region.width, swapWH ? region.width : region.height);\r\n var orig = new Rectangle(0, 0, region.originalWidth, region.originalHeight);\r\n var trim = new Rectangle(region.offsetX, region.originalHeight - region.height - region.offsetY, region.width, region.height);\r\n atlasRegion.texture = new Texture(atlasRegion.page.baseTexture, frame, orig, trim, region.rotate);\r\n atlasRegion.index = region.index;\r\n atlasRegion.texture.updateUvs();\r\n _this.regions.push(atlasRegion);\r\n }\r\n }\r\n };\r\n iterateParser();\r\n };\r\n TextureAtlas.prototype.findRegion = function (name) {\r\n for (var i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n };\r\n TextureAtlas.prototype.dispose = function () {\r\n for (var i = 0; i < this.pages.length; i++) {\r\n this.pages[i].baseTexture.dispose();\r\n }\r\n };\r\n return TextureAtlas;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlasReader = /** @class */ (function () {\r\n function TextureAtlasReader(text) {\r\n this.index = 0;\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n TextureAtlasReader.prototype.readLine = function () {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n };\r\n TextureAtlasReader.prototype.readEntry = function (entry, line) {\r\n if (line == null)\r\n return 0;\r\n line = line.trim();\r\n if (line.length == 0)\r\n return 0;\r\n var colon = line.indexOf(':');\r\n if (colon == -1)\r\n return 0;\r\n entry[0] = line.substr(0, colon).trim();\r\n for (var i = 1, lastMatch = colon + 1;; i++) {\r\n var comma = line.indexOf(',', lastMatch);\r\n if (comma == -1) {\r\n entry[i] = line.substr(lastMatch).trim();\r\n return i;\r\n }\r\n entry[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n if (i == 4)\r\n return 4;\r\n }\r\n };\r\n return TextureAtlasReader;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlasPage = /** @class */ (function () {\r\n function TextureAtlasPage() {\r\n this.minFilter = TextureFilter.Nearest;\r\n this.magFilter = TextureFilter.Nearest;\r\n this.uWrap = TextureWrap.ClampToEdge;\r\n this.vWrap = TextureWrap.ClampToEdge;\r\n }\r\n TextureAtlasPage.prototype.setFilters = function () {\r\n var tex = this.baseTexture;\r\n var filter = this.minFilter;\r\n if (filter == TextureFilter.Linear) {\r\n tex.scaleMode = SCALE_MODES.LINEAR;\r\n }\r\n else if (this.minFilter == TextureFilter.Nearest) {\r\n tex.scaleMode = SCALE_MODES.NEAREST;\r\n }\r\n else {\r\n tex.mipmap = MIPMAP_MODES.POW2;\r\n if (filter == TextureFilter.MipMapNearestNearest) {\r\n tex.scaleMode = SCALE_MODES.NEAREST;\r\n }\r\n else {\r\n tex.scaleMode = SCALE_MODES.LINEAR;\r\n }\r\n }\r\n };\r\n return TextureAtlasPage;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TextureAtlasRegion = /** @class */ (function (_super) {\r\n __extends(TextureAtlasRegion, _super);\r\n function TextureAtlasRegion() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return TextureAtlasRegion;\r\n}(TextureRegion));\n\nvar fround_polyfill = (function (array) {\r\n return function (x) {\r\n return array[0] = x, array[0];\r\n };\r\n})(new Float32Array(1));\r\nvar fround = Math.fround || fround_polyfill;\r\n/**\r\n * @public\r\n */\r\nvar IntSet = /** @class */ (function () {\r\n function IntSet() {\r\n this.array = new Array();\r\n }\r\n IntSet.prototype.add = function (value) {\r\n var contains = this.contains(value);\r\n this.array[value | 0] = value | 0;\r\n return !contains;\r\n };\r\n IntSet.prototype.contains = function (value) {\r\n return this.array[value | 0] != undefined;\r\n };\r\n IntSet.prototype.remove = function (value) {\r\n this.array[value | 0] = undefined;\r\n };\r\n IntSet.prototype.clear = function () {\r\n this.array.length = 0;\r\n };\r\n return IntSet;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar StringSet = /** @class */ (function () {\r\n function StringSet() {\r\n this.entries = {};\r\n this.size = 0;\r\n }\r\n StringSet.prototype.add = function (value) {\r\n var contains = this.entries[value];\r\n this.entries[value] = true;\r\n if (!contains) {\r\n this.size++;\r\n return true;\r\n }\r\n return false;\r\n };\r\n StringSet.prototype.addAll = function (values) {\r\n var oldSize = this.size;\r\n for (var i = 0, n = values.length; i < n; i++)\r\n this.add(values[i]);\r\n return oldSize != this.size;\r\n };\r\n StringSet.prototype.contains = function (value) {\r\n return this.entries[value];\r\n };\r\n StringSet.prototype.clear = function () {\r\n this.entries = {};\r\n this.size = 0;\r\n };\r\n return StringSet;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Color = /** @class */ (function () {\r\n function Color(r, g, b, a) {\r\n if (r === void 0) { r = 0; }\r\n if (g === void 0) { g = 0; }\r\n if (b === void 0) { b = 0; }\r\n if (a === void 0) { a = 0; }\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n }\r\n Color.prototype.set = function (r, g, b, a) {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n return this.clamp();\r\n };\r\n Color.prototype.setFromColor = function (c) {\r\n this.r = c.r;\r\n this.g = c.g;\r\n this.b = c.b;\r\n this.a = c.a;\r\n return this;\r\n };\r\n Color.prototype.setFromString = function (hex) {\r\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n this.r = parseInt(hex.substr(0, 2), 16) / 255;\r\n this.g = parseInt(hex.substr(2, 2), 16) / 255;\r\n this.b = parseInt(hex.substr(4, 2), 16) / 255;\r\n this.a = hex.length != 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255;\r\n return this;\r\n };\r\n Color.prototype.add = function (r, g, b, a) {\r\n this.r += r;\r\n this.g += g;\r\n this.b += b;\r\n this.a += a;\r\n return this.clamp();\r\n };\r\n Color.prototype.clamp = function () {\r\n if (this.r < 0)\r\n this.r = 0;\r\n else if (this.r > 1)\r\n this.r = 1;\r\n if (this.g < 0)\r\n this.g = 0;\r\n else if (this.g > 1)\r\n this.g = 1;\r\n if (this.b < 0)\r\n this.b = 0;\r\n else if (this.b > 1)\r\n this.b = 1;\r\n if (this.a < 0)\r\n this.a = 0;\r\n else if (this.a > 1)\r\n this.a = 1;\r\n return this;\r\n };\r\n Color.rgba8888ToColor = function (color, value) {\r\n color.r = ((value & 0xff000000) >>> 24) / 255;\r\n color.g = ((value & 0x00ff0000) >>> 16) / 255;\r\n color.b = ((value & 0x0000ff00) >>> 8) / 255;\r\n color.a = ((value & 0x000000ff)) / 255;\r\n };\r\n Color.rgb888ToColor = function (color, value) {\r\n color.r = ((value & 0x00ff0000) >>> 16) / 255;\r\n color.g = ((value & 0x0000ff00) >>> 8) / 255;\r\n color.b = ((value & 0x000000ff)) / 255;\r\n };\r\n Color.fromString = function (hex) {\r\n return new Color().setFromString(hex);\r\n };\r\n Color.WHITE = new Color(1, 1, 1, 1);\r\n Color.RED = new Color(1, 0, 0, 1);\r\n Color.GREEN = new Color(0, 1, 0, 1);\r\n Color.BLUE = new Color(0, 0, 1, 1);\r\n Color.MAGENTA = new Color(1, 0, 1, 1);\r\n return Color;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar MathUtils = /** @class */ (function () {\r\n function MathUtils() {\r\n }\r\n MathUtils.clamp = function (value, min, max) {\r\n if (value < min)\r\n return min;\r\n if (value > max)\r\n return max;\r\n return value;\r\n };\r\n MathUtils.cosDeg = function (degrees) {\r\n return Math.cos(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.sinDeg = function (degrees) {\r\n return Math.sin(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.signum = function (value) {\r\n return value > 0 ? 1 : value < 0 ? -1 : 0;\r\n };\r\n MathUtils.toInt = function (x) {\r\n return x > 0 ? Math.floor(x) : Math.ceil(x);\r\n };\r\n MathUtils.cbrt = function (x) {\r\n var y = Math.pow(Math.abs(x), 1 / 3);\r\n return x < 0 ? -y : y;\r\n };\r\n MathUtils.randomTriangular = function (min, max) {\r\n return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\r\n };\r\n MathUtils.randomTriangularWith = function (min, max, mode) {\r\n var u = Math.random();\r\n var d = max - min;\r\n if (u <= (mode - min) / d)\r\n return min + Math.sqrt(u * d * (mode - min));\r\n return max - Math.sqrt((1 - u) * d * (max - mode));\r\n };\r\n MathUtils.isPowerOfTwo = function (value) {\r\n return value && (value & (value - 1)) === 0;\r\n };\r\n MathUtils.PI = 3.1415927;\r\n MathUtils.PI2 = MathUtils.PI * 2;\r\n MathUtils.radiansToDegrees = 180 / MathUtils.PI;\r\n MathUtils.radDeg = MathUtils.radiansToDegrees;\r\n MathUtils.degreesToRadians = MathUtils.PI / 180;\r\n MathUtils.degRad = MathUtils.degreesToRadians;\r\n return MathUtils;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Interpolation = /** @class */ (function () {\r\n function Interpolation() {\r\n }\r\n Interpolation.prototype.apply = function (start, end, a) {\r\n return start + (end - start) * this.applyInternal(a);\r\n };\r\n return Interpolation;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Pow = /** @class */ (function (_super) {\r\n __extends(Pow, _super);\r\n function Pow(power) {\r\n var _this = _super.call(this) || this;\r\n _this.power = 2;\r\n _this.power = power;\r\n return _this;\r\n }\r\n Pow.prototype.applyInternal = function (a) {\r\n if (a <= 0.5)\r\n return Math.pow(a * 2, this.power) / 2;\r\n return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\r\n };\r\n return Pow;\r\n}(Interpolation));\r\n/**\r\n * @public\r\n */\r\nvar PowOut = /** @class */ (function (_super) {\r\n __extends(PowOut, _super);\r\n function PowOut(power) {\r\n return _super.call(this, power) || this;\r\n }\r\n PowOut.prototype.applyInternal = function (a) {\r\n return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\r\n };\r\n return PowOut;\r\n}(Pow));\r\n/**\r\n * @public\r\n */\r\nvar Utils = /** @class */ (function () {\r\n function Utils() {\r\n }\r\n Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\r\n for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n dest[j] = source[i];\r\n }\r\n };\r\n Utils.arrayFill = function (array, fromIndex, toIndex, value) {\r\n for (var i = fromIndex; i < toIndex; i++)\r\n array[i] = value;\r\n };\r\n Utils.setArraySize = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n var oldSize = array.length;\r\n if (oldSize == size)\r\n return array;\r\n array.length = size;\r\n if (oldSize < size) {\r\n for (var i = oldSize; i < size; i++)\r\n array[i] = value;\r\n }\r\n return array;\r\n };\r\n Utils.ensureArrayCapacity = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n if (array.length >= size)\r\n return array;\r\n return Utils.setArraySize(array, size, value);\r\n };\r\n Utils.newArray = function (size, defaultValue) {\r\n var array = new Array(size);\r\n for (var i = 0; i < size; i++)\r\n array[i] = defaultValue;\r\n return array;\r\n };\r\n Utils.newFloatArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS)\r\n return new Float32Array(size);\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.newShortArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS)\r\n return new Int16Array(size);\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.toFloatArray = function (array) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n };\r\n Utils.toSinglePrecision = function (value) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? fround(value) : value;\r\n };\r\n // This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper = function (alpha, blend) {\r\n };\r\n Utils.contains = function (array, element, identity) {\r\n for (var i = 0; i < array.length; i++)\r\n if (array[i] == element)\r\n return true;\r\n return false;\r\n };\r\n Utils.enumValue = function (type, name) {\r\n return type[name[0].toUpperCase() + name.slice(1)];\r\n };\r\n Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\r\n return Utils;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar DebugUtils = /** @class */ (function () {\r\n function DebugUtils() {\r\n }\r\n DebugUtils.logBones = function (skeleton) {\r\n for (var i = 0; i < skeleton.bones.length; i++) {\r\n var bone = skeleton.bones[i];\r\n var mat = bone.matrix;\r\n console.log(bone.data.name + \", \" + mat.a + \", \" + mat.b + \", \" + mat.c + \", \" + mat.d + \", \" + mat.tx + \", \" + mat.ty);\r\n }\r\n };\r\n return DebugUtils;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Pool = /** @class */ (function () {\r\n function Pool(instantiator) {\r\n this.items = new Array();\r\n this.instantiator = instantiator;\r\n }\r\n Pool.prototype.obtain = function () {\r\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n };\r\n Pool.prototype.free = function (item) {\r\n if (item.reset)\r\n item.reset();\r\n this.items.push(item);\r\n };\r\n Pool.prototype.freeAll = function (items) {\r\n for (var i = 0; i < items.length; i++)\r\n this.free(items[i]);\r\n };\r\n Pool.prototype.clear = function () {\r\n this.items.length = 0;\r\n };\r\n return Pool;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Vector2 = /** @class */ (function () {\r\n function Vector2(x, y) {\r\n if (x === void 0) { x = 0; }\r\n if (y === void 0) { y = 0; }\r\n this.x = x;\r\n this.y = y;\r\n }\r\n Vector2.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Vector2.prototype.length = function () {\r\n var x = this.x;\r\n var y = this.y;\r\n return Math.sqrt(x * x + y * y);\r\n };\r\n Vector2.prototype.normalize = function () {\r\n var len = this.length();\r\n if (len != 0) {\r\n this.x /= len;\r\n this.y /= len;\r\n }\r\n return this;\r\n };\r\n return Vector2;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TimeKeeper = /** @class */ (function () {\r\n function TimeKeeper() {\r\n this.maxDelta = 0.064;\r\n this.framesPerSecond = 0;\r\n this.delta = 0;\r\n this.totalTime = 0;\r\n this.lastTime = Date.now() / 1000;\r\n this.frameCount = 0;\r\n this.frameTime = 0;\r\n }\r\n TimeKeeper.prototype.update = function () {\r\n var now = Date.now() / 1000;\r\n this.delta = now - this.lastTime;\r\n this.frameTime += this.delta;\r\n this.totalTime += this.delta;\r\n if (this.delta > this.maxDelta)\r\n this.delta = this.maxDelta;\r\n this.lastTime = now;\r\n this.frameCount++;\r\n if (this.frameTime > 1) {\r\n this.framesPerSecond = this.frameCount / this.frameTime;\r\n this.frameTime = 0;\r\n this.frameCount = 0;\r\n }\r\n };\r\n return TimeKeeper;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar WindowedMean = /** @class */ (function () {\r\n function WindowedMean(windowSize) {\r\n if (windowSize === void 0) { windowSize = 32; }\r\n this.addedValues = 0;\r\n this.lastValue = 0;\r\n this.mean = 0;\r\n this.dirty = true;\r\n this.values = new Array(windowSize);\r\n }\r\n WindowedMean.prototype.hasEnoughData = function () {\r\n return this.addedValues >= this.values.length;\r\n };\r\n WindowedMean.prototype.addValue = function (value) {\r\n if (this.addedValues < this.values.length)\r\n this.addedValues++;\r\n this.values[this.lastValue++] = value;\r\n if (this.lastValue > this.values.length - 1)\r\n this.lastValue = 0;\r\n this.dirty = true;\r\n };\r\n WindowedMean.prototype.getMean = function () {\r\n if (this.hasEnoughData()) {\r\n if (this.dirty) {\r\n var mean = 0;\r\n for (var i = 0; i < this.values.length; i++)\r\n mean += this.values[i];\r\n this.mean = mean / this.values.length;\r\n this.dirty = false;\r\n }\r\n return this.mean;\r\n }\r\n return 0;\r\n };\r\n return WindowedMean;\r\n}());\n\n/** Collects each visible BoundingBoxAttachment and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBoundsBase = /** @class */ (function () {\r\n function SkeletonBoundsBase() {\r\n /** The left edge of the axis aligned bounding box. */\r\n this.minX = 0;\r\n /** The bottom edge of the axis aligned bounding box. */\r\n this.minY = 0;\r\n /** The right edge of the axis aligned bounding box. */\r\n this.maxX = 0;\r\n /** The top edge of the axis aligned bounding box. */\r\n this.maxY = 0;\r\n /** The visible bounding boxes. */\r\n this.boundingBoxes = new Array();\r\n /** The world vertices for the bounding box polygons. */\r\n this.polygons = new Array();\r\n this.polygonPool = new Pool(function () {\r\n return Utils.newFloatArray(16);\r\n });\r\n }\r\n /** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding\r\n * box's polygon.\r\n * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the\r\n * SkeletonBounds AABB methods will always return true. */\r\n SkeletonBoundsBase.prototype.update = function (skeleton, updateAabb) {\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n var boundingBoxes = this.boundingBoxes;\r\n var polygons = this.polygons;\r\n var polygonPool = this.polygonPool;\r\n var slots = skeleton.slots;\r\n var slotCount = slots.length;\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n for (var i = 0; i < slotCount; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var attachment = slot.getAttachment();\r\n if (attachment != null && attachment.type === AttachmentType.BoundingBox) {\r\n var boundingBox = attachment;\r\n boundingBoxes.push(boundingBox);\r\n var polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\r\n }\r\n }\r\n if (updateAabb) {\r\n this.aabbCompute();\r\n }\r\n else {\r\n this.minX = Number.POSITIVE_INFINITY;\r\n this.minY = Number.POSITIVE_INFINITY;\r\n this.maxX = Number.NEGATIVE_INFINITY;\r\n this.maxY = Number.NEGATIVE_INFINITY;\r\n }\r\n };\r\n SkeletonBoundsBase.prototype.aabbCompute = function () {\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++) {\r\n var polygon = polygons[i];\r\n var vertices = polygon;\r\n for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n var x = vertices[ii];\r\n var y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n };\r\n /** Returns true if the axis aligned bounding box contains the point. */\r\n SkeletonBoundsBase.prototype.aabbContainsPoint = function (x, y) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n };\r\n /** Returns true if the axis aligned bounding box intersects the line segment. */\r\n SkeletonBoundsBase.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\r\n var minX = this.minX;\r\n var minY = this.minY;\r\n var maxX = this.maxX;\r\n var maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n var m = (y2 - y1) / (x2 - x1);\r\n var y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n var x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n return false;\r\n };\r\n /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\r\n SkeletonBoundsBase.prototype.aabbIntersectsSkeleton = function (bounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n };\r\n /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\r\n * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true.\r\n * Cannot be done here because BoundingBoxAttachment is not a thing yet*/\r\n SkeletonBoundsBase.prototype.containsPoint = function (x, y) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n /** Returns true if the polygon contains the point. */\r\n SkeletonBoundsBase.prototype.containsPointPolygon = function (polygon, x, y) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var prevIndex = nn - 2;\r\n var inside = false;\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var vertexY = vertices[ii + 1];\r\n var prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n var vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\r\n inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n };\r\n /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\r\n * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns\r\n * true. */\r\n SkeletonBoundsBase.prototype.intersectsSegment = function (x1, y1, x2, y2) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n /** Returns true if the polygon contains any part of the line segment. */\r\n SkeletonBoundsBase.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var width12 = x1 - x2, height12 = y1 - y2;\r\n var det1 = x1 * y2 - y1 * x2;\r\n var x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var x4 = vertices[ii], y4 = vertices[ii + 1];\r\n var det2 = x3 * y4 - y3 * x4;\r\n var width34 = x3 - x4, height34 = y3 - y4;\r\n var det3 = width12 * height34 - height12 * width34;\r\n var x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n var y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\r\n return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n };\r\n /** Returns the polygon for the specified bounding box, or null. */\r\n SkeletonBoundsBase.prototype.getPolygon = function (boundingBox) {\r\n if (!boundingBox)\r\n throw new Error(\"boundingBox cannot be null.\");\r\n var index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n };\r\n /** The width of the axis aligned bounding box. */\r\n SkeletonBoundsBase.prototype.getWidth = function () {\r\n return this.maxX - this.minX;\r\n };\r\n /** The height of the axis aligned bounding box. */\r\n SkeletonBoundsBase.prototype.getHeight = function () {\r\n return this.maxY - this.minY;\r\n };\r\n return SkeletonBoundsBase;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar settings = {\r\n yDown: true,\r\n /**\r\n * pixi-spine gives option to not fail at certain parsing errors\r\n * spine-ts fails here\r\n */\r\n FAIL_ON_NON_EXISTING_SKIN: false,\r\n /**\r\n * past Spine.globalAutoUpdate\r\n */\r\n GLOBAL_AUTO_UPDATE: true,\r\n /**\r\n * past Spine.globalDelayLimit\r\n */\r\n GLOBAL_DELAY_LIMIT: 0,\r\n};\n\nvar tempRgb = [0, 0, 0];\r\n/**\r\n * @public\r\n */\r\nvar SpineSprite = /** @class */ (function (_super) {\r\n __extends(SpineSprite, _super);\r\n function SpineSprite() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.region = null;\r\n _this.attachment = null;\r\n return _this;\r\n }\r\n return SpineSprite;\r\n}(Sprite));\r\n/**\r\n * @public\r\n */\r\nvar SpineMesh = /** @class */ (function (_super) {\r\n __extends(SpineMesh, _super);\r\n function SpineMesh(texture, vertices, uvs, indices, drawMode) {\r\n var _this = _super.call(this, texture, vertices, uvs, indices, drawMode) || this;\r\n _this.region = null;\r\n _this.attachment = null;\r\n return _this;\r\n }\r\n return SpineMesh;\r\n}(SimpleMesh));\r\n/**\r\n * A class that enables the you to import and run your spine animations in pixi.\r\n * The Spine animation data needs to be loaded using either the Loader or a SpineLoader before it can be used by this class\r\n * See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\r\n *\r\n * ```js\r\n * let spineAnimation = new spine(spineData);\r\n * ```\r\n *\r\n * @public\r\n * @class\r\n * @extends Container\r\n * @memberof spine\r\n * @param spineData {object} The spine data loaded from a spine atlas.\r\n */\r\nvar SpineBase = /** @class */ (function (_super) {\r\n __extends(SpineBase, _super);\r\n function SpineBase(spineData) {\r\n var _this = _super.call(this) || this;\r\n if (!spineData) {\r\n throw new Error('The spineData param is required.');\r\n }\r\n if ((typeof spineData) === \"string\") {\r\n throw new Error('spineData param cant be string. Please use spine.Spine.fromAtlas(\"YOUR_RESOURCE_NAME\") from now on.');\r\n }\r\n /**\r\n * The spineData object\r\n *\r\n * @member {object}\r\n */\r\n _this.spineData = spineData;\r\n /**\r\n * A spine Skeleton object\r\n *\r\n * @member {object}\r\n */\r\n _this.createSkeleton(spineData);\r\n /**\r\n * An array of containers\r\n *\r\n * @member {Container[]}\r\n */\r\n _this.slotContainers = [];\r\n _this.tempClipContainers = [];\r\n for (var i = 0, n = _this.skeleton.slots.length; i < n; i++) {\r\n var slot = _this.skeleton.slots[i];\r\n var attachment = slot.getAttachment();\r\n var slotContainer = _this.newContainer();\r\n _this.slotContainers.push(slotContainer);\r\n _this.addChild(slotContainer);\r\n _this.tempClipContainers.push(null);\r\n if (!attachment) {\r\n continue;\r\n }\r\n if (attachment.type === AttachmentType.Region) {\r\n var spriteName = attachment.name;\r\n var sprite = _this.createSprite(slot, attachment, spriteName);\r\n slot.currentSprite = sprite;\r\n slot.currentSpriteName = spriteName;\r\n slotContainer.addChild(sprite);\r\n }\r\n else if (attachment.type === AttachmentType.Mesh) {\r\n var mesh = _this.createMesh(slot, attachment);\r\n slot.currentMesh = mesh;\r\n slot.currentMeshId = attachment.id;\r\n slot.currentMeshName = attachment.name;\r\n slotContainer.addChild(mesh);\r\n }\r\n else if (attachment.type === AttachmentType.Clipping) {\r\n _this.createGraphics(slot, attachment);\r\n slotContainer.addChild(slot.clippingContainer);\r\n slotContainer.addChild(slot.currentGraphics);\r\n }\r\n }\r\n /**\r\n * The tint applied to all spine slots. This is a [r,g,b] value. A value of [1,1,1] will remove any tint effect.\r\n *\r\n * @member {number}\r\n * @memberof spine.Spine#\r\n */\r\n _this.tintRgb = new Float32Array([1, 1, 1]);\r\n _this.autoUpdate = true;\r\n _this.visible = true;\r\n return _this;\r\n }\r\n Object.defineProperty(SpineBase.prototype, \"debug\", {\r\n get: function () {\r\n return this._debug;\r\n },\r\n set: function (value) {\r\n var _a;\r\n if (value == this._debug) { // soft equality allows null == undefined\r\n return;\r\n }\r\n (_a = this._debug) === null || _a === void 0 ? void 0 : _a.unregisterSpine(this);\r\n value === null || value === void 0 ? void 0 : value.registerSpine(this);\r\n this._debug = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(SpineBase.prototype, \"autoUpdate\", {\r\n /**\r\n * If this flag is set to true, the spine animation will be automatically updated every\r\n * time the object id drawn. The down side of this approach is that the delta time is\r\n * automatically calculated and you could miss out on cool effects like slow motion,\r\n * pause, skip ahead and the sorts. Most of these effects can be achieved even with\r\n * autoUpdate enabled but are harder to achieve.\r\n *\r\n * @member {boolean}\r\n * @memberof spine.Spine#\r\n * @default true\r\n */\r\n get: function () {\r\n return this._autoUpdate;\r\n },\r\n set: function (value) {\r\n if (value !== this._autoUpdate) {\r\n this._autoUpdate = value;\r\n this.updateTransform = value ? SpineBase.prototype.autoUpdateTransform : Container.prototype.updateTransform;\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(SpineBase.prototype, \"tint\", {\r\n /**\r\n * The tint applied to the spine object. This is a hex value. A value of 0xFFFFFF will remove any tint effect.\r\n *\r\n * @member {number}\r\n * @memberof spine.Spine#\r\n * @default 0xFFFFFF\r\n */\r\n get: function () {\r\n return rgb2hex(this.tintRgb);\r\n },\r\n set: function (value) {\r\n this.tintRgb = hex2rgb(value, this.tintRgb);\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(SpineBase.prototype, \"delayLimit\", {\r\n /**\r\n * Limit value for the update dt with Spine.globalDelayLimit\r\n * that can be overridden with localDelayLimit\r\n * @return {number} - Maximum processed dt value for the update\r\n */\r\n get: function () {\r\n var limit = typeof this.localDelayLimit !== \"undefined\" ?\r\n this.localDelayLimit : settings.GLOBAL_DELAY_LIMIT;\r\n // If limit is 0, this means there is no limit for the delay\r\n return limit || Number.MAX_VALUE;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Update the spine skeleton and its animations by delta time (dt)\r\n *\r\n * @param dt {number} Delta time. Time by which the animation should be updated\r\n */\r\n SpineBase.prototype.update = function (dt) {\r\n var _a;\r\n // Limit delta value to avoid animation jumps\r\n var delayLimit = this.delayLimit;\r\n if (dt > delayLimit)\r\n dt = delayLimit;\r\n this.state.update(dt);\r\n this.state.apply(this.skeleton);\r\n //check we haven't been destroyed via a spine event callback in state update\r\n if (!this.skeleton)\r\n return;\r\n this.skeleton.updateWorldTransform();\r\n var slots = this.skeleton.slots;\r\n // in case pixi has double tint\r\n var globalClr = this.color;\r\n var light = null, dark = null;\r\n if (globalClr) {\r\n light = globalClr.light;\r\n dark = globalClr.dark;\r\n }\r\n else {\r\n light = this.tintRgb;\r\n }\r\n // let thack = false;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n var slotContainer = this.slotContainers[i];\r\n if (!attachment) {\r\n slotContainer.visible = false;\r\n continue;\r\n }\r\n var spriteColor = null;\r\n if (attachment.sequence) {\r\n attachment.sequence.apply(slot, attachment);\r\n }\r\n var region = attachment.region;\r\n var attColor = attachment.color;\r\n switch (attachment != null && attachment.type) {\r\n case AttachmentType.Region:\r\n var transform = slotContainer.transform;\r\n transform.setFromMatrix(slot.bone.matrix);\r\n region = attachment.region;\r\n if (slot.currentMesh) {\r\n slot.currentMesh.visible = false;\r\n slot.currentMesh = null;\r\n slot.currentMeshId = undefined;\r\n slot.currentMeshName = undefined;\r\n }\r\n if (!region) {\r\n if (slot.currentSprite) {\r\n slot.currentSprite.renderable = false;\r\n }\r\n break;\r\n }\r\n if (!slot.currentSpriteName || slot.currentSpriteName !== attachment.name) {\r\n var spriteName = attachment.name;\r\n if (slot.currentSprite) {\r\n slot.currentSprite.visible = false;\r\n }\r\n slot.sprites = slot.sprites || {};\r\n if (slot.sprites[spriteName] !== undefined) {\r\n slot.sprites[spriteName].visible = true;\r\n }\r\n else {\r\n var sprite = this.createSprite(slot, attachment, spriteName);\r\n slotContainer.addChild(sprite);\r\n }\r\n slot.currentSprite = slot.sprites[spriteName];\r\n slot.currentSpriteName = spriteName;\r\n // force sprite update when attachment name is same.\r\n // issues https://github.com/pixijs/pixi-spine/issues/318\r\n }\r\n slot.currentSprite.renderable = true;\r\n if (!slot.hackRegion) {\r\n this.setSpriteRegion(attachment, slot.currentSprite, region);\r\n }\r\n if (slot.currentSprite.color) {\r\n //YAY! double - tint!\r\n spriteColor = slot.currentSprite.color;\r\n }\r\n else {\r\n tempRgb[0] = light[0] * slot.color.r * attColor.r;\r\n tempRgb[1] = light[1] * slot.color.g * attColor.g;\r\n tempRgb[2] = light[2] * slot.color.b * attColor.b;\r\n slot.currentSprite.tint = rgb2hex(tempRgb);\r\n }\r\n slot.currentSprite.blendMode = slot.blendMode;\r\n break;\r\n case AttachmentType.Mesh:\r\n if (slot.currentSprite) {\r\n //TODO: refactor this thing, switch it on and off for container\r\n slot.currentSprite.visible = false;\r\n slot.currentSprite = null;\r\n slot.currentSpriteName = undefined;\r\n //TODO: refactor this shit\r\n var transform_1 = new Transform();\r\n transform_1._parentID = -1;\r\n transform_1._worldID = slotContainer.transform._worldID;\r\n slotContainer.transform = transform_1;\r\n }\r\n if (!region) {\r\n if (slot.currentMesh) {\r\n slot.currentMesh.renderable = false;\r\n }\r\n break;\r\n }\r\n var id = attachment.id;\r\n if (slot.currentMeshId === undefined || slot.currentMeshId !== id) {\r\n var meshId = id;\r\n if (slot.currentMesh) {\r\n slot.currentMesh.visible = false;\r\n }\r\n slot.meshes = slot.meshes || {};\r\n if (slot.meshes[meshId] !== undefined) {\r\n slot.meshes[meshId].visible = true;\r\n }\r\n else {\r\n var mesh = this.createMesh(slot, attachment);\r\n slotContainer.addChild(mesh);\r\n }\r\n slot.currentMesh = slot.meshes[meshId];\r\n slot.currentMeshName = attachment.name;\r\n slot.currentMeshId = meshId;\r\n }\r\n slot.currentMesh.renderable = true;\r\n attachment.computeWorldVerticesOld(slot, slot.currentMesh.vertices);\r\n if (slot.currentMesh.color) {\r\n // pixi-heaven\r\n spriteColor = slot.currentMesh.color;\r\n }\r\n else {\r\n tempRgb[0] = light[0] * slot.color.r * attColor.r;\r\n tempRgb[1] = light[1] * slot.color.g * attColor.g;\r\n tempRgb[2] = light[2] * slot.color.b * attColor.b;\r\n slot.currentMesh.tint = rgb2hex(tempRgb);\r\n }\r\n slot.currentMesh.blendMode = slot.blendMode;\r\n if (!slot.hackRegion) {\r\n this.setMeshRegion(attachment, slot.currentMesh, region);\r\n }\r\n break;\r\n case AttachmentType.Clipping:\r\n if (!slot.currentGraphics) {\r\n this.createGraphics(slot, attachment);\r\n slotContainer.addChild(slot.clippingContainer);\r\n slotContainer.addChild(slot.currentGraphics);\r\n }\r\n this.updateGraphics(slot, attachment);\r\n slotContainer.alpha = 1.0;\r\n slotContainer.visible = true;\r\n continue;\r\n default:\r\n slotContainer.visible = false;\r\n continue;\r\n }\r\n slotContainer.visible = true;\r\n // pixi has double tint\r\n if (spriteColor) {\r\n var r0 = slot.color.r * attColor.r;\r\n var g0 = slot.color.g * attColor.g;\r\n var b0 = slot.color.b * attColor.b;\r\n //YAY! double-tint!\r\n spriteColor.setLight(light[0] * r0 + dark[0] * (1.0 - r0), light[1] * g0 + dark[1] * (1.0 - g0), light[2] * b0 + dark[2] * (1.0 - b0));\r\n if (slot.darkColor) {\r\n r0 = slot.darkColor.r;\r\n g0 = slot.darkColor.g;\r\n b0 = slot.darkColor.b;\r\n }\r\n else {\r\n r0 = 0.0;\r\n g0 = 0.0;\r\n b0 = 0.0;\r\n }\r\n spriteColor.setDark(light[0] * r0 + dark[0] * (1 - r0), light[1] * g0 + dark[1] * (1 - g0), light[2] * b0 + dark[2] * (1 - b0));\r\n }\r\n slotContainer.alpha = slot.color.a;\r\n }\r\n //== this is clipping implementation ===\r\n //TODO: remove parent hacks when pixi masks allow it\r\n var drawOrder = this.skeleton.drawOrder;\r\n var clippingAttachment = null;\r\n var clippingContainer = null;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = slots[drawOrder[i].data.index];\r\n var slotContainer = this.slotContainers[drawOrder[i].data.index];\r\n if (!clippingContainer) {\r\n //Adding null check as it is possible for slotContainer.parent to be null in the event of a spine being disposed off in its loop callback\r\n if (slotContainer.parent !== null && slotContainer.parent !== this) {\r\n slotContainer.parent.removeChild(slotContainer);\r\n //silend add hack\r\n slotContainer.parent = this;\r\n }\r\n }\r\n if (slot.currentGraphics && slot.getAttachment()) {\r\n clippingContainer = slot.clippingContainer;\r\n clippingAttachment = slot.getAttachment();\r\n clippingContainer.children.length = 0;\r\n this.children[i] = slotContainer;\r\n if (clippingAttachment.endSlot === slot.data) {\r\n clippingAttachment.endSlot = null;\r\n }\r\n }\r\n else {\r\n if (clippingContainer) {\r\n var c = this.tempClipContainers[i];\r\n if (!c) {\r\n c = this.tempClipContainers[i] = this.newContainer();\r\n c.visible = false;\r\n }\r\n this.children[i] = c;\r\n //silent remove hack\r\n slotContainer.parent = null;\r\n clippingContainer.addChild(slotContainer);\r\n if (clippingAttachment.endSlot == slot.data) {\r\n clippingContainer.renderable = true;\r\n clippingContainer = null;\r\n clippingAttachment = null;\r\n }\r\n }\r\n else {\r\n this.children[i] = slotContainer;\r\n }\r\n }\r\n }\r\n // if you can debug, then debug!\r\n (_a = this._debug) === null || _a === void 0 ? void 0 : _a.renderDebug(this);\r\n };\r\n SpineBase.prototype.setSpriteRegion = function (attachment, sprite, region) {\r\n // prevent setters calling when attachment and region is same\r\n if (sprite.attachment === attachment && sprite.region === region) {\r\n return;\r\n }\r\n sprite.region = region;\r\n sprite.attachment = attachment;\r\n sprite.texture = region.texture;\r\n sprite.rotation = attachment.rotation * MathUtils.degRad;\r\n sprite.position.x = attachment.x;\r\n sprite.position.y = attachment.y;\r\n sprite.alpha = attachment.color.a;\r\n if (!region.size) {\r\n sprite.scale.x = attachment.scaleX * attachment.width / region.originalWidth;\r\n sprite.scale.y = -attachment.scaleY * attachment.height / region.originalHeight;\r\n }\r\n else {\r\n //hacked!\r\n sprite.scale.x = region.size.width / region.originalWidth;\r\n sprite.scale.y = -region.size.height / region.originalHeight;\r\n }\r\n };\r\n SpineBase.prototype.setMeshRegion = function (attachment, mesh, region) {\r\n if (mesh.attachment === attachment && mesh.region === region) {\r\n return;\r\n }\r\n mesh.region = region;\r\n mesh.attachment = attachment;\r\n mesh.texture = region.texture;\r\n region.texture.updateUvs();\r\n mesh.uvBuffer.update(attachment.regionUVs);\r\n };\r\n /**\r\n * When autoupdate is set to yes this function is used as pixi's updateTransform function\r\n *\r\n * @private\r\n */\r\n SpineBase.prototype.autoUpdateTransform = function () {\r\n if (settings.GLOBAL_AUTO_UPDATE) {\r\n this.lastTime = this.lastTime || Date.now();\r\n var timeDelta = (Date.now() - this.lastTime) * 0.001;\r\n this.lastTime = Date.now();\r\n this.update(timeDelta);\r\n }\r\n else {\r\n this.lastTime = 0;\r\n }\r\n Container.prototype.updateTransform.call(this);\r\n };\r\n /**\r\n * Create a new sprite to be used with core.RegionAttachment\r\n *\r\n * @param slot {spine.Slot} The slot to which the attachment is parented\r\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\r\n * @private\r\n */\r\n SpineBase.prototype.createSprite = function (slot, attachment, defName) {\r\n var region = attachment.region;\r\n if (slot.hackAttachment === attachment) {\r\n region = slot.hackRegion;\r\n }\r\n var texture = region ? region.texture : null;\r\n var sprite = this.newSprite(texture);\r\n sprite.anchor.set(0.5);\r\n if (region) {\r\n this.setSpriteRegion(attachment, sprite, attachment.region);\r\n }\r\n slot.sprites = slot.sprites || {};\r\n slot.sprites[defName] = sprite;\r\n return sprite;\r\n };\r\n /**\r\n * Creates a Strip from the spine data\r\n * @param slot {spine.Slot} The slot to which the attachment is parented\r\n * @param attachment {spine.RegionAttachment} The attachment that the sprite will represent\r\n * @private\r\n */\r\n SpineBase.prototype.createMesh = function (slot, attachment) {\r\n var region = attachment.region;\r\n if (slot.hackAttachment === attachment) {\r\n region = slot.hackRegion;\r\n slot.hackAttachment = null;\r\n slot.hackRegion = null;\r\n }\r\n var strip = this.newMesh(region ? region.texture : null, new Float32Array(attachment.regionUVs.length), attachment.regionUVs, new Uint16Array(attachment.triangles), DRAW_MODES.TRIANGLES);\r\n if (typeof strip._canvasPadding !== \"undefined\") {\r\n strip._canvasPadding = 1.5;\r\n }\r\n strip.alpha = attachment.color.a;\r\n strip.region = attachment.region;\r\n if (region) {\r\n this.setMeshRegion(attachment, strip, region);\r\n }\r\n slot.meshes = slot.meshes || {};\r\n slot.meshes[attachment.id] = strip;\r\n return strip;\r\n };\r\n //@ts-ignore\r\n SpineBase.prototype.createGraphics = function (slot, clip) {\r\n var graphics = this.newGraphics();\r\n var poly = new Polygon([]);\r\n graphics.clear();\r\n graphics.beginFill(0xffffff, 1);\r\n graphics.drawPolygon(poly);\r\n graphics.renderable = false;\r\n slot.currentGraphics = graphics;\r\n slot.clippingContainer = this.newContainer();\r\n slot.clippingContainer.mask = slot.currentGraphics;\r\n return graphics;\r\n };\r\n SpineBase.prototype.updateGraphics = function (slot, clip) {\r\n var geom = slot.currentGraphics.geometry;\r\n var vertices = geom.graphicsData[0].shape.points;\r\n var n = clip.worldVerticesLength;\r\n vertices.length = n;\r\n clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\r\n geom.invalidate();\r\n };\r\n /**\r\n * Changes texture in attachment in specific slot.\r\n *\r\n * PIXI runtime feature, it was made to satisfy our users.\r\n *\r\n * @param slotIndex {number}\r\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\r\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\r\n * @returns {boolean} Success flag\r\n */\r\n SpineBase.prototype.hackTextureBySlotIndex = function (slotIndex, texture, size) {\r\n if (texture === void 0) { texture = null; }\r\n if (size === void 0) { size = null; }\r\n var slot = this.skeleton.slots[slotIndex];\r\n if (!slot) {\r\n return false;\r\n }\r\n var attachment = slot.getAttachment();\r\n var region = attachment.region;\r\n if (texture) {\r\n region = new TextureRegion();\r\n region.texture = texture;\r\n region.size = size;\r\n slot.hackRegion = region;\r\n slot.hackAttachment = attachment;\r\n }\r\n else {\r\n slot.hackRegion = null;\r\n slot.hackAttachment = null;\r\n }\r\n if (slot.currentSprite) {\r\n this.setSpriteRegion(attachment, slot.currentSprite, region);\r\n }\r\n else if (slot.currentMesh) {\r\n this.setMeshRegion(attachment, slot.currentMesh, region);\r\n }\r\n return true;\r\n };\r\n /**\r\n * Changes texture in attachment in specific slot.\r\n *\r\n * PIXI runtime feature, it was made to satisfy our users.\r\n *\r\n * @param slotName {string}\r\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\r\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\r\n * @returns {boolean} Success flag\r\n */\r\n SpineBase.prototype.hackTextureBySlotName = function (slotName, texture, size) {\r\n if (texture === void 0) { texture = null; }\r\n if (size === void 0) { size = null; }\r\n var index = this.skeleton.findSlotIndex(slotName);\r\n if (index == -1) {\r\n return false;\r\n }\r\n return this.hackTextureBySlotIndex(index, texture, size);\r\n };\r\n /**\r\n * Changes texture of an attachment\r\n *\r\n * PIXI runtime feature, it was made to satisfy our users.\r\n *\r\n * @param slotName {string}\r\n * @param attachmentName {string}\r\n * @param [texture = null] {PIXI.Texture} If null, take default (original) texture\r\n * @param [size = null] {PIXI.Point} sometimes we need new size for region attachment, you can pass 'texture.orig' there\r\n * @returns {boolean} Success flag\r\n */\r\n SpineBase.prototype.hackTextureAttachment = function (slotName, attachmentName, texture, size) {\r\n if (size === void 0) { size = null; }\r\n // changes the texture of an attachment at the skeleton level\r\n var slotIndex = this.skeleton.findSlotIndex(slotName);\r\n var attachment = this.skeleton.getAttachmentByName(slotName, attachmentName);\r\n attachment.region.texture = texture;\r\n var slot = this.skeleton.slots[slotIndex];\r\n if (!slot) {\r\n return false;\r\n }\r\n // gets the currently active attachment in this slot\r\n var currentAttachment = slot.getAttachment();\r\n if (attachmentName === currentAttachment.name) {\r\n // if the attachment we are changing is currently active, change the the live texture\r\n var region = attachment.region;\r\n if (texture) {\r\n region = new TextureRegion();\r\n region.texture = texture;\r\n region.size = size;\r\n slot.hackRegion = region;\r\n slot.hackAttachment = currentAttachment;\r\n }\r\n else {\r\n slot.hackRegion = null;\r\n slot.hackAttachment = null;\r\n }\r\n if (slot.currentSprite && slot.currentSprite.region != region) {\r\n this.setSpriteRegion(currentAttachment, slot.currentSprite, region);\r\n slot.currentSprite.region = region;\r\n }\r\n else if (slot.currentMesh && slot.currentMesh.region != region) {\r\n this.setMeshRegion(currentAttachment, slot.currentMesh, region);\r\n }\r\n return true;\r\n }\r\n return false;\r\n };\r\n //those methods can be overriden to spawn different classes\r\n SpineBase.prototype.newContainer = function () {\r\n return new Container();\r\n };\r\n SpineBase.prototype.newSprite = function (tex) {\r\n return new SpineSprite(tex);\r\n };\r\n SpineBase.prototype.newGraphics = function () {\r\n return new Graphics();\r\n };\r\n SpineBase.prototype.newMesh = function (texture, vertices, uvs, indices, drawMode) {\r\n return new SpineMesh(texture, vertices, uvs, indices, drawMode);\r\n };\r\n SpineBase.prototype.transformHack = function () {\r\n return 1;\r\n };\r\n /**\r\n * Hack for pixi-display and pixi-lights. Every attachment name ending with a suffix will be added to different layer\r\n * @param nameSuffix\r\n * @param group\r\n * @param outGroup\r\n */\r\n SpineBase.prototype.hackAttachmentGroups = function (nameSuffix, group, outGroup) {\r\n if (!nameSuffix) {\r\n return undefined;\r\n }\r\n var list_d = [], list_n = [];\r\n for (var i = 0, len = this.skeleton.slots.length; i < len; i++) {\r\n var slot = this.skeleton.slots[i];\r\n var name_1 = slot.currentSpriteName || slot.currentMeshName || \"\";\r\n var target = slot.currentSprite || slot.currentMesh;\r\n if (name_1.endsWith(nameSuffix)) {\r\n target.parentGroup = group;\r\n list_n.push(target);\r\n }\r\n else if (outGroup && target) {\r\n target.parentGroup = outGroup;\r\n list_d.push(target);\r\n }\r\n }\r\n return [list_d, list_n];\r\n };\r\n SpineBase.prototype.destroy = function (options) {\r\n this.debug = null; // setter will do the cleanup\r\n for (var i = 0, n = this.skeleton.slots.length; i < n; i++) {\r\n var slot = this.skeleton.slots[i];\r\n for (var name_2 in slot.meshes) {\r\n slot.meshes[name_2].destroy(options);\r\n }\r\n slot.meshes = null;\r\n for (var name_3 in slot.sprites) {\r\n slot.sprites[name_3].destroy(options);\r\n }\r\n slot.sprites = null;\r\n }\r\n for (var i = 0, n = this.slotContainers.length; i < n; i++) {\r\n this.slotContainers[i].destroy(options);\r\n }\r\n this.spineData = null;\r\n this.skeleton = null;\r\n this.slotContainers = null;\r\n this.stateData = null;\r\n this.state = null;\r\n this.tempClipContainers = null;\r\n _super.prototype.destroy.call(this, options);\r\n };\r\n SpineBase.clippingPolygon = [];\r\n return SpineBase;\r\n}(Container));\r\n/**\r\n * The visibility of the spine object. If false the object will not be drawn,\r\n * the updateTransform function will not be called, and the spine will not be automatically updated.\r\n *\r\n * @member {boolean}\r\n * @memberof spine.Spine#\r\n * @default true\r\n */\r\nObject.defineProperty(SpineBase.prototype, 'visible', {\r\n get: function () {\r\n return this._visible;\r\n },\r\n set: function (value) {\r\n if (value !== this._visible) {\r\n this._visible = value;\r\n if (value) {\r\n this.lastTime = 0;\r\n }\r\n }\r\n }\r\n});\n\n/**\r\n * This is a debug renderer that uses PixiJS Graphics under the hood.\r\n * @public\r\n */\r\nvar SpineDebugRenderer = /** @class */ (function () {\r\n function SpineDebugRenderer() {\r\n this.registeredSpines = new Map();\r\n this.drawDebug = true;\r\n this.drawMeshHull = true;\r\n this.drawMeshTriangles = true;\r\n this.drawBones = true;\r\n this.drawPaths = true;\r\n this.drawBoundingBoxes = true;\r\n this.drawClipping = true;\r\n this.drawRegionAttachments = true;\r\n this.lineWidth = 1;\r\n this.regionAttachmentsColor = 0x0078ff;\r\n this.meshHullColor = 0x0078ff;\r\n this.meshTrianglesColor = 0xffcc00;\r\n this.clippingPolygonColor = 0xff00ff;\r\n this.boundingBoxesRectColor = 0x00ff00;\r\n this.boundingBoxesPolygonColor = 0x00ff00;\r\n this.boundingBoxesCircleColor = 0x00ff00;\r\n this.pathsCurveColor = 0xff0000;\r\n this.pathsLineColor = 0xff00ff;\r\n this.skeletonXYColor = 0xff0000;\r\n this.bonesColor = 0x00eecc;\r\n }\r\n /**\r\n * The debug is attached by force to each spine object. So we need to create it inside the spine when we get the first update\r\n */\r\n SpineDebugRenderer.prototype.registerSpine = function (spine) {\r\n if (this.registeredSpines.has(spine)) {\r\n console.warn(\"SpineDebugRenderer.registerSpine() - this spine is already registered!\", spine);\r\n }\r\n var debugDisplayObjects = {\r\n parentDebugContainer: new Container(),\r\n bones: new Container(),\r\n skeletonXY: new Graphics(),\r\n regionAttachmentsShape: new Graphics(),\r\n meshTrianglesLine: new Graphics(),\r\n meshHullLine: new Graphics(),\r\n clippingPolygon: new Graphics(),\r\n boundingBoxesRect: new Graphics(),\r\n boundingBoxesCircle: new Graphics(),\r\n boundingBoxesPolygon: new Graphics(),\r\n pathsCurve: new Graphics(),\r\n pathsLine: new Graphics(),\r\n };\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.bones);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.skeletonXY);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.regionAttachmentsShape);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.meshTrianglesLine);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.meshHullLine);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.clippingPolygon);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesRect);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesCircle);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.boundingBoxesPolygon);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.pathsCurve);\r\n debugDisplayObjects.parentDebugContainer.addChild(debugDisplayObjects.pathsLine);\r\n spine.addChild(debugDisplayObjects.parentDebugContainer);\r\n this.registeredSpines.set(spine, debugDisplayObjects);\r\n };\r\n SpineDebugRenderer.prototype.renderDebug = function (spine) {\r\n if (!this.registeredSpines.has(spine)) {\r\n // This should never happen. Spines are registered when you assign spine.debug\r\n this.registerSpine(spine);\r\n }\r\n var debugDisplayObjects = this.registeredSpines.get(spine);\r\n debugDisplayObjects.skeletonXY.clear();\r\n debugDisplayObjects.regionAttachmentsShape.clear();\r\n debugDisplayObjects.meshTrianglesLine.clear();\r\n debugDisplayObjects.meshHullLine.clear();\r\n debugDisplayObjects.clippingPolygon.clear();\r\n debugDisplayObjects.boundingBoxesRect.clear();\r\n debugDisplayObjects.boundingBoxesCircle.clear();\r\n debugDisplayObjects.boundingBoxesPolygon.clear();\r\n debugDisplayObjects.pathsCurve.clear();\r\n debugDisplayObjects.pathsLine.clear();\r\n for (var len = debugDisplayObjects.bones.children.length; len > 0; len--) {\r\n debugDisplayObjects.bones.children[len - 1].destroy({ children: true, texture: true, baseTexture: true });\r\n }\r\n var scale = spine.scale.x || spine.scale.y || 1;\r\n var lineWidth = this.lineWidth / scale;\r\n if (this.drawBones) {\r\n this.drawBonesFunc(spine, debugDisplayObjects, lineWidth, scale);\r\n }\r\n if (this.drawPaths) {\r\n this.drawPathsFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawBoundingBoxes) {\r\n this.drawBoundingBoxesFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawClipping) {\r\n this.drawClippingFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawMeshHull || this.drawMeshTriangles) {\r\n this.drawMeshHullAndMeshTriangles(spine, debugDisplayObjects, lineWidth);\r\n }\r\n if (this.drawRegionAttachments) {\r\n this.drawRegionAttachmentsFunc(spine, debugDisplayObjects, lineWidth);\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawBonesFunc = function (spine, debugDisplayObjects, lineWidth, scale) {\r\n var skeleton = spine.skeleton;\r\n var skeletonX = skeleton.x;\r\n var skeletonY = skeleton.y;\r\n var bones = skeleton.bones;\r\n debugDisplayObjects.skeletonXY.lineStyle(lineWidth, this.skeletonXYColor, 1);\r\n for (var i = 0, len = bones.length; i < len; i++) {\r\n var bone = bones[i], boneLen = bone.data.length, starX = skeletonX + bone.matrix.tx, starY = skeletonY + bone.matrix.ty, endX = skeletonX + boneLen * bone.matrix.a + bone.matrix.tx, endY = skeletonY + boneLen * bone.matrix.b + bone.matrix.ty;\r\n if (bone.data.name === \"root\" || bone.data.parent === null) {\r\n continue;\r\n }\r\n // Triangle calculation formula\r\n // area: A=sqrt((a+b+c)*(-a+b+c)*(a-b+c)*(a+b-c))/4\r\n // alpha: alpha=acos((pow(b, 2)+pow(c, 2)-pow(a, 2))/(2*b*c))\r\n // beta: beta=acos((pow(a, 2)+pow(c, 2)-pow(b, 2))/(2*a*c))\r\n // gamma: gamma=acos((pow(a, 2)+pow(b, 2)-pow(c, 2))/(2*a*b))\r\n var w = Math.abs(starX - endX), h = Math.abs(starY - endY), \r\n // a = w, // side length a\r\n a2 = Math.pow(w, 2), // square root of side length a\r\n b = h, // side length b\r\n b2 = Math.pow(h, 2), // square root of side length b\r\n c = Math.sqrt(a2 + b2), // side length c\r\n c2 = Math.pow(c, 2), // square root of side length c\r\n rad = Math.PI / 180, \r\n // A = Math.acos([a2 + c2 - b2] / [2 * a * c]) || 0, // Angle A\r\n // C = Math.acos([a2 + b2 - c2] / [2 * a * b]) || 0, // C angle\r\n B = Math.acos((c2 + b2 - a2) / (2 * b * c)) || 0; // angle of corner B\r\n if (c === 0) {\r\n continue;\r\n }\r\n var gp = new Graphics();\r\n debugDisplayObjects.bones.addChild(gp);\r\n // draw bone\r\n var refRation = c / 50 / scale;\r\n gp.beginFill(this.bonesColor, 1);\r\n gp.drawPolygon(0, 0, 0 - refRation, c - refRation * 3, 0, c - refRation, 0 + refRation, c - refRation * 3);\r\n gp.endFill();\r\n gp.x = starX;\r\n gp.y = starY;\r\n gp.pivot.y = c;\r\n // Calculate bone rotation angle\r\n var rotation = 0;\r\n if (starX < endX && starY < endY) {\r\n // bottom right\r\n rotation = -B + 180 * rad;\r\n }\r\n else if (starX > endX && starY < endY) {\r\n // bottom left\r\n rotation = 180 * rad + B;\r\n }\r\n else if (starX > endX && starY > endY) {\r\n // top left\r\n rotation = -B;\r\n }\r\n else if (starX < endX && starY > endY) {\r\n // bottom left\r\n rotation = B;\r\n }\r\n else if (starY === endY && starX < endX) {\r\n // To the right\r\n rotation = 90 * rad;\r\n }\r\n else if (starY === endY && starX > endX) {\r\n // go left\r\n rotation = -90 * rad;\r\n }\r\n else if (starX === endX && starY < endY) {\r\n // down\r\n rotation = 180 * rad;\r\n }\r\n else if (starX === endX && starY > endY) {\r\n // up\r\n rotation = 0;\r\n }\r\n gp.rotation = rotation;\r\n // Draw the starting rotation point of the bone\r\n gp.lineStyle(lineWidth + refRation / 2.4, this.bonesColor, 1);\r\n gp.beginFill(0x000000, 0.6);\r\n gp.drawCircle(0, c, refRation * 1.2);\r\n gp.endFill();\r\n }\r\n // Draw the skeleton starting point \"X\" form\r\n var startDotSize = lineWidth * 3;\r\n debugDisplayObjects.skeletonXY.moveTo(skeletonX - startDotSize, skeletonY - startDotSize);\r\n debugDisplayObjects.skeletonXY.lineTo(skeletonX + startDotSize, skeletonY + startDotSize);\r\n debugDisplayObjects.skeletonXY.moveTo(skeletonX + startDotSize, skeletonY - startDotSize);\r\n debugDisplayObjects.skeletonXY.lineTo(skeletonX - startDotSize, skeletonY + startDotSize);\r\n };\r\n SpineDebugRenderer.prototype.drawRegionAttachmentsFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.regionAttachmentsShape.lineStyle(lineWidth, this.regionAttachmentsColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i], attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Region) {\r\n continue;\r\n }\r\n var regionAttachment = attachment;\r\n var vertices = new Float32Array(8);\r\n regionAttachment === null || regionAttachment === void 0 ? void 0 : regionAttachment.updateOffset(); // We don't need this on all versions\r\n regionAttachment.computeWorldVertices(slot, vertices, 0, 2);\r\n debugDisplayObjects.regionAttachmentsShape.drawPolygon(Array.from(vertices.slice(0, 8)));\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawMeshHullAndMeshTriangles = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.meshHullLine.lineStyle(lineWidth, this.meshHullColor, 1);\r\n debugDisplayObjects.meshTrianglesLine.lineStyle(lineWidth, this.meshTrianglesColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active) {\r\n continue;\r\n }\r\n var attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Mesh) {\r\n continue;\r\n }\r\n var meshAttachment = attachment;\r\n var vertices = new Float32Array(meshAttachment.worldVerticesLength), triangles = meshAttachment.triangles;\r\n var hullLength = meshAttachment.hullLength;\r\n meshAttachment.computeWorldVertices(slot, 0, meshAttachment.worldVerticesLength, vertices, 0, 2);\r\n // draw the skinned mesh (triangle)\r\n if (this.drawMeshTriangles) {\r\n for (var i_1 = 0, len_1 = triangles.length; i_1 < len_1; i_1 += 3) {\r\n var v1 = triangles[i_1] * 2, v2 = triangles[i_1 + 1] * 2, v3 = triangles[i_1 + 2] * 2;\r\n debugDisplayObjects.meshTrianglesLine.moveTo(vertices[v1], vertices[v1 + 1]);\r\n debugDisplayObjects.meshTrianglesLine.lineTo(vertices[v2], vertices[v2 + 1]);\r\n debugDisplayObjects.meshTrianglesLine.lineTo(vertices[v3], vertices[v3 + 1]);\r\n }\r\n }\r\n // draw skin border\r\n if (this.drawMeshHull && hullLength > 0) {\r\n hullLength = (hullLength >> 1) * 2;\r\n var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\r\n for (var i_2 = 0, len_2 = hullLength; i_2 < len_2; i_2 += 2) {\r\n var x = vertices[i_2], y = vertices[i_2 + 1];\r\n debugDisplayObjects.meshHullLine.moveTo(x, y);\r\n debugDisplayObjects.meshHullLine.lineTo(lastX, lastY);\r\n lastX = x;\r\n lastY = y;\r\n }\r\n }\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawClippingFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.clippingPolygon.lineStyle(lineWidth, this.clippingPolygonColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active) {\r\n continue;\r\n }\r\n var attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Clipping) {\r\n continue;\r\n }\r\n var clippingAttachment = attachment;\r\n var nn = clippingAttachment.worldVerticesLength, world = new Float32Array(nn);\r\n clippingAttachment.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n debugDisplayObjects.clippingPolygon.drawPolygon(Array.from(world));\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawBoundingBoxesFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var _this = this;\r\n // draw the total outline of the bounding box\r\n debugDisplayObjects.boundingBoxesRect.lineStyle(lineWidth, this.boundingBoxesRectColor, 5);\r\n var bounds = new SkeletonBoundsBase();\r\n bounds.update(spine.skeleton, true);\r\n debugDisplayObjects.boundingBoxesRect.drawRect(bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\r\n var polygons = bounds.polygons, drawPolygon = function (polygonVertices, _offset, count) {\r\n debugDisplayObjects.boundingBoxesPolygon.lineStyle(lineWidth, _this.boundingBoxesPolygonColor, 1);\r\n debugDisplayObjects.boundingBoxesPolygon.beginFill(_this.boundingBoxesPolygonColor, 0.1);\r\n if (count < 3) {\r\n throw new Error(\"Polygon must contain at least 3 vertices\");\r\n }\r\n var paths = [], dotSize = lineWidth * 2;\r\n for (var i = 0, len = polygonVertices.length; i < len; i += 2) {\r\n var x1 = polygonVertices[i], y1 = polygonVertices[i + 1];\r\n // draw the bounding box node\r\n debugDisplayObjects.boundingBoxesCircle.lineStyle(0);\r\n debugDisplayObjects.boundingBoxesCircle.beginFill(_this.boundingBoxesCircleColor);\r\n debugDisplayObjects.boundingBoxesCircle.drawCircle(x1, y1, dotSize);\r\n debugDisplayObjects.boundingBoxesCircle.endFill();\r\n paths.push(x1, y1);\r\n }\r\n // draw the bounding box area\r\n debugDisplayObjects.boundingBoxesPolygon.drawPolygon(paths);\r\n debugDisplayObjects.boundingBoxesPolygon.endFill();\r\n };\r\n for (var i = 0, len = polygons.length; i < len; i++) {\r\n var polygon = polygons[i];\r\n drawPolygon(polygon, 0, polygon.length);\r\n }\r\n };\r\n SpineDebugRenderer.prototype.drawPathsFunc = function (spine, debugDisplayObjects, lineWidth) {\r\n var skeleton = spine.skeleton;\r\n var slots = skeleton.slots;\r\n debugDisplayObjects.pathsCurve.lineStyle(lineWidth, this.pathsCurveColor, 1);\r\n debugDisplayObjects.pathsLine.lineStyle(lineWidth, this.pathsLineColor, 1);\r\n for (var i = 0, len = slots.length; i < len; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active) {\r\n continue;\r\n }\r\n var attachment = slot.getAttachment();\r\n if (attachment == null || attachment.type !== AttachmentType.Path) {\r\n continue;\r\n }\r\n var pathAttachment = attachment;\r\n var nn = pathAttachment.worldVerticesLength;\r\n var world = new Float32Array(nn);\r\n pathAttachment.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\r\n if (pathAttachment.closed) {\r\n var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\r\n x2 = world[nn - 4];\r\n y2 = world[nn - 3];\r\n // curve\r\n debugDisplayObjects.pathsCurve.moveTo(x1, y1);\r\n debugDisplayObjects.pathsCurve.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);\r\n // handle\r\n debugDisplayObjects.pathsLine.moveTo(x1, y1);\r\n debugDisplayObjects.pathsLine.lineTo(cx1, cy1);\r\n debugDisplayObjects.pathsLine.moveTo(x2, y2);\r\n debugDisplayObjects.pathsLine.lineTo(cx2, cy2);\r\n }\r\n nn -= 4;\r\n for (var ii = 4; ii < nn; ii += 6) {\r\n var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\r\n x2 = world[ii + 4];\r\n y2 = world[ii + 5];\r\n // curve\r\n debugDisplayObjects.pathsCurve.moveTo(x1, y1);\r\n debugDisplayObjects.pathsCurve.bezierCurveTo(cx1, cy1, cx2, cy2, x2, y2);\r\n // handle\r\n debugDisplayObjects.pathsLine.moveTo(x1, y1);\r\n debugDisplayObjects.pathsLine.lineTo(cx1, cy1);\r\n debugDisplayObjects.pathsLine.moveTo(x2, y2);\r\n debugDisplayObjects.pathsLine.lineTo(cx2, cy2);\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n }\r\n };\r\n SpineDebugRenderer.prototype.unregisterSpine = function (spine) {\r\n if (!this.registeredSpines.has(spine)) {\r\n console.warn(\"SpineDebugRenderer.unregisterSpine() - spine is not registered, can't unregister!\", spine);\r\n }\r\n var debugDisplayObjects = this.registeredSpines.get(spine);\r\n debugDisplayObjects.parentDebugContainer.destroy({ baseTexture: true, children: true, texture: true });\r\n this.registeredSpines.delete(spine);\r\n };\r\n return SpineDebugRenderer;\r\n}());\n\nexport { AttachmentType, BinaryInput, Color, DebugUtils, IntSet, Interpolation, MathUtils, MixBlend, MixDirection, Pool, PositionMode, Pow, PowOut, RotateMode, SkeletonBoundsBase, SpineBase, SpineDebugRenderer, SpineMesh, SpineSprite, StringSet, TextureAtlas, TextureAtlasPage, TextureAtlasRegion, TextureFilter, TextureRegion, TextureWrap, TimeKeeper, TransformMode, Utils, Vector2, WindowedMean, filterFromString, settings, wrapFromString };\n//# sourceMappingURL=base.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/loader-base - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/loader-base is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev <ivan.popelyshev@gmail.com>, All Rights Reserved\n */\nimport { LoaderResource } from '@pixi/loaders';\nimport { BaseTexture } from '@pixi/core';\nimport { TextureAtlas } from '@pixi-spine/base';\nimport { ALPHA_MODES } from '@pixi/constants';\n\nfunction isJson(resource) {\r\n return resource.type === LoaderResource.TYPE.JSON;\r\n}\r\nfunction isBuffer(resource) {\r\n return resource.xhrType === LoaderResource.XHR_RESPONSE_TYPE.BUFFER;\r\n}\r\nLoaderResource.setExtensionXhrType('skel', LoaderResource.XHR_RESPONSE_TYPE.BUFFER);\r\n/**\r\n * @public\r\n */\r\nvar AbstractSpineParser = /** @class */ (function () {\r\n function AbstractSpineParser() {\r\n }\r\n AbstractSpineParser.prototype.genMiddleware = function () {\r\n var self = this;\r\n return {\r\n use: function (resource, next) {\r\n // skip if no data, its not json, or it isn't atlas data\r\n if (!resource.data) {\r\n return next();\r\n }\r\n var isJsonSpineModel = isJson(resource) && resource.data.bones;\r\n var isBinarySpineModel = isBuffer(resource) && (resource.extension === 'skel' || resource.metadata\r\n && resource.metadata.spineMetadata);\r\n if (!isJsonSpineModel && !isBinarySpineModel) {\r\n return next();\r\n }\r\n var parser = null;\r\n var dataToParse = resource.data;\r\n if (isJsonSpineModel) {\r\n parser = self.createJsonParser();\r\n }\r\n else {\r\n parser = self.createBinaryParser();\r\n if (resource.data instanceof ArrayBuffer) {\r\n dataToParse = new Uint8Array(resource.data);\r\n }\r\n }\r\n var metadata = (resource.metadata || {});\r\n var metadataSkeletonScale = metadata ? metadata.spineSkeletonScale : null;\r\n if (metadataSkeletonScale) {\r\n parser.scale = metadataSkeletonScale;\r\n }\r\n var metadataAtlas = metadata.spineAtlas;\r\n if (metadataAtlas === false) {\r\n return next();\r\n }\r\n if (metadataAtlas && metadataAtlas.pages) {\r\n self.parseData(resource, parser, metadataAtlas, dataToParse);\r\n return next();\r\n }\r\n var metadataAtlasSuffix = metadata.spineAtlasSuffix || '.atlas';\r\n /**\r\n * use a bit of hackery to load the atlas file, here we assume that the .json, .atlas and .png files\r\n * that correspond to the spine file are in the same base URL and that the .json and .atlas files\r\n * have the same name\r\n */\r\n var atlasPath = resource.url;\r\n var queryStringPos = atlasPath.indexOf('?');\r\n if (queryStringPos > 0) {\r\n //remove querystring\r\n atlasPath = atlasPath.substr(0, queryStringPos);\r\n }\r\n atlasPath = atlasPath.substr(0, atlasPath.lastIndexOf('.')) + metadataAtlasSuffix;\r\n // use atlas path as a params. (no need to use same atlas file name with json file name)\r\n if (metadata.spineAtlasFile) {\r\n atlasPath = metadata.spineAtlasFile;\r\n }\r\n //remove the baseUrl\r\n atlasPath = atlasPath.replace(this.baseUrl, '');\r\n var atlasOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n xhrType: LoaderResource.XHR_RESPONSE_TYPE.TEXT,\r\n metadata: metadata.spineMetadata || null,\r\n parentResource: resource\r\n };\r\n var imageOptions = {\r\n crossOrigin: resource.crossOrigin,\r\n metadata: metadata.imageMetadata || null,\r\n parentResource: resource\r\n };\r\n var baseUrl = resource.url.substr(0, resource.url.lastIndexOf('/') + 1);\r\n //remove the baseUrl\r\n baseUrl = baseUrl.replace(this.baseUrl, '');\r\n var namePrefix = metadata.imageNamePrefix || (resource.name + '_atlas_page_');\r\n var adapter = metadata.images ? staticImageLoader(metadata.images)\r\n : metadata.image ? staticImageLoader({ 'default': metadata.image })\r\n : metadata.imageLoader ? metadata.imageLoader(this, namePrefix, baseUrl, imageOptions)\r\n : imageLoaderAdapter(this, namePrefix, baseUrl, imageOptions);\r\n function createSkeletonWithRawAtlas(rawData) {\r\n new TextureAtlas(rawData, adapter, function (spineAtlas) {\r\n if (spineAtlas) {\r\n self.parseData(resource, parser, spineAtlas, dataToParse);\r\n }\r\n next();\r\n });\r\n }\r\n if (metadata.atlasRawData) {\r\n createSkeletonWithRawAtlas(metadata.atlasRawData);\r\n }\r\n else {\r\n this.add(resource.name + '_atlas', atlasPath, atlasOptions, function (atlasResource) {\r\n if (!atlasResource.error) {\r\n createSkeletonWithRawAtlas(atlasResource.data);\r\n }\r\n else {\r\n next();\r\n }\r\n });\r\n }\r\n }\r\n };\r\n };\r\n return AbstractSpineParser;\r\n}());\r\n/**\r\n * @public\r\n */\r\nfunction imageLoaderAdapter(loader, namePrefix, baseUrl, imageOptions) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length - 1)) {\r\n baseUrl += '/';\r\n }\r\n return function (line, callback) {\r\n var name = namePrefix + line;\r\n var url = baseUrl + line;\r\n var cachedResource = loader.resources[name];\r\n if (cachedResource) {\r\n var done = function () {\r\n callback(cachedResource.texture.baseTexture);\r\n };\r\n if (cachedResource.texture) {\r\n done();\r\n }\r\n else {\r\n cachedResource.onAfterMiddleware.add(done);\r\n }\r\n }\r\n else {\r\n loader.add(name, url, imageOptions, function (resource) {\r\n if (!resource.error) {\r\n if (line.indexOf('-pma.') >= 0) {\r\n resource.texture.baseTexture.alphaMode = ALPHA_MODES.PMA;\r\n }\r\n callback(resource.texture.baseTexture);\r\n }\r\n else {\r\n callback(null);\r\n }\r\n });\r\n }\r\n };\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction syncImageLoaderAdapter(baseUrl, crossOrigin) {\r\n if (baseUrl && baseUrl.lastIndexOf('/') !== (baseUrl.length - 1)) {\r\n baseUrl += '/';\r\n }\r\n return function (line, callback) {\r\n callback(BaseTexture.from(line, crossOrigin));\r\n };\r\n}\r\n/**\r\n * @public\r\n */\r\nfunction staticImageLoader(pages) {\r\n return function (line, callback) {\r\n var page = pages[line] || pages['default'];\r\n if (page && page.baseTexture)\r\n callback(page.baseTexture);\r\n else\r\n callback(page);\r\n };\r\n}\n\nexport { AbstractSpineParser, imageLoaderAdapter, staticImageLoader, syncImageLoaderAdapter };\n//# sourceMappingURL=loader-base.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/runtime-3.8 - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/runtime-3.8 is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev <ivan.popelyshev@gmail.com>, All Rights Reserved\n */\nimport { Utils, AttachmentType, Color, MathUtils, PowOut, MixBlend, MixDirection, IntSet, Pool, settings, TransformMode, RotateMode, PositionMode, Vector2, BinaryInput, SkeletonBoundsBase, SpineBase } from '@pixi-spine/base';\nimport { Matrix } from '@pixi/math';\nimport { BLEND_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nvar Attachment = /** @class */ (function () {\r\n function Attachment(name) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar VertexAttachment = /** @class */ (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n _this.worldVerticesLength = 0;\r\n _this.deformAttachment = _this;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVerticesOld = function (slot, worldVertices) {\r\n this.computeWorldVertices(slot, 0, this.worldVerticesLength, worldVertices, 0, 2);\r\n };\r\n /** Transforms local vertices to world coordinates.\r\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\r\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\r\n * @param offset The worldVertices index to begin writing values. */\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.deform;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var mat = slot.bone.matrix;\r\n var x = mat.tx;\r\n var y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n VertexAttachment.prototype.copyTo = function (attachment) {\r\n if (this.bones != null) {\r\n attachment.bones = new Array(this.bones.length);\r\n Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\r\n }\r\n else\r\n attachment.bones = null;\r\n if (this.vertices != null) {\r\n attachment.vertices = Utils.newFloatArray(this.vertices.length);\r\n Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\r\n }\r\n else\r\n attachment.vertices = null;\r\n attachment.worldVerticesLength = this.worldVerticesLength;\r\n attachment.deformAttachment = this.deformAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar BoundingBoxAttachment = /** @class */ (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.BoundingBox;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n BoundingBoxAttachment.prototype.copy = function () {\r\n var copy = new BoundingBoxAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return BoundingBoxAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar ClippingAttachment = /** @class */ (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Clipping;\r\n // Nonessential.\r\n _this.color = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\r\n return _this;\r\n }\r\n ClippingAttachment.prototype.copy = function () {\r\n var copy = new ClippingAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.endSlot = this.endSlot;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return ClippingAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar MeshAttachment = /** @class */ (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Mesh;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.tempColor = new Color(0, 0, 0, 0);\r\n return _this;\r\n }\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n /** @param parentMesh May be null. */\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n MeshAttachment.prototype.copy = function () {\r\n if (this.parentMesh != null)\r\n return this.newLinkedMesh();\r\n var copy = new MeshAttachment(this.name);\r\n copy.region = this.region;\r\n copy.path = this.path;\r\n copy.color.setFromColor(this.color);\r\n this.copyTo(copy);\r\n copy.regionUVs = new Float32Array(this.regionUVs.length);\r\n Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\r\n copy.triangles = new Array(this.triangles.length);\r\n Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\r\n copy.hullLength = this.hullLength;\r\n // Nonessential.\r\n if (this.edges != null) {\r\n copy.edges = new Array(this.edges.length);\r\n Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\r\n }\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n return copy;\r\n };\r\n MeshAttachment.prototype.newLinkedMesh = function () {\r\n var copy = new MeshAttachment(this.name);\r\n copy.region = this.region;\r\n copy.path = this.path;\r\n copy.color.setFromColor(this.color);\r\n copy.deformAttachment = this.deformAttachment;\r\n copy.setParentMesh(this.parentMesh != null ? this.parentMesh : this);\r\n // copy.updateUVs();\r\n return copy;\r\n };\r\n return MeshAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PathAttachment = /** @class */ (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Path;\r\n _this.closed = false;\r\n _this.constantSpeed = false;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n PathAttachment.prototype.copy = function () {\r\n var copy = new PathAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.lengths = new Array(this.lengths.length);\r\n Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\r\n copy.closed = closed;\r\n copy.constantSpeed = this.constantSpeed;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PathAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PointAttachment = /** @class */ (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Point;\r\n _this.color = new Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n var mat = bone.matrix;\r\n point.x = this.x * mat.a + this.y * mat.c + bone.worldX;\r\n point.y = this.x * mat.b + this.y * mat.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var mat = bone.matrix;\r\n var cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\r\n var x = cos * mat.a + sin * mat.c;\r\n var y = cos * mat.b + sin * mat.d;\r\n return Math.atan2(y, x) * MathUtils.radDeg;\r\n };\r\n PointAttachment.prototype.copy = function () {\r\n var copy = new PointAttachment(this.name);\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.rotation = this.rotation;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PointAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar Slot = /** @class */ (function () {\r\n function Slot(data, bone) {\r\n this.deform = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (bone == null)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.darkColor = data.darkColor == null ? null : new Color();\r\n this.setToSetupPose();\r\n this.blendMode = this.data.blendMode;\r\n }\r\n /** @return May be null. */\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.deform.length = 0;\r\n };\r\n Slot.prototype.setAttachmentTime = function (time) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n };\r\n /** Returns the time since the attachment was set. */\r\n Slot.prototype.getAttachmentTime = function () {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n };\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor != null)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar RegionAttachment = /** @class */ (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Region;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.scaleX = 1;\r\n _this.scaleY = 1;\r\n _this.rotation = 0;\r\n _this.width = 0;\r\n _this.height = 0;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.offset = Utils.newFloatArray(8);\r\n _this.uvs = Utils.newFloatArray(8);\r\n _this.tempColor = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n RegionAttachment.prototype.updateOffset = function () {\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var localXCos = localX * cos + this.x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + this.y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + this.x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + this.y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[RegionAttachment.OX1] = localXCos - localYSin;\r\n offset[RegionAttachment.OY1] = localYCos + localXSin;\r\n offset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n offset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n offset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n offset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n };\r\n RegionAttachment.prototype.setRegion = function (region) {\r\n this.region = region;\r\n var uvs = this.uvs;\r\n if (region.rotate) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n var vertexOffset = this.offset;\r\n var mat = bone instanceof Slot ? bone.bone.matrix : bone.matrix;\r\n var x = mat.tx, y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[RegionAttachment.OX1];\r\n offsetY = vertexOffset[RegionAttachment.OY1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // br\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX2];\r\n offsetY = vertexOffset[RegionAttachment.OY2];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // bl\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX3];\r\n offsetY = vertexOffset[RegionAttachment.OY3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ul\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX4];\r\n offsetY = vertexOffset[RegionAttachment.OY4];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ur\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.prototype.copy = function () {\r\n var copy = new RegionAttachment(this.name);\r\n copy.region = this.region;\r\n copy.rendererObject = this.rendererObject;\r\n copy.path = this.path;\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.scaleX = this.scaleX;\r\n copy.scaleY = this.scaleY;\r\n copy.rotation = this.rotation;\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\r\n Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n RegionAttachment.OX1 = 0;\r\n RegionAttachment.OY1 = 1;\r\n RegionAttachment.OX2 = 2;\r\n RegionAttachment.OY2 = 3;\r\n RegionAttachment.OX3 = 4;\r\n RegionAttachment.OY3 = 5;\r\n RegionAttachment.OX4 = 6;\r\n RegionAttachment.OY4 = 7;\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar JitterEffect = /** @class */ (function () {\r\n function JitterEffect(jitterX, jitterY) {\r\n this.jitterX = 0;\r\n this.jitterY = 0;\r\n this.jitterX = jitterX;\r\n this.jitterY = jitterY;\r\n }\r\n JitterEffect.prototype.begin = function (skeleton) {\r\n };\r\n JitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n position.x += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n position.y += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n };\r\n JitterEffect.prototype.end = function () {\r\n };\r\n return JitterEffect;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SwirlEffect = /** @class */ (function () {\r\n function SwirlEffect(radius) {\r\n this.centerX = 0;\r\n this.centerY = 0;\r\n this.radius = 0;\r\n this.angle = 0;\r\n this.worldX = 0;\r\n this.worldY = 0;\r\n this.radius = radius;\r\n }\r\n SwirlEffect.prototype.begin = function (skeleton) {\r\n this.worldX = skeleton.x + this.centerX;\r\n this.worldY = skeleton.y + this.centerY;\r\n };\r\n SwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n var radAngle = this.angle * MathUtils.degreesToRadians;\r\n var x = position.x - this.worldX;\r\n var y = position.y - this.worldY;\r\n var dist = Math.sqrt(x * x + y * y);\r\n if (dist < this.radius) {\r\n var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n var cos = Math.cos(theta);\r\n var sin = Math.sin(theta);\r\n position.x = cos * x - sin * y + this.worldX;\r\n position.y = sin * x + cos * y + this.worldY;\r\n }\r\n };\r\n SwirlEffect.prototype.end = function () {\r\n };\r\n SwirlEffect.interpolation = new PowOut(2);\r\n return SwirlEffect;\r\n}());\n\n/** A simple container for a list of timelines and a name. */\r\n/**\r\n * @public\r\n */\r\nvar Animation = /** @class */ (function () {\r\n function Animation(name, timelines, duration) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (timelines == null)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.timelineIds = [];\r\n for (var i = 0; i < timelines.length; i++)\r\n this.timelineIds[timelines[i].getPropertyId()] = true;\r\n this.duration = duration;\r\n }\r\n Animation.prototype.hasTimeline = function (id) {\r\n return this.timelineIds[id] == true;\r\n };\r\n /** Applies all the animation's timelines to the specified skeleton.\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @param loop If true, the animation repeats after {@link #getDuration()}.\r\n * @param events May be null to ignore fired events. */\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n /** @param target After the first and before the last value.\r\n * @returns index of first value greater than the target. */\r\n Animation.binarySearch = function (values, target, step) {\r\n if (step === void 0) { step = 1; }\r\n var low = 0;\r\n var high = values.length / step - 2;\r\n if (high == 0)\r\n return step;\r\n var current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high)\r\n return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n };\r\n Animation.linearSearch = function (values, target, step) {\r\n for (var i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target)\r\n return i;\r\n return -1;\r\n };\r\n return Animation;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TimelineType;\r\n(function (TimelineType) {\r\n TimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n TimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n TimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n TimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n TimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n TimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n TimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n TimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n TimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n TimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n TimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n TimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n TimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n TimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n TimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n})(TimelineType || (TimelineType = {}));\r\n/** The base class for timelines that use interpolation between key frame values. */\r\n/**\r\n * @public\r\n */\r\nvar CurveTimeline = /** @class */ (function () {\r\n function CurveTimeline(frameCount) {\r\n if (frameCount <= 0)\r\n throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n /** The number of key frames for this timeline. */\r\n CurveTimeline.prototype.getFrameCount = function () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n };\r\n /** Sets the specified key frame to linear interpolation. */\r\n CurveTimeline.prototype.setLinear = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n };\r\n /** Sets the specified key frame to stepped interpolation. */\r\n CurveTimeline.prototype.setStepped = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n };\r\n /** Returns the interpolation type for the specified key frame.\r\n * @returns Linear is 0, stepped is 1, Bezier is 2. */\r\n CurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n var index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length)\r\n return CurveTimeline.LINEAR;\r\n var type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR)\r\n return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED)\r\n return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n };\r\n /** Sets the specified key frame to Bezier interpolation. `cx1` and `cx2` are from 0 to 1,\r\n * representing the percent of time between the two key frames. `cy1` and `cy2` are the percent of the\r\n * difference between the key frame's values. */\r\n CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n var x = dfx, y = dfy;\r\n for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n };\r\n /** Returns the interpolated percentage for the specified key frame and linear percentage. */\r\n CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n percent = MathUtils.clamp(percent, 0, 1);\r\n var curves = this.curves;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var type = curves[i];\r\n if (type == CurveTimeline.LINEAR)\r\n return percent;\r\n if (type == CurveTimeline.STEPPED)\r\n return 0;\r\n i++;\r\n var x = 0;\r\n for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n var prevX = void 0, prevY = void 0;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n }\r\n else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n var y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\r\n };\r\n CurveTimeline.LINEAR = 0;\r\n CurveTimeline.STEPPED = 1;\r\n CurveTimeline.BEZIER = 2;\r\n CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n return CurveTimeline;\r\n}());\r\n/** Changes a bone's local {@link Bone#rotation}. */\r\n/**\r\n * @public\r\n */\r\nvar RotateTimeline = /** @class */ (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount << 1);\r\n return _this;\r\n }\r\n RotateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.rotate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time and angle of the specified keyframe. */\r\n RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n };\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n var r_1 = bone.data.rotation - bone.rotation;\r\n bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\r\n var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r_2 * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r_2 += bone.data.rotation - bone.rotation;\r\n r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; // Wrap within -180 and 180.\r\n case MixBlend.add:\r\n bone.rotation += r_2 * alpha;\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n var r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n }\r\n };\r\n RotateTimeline.ENTRIES = 2;\r\n RotateTimeline.PREV_TIME = -2;\r\n RotateTimeline.PREV_ROTATION = -1;\r\n RotateTimeline.ROTATION = 1;\r\n return RotateTimeline;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */\r\n/**\r\n * @public\r\n */\r\nvar TranslateTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.translate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time in seconds, x, and y values for the specified key frame. */\r\n TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n };\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + TranslateTimeline.PREV_X];\r\n y = frames[frames.length + TranslateTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n x = frames[frame + TranslateTimeline.PREV_X];\r\n y = frames[frame + TranslateTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n x += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n y += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n TranslateTimeline.ENTRIES = 3;\r\n TranslateTimeline.PREV_TIME = -3;\r\n TranslateTimeline.PREV_X = -2;\r\n TranslateTimeline.PREV_Y = -1;\r\n TranslateTimeline.X = 1;\r\n TranslateTimeline.Y = 2;\r\n return TranslateTimeline;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\r\n/**\r\n * @public\r\n */\r\nvar ScaleTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ScaleTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.scale << 24) + this.boneIndex;\r\n };\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n x = frames[frame + ScaleTimeline.PREV_X];\r\n y = frames[frame + ScaleTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n }\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = MathUtils.signum(x);\r\n by = MathUtils.signum(y);\r\n bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n}(TranslateTimeline));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\r\n/**\r\n * @public\r\n */\r\nvar ShearTimeline = /** @class */ (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ShearTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.shear << 24) + this.boneIndex;\r\n };\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ShearTimeline.PREV_X];\r\n y = frames[frames.length + ShearTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n x = frames[frame + ShearTimeline.PREV_X];\r\n y = frames[frame + ShearTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n x = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n y = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n}(TranslateTimeline));\r\n/** Changes a slot's {@link Slot#color}. */\r\n/**\r\n * @public\r\n */\r\nvar ColorTimeline = /** @class */ (function (_super) {\r\n __extends(ColorTimeline, _super);\r\n function ColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n ColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.color << 24) + this.slotIndex;\r\n };\r\n /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\r\n ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n };\r\n ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n return;\r\n case MixBlend.first:\r\n var color = slot.color, setup = slot.data.color;\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n if (alpha == 1)\r\n slot.color.set(r, g, b, a);\r\n else {\r\n var color = slot.color;\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n ColorTimeline.ENTRIES = 5;\r\n ColorTimeline.PREV_TIME = -5;\r\n ColorTimeline.PREV_R = -4;\r\n ColorTimeline.PREV_G = -3;\r\n ColorTimeline.PREV_B = -2;\r\n ColorTimeline.PREV_A = -1;\r\n ColorTimeline.R = 1;\r\n ColorTimeline.G = 2;\r\n ColorTimeline.B = 3;\r\n ColorTimeline.A = 4;\r\n return ColorTimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\r\n/**\r\n * @public\r\n */\r\nvar TwoColorTimeline = /** @class */ (function (_super) {\r\n __extends(TwoColorTimeline, _super);\r\n function TwoColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TwoColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.twoColor << 24) + this.slotIndex;\r\n };\r\n /** Sets the time in seconds, light, and dark colors for the specified key frame. */\r\n TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n frameIndex *= TwoColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TwoColorTimeline.R] = r;\r\n this.frames[frameIndex + TwoColorTimeline.G] = g;\r\n this.frames[frameIndex + TwoColorTimeline.B] = b;\r\n this.frames[frameIndex + TwoColorTimeline.A] = a;\r\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n };\r\n TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n slot.darkColor.setFromColor(slot.data.darkColor);\r\n return;\r\n case MixBlend.first:\r\n var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + TwoColorTimeline.PREV_R];\r\n g = frames[i + TwoColorTimeline.PREV_G];\r\n b = frames[i + TwoColorTimeline.PREV_B];\r\n a = frames[i + TwoColorTimeline.PREV_A];\r\n r2 = frames[i + TwoColorTimeline.PREV_R2];\r\n g2 = frames[i + TwoColorTimeline.PREV_G2];\r\n b2 = frames[i + TwoColorTimeline.PREV_B2];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n r = frames[frame + TwoColorTimeline.PREV_R];\r\n g = frames[frame + TwoColorTimeline.PREV_G];\r\n b = frames[frame + TwoColorTimeline.PREV_B];\r\n a = frames[frame + TwoColorTimeline.PREV_A];\r\n r2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n g2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n b2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n g += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n b += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n a += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n }\r\n if (alpha == 1) {\r\n slot.color.set(r, g, b, a);\r\n slot.darkColor.set(r2, g2, b2, 1);\r\n }\r\n else {\r\n var light = slot.color, dark = slot.darkColor;\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n dark.setFromColor(slot.data.darkColor);\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n }\r\n };\r\n TwoColorTimeline.ENTRIES = 8;\r\n TwoColorTimeline.PREV_TIME = -8;\r\n TwoColorTimeline.PREV_R = -7;\r\n TwoColorTimeline.PREV_G = -6;\r\n TwoColorTimeline.PREV_B = -5;\r\n TwoColorTimeline.PREV_A = -4;\r\n TwoColorTimeline.PREV_R2 = -3;\r\n TwoColorTimeline.PREV_G2 = -2;\r\n TwoColorTimeline.PREV_B2 = -1;\r\n TwoColorTimeline.R = 1;\r\n TwoColorTimeline.G = 2;\r\n TwoColorTimeline.B = 3;\r\n TwoColorTimeline.A = 4;\r\n TwoColorTimeline.R2 = 5;\r\n TwoColorTimeline.G2 = 6;\r\n TwoColorTimeline.B2 = 7;\r\n return TwoColorTimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#attachment}. */\r\n/**\r\n * @public\r\n */\r\nvar AttachmentTimeline = /** @class */ (function () {\r\n function AttachmentTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n AttachmentTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.attachment << 24) + this.slotIndex;\r\n };\r\n /** The number of key frames for this timeline. */\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the attachment name for the specified key frame. */\r\n AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n var frameIndex = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n var attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n AttachmentTimeline.prototype.setAttachment = function (skeleton, slot, attachmentName) {\r\n slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n return AttachmentTimeline;\r\n}());\r\nvar zeros = null;\r\n/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}. */\r\n/**\r\n * @public\r\n */\r\nvar DeformTimeline = /** @class */ (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount);\r\n _this.frameVertices = new Array(frameCount);\r\n if (zeros == null)\r\n zeros = Utils.newFloatArray(64);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n };\r\n /** Sets the time in seconds and the vertices for the specified key frame.\r\n * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\r\n DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var slotAttachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof VertexAttachment) || !(slotAttachment.deformAttachment == this.attachment))\r\n return;\r\n var deformArray = slot.deform;\r\n if (deformArray.length == 0)\r\n blend = MixBlend.setup;\r\n var frameVertices = this.frameVertices;\r\n var vertexCount = frameVertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var vertexAttachment = slotAttachment;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n deformArray.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n deformArray.length = 0;\r\n break;\r\n }\r\n var deform_1 = Utils.setArraySize(deformArray, vertexCount);\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform_1[i] += (setupVertices[i] - deform_1[i]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets.\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform_1[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n var deform = Utils.setArraySize(deformArray, vertexCount);\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n var lastVertices = frameVertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_1 = 0; i_1 < vertexCount; i_1++) {\r\n deform[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n deform[i_2] += lastVertices[i_2];\r\n }\r\n }\r\n else {\r\n Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (vertexAttachment_1.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n var setup = setupVertices[i_3];\r\n deform[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n deform[i_4] = lastVertices[i_4] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_6 = 0; i_6 < vertexCount; i_6++) {\r\n deform[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n deform[i_7] += lastVertices[i_7] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time);\r\n var prevVertices = frameVertices[frame - 1];\r\n var nextVertices = frameVertices[frame];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n var prev = prevVertices[i_8];\r\n deform[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n var prev = prevVertices[i_9];\r\n deform[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n var prev = prevVertices[i_10];\r\n deform[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (vertexAttachment_2.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n var prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n deform[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n var prev = prevVertices[i_12];\r\n deform[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n var prev = prevVertices[i_13];\r\n deform[i_13] += (prev + (nextVertices[i_13] - prev) * percent - deform[i_13]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n var prev = prevVertices[i_14];\r\n deform[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n var prev = prevVertices[i_15];\r\n deform[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n}(CurveTimeline));\r\n/** Fires an {@link Event} when specific animation times are reached. */\r\n/**\r\n * @public\r\n */\r\nvar EventTimeline = /** @class */ (function () {\r\n function EventTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n EventTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.event << 24;\r\n };\r\n /** The number of key frames for this timeline. */\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the event for the specified key frame. */\r\n EventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n };\r\n /** Fires events for frames > `lastTime` and <= `time`. */\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (firedEvents == null)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0])\r\n return; // Time is before first frame.\r\n var frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n var frameTime = frames[frame];\r\n while (frame > 0) { // Fire multiple events with the same frame.\r\n if (frames[frame - 1] != frameTime)\r\n break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n };\r\n return EventTimeline;\r\n}());\r\n/** Changes a skeleton's {@link Skeleton#drawOrder}. */\r\n/**\r\n * @public\r\n */\r\nvar DrawOrderTimeline = /** @class */ (function () {\r\n function DrawOrderTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array(frameCount);\r\n }\r\n DrawOrderTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.drawOrder << 24;\r\n };\r\n /** The number of key frames for this timeline. */\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the draw order for the specified key frame.\r\n * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\r\n * draw order. */\r\n DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n if (direction == MixDirection.mixOut && blend == MixBlend.setup) {\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frame = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n var drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n return DrawOrderTimeline;\r\n}());\r\n/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},\r\n * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */\r\n/**\r\n * @public\r\n */\r\nvar IkConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n };\r\n /** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */\r\n IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, softness, bendDirection, compress, stretch) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.SOFTNESS] = softness;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.softness += (constraint.data.softness - constraint.softness) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness\r\n + (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n constraint.softness += (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n var mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n var softness = frames[frame + IkConstraintTimeline.PREV_SOFTNESS];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness\r\n + (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n constraint.softness += (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n };\r\n IkConstraintTimeline.ENTRIES = 6;\r\n IkConstraintTimeline.PREV_TIME = -6;\r\n IkConstraintTimeline.PREV_MIX = -5;\r\n IkConstraintTimeline.PREV_SOFTNESS = -4;\r\n IkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n IkConstraintTimeline.PREV_COMPRESS = -2;\r\n IkConstraintTimeline.PREV_STRETCH = -1;\r\n IkConstraintTimeline.MIX = 1;\r\n IkConstraintTimeline.SOFTNESS = 2;\r\n IkConstraintTimeline.BEND_DIRECTION = 3;\r\n IkConstraintTimeline.COMPRESS = 4;\r\n IkConstraintTimeline.STRETCH = 5;\r\n return IkConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},\r\n * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */\r\n/**\r\n * @public\r\n */\r\nvar TransformConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n };\r\n /** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */\r\n TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0, scale = 0, shear = 0;\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n }\r\n };\r\n TransformConstraintTimeline.ENTRIES = 5;\r\n TransformConstraintTimeline.PREV_TIME = -5;\r\n TransformConstraintTimeline.PREV_ROTATE = -4;\r\n TransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n TransformConstraintTimeline.PREV_SCALE = -2;\r\n TransformConstraintTimeline.PREV_SHEAR = -1;\r\n TransformConstraintTimeline.ROTATE = 1;\r\n TransformConstraintTimeline.TRANSLATE = 2;\r\n TransformConstraintTimeline.SCALE = 3;\r\n TransformConstraintTimeline.SHEAR = 4;\r\n return TransformConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a path constraint's {@link PathConstraint#position}. */\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintPositionTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n };\r\n /** Sets the time in seconds and path constraint position for the specified key frame. */\r\n PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n };\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = 0;\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) // Time is after last frame.\r\n position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n PathConstraintPositionTimeline.ENTRIES = 2;\r\n PathConstraintPositionTimeline.PREV_TIME = -2;\r\n PathConstraintPositionTimeline.PREV_VALUE = -1;\r\n PathConstraintPositionTimeline.VALUE = 1;\r\n return PathConstraintPositionTimeline;\r\n}(CurveTimeline));\r\n/** Changes a path constraint's {@link PathConstraint#spacing}. */\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintSpacingTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = 0;\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) // Time is after last frame.\r\n spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n}(PathConstraintPositionTimeline));\r\n/** Changes a transform constraint's {@link PathConstraint#rotateMix} and\r\n * {@link TransformConstraint#translateMix}. */\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintMixTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n };\r\n /** The time in seconds, rotate mix, and translate mix for the specified key frame. */\r\n PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = constraint.data.rotateMix;\r\n constraint.translateMix = constraint.data.translateMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0;\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\r\n rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n }\r\n };\r\n PathConstraintMixTimeline.ENTRIES = 3;\r\n PathConstraintMixTimeline.PREV_TIME = -3;\r\n PathConstraintMixTimeline.PREV_ROTATE = -2;\r\n PathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n PathConstraintMixTimeline.ROTATE = 1;\r\n PathConstraintMixTimeline.TRANSLATE = 2;\r\n return PathConstraintMixTimeline;\r\n}(CurveTimeline));\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\r\n * multiple animations on top of each other (layering).\r\n *\r\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */\r\n/**\r\n * @public\r\n */\r\nvar AnimationState = /** @class */ (function () {\r\n function AnimationState(data) {\r\n /** The list of tracks that currently have animations, which may contain null entries. */\r\n this.tracks = new Array();\r\n /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\r\n * or faster. Defaults to 1.\r\n *\r\n * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\r\n this.timeScale = 1;\r\n this.unkeyedState = 0;\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new IntSet();\r\n this.animationsChanged = false;\r\n this.trackEntryPool = new Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next != null) {\r\n // When the next entry's delay is passed, change to the next entry, preserving leftover time.\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom != null) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n // End mixing from entries once all have completed.\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from != null)\r\n from.mixingTo = null;\r\n while (from != null) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n /** Returns true when all mixing from entries are complete. */\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (from == null)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n // Require mixTime > 0 to ensure the mixing from entry was applied at least once.\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom != null)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\r\n * animation state can be applied to multiple skeletons to pose them identically.\r\n * @returns True if any animations were applied. */\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i_1 = 0, n_1 = tracks.length; i_1 < n_1; i_1++) {\r\n var current = tracks[i_1];\r\n if (current == null || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i_1 == 0 ? MixBlend.first : current.mixBlend;\r\n // Apply mixing from entries first.\r\n var mix = current.alpha;\r\n if (current.mixingFrom != null)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && current.next == null)\r\n mix = 0;\r\n // Apply current entry.\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n var timelineCount = current.animation.timelines.length;\r\n var timelines = current.animation.timelines;\r\n if ((i_1 == 0 && mix == 1) || blend == MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n // Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\r\n // to sometimes stop rendering when using color correction, as their RGBA values become NaN.\r\n // (https://github.com/pixijs/pixi-spine/issues/302)\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n var timeline = timelines[ii];\r\n if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, blend, true);\r\n else\r\n timeline.apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.mixIn);\r\n }\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var firstFrame = current.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = current.timelinesRotation;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline_1 = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : MixBlend.setup;\r\n if (timeline_1 instanceof RotateTimeline) {\r\n this.applyRotateTimeline(timeline_1, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else if (timeline_1 instanceof AttachmentTimeline) {\r\n this.applyAttachmentTimeline(timeline_1, skeleton, animationTime, blend, true);\r\n }\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timeline_1.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection.mixIn);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n // Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\r\n // subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\r\n // the time is before the first key).\r\n var setupState = this.unkeyedState + AnimationState.SETUP;\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = skeleton.slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.attachmentState == setupState) {\r\n var attachmentName = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n }\r\n }\r\n this.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom != null)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\r\n mix = 1;\r\n if (blend == MixBlend.first)\r\n blend = MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var events = mix < from.eventThreshold ? this.events : null;\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n var timelineCount = from.animation.timelines.length;\r\n var timelines = from.animation.timelines;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n if (blend == MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.mixOut);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var firstFrame = from.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = from.timelinesRotation;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = MixDirection.mixOut;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case AnimationState.SUBSEQUENT:\r\n if (!drawOrder && timeline instanceof DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.HOLD_SUBSEQUENT:\r\n timelineBlend = blend;\r\n alpha = alphaHold;\r\n break;\r\n case AnimationState.HOLD_FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (timeline instanceof RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n else if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, timelineBlend, attachments);\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(alpha, blend);\r\n if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)\r\n direction = MixDirection.mixIn;\r\n timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyAttachmentTimeline = function (timeline, skeleton, time, blend, attachments) {\r\n var slot = skeleton.slots[timeline.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = timeline.frames;\r\n if (time < frames[0]) { // Time is before first frame.\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\r\n }\r\n else {\r\n var frameIndex;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time) - 1;\r\n this.setAttachment(skeleton, slot, timeline.attachmentNames[frameIndex], attachments);\r\n }\r\n // If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\r\n if (slot.attachmentState <= this.unkeyedState)\r\n slot.attachmentState = this.unkeyedState + AnimationState.SETUP;\r\n };\r\n AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {\r\n slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n if (attachments)\r\n slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\r\n return;\r\n }\r\n var rotateTimeline = timeline;\r\n var frames = rotateTimeline.frames;\r\n var bone = skeleton.bones[rotateTimeline.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) // Time is after last frame.\r\n r2 = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n r2 = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n r2 = prevRotation + r2 * percent + bone.data.rotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n }\r\n }\r\n // Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops.\r\n lastDiff = timelinesRotation[i + 1]; // Difference between bones.\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n // Detect cross at 0 (not 180).\r\n if (MathUtils.signum(lastDiff) != MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n // A cross after a 360 rotation is a loop.\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360; // Store loops as part of lastTotal.\r\n if (dir != current)\r\n total += 360 * MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n r1 += total * alpha;\r\n bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n // Queue events before complete.\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_1);\r\n }\r\n // Queue complete if completed a loop iteration or the animation.\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n // Queue events after complete.\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, events[i]);\r\n }\r\n };\r\n /** Removes all animations from all tracks, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n /** Removes all animations from the track, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (current == null)\r\n return;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (from == null)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n if (from != null) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n // Store the interrupted mix percentage.\r\n if (from.mixingFrom != null && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\r\n }\r\n this.queue.start(current);\r\n };\r\n /** Sets an animation by name.\r\n *\r\n * {@link #setAnimationWith(}. */\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never\r\n * applied to a skeleton, it is replaced (not mixed from).\r\n * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\r\n * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current != null) {\r\n if (current.nextTrackLast == -1) {\r\n // Don't mix from an entry that was never applied.\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.disposeNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n /** Queues an animation by name.\r\n *\r\n * See {@link #addAnimationWith()}. */\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is\r\n * equivalent to calling {@link #setAnimationWith()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix\r\n * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the\r\n * previous entry is looping, its next loop completion is used instead of its duration.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (last == null) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n if (delay <= 0) {\r\n var duration = last.animationEnd - last.animationStart;\r\n if (duration != 0) {\r\n if (last.loop)\r\n delay += duration * (1 + ((last.trackTime / duration) | 0));\r\n else\r\n delay += Math.max(duration, last.trackTime);\r\n delay -= this.data.getMix(last.animation, animation);\r\n }\r\n else\r\n delay = last.trackTime;\r\n }\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\r\n * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n *\r\n * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\r\n * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\r\n * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\r\n * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\r\n * 0 still mixes out over one frame.\r\n *\r\n * Mixing in is done by first setting an empty animation, then adding an animation using\r\n * {@link #addAnimation()} and on the returned track entry, set the\r\n * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\r\n * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\r\n * setup pose value if no lower tracks key the property to the value keyed in the new animation. */\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\r\n * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling\r\n * {@link #setEmptyAnimation()}.\r\n *\r\n * See {@link #setEmptyAnimation()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or\r\n * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next\r\n * loop completion is used instead of its duration.\r\n * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (delay <= 0)\r\n delay -= mixDuration;\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix\r\n * duration. */\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current != null)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n /** @param last May be null. */\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.interruptAlpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n entry.mixBlend = MixBlend.replace;\r\n return entry;\r\n };\r\n AnimationState.prototype.disposeNext = function (entry) {\r\n var next = entry.next;\r\n while (next != null) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var entry = this.tracks[i];\r\n if (entry == null)\r\n continue;\r\n while (entry.mixingFrom != null)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (entry.mixingFrom == null || entry.mixBlend != MixBlend.add)\r\n this.computeHold(entry);\r\n entry = entry.mixingTo;\r\n } while (entry != null);\r\n }\r\n };\r\n AnimationState.prototype.computeHold = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n entry.timelineHoldMix.length = 0;\r\n var timelineDipMix = Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n var propertyIDs = this.propertyIDs;\r\n if (to != null && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++) {\r\n timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;\r\n }\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var timeline = timelines[i];\r\n var id = timeline.getPropertyId();\r\n if (!propertyIDs.add(id))\r\n timelineMode[i] = AnimationState.SUBSEQUENT;\r\n else if (to == null || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\r\n || timeline instanceof EventTimeline || !to.animation.hasTimeline(id)) {\r\n timelineMode[i] = AnimationState.FIRST;\r\n }\r\n else {\r\n for (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n if (next.animation.hasTimeline(id))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = AnimationState.HOLD_MIX;\r\n timelineDipMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = AnimationState.HOLD_FIRST;\r\n }\r\n }\r\n };\r\n /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n /** Adds a listener to receive events for all track entries. */\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (listener == null)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n /** Removes the listener added with {@link #addListener()}. */\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n /** Removes all listeners added with {@link #addListener()}. */\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\r\n * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\r\n * are not wanted because new animations are being set. */\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.prototype.setAnimationByName = function (trackIndex, animationName, loop) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n };\r\n AnimationState.prototype.addAnimationByName = function (trackIndex, animationName, loop, delay) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n };\r\n AnimationState.prototype.hasAnimation = function (animationName) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n };\r\n AnimationState.prototype.hasAnimationByName = function (animationName) {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n return this.hasAnimation(animationName);\r\n };\r\n AnimationState.emptyAnimation = new Animation(\"<empty>\", [], 0);\r\n /** 1. A previously applied timeline has set this property.\r\n *\r\n * Result: Mix from the current pose to the timeline pose. */\r\n AnimationState.SUBSEQUENT = 0;\r\n /** 1. This is the first timeline to set this property.\r\n * 2. The next track entry applied after this one does not have a timeline to set this property.\r\n *\r\n * Result: Mix from the setup pose to the timeline pose. */\r\n AnimationState.FIRST = 1;\r\n /** 1) A previously applied timeline has set this property.<br>\r\n * 2) The next track entry to be applied does have a timeline to set this property.<br>\r\n * 3) The next track entry after that one does not have a timeline to set this property.<br>\r\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\r\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\r\n AnimationState.HOLD_SUBSEQUENT = 2;\r\n /** 1) This is the first timeline to set this property.<br>\r\n * 2) The next track entry to be applied does have a timeline to set this property.<br>\r\n * 3) The next track entry after that one does not have a timeline to set this property.<br>\r\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\r\n * that key the same property. A subsequent timeline will set this property using a mix. */\r\n AnimationState.HOLD_FIRST = 3;\r\n /** 1. This is the first timeline to set this property.\r\n * 2. The next track entry to be applied does have a timeline to set this property.\r\n * 3. The next track entry after that one does have a timeline to set this property.\r\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\r\n *\r\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\r\n * 2 track entries in a row have a timeline that sets the same property.\r\n *\r\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\r\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\r\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\r\n * place. */\r\n AnimationState.HOLD_MIX = 4;\r\n AnimationState.SETUP = 1;\r\n AnimationState.CURRENT = 2;\r\n AnimationState.deprecatedWarning1 = false;\r\n AnimationState.deprecatedWarning2 = false;\r\n AnimationState.deprecatedWarning3 = false;\r\n return AnimationState;\r\n}());\r\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\r\n *\r\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */\r\n/**\r\n * @public\r\n */\r\nvar TrackEntry = /** @class */ (function () {\r\n function TrackEntry() {\r\n /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\r\n * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\r\n * the values from the lower tracks.\r\n *\r\n * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first\r\n * called. */\r\n this.mixBlend = MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\r\n * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\r\n * `animationStart` time. */\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n /** Returns true if at least one loop has been completed.\r\n *\r\n * See {@link AnimationStateListener#complete()}. */\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\r\n * long way around when using {@link #alpha} and starting animations on other tracks.\r\n *\r\n * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\r\n * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\r\n * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\r\n * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n Object.defineProperty(TrackEntry.prototype, \"time\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TrackEntry.prototype, \"endTime\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n TrackEntry.prototype.loopsCount = function () {\r\n return Math.floor(this.trackTime / this.trackEnd);\r\n };\r\n TrackEntry.deprecatedWarning1 = false;\r\n TrackEntry.deprecatedWarning2 = false;\r\n return TrackEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.deprecateStuff = function () {\r\n if (!EventQueue.deprecatedWarning1) {\r\n EventQueue.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'\");\r\n }\r\n return true;\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener != null && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].start)\r\n listeners[ii].start(entry);\r\n //deprecation\r\n entry.onStart && this.deprecateStuff() && entry.onStart(entry.trackIndex);\r\n this.animState.onStart && this.deprecateStuff() && this.deprecateStuff && this.animState.onStart(entry.trackIndex);\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener != null && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].interrupt)\r\n listeners[ii].interrupt(entry);\r\n break;\r\n case EventType.end:\r\n if (entry.listener != null && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].end)\r\n listeners[ii].end(entry);\r\n //deprecation\r\n entry.onEnd && this.deprecateStuff() && entry.onEnd(entry.trackIndex);\r\n this.animState.onEnd && this.deprecateStuff() && this.animState.onEnd(entry.trackIndex);\r\n // Fall through.\r\n case EventType.dispose:\r\n if (entry.listener != null && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].dispose)\r\n listeners[ii].dispose(entry);\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener != null && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].complete)\r\n listeners[ii].complete(entry);\r\n //deprecation\r\n var count = MathUtils.toInt(entry.loopsCount());\r\n entry.onComplete && this.deprecateStuff() && entry.onComplete(entry.trackIndex, count);\r\n this.animState.onComplete && this.deprecateStuff() && this.animState.onComplete(entry.trackIndex, count);\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener != null && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].event)\r\n listeners[ii].event(entry, event_3);\r\n //deprecation\r\n entry.onEvent && this.deprecateStuff() && entry.onEvent(entry.trackIndex, event_3);\r\n this.animState.onEvent && this.deprecateStuff() && this.animState.onEvent(entry.trackIndex, event_3);\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n EventQueue.deprecatedWarning1 = false;\r\n return EventQueue;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventType;\r\n(function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n})(EventType || (EventType = {}));\r\n/**\r\n * @public\r\n */\r\nvar AnimationStateAdapter = /** @class */ (function () {\r\n function AnimationStateAdapter() {\r\n }\r\n AnimationStateAdapter.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AnimationStateData = /** @class */ (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n this.defaultMix = 0;\r\n if (skeletonData == null)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (from == null)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (to == null)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n AnimationStateData.prototype.setMixByName = function (fromName, toName, duration) {\r\n if (!AnimationStateData.deprecatedWarning1) {\r\n AnimationStateData.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\r\n }\r\n this.setMix(fromName, toName, duration);\r\n };\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (from == null)\r\n throw new Error(\"from cannot be null.\");\r\n if (to == null)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n AnimationStateData.deprecatedWarning1 = false;\r\n return AnimationStateData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AtlasAttachmentLoader = /** @class */ (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n var attachment = new RegionAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n var attachment = new MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new BoundingBoxAttachment(name);\r\n };\r\n /** @return May be null to not load an attachment */\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Bone = /** @class */ (function () {\r\n /** @param parent May be null. */\r\n function Bone(data, skeleton, parent) {\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n this.matrix = new Matrix();\r\n this.children = new Array();\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 0;\r\n this.scaleY = 0;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.ax = 0;\r\n this.ay = 0;\r\n this.arotation = 0;\r\n this.ascaleX = 0;\r\n this.ascaleY = 0;\r\n this.ashearX = 0;\r\n this.ashearY = 0;\r\n this.appliedValid = false;\r\n this.sorted = false;\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Object.defineProperty(Bone.prototype, \"worldX\", {\r\n get: function () {\r\n return this.matrix.tx;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bone.prototype, \"worldY\", {\r\n get: function () {\r\n return this.matrix.ty;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Bone.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local transform. */\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and the specified local transform. */\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n var sx = this.skeleton.scaleX;\r\n var sy = settings.yDown ? -this.skeleton.scaleY : this.skeleton.scaleY;\r\n if (parent == null) { // Root bone.\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n m.tx = x * sx + skeleton.x;\r\n m.ty = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n switch (this.data.transformMode) {\r\n case TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pa /= this.skeleton.scaleX;\r\n pc /= this.skeleton.scaleY;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = MathUtils.cosDeg(rx) * scaleX;\r\n var lb = MathUtils.cosDeg(ry) * scaleY;\r\n var lc = MathUtils.sinDeg(rx) * scaleX;\r\n var ld = MathUtils.sinDeg(ry) * scaleY;\r\n m.a = pa * la - pb * lc;\r\n m.c = pa * lb - pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection: {\r\n var cos = MathUtils.cosDeg(rotation);\r\n var sin = MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / sx;\r\n var zc = (pc * cos + pd * sin) / sy;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (settings.yDown ?\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY > 0) :\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(90 + shearY) * scaleY;\r\n m.a = za * la + zb * lc;\r\n m.c = za * lb + zb * ld;\r\n m.b = zc * la + zd * lc;\r\n m.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n m.a *= sx;\r\n m.c *= sx;\r\n m.b *= sy;\r\n m.d *= sy;\r\n };\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldScaleX = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.a * m.a + m.c * m.c);\r\n };\r\n Bone.prototype.getWorldScaleY = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.b * m.b + m.d * m.d);\r\n };\r\n /** Computes the individual applied transform values from the world transform. This can be useful to perform processing using\r\n * the applied transform after the world transform has been modified directly (eg, by a constraint).\r\n * <p>\r\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */\r\n Bone.prototype.updateAppliedTransform = function () {\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n if (parent == null) {\r\n this.ax = m.tx;\r\n this.ay = m.ty;\r\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\r\n return;\r\n }\r\n var pm = parent.matrix;\r\n var pid = 1 / (pm.a * pm.d - pm.b * pm.c);\r\n var dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\r\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\r\n var ia = pid * pm.d;\r\n var id = pid * pm.a;\r\n var ib = pid * pm.c;\r\n var ic = pid * pm.b;\r\n var ra = ia * m.a - ib * m.b;\r\n var rb = ia * m.c - ib * m.d;\r\n var rc = id * m.b - ic * m.a;\r\n var rd = id * m.d - ic * m.c;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n };\r\n Bone.prototype.worldToLocal = function (world) {\r\n var m = this.matrix;\r\n var a = m.a, b = m.c, c = m.b, d = m.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n Bone.prototype.localToWorld = function (local) {\r\n var m = this.matrix;\r\n var x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n };\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(mat.a * sin - mat.b * cos, mat.d * cos - mat.c * sin) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n var sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(cos * mat.b + sin * mat.d, cos * mat.a + sin * mat.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var mat = this.matrix;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n this.appliedValid = false;\r\n };\r\n return Bone;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar BoneData = /** @class */ (function () {\r\n function BoneData(index, name, parent) {\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.transformMode = TransformMode.Normal;\r\n this.skinRequired = false;\r\n this.color = new Color();\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar ConstraintData = /** @class */ (function () {\r\n function ConstraintData(name, order, skinRequired) {\r\n this.name = name;\r\n this.order = order;\r\n this.skinRequired = skinRequired;\r\n }\r\n return ConstraintData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Event = /** @class */ (function () {\r\n function Event(time, data) {\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar EventData = /** @class */ (function () {\r\n function EventData(name) {\r\n this.name = name;\r\n }\r\n return EventData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraint = /** @class */ (function () {\r\n function IkConstraint(data, skeleton) {\r\n this.bendDirection = 0;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.mix = 1;\r\n this.softness = 0;\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.softness = data.softness;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n IkConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n IkConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n IkConstraint.prototype.update = function () {\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.softness, this.mix);\r\n break;\r\n }\r\n };\r\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\r\n * coordinate system. */\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var p = bone.parent.matrix;\r\n var pa = p.a, pb = p.c, pc = p.b, pd = p.d;\r\n var rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\r\n switch (bone.data.transformMode) {\r\n case TransformMode.OnlyTranslation:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n break;\r\n case TransformMode.NoRotationOrReflection:\r\n var s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\r\n var sa = pa / bone.skeleton.scaleX;\r\n var sc = pc / bone.skeleton.scaleY;\r\n pb = -sc * s * bone.skeleton.scaleX;\r\n pd = sa * s * bone.skeleton.scaleY;\r\n rotationIK += Math.atan2(sc, sa) * MathUtils.radDeg;\r\n // Fall through\r\n default:\r\n var x = targetX - p.tx, y = targetY - p.ty;\r\n var d = pa * pd - pb * pc;\r\n tx = (x * pd - y * pb) / d - bone.ax;\r\n ty = (y * pa - x * pc) / d - bone.ay;\r\n }\r\n rotationIK += Math.atan2(ty, tx) * MathUtils.radDeg;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n switch (bone.data.transformMode) {\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n }\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\r\n * target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, softness, alpha) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n if (!parent.appliedValid)\r\n parent.updateAppliedTransform();\r\n if (!child.appliedValid)\r\n child.updateAppliedTransform();\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n var pmat = parent.matrix;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pmat.a, b = pmat.c, c = pmat.b, d = pmat.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + pmat.tx;\r\n cwy = c * cx + pmat.ty;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + pmat.tx;\r\n cwy = c * cx + d * cy + pmat.ty;\r\n }\r\n var pp = parent.parent.matrix;\r\n a = pp.a;\r\n b = pp.c;\r\n c = pp.b;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = cwx - pp.tx, y = cwy - pp.ty;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\r\n if (l1 < 0.0001) {\r\n this.apply1(parent, targetX, targetY, false, stretch, false, alpha);\r\n child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n return;\r\n }\r\n x = targetX - pp.tx;\r\n y = targetY - pp.ty;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\r\n var dd = tx * tx + ty * ty;\r\n if (softness != 0) {\r\n softness *= psx * (csx + 1) / 2;\r\n var td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\r\n if (sd > 0) {\r\n var p = Math.min(1, sd / (softness * 2)) - 1;\r\n p = (sd - softness * (1 - p * p)) / td;\r\n tx -= p * tx;\r\n ty -= p * ty;\r\n dd = tx * tx + ty * ty;\r\n }\r\n }\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) {\r\n cos = 1;\r\n if (stretch)\r\n sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n }\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) / 2;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180)\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180)\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraintData = /** @class */ (function (_super) {\r\n __extends(IkConstraintData, _super);\r\n function IkConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n _this.bendDirection = 1;\r\n _this.compress = false;\r\n _this.stretch = false;\r\n _this.uniform = false;\r\n _this.mix = 1;\r\n _this.softness = 0;\r\n return _this;\r\n }\r\n return IkConstraintData;\r\n}(ConstraintData));\n\n/**\r\n * @public\r\n */\r\nvar PathConstraintData = /** @class */ (function (_super) {\r\n __extends(PathConstraintData, _super);\r\n function PathConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n return _this;\r\n }\r\n return PathConstraintData;\r\n}(ConstraintData));\r\n/**\r\n * @public\r\n */\r\nvar SpacingMode;\r\n(function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n})(SpacingMode || (SpacingMode = {}));\n\n/**\r\n * @public\r\n */\r\nvar PathConstraint = /** @class */ (function () {\r\n function PathConstraint(data, skeleton) {\r\n this.position = 0;\r\n this.spacing = 0;\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n PathConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n PathConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n var translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate)\r\n return;\r\n var data = this.data;\r\n var spacingMode = data.spacingMode;\r\n var lengthSpacing = spacingMode == SpacingMode.Length;\r\n var rotateMode = data.rotateMode;\r\n var tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\r\n var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var bones = this.bones;\r\n var spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n var spacing = this.spacing;\r\n if (scale || lengthSpacing) {\r\n if (scale)\r\n lengths = Utils.setArraySize(this.lengths, boneCount);\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = 0;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_1;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_1 / setupLength;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = rotateMode == RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone.matrix;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n mat.tx += (boneX - mat.tx) * translateMix;\r\n mat.ty += (boneY - mat.ty) * translateMix;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_2 = lengths[i];\r\n if (length_2 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_2 - 1) * rotateMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_3 = bone.data.length;\r\n boneX += (length_3 * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length_3 * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n bone.appliedValid = false;\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (percentPosition)\r\n position *= pathLength_1;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength_1;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_4 = lengths[curve];\r\n if (p > length_4)\r\n continue;\r\n if (curve == 0)\r\n p /= length_4;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_4 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n // Curve lengths.\r\n var curves = Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition)\r\n position *= pathLength;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_5 = curves[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_6 = segments[segment];\r\n if (p > length_6)\r\n continue;\r\n if (segment == 0)\r\n p /= length_6;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p))\r\n p = 0.0001;\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents)\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraint = /** @class */ (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.temp = new Vector2();\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n TransformConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n TransformConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += (temp.x - mat.tx) * translateMix;\r\n mat.ty += (temp.y - mat.ty) * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = Math.sqrt(mat.a * mat.a + mat.b * mat.b);\r\n var ts = Math.sqrt(ta * ta + tc * tc);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = Math.sqrt(mat.c * mat.c + mat.d * mat.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var b = mat.c, d = mat.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(mat.b, mat.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r = by + (r + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += temp.x * translateMix;\r\n mat.ty += temp.y * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n var b = mat.c, d = mat.d;\r\n r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * rotateMix;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax - x + this.data.offsetX) * translateMix;\r\n y += (target.ay - y + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n if (scaleY > 0.00001)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n bone.shearY += r * shearMix;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0)\r\n rotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax + this.data.offsetX) * translateMix;\r\n y += (target.ay + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n if (scaleY > 0.00001)\r\n scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0)\r\n shearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n return TransformConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Skeleton = /** @class */ (function () {\r\n function Skeleton(data) {\r\n this._updateCache = new Array();\r\n this.updateCacheReset = new Array();\r\n this.time = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.x = 0;\r\n this.y = 0;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (boneData.parent == null)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n this.updateCacheReset.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n bone.sorted = bone.data.skinRequired;\r\n bone.active = !bone.sorted;\r\n }\r\n if (this.skin != null) {\r\n var skinBones = this.skin.bones;\r\n for (var i = 0, n = this.skin.bones.length; i < n; i++) {\r\n var bone = this.bones[skinBones[i].index];\r\n do {\r\n bone.sorted = false;\r\n bone.active = true;\r\n bone = bone.parent;\r\n } while (bone != null);\r\n }\r\n }\r\n // IK first, lowest hierarchy depth first.\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length > 1) {\r\n var child = constrained[constrained.length - 1];\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin != null)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n var i = 0;\r\n while (i < pathBones.length) {\r\n var boneCount = pathBones[i++];\r\n for (var n = i + boneCount; i < n; i++) {\r\n var boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent != null)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.active)\r\n continue;\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n /** Updates the world transform for each bone and applies constraints. */\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var updateCacheReset = this.updateCacheReset;\r\n for (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n var bone = updateCacheReset[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n bone.appliedValid = true;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n /** Sets the bones and constraints to their setup pose values. */\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n };\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n /** @return May return null. */\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Sets a skin by name.\r\n * @see #setSkin(Skin) */\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n * @param newSkin May be null. */\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin == this.skin)\r\n return;\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1 != null) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n this.updateCache();\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (attachmentName == null)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin != null)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n /** @param attachmentName May be null. */\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size The width and height of the AABB.\r\n * @param temp Working memory */\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (temp === void 0) { temp = new Array(2); }\r\n if (offset == null)\r\n throw new Error(\"offset cannot be null.\");\r\n if (size == null)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices != null) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Skeleton.prototype.update = function (delta) {\r\n this.time += delta;\r\n };\r\n Object.defineProperty(Skeleton.prototype, \"flipX\", {\r\n get: function () {\r\n return this.scaleX == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleX = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Skeleton.prototype, \"flipY\", {\r\n get: function () {\r\n return this.scaleY == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleY = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Skeleton.deprecatedWarning1 = false;\r\n return Skeleton;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SkeletonData = /** @class */ (function () {\r\n function SkeletonData() {\r\n this.bones = new Array(); // Ordered parents first.\r\n this.slots = new Array(); // Setup pose draw order.\r\n this.skins = new Array();\r\n this.events = new Array();\r\n this.animations = new Array();\r\n this.ikConstraints = new Array();\r\n this.transformConstraints = new Array();\r\n this.pathConstraints = new Array();\r\n // Nonessential\r\n this.fps = 0;\r\n }\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (skinName == null)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (eventDataName == null)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.name == eventDataName)\r\n return event_1;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (animationName == null)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SlotData = /** @class */ (function () {\r\n function SlotData(index, name, boneData) {\r\n this.color = new Color(1, 1, 1, 1);\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (boneData == null)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraintData = /** @class */ (function (_super) {\r\n __extends(TransformConstraintData, _super);\r\n function TransformConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n _this.rotateMix = 0;\r\n _this.translateMix = 0;\r\n _this.scaleMix = 0;\r\n _this.shearMix = 0;\r\n _this.offsetRotation = 0;\r\n _this.offsetX = 0;\r\n _this.offsetY = 0;\r\n _this.offsetScaleX = 0;\r\n _this.offsetScaleY = 0;\r\n _this.offsetShearY = 0;\r\n _this.relative = false;\r\n _this.local = false;\r\n return _this;\r\n }\r\n return TransformConstraintData;\r\n}(ConstraintData));\n\n/**\r\n * @public\r\n */\r\nvar SkinEntry = /** @class */ (function () {\r\n function SkinEntry(slotIndex, name, attachment) {\r\n this.slotIndex = slotIndex;\r\n this.name = name;\r\n this.attachment = attachment;\r\n }\r\n return SkinEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar Skin = /** @class */ (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n this.bones = Array();\r\n this.constraints = new Array();\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n Skin.prototype.setAttachment = function (slotIndex, name, attachment) {\r\n if (attachment == null)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n Skin.prototype.addSkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var j = 0; j < this.bones.length; j++) {\r\n if (this.bones[j] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var j = 0; j < this.constraints.length; j++) {\r\n if (this.constraints[j] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n };\r\n Skin.prototype.copySkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var j = 0; j < this.bones.length; j++) {\r\n if (this.bones[j] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var j = 0; j < this.constraints.length; j++) {\r\n if (this.constraints[j] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n if (attachment.attachment == null)\r\n continue;\r\n if (attachment.attachment instanceof MeshAttachment) {\r\n attachment.attachment = attachment.attachment.newLinkedMesh();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n else {\r\n attachment.attachment = attachment.attachment.copy();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n }\r\n };\r\n /** @return May be null. */\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n Skin.prototype.removeAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n if (dictionary)\r\n dictionary[name] = null;\r\n };\r\n Skin.prototype.getAttachments = function () {\r\n var entries = new Array();\r\n for (var i = 0; i < this.attachments.length; i++) {\r\n var slotAttachments = this.attachments[i];\r\n if (slotAttachments) {\r\n for (var name_1 in slotAttachments) {\r\n var attachment = slotAttachments[name_1];\r\n if (attachment)\r\n entries.push(new SkinEntry(i, name_1, attachment));\r\n }\r\n }\r\n }\r\n return entries;\r\n };\r\n Skin.prototype.getAttachmentsForSlot = function (slotIndex, attachments) {\r\n var slotAttachments = this.attachments[slotIndex];\r\n if (slotAttachments) {\r\n for (var name_2 in slotAttachments) {\r\n var attachment = slotAttachments[name_2];\r\n if (attachment)\r\n attachments.push(new SkinEntry(slotIndex, name_2, attachment));\r\n }\r\n }\r\n };\r\n Skin.prototype.clear = function () {\r\n this.attachments.length = 0;\r\n this.bones.length = 0;\r\n this.constraints.length = 0;\r\n };\r\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SkeletonBinary = /** @class */ (function () {\r\n function SkeletonBinary(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonBinary.prototype.readSkeletonData = function (binary) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n skeletonData.name = \"\"; // BOZO\r\n var input = new BinaryInput(binary);\r\n skeletonData.hash = input.readString();\r\n skeletonData.version = input.readString();\r\n if (skeletonData.version === '3.8.75') {\r\n var error = \"Unsupported skeleton data, 3.8.75 is deprecated, please export with a newer version of Spine.\";\r\n console.error(error);\r\n }\r\n skeletonData.x = input.readFloat();\r\n skeletonData.y = input.readFloat();\r\n skeletonData.width = input.readFloat();\r\n skeletonData.height = input.readFloat();\r\n var nonessential = input.readBoolean();\r\n if (nonessential) {\r\n skeletonData.fps = input.readFloat();\r\n skeletonData.imagesPath = input.readString();\r\n skeletonData.audioPath = input.readString();\r\n }\r\n var n = 0;\r\n // Strings.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++)\r\n input.strings.push(input.readString());\r\n // Bones.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var name_1 = input.readString();\r\n var parent_1 = i == 0 ? null : skeletonData.bones[input.readInt(true)];\r\n var data = new BoneData(i, name_1, parent_1);\r\n data.rotation = input.readFloat();\r\n data.x = input.readFloat() * scale;\r\n data.y = input.readFloat() * scale;\r\n data.scaleX = input.readFloat();\r\n data.scaleY = input.readFloat();\r\n data.shearX = input.readFloat();\r\n data.shearY = input.readFloat();\r\n data.length = input.readFloat() * scale;\r\n data.transformMode = SkeletonBinary.TransformModeValues[input.readInt(true)];\r\n data.skinRequired = input.readBoolean();\r\n if (nonessential)\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n skeletonData.bones.push(data);\r\n }\r\n // Slots.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var slotName = input.readString();\r\n var boneData = skeletonData.bones[input.readInt(true)];\r\n var data = new SlotData(i, slotName, boneData);\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n var darkColor = input.readInt32();\r\n if (darkColor != -1)\r\n Color.rgb888ToColor(data.darkColor = new Color(), darkColor);\r\n data.attachmentName = input.readStringRef();\r\n data.blendMode = SkeletonBinary.BlendModeValues[input.readInt(true)];\r\n skeletonData.slots.push(data);\r\n }\r\n // IK constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new IkConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.mix = input.readFloat();\r\n data.softness = input.readFloat() * scale;\r\n data.bendDirection = input.readByte();\r\n data.compress = input.readBoolean();\r\n data.stretch = input.readBoolean();\r\n data.uniform = input.readBoolean();\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n // Transform constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new TransformConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.local = input.readBoolean();\r\n data.relative = input.readBoolean();\r\n data.offsetRotation = input.readFloat();\r\n data.offsetX = input.readFloat() * scale;\r\n data.offsetY = input.readFloat() * scale;\r\n data.offsetScaleX = input.readFloat();\r\n data.offsetScaleY = input.readFloat();\r\n data.offsetShearY = input.readFloat();\r\n data.rotateMix = input.readFloat();\r\n data.translateMix = input.readFloat();\r\n data.scaleMix = input.readFloat();\r\n data.shearMix = input.readFloat();\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n // Path constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new PathConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.slots[input.readInt(true)];\r\n data.positionMode = SkeletonBinary.PositionModeValues[input.readInt(true)];\r\n data.spacingMode = SkeletonBinary.SpacingModeValues[input.readInt(true)];\r\n data.rotateMode = SkeletonBinary.RotateModeValues[input.readInt(true)];\r\n data.offsetRotation = input.readFloat();\r\n data.position = input.readFloat();\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = input.readFloat();\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = input.readFloat();\r\n data.translateMix = input.readFloat();\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n // Default skin.\r\n var defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\r\n if (defaultSkin != null) {\r\n skeletonData.defaultSkin = defaultSkin;\r\n skeletonData.skins.push(defaultSkin);\r\n }\r\n // Skins.\r\n {\r\n var i = skeletonData.skins.length;\r\n Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\r\n for (; i < n; i++)\r\n skeletonData.skins[i] = this.readSkin(input, skeletonData, false, nonessential);\r\n }\r\n // Linked meshes.\r\n n = this.linkedMeshes.length;\r\n for (var i = 0; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_2 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var data = new EventData(input.readStringRef());\r\n data.intValue = input.readInt(false);\r\n data.floatValue = input.readFloat();\r\n data.stringValue = input.readString();\r\n data.audioPath = input.readString();\r\n if (data.audioPath != null) {\r\n data.volume = input.readFloat();\r\n data.balance = input.readFloat();\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n // Animations.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++)\r\n skeletonData.animations.push(this.readAnimation(input, input.readString(), skeletonData));\r\n return skeletonData;\r\n };\r\n SkeletonBinary.prototype.readSkin = function (input, skeletonData, defaultSkin, nonessential) {\r\n var skin = null;\r\n var slotCount = 0;\r\n if (defaultSkin) {\r\n slotCount = input.readInt(true);\r\n if (slotCount == 0)\r\n return null;\r\n skin = new Skin(\"default\");\r\n }\r\n else {\r\n skin = new Skin(input.readStringRef());\r\n skin.bones.length = input.readInt(true);\r\n for (var i = 0, n = skin.bones.length; i < n; i++)\r\n skin.bones[i] = skeletonData.bones[input.readInt(true)];\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\r\n slotCount = input.readInt(true);\r\n }\r\n for (var i = 0; i < slotCount; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var name_2 = input.readStringRef();\r\n var attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name_2, nonessential);\r\n if (attachment != null)\r\n skin.setAttachment(slotIndex, name_2, attachment);\r\n }\r\n }\r\n return skin;\r\n };\r\n SkeletonBinary.prototype.readAttachment = function (input, skeletonData, skin, slotIndex, attachmentName, nonessential) {\r\n var scale = this.scale;\r\n var name = input.readStringRef();\r\n if (name == null)\r\n name = attachmentName;\r\n var typeIndex = input.readByte();\r\n var type = SkeletonBinary.AttachmentTypeValues[typeIndex];\r\n switch (type) {\r\n case AttachmentType.Region: {\r\n var path = input.readStringRef();\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var scaleX = input.readFloat();\r\n var scaleY = input.readFloat();\r\n var width = input.readFloat();\r\n var height = input.readFloat();\r\n var color = input.readInt32();\r\n if (path == null)\r\n path = name;\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = x * scale;\r\n region.y = y * scale;\r\n region.scaleX = scaleX;\r\n region.scaleY = scaleY;\r\n region.rotation = rotation;\r\n region.width = width * scale;\r\n region.height = height * scale;\r\n Color.rgba8888ToColor(region.color, color);\r\n // region.updateOffset();\r\n return region;\r\n }\r\n case AttachmentType.BoundingBox: {\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n box.worldVerticesLength = vertexCount << 1;\r\n box.vertices = vertices.vertices;\r\n box.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(box.color, color);\r\n return box;\r\n }\r\n case AttachmentType.Mesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var vertexCount = input.readInt(true);\r\n var uvs = this.readFloatArray(input, vertexCount << 1, 1);\r\n var triangles = this.readShortArray(input);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var hullLength = input.readInt(true);\r\n var edges = null;\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n edges = this.readShortArray(input);\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (path == null)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n mesh.bones = vertices.bones;\r\n mesh.vertices = vertices.vertices;\r\n mesh.worldVerticesLength = vertexCount << 1;\r\n mesh.triangles = triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // mesh.updateUVs();\r\n mesh.hullLength = hullLength << 1;\r\n if (nonessential) {\r\n mesh.edges = edges;\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n return mesh;\r\n }\r\n case AttachmentType.LinkedMesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var skinName = input.readStringRef();\r\n var parent_3 = input.readStringRef();\r\n var inheritDeform = input.readBoolean();\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (path == null)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n if (nonessential) {\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n this.linkedMeshes.push(new LinkedMesh$1(mesh, skinName, slotIndex, parent_3, inheritDeform));\r\n return mesh;\r\n }\r\n case AttachmentType.Path: {\r\n var closed_1 = input.readBoolean();\r\n var constantSpeed = input.readBoolean();\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0, n = lengths.length; i < n; i++)\r\n lengths[i] = input.readFloat() * scale;\r\n var color = nonessential ? input.readInt32() : 0;\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = closed_1;\r\n path.constantSpeed = constantSpeed;\r\n path.worldVerticesLength = vertexCount << 1;\r\n path.vertices = vertices.vertices;\r\n path.bones = vertices.bones;\r\n path.lengths = lengths;\r\n if (nonessential)\r\n Color.rgba8888ToColor(path.color, color);\r\n return path;\r\n }\r\n case AttachmentType.Point: {\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var color = nonessential ? input.readInt32() : 0;\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = x * scale;\r\n point.y = y * scale;\r\n point.rotation = rotation;\r\n if (nonessential)\r\n Color.rgba8888ToColor(point.color, color);\r\n return point;\r\n }\r\n case AttachmentType.Clipping: {\r\n var endSlotIndex = input.readInt(true);\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n clip.endSlot = skeletonData.slots[endSlotIndex];\r\n clip.worldVerticesLength = vertexCount << 1;\r\n clip.vertices = vertices.vertices;\r\n clip.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(clip.color, color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonBinary.prototype.readVertices = function (input, vertexCount) {\r\n var verticesLength = vertexCount << 1;\r\n var vertices = new Vertices();\r\n var scale = this.scale;\r\n if (!input.readBoolean()) {\r\n vertices.vertices = this.readFloatArray(input, verticesLength, scale);\r\n return vertices;\r\n }\r\n var weights = new Array();\r\n var bonesArray = new Array();\r\n for (var i = 0; i < vertexCount; i++) {\r\n var boneCount = input.readInt(true);\r\n bonesArray.push(boneCount);\r\n for (var ii = 0; ii < boneCount; ii++) {\r\n bonesArray.push(input.readInt(true));\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat());\r\n }\r\n }\r\n vertices.vertices = Utils.toFloatArray(weights);\r\n vertices.bones = bonesArray;\r\n return vertices;\r\n };\r\n SkeletonBinary.prototype.readFloatArray = function (input, n, scale) {\r\n var array = new Array(n);\r\n if (scale == 1) {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat();\r\n }\r\n else {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat() * scale;\r\n }\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readShortArray = function (input) {\r\n var n = input.readInt(true);\r\n var array = new Array(n);\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readShort();\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readAnimation = function (input, name, skeletonData) {\r\n var timelines = new Array();\r\n var scale = this.scale;\r\n var duration = 0;\r\n var tempColor1 = new Color();\r\n var tempColor2 = new Color();\r\n // Slot timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.SLOT_ATTACHMENT: {\r\n var timeline = new AttachmentTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++)\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readStringRef());\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\r\n break;\r\n }\r\n case SkeletonBinary.SLOT_COLOR: {\r\n var timeline = new ColorTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n Color.rgba8888ToColor(tempColor1, input.readInt32());\r\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * ColorTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.SLOT_TWO_COLOR: {\r\n var timeline = new TwoColorTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n Color.rgba8888ToColor(tempColor1, input.readInt32());\r\n Color.rgb888ToColor(tempColor2, input.readInt32());\r\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a, tempColor2.r, tempColor2.g, tempColor2.b);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * TwoColorTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var boneIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.BONE_ROTATE: {\r\n var timeline = new RotateTimeline(frameCount);\r\n timeline.boneIndex = boneIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * RotateTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.BONE_TRANSLATE:\r\n case SkeletonBinary.BONE_SCALE:\r\n case SkeletonBinary.BONE_SHEAR: {\r\n var timeline = void 0;\r\n var timelineScale = 1;\r\n if (timelineType == SkeletonBinary.BONE_SCALE)\r\n timeline = new ScaleTimeline(frameCount);\r\n else if (timelineType == SkeletonBinary.BONE_SHEAR)\r\n timeline = new ShearTimeline(frameCount);\r\n else {\r\n timeline = new TranslateTimeline(frameCount);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale, input.readFloat() * timelineScale);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * TranslateTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var frameCount = input.readInt(true);\r\n var timeline = new IkConstraintTimeline(frameCount);\r\n timeline.ikConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat() * scale, input.readByte(), input.readBoolean(), input.readBoolean());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n // Transform constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var frameCount = input.readInt(true);\r\n var timeline = new TransformConstraintTimeline(frameCount);\r\n timeline.transformConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n // Path constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.PATH_POSITION:\r\n case SkeletonBinary.PATH_SPACING: {\r\n var timeline = void 0;\r\n var timelineScale = 1;\r\n if (timelineType == SkeletonBinary.PATH_SPACING) {\r\n timeline = new PathConstraintSpacingTimeline(frameCount);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new PathConstraintPositionTimeline(frameCount);\r\n if (data.positionMode == PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.PATH_MIX: {\r\n var timeline = new PathConstraintMixTimeline(frameCount);\r\n timeline.pathConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var skin = skeletonData.skins[input.readInt(true)];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var slotIndex = input.readInt(true);\r\n for (var iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\r\n var attachment = skin.getAttachment(slotIndex, input.readStringRef());\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var frameCount = input.readInt(true);\r\n var timeline = new DeformTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n var deform = void 0;\r\n var end = input.readInt(true);\r\n if (end == 0)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = input.readInt(true);\r\n end += start;\r\n if (scale == 1) {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat();\r\n }\r\n else {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat() * scale;\r\n }\r\n if (!weighted) {\r\n for (var v = 0, vn = deform.length; v < vn; v++)\r\n deform[v] += vertices[v];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, time, deform);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderCount = input.readInt(true);\r\n if (drawOrderCount > 0) {\r\n var timeline = new DrawOrderTimeline(drawOrderCount);\r\n var slotCount = skeletonData.slots.length;\r\n for (var i = 0; i < drawOrderCount; i++) {\r\n var time = input.readFloat();\r\n var offsetCount = input.readInt(true);\r\n var drawOrder = Utils.newArray(slotCount, 0);\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n drawOrder[ii] = -1;\r\n var unchanged = Utils.newArray(slotCount - offsetCount, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var ii = 0; ii < offsetCount; ii++) {\r\n var slotIndex = input.readInt(true);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + input.readInt(true)] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n if (drawOrder[ii] == -1)\r\n drawOrder[ii] = unchanged[--unchangedIndex];\r\n timeline.setFrame(i, time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[drawOrderCount - 1]);\r\n }\r\n // Event timeline.\r\n var eventCount = input.readInt(true);\r\n if (eventCount > 0) {\r\n var timeline = new EventTimeline(eventCount);\r\n for (var i = 0; i < eventCount; i++) {\r\n var time = input.readFloat();\r\n var eventData = skeletonData.events[input.readInt(true)];\r\n var event_1 = new Event(time, eventData);\r\n event_1.intValue = input.readInt(false);\r\n event_1.floatValue = input.readFloat();\r\n event_1.stringValue = input.readBoolean() ? input.readString() : eventData.stringValue;\r\n if (event_1.data.audioPath != null) {\r\n event_1.volume = input.readFloat();\r\n event_1.balance = input.readFloat();\r\n }\r\n timeline.setFrame(i, event_1);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[eventCount - 1]);\r\n }\r\n return new Animation(name, timelines, duration);\r\n };\r\n SkeletonBinary.prototype.readCurve = function (input, frameIndex, timeline) {\r\n switch (input.readByte()) {\r\n case SkeletonBinary.CURVE_STEPPED:\r\n timeline.setStepped(frameIndex);\r\n break;\r\n case SkeletonBinary.CURVE_BEZIER:\r\n this.setCurve(timeline, frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\r\n break;\r\n }\r\n };\r\n SkeletonBinary.prototype.setCurve = function (timeline, frameIndex, cx1, cy1, cx2, cy2) {\r\n timeline.setCurve(frameIndex, cx1, cy1, cx2, cy2);\r\n };\r\n SkeletonBinary.AttachmentTypeValues = [0 /*AttachmentType.Region*/, 1 /*AttachmentType.BoundingBox*/, 2 /*AttachmentType.Mesh*/, 3 /*AttachmentType.LinkedMesh*/, 4 /*AttachmentType.Path*/, 5 /*AttachmentType.Point*/, 6 /*AttachmentType.Clipping*/];\r\n SkeletonBinary.TransformModeValues = [TransformMode.Normal, TransformMode.OnlyTranslation, TransformMode.NoRotationOrReflection, TransformMode.NoScale, TransformMode.NoScaleOrReflection];\r\n SkeletonBinary.PositionModeValues = [PositionMode.Fixed, PositionMode.Percent];\r\n SkeletonBinary.SpacingModeValues = [SpacingMode.Length, SpacingMode.Fixed, SpacingMode.Percent];\r\n SkeletonBinary.RotateModeValues = [RotateMode.Tangent, RotateMode.Chain, RotateMode.ChainScale];\r\n SkeletonBinary.BlendModeValues = [BLEND_MODES.NORMAL, BLEND_MODES.ADD, BLEND_MODES.MULTIPLY, BLEND_MODES.SCREEN];\r\n SkeletonBinary.BONE_ROTATE = 0;\r\n SkeletonBinary.BONE_TRANSLATE = 1;\r\n SkeletonBinary.BONE_SCALE = 2;\r\n SkeletonBinary.BONE_SHEAR = 3;\r\n SkeletonBinary.SLOT_ATTACHMENT = 0;\r\n SkeletonBinary.SLOT_COLOR = 1;\r\n SkeletonBinary.SLOT_TWO_COLOR = 2;\r\n SkeletonBinary.PATH_POSITION = 0;\r\n SkeletonBinary.PATH_SPACING = 1;\r\n SkeletonBinary.PATH_MIX = 2;\r\n SkeletonBinary.CURVE_LINEAR = 0;\r\n SkeletonBinary.CURVE_STEPPED = 1;\r\n SkeletonBinary.CURVE_BEZIER = 2;\r\n return SkeletonBinary;\r\n}());\r\nvar LinkedMesh$1 = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritDeform = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\r\nvar Vertices = /** @class */ (function () {\r\n function Vertices(bones, vertices) {\r\n if (bones === void 0) { bones = null; }\r\n if (vertices === void 0) { vertices = null; }\r\n this.bones = bones;\r\n this.vertices = vertices;\r\n }\r\n return Vertices;\r\n}());\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBounds = /** @class */ (function (_super) {\r\n __extends(SkeletonBounds, _super);\r\n function SkeletonBounds() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return SkeletonBounds;\r\n}(SkeletonBoundsBase));\n\n/**\r\n * @public\r\n */\r\nvar SkeletonJson = /** @class */ (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n // Skeleton\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n if (skeletonData.version.substr(0, 3) !== '3.8') {\r\n var error = \"Spine 3.8 loader cant load version \" + skeletonMap.spine + \". Please configure your pixi-spine bundle\";\r\n console.error(error);\r\n }\r\n if (skeletonData.version === '3.8.75') {\r\n var error = \"Unsupported skeleton data, 3.8.75 is deprecated, please export with a newer version of Spine.\";\r\n console.error(error);\r\n }\r\n skeletonData.x = skeletonMap.x;\r\n skeletonData.y = skeletonMap.y;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n // Bones\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_1 = null;\r\n var parentName = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_1 = skeletonData.findBone(parentName);\r\n if (parent_1 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new BoneData(skeletonData.bones.length, boneMap.name, parent_1);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n data.skinRequired = this.getValue(boneMap, \"skin\", false);\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n // Slots.\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var slotName = slotMap.name;\r\n var boneName = slotMap.bone;\r\n var boneData = skeletonData.findBone(boneName);\r\n if (boneData == null)\r\n throw new Error(\"Slot bone not found: \" + boneName);\r\n var data = new SlotData(skeletonData.slots.length, slotName, boneData);\r\n var color = this.getValue(slotMap, \"color\", null);\r\n if (color != null)\r\n data.color.setFromString(color);\r\n var dark = this.getValue(slotMap, \"dark\", null);\r\n if (dark != null) {\r\n data.darkColor = new Color(1, 1, 1, 1);\r\n data.darkColor.setFromString(dark);\r\n }\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n // IK constraints\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new IkConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"IK target bone not found: \" + targetName);\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n data.softness = this.getValue(constraintMap, \"softness\", 0) * scale;\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.compress = this.getValue(constraintMap, \"compress\", false);\r\n data.stretch = this.getValue(constraintMap, \"stretch\", false);\r\n data.uniform = this.getValue(constraintMap, \"uniform\", false);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new TransformConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n data.local = this.getValue(constraintMap, \"local\", false);\r\n data.relative = this.getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n // Path constraints.\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new PathConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Path target slot not found: \" + targetName);\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n // Skins.\r\n if (root.skins) {\r\n for (var i = 0; i < root.skins.length; i++) {\r\n var skinMap = root.skins[i];\r\n var skin = new Skin(skinMap.name);\r\n if (skinMap.bones) {\r\n for (var ii = 0; ii < skinMap.bones.length; ii++) {\r\n var bone = skeletonData.findBone(skinMap.bones[ii]);\r\n if (bone == null)\r\n throw new Error(\"Skin bone not found: \" + skinMap.bones[i]);\r\n skin.bones.push(bone);\r\n }\r\n }\r\n if (skinMap.ik) {\r\n for (var ii = 0; ii < skinMap.ik.length; ii++) {\r\n var constraint = skeletonData.findIkConstraint(skinMap.ik[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin IK constraint not found: \" + skinMap.ik[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.transform) {\r\n for (var ii = 0; ii < skinMap.transform.length; ii++) {\r\n var constraint = skeletonData.findTransformConstraint(skinMap.transform[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin transform constraint not found: \" + skinMap.transform[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.path) {\r\n for (var ii = 0; ii < skinMap.path.length; ii++) {\r\n var constraint = skeletonData.findPathConstraint(skinMap.path[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin path constraint not found: \" + skinMap.path[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n for (var slotName in skinMap.attachments) {\r\n var slot = skeletonData.findSlot(slotName);\r\n if (slot == null)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotMap = skinMap.attachments[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\r\n if (attachment != null)\r\n skin.setAttachment(slot.index, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_2 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n data.audioPath = this.getValue(eventMap, \"audio\", null);\r\n if (data.audioPath != null) {\r\n data.volume = this.getValue(eventMap, \"volume\", 1);\r\n data.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n // Animations.\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n var type = this.getValue(map, \"type\", \"region\");\r\n switch (type) {\r\n case \"region\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n region.color.setFromString(color);\r\n // region.updateOffset();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n mesh.color.setFromString(color);\r\n mesh.width = this.getValue(map, \"width\", 0) * scale;\r\n mesh.height = this.getValue(map, \"height\", 0) * scale;\r\n var parent_3 = this.getValue(map, \"parent\", null);\r\n if (parent_3 != null) {\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_3, this.getValue(map, \"deform\", true)));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // mesh.updateUVs();\r\n mesh.edges = this.getValue(map, \"edges\", null);\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = this.getValue(map, \"x\", 0) * scale;\r\n point.y = this.getValue(map, \"y\", 0) * scale;\r\n point.rotation = this.getValue(map, \"rotation\", 0);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n var end = this.getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n var duration = 0;\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (timelineName == \"attachment\") {\r\n var timeline = new AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, this.getValue(valueMap, \"time\", 0), valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n else if (timelineName == \"color\") {\r\n var timeline = new ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var color = new Color();\r\n color.setFromString(valueMap.color || \"ffffffff\");\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\r\n }\r\n else if (timelineName == \"twoColor\") {\r\n var timeline = new TwoColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var light = new Color();\r\n var dark = new Color();\r\n light.setFromString(valueMap.light);\r\n dark.setFromString(valueMap.dark);\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TwoColorTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n var timeline = new RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"angle\", 0));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n var timeline = null;\r\n var timelineScale = 1, defaultValue = 0;\r\n if (timelineName === \"scale\") {\r\n timeline = new ScaleTimeline(timelineMap.length);\r\n defaultValue = 1;\r\n }\r\n else if (timelineName === \"shear\")\r\n timeline = new ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var x = this.getValue(valueMap, \"x\", defaultValue), y = this.getValue(valueMap, \"y\", defaultValue);\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n var timeline = new IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"softness\", 0) * scale, this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var constraintMap = map.transform[constraintName];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n var timeline = new TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Path constraint timelines.\r\n if (map.path) {\r\n for (var constraintName in map.path) {\r\n var constraintMap = map.path[constraintName];\r\n var index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n if (map.deform) {\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var skin = skeletonData.findSkin(deformName);\r\n if (skin == null) {\r\n if (settings.FAIL_ON_NON_EXISTING_SKIN) {\r\n throw new Error(\"Skin not found: \" + deformName);\r\n }\r\n else {\r\n continue;\r\n }\r\n }\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n var attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null)\r\n throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n var frameIndex = 0;\r\n for (var j = 0; j < timelineMap.length; j++) {\r\n var valueMap = timelineMap[j];\r\n var deform = void 0;\r\n var verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = this.getValue(valueMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null)\r\n drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n var timeline = new DrawOrderTimeline(drawOrderNode.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frameIndex = 0;\r\n for (var j = 0; j < drawOrderNode.length; j++) {\r\n var drawOrderMap = drawOrderNode[j];\r\n var drawOrder = null;\r\n var offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n var unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var i = 0; i < offsets.length; i++) {\r\n var offsetMap = offsets[i];\r\n var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1)\r\n drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, this.getValue(drawOrderMap, \"time\", 0), drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n // Event timeline.\r\n if (map.events) {\r\n var timeline = new EventTimeline(map.events.length);\r\n var frameIndex = 0;\r\n for (var i = 0; i < map.events.length; i++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_1 = new Event(Utils.toSinglePrecision(this.getValue(eventMap, \"time\", 0)), eventData);\r\n event_1.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event_1.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event_1.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_1.data.audioPath != null) {\r\n event_1.volume = this.getValue(eventMap, \"volume\", 1);\r\n event_1.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frameIndex++, event_1);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n if (!map.hasOwnProperty(\"curve\"))\r\n return;\r\n if (map.curve === \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else {\r\n var curve = map.curve;\r\n timeline.setCurve(frameIndex, curve, this.getValue(map, \"c2\", 0), this.getValue(map, \"c3\", 1), this.getValue(map, \"c4\", 1));\r\n }\r\n };\r\n SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return BLEND_MODES.NORMAL;\r\n if (str == \"additive\")\r\n return BLEND_MODES.ADD;\r\n if (str == \"multiply\")\r\n return BLEND_MODES.MULTIPLY;\r\n if (str == \"screen\")\r\n return BLEND_MODES.SCREEN;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n SkeletonJson.positionModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\")\r\n return PositionMode.Fixed;\r\n if (str == \"percent\")\r\n return PositionMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.spacingModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"length\")\r\n return SpacingMode.Length;\r\n if (str == \"fixed\")\r\n return SpacingMode.Fixed;\r\n if (str == \"percent\")\r\n return SpacingMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.rotateModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\")\r\n return RotateMode.Tangent;\r\n if (str == \"chain\")\r\n return RotateMode.Chain;\r\n if (str == \"chainscale\")\r\n return RotateMode.ChainScale;\r\n throw new Error(\"Unknown rotate mode: \" + str);\r\n };\r\n SkeletonJson.transformModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return TransformMode.Normal;\r\n if (str == \"onlytranslation\")\r\n return TransformMode.OnlyTranslation;\r\n if (str == \"norotationorreflection\")\r\n return TransformMode.NoRotationOrReflection;\r\n if (str == \"noscale\")\r\n return TransformMode.NoScale;\r\n if (str == \"noscaleorreflection\")\r\n return TransformMode.NoScaleOrReflection;\r\n throw new Error(\"Unknown transform mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n}());\r\nvar LinkedMesh = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritDeform = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n this.skeleton = new Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new AnimationStateData(spineData);\r\n this.state = new AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { Animation, AnimationState, AnimationStateAdapter, AnimationStateData, AtlasAttachmentLoader, Attachment, AttachmentTimeline, Bone, BoneData, BoundingBoxAttachment, ClippingAttachment, ColorTimeline, ConstraintData, CurveTimeline, DeformTimeline, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, IkConstraint, IkConstraintData, IkConstraintTimeline, JitterEffect, MeshAttachment, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PointAttachment, RegionAttachment, RotateTimeline, ScaleTimeline, ShearTimeline, Skeleton, SkeletonBinary, SkeletonBounds, SkeletonData, SkeletonJson, Skin, SkinEntry, Slot, SlotData, SpacingMode, Spine, SwirlEffect, TimelineType, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TranslateTimeline, TwoColorTimeline, VertexAttachment };\n//# sourceMappingURL=runtime-3.8.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/runtime-3.7 - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/runtime-3.7 is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev <ivan.popelyshev@gmail.com>, All Rights Reserved\n */\nimport { AttachmentType, Color, MathUtils, Utils, PowOut, MixBlend, MixDirection, IntSet, Pool, settings, TransformMode, RotateMode, PositionMode, Vector2, SkeletonBoundsBase, SpineBase } from '@pixi-spine/base';\nimport { Matrix } from '@pixi/math';\nimport { BLEND_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nvar Attachment = /** @class */ (function () {\r\n function Attachment(name) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar VertexAttachment = /** @class */ (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n _this.worldVerticesLength = 0;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVerticesOld = function (slot, worldVertices) {\r\n this.computeWorldVertices(slot, 0, this.worldVerticesLength, worldVertices, 0, 2);\r\n };\r\n /** Transforms local vertices to world coordinates.\r\n * @param start The index of the first local vertex value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #getWorldVerticesLength()} - start.\r\n * @param worldVertices The output world vertices. Must have a length >= offset + count.\r\n * @param offset The worldVertices index to begin writing values. */\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.attachmentVertices;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var mat = slot.bone.matrix;\r\n var x = mat.tx;\r\n var y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n /** Returns true if a deform originally applied to the specified attachment should be applied to this attachment. */\r\n VertexAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n return this == sourceAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar BoundingBoxAttachment = /** @class */ (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.BoundingBox;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n return BoundingBoxAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar ClippingAttachment = /** @class */ (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Clipping;\r\n // Nonessential.\r\n _this.color = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\r\n return _this;\r\n }\r\n return ClippingAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar MeshAttachment = /** @class */ (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Mesh;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.inheritDeform = false;\r\n _this.tempColor = new Color(0, 0, 0, 0);\r\n return _this;\r\n }\r\n MeshAttachment.prototype.applyDeform = function (sourceAttachment) {\r\n return this == sourceAttachment || (this.inheritDeform && this.parentMesh == sourceAttachment);\r\n };\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n /** @param parentMesh May be null. */\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n return MeshAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PathAttachment = /** @class */ (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Path;\r\n _this.closed = false;\r\n _this.constantSpeed = false;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n return PathAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PointAttachment = /** @class */ (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Point;\r\n _this.color = new Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n var mat = bone.matrix;\r\n point.x = this.x * mat.a + this.y * mat.c + bone.worldX;\r\n point.y = this.x * mat.b + this.y * mat.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var mat = bone.matrix;\r\n var cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\r\n var x = cos * mat.a + sin * mat.c;\r\n var y = cos * mat.b + sin * mat.d;\r\n return Math.atan2(y, x) * MathUtils.radDeg;\r\n };\r\n return PointAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar Slot = /** @class */ (function () {\r\n function Slot(data, bone) {\r\n this.attachmentVertices = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (bone == null)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.darkColor = data.darkColor == null ? null : new Color();\r\n this.setToSetupPose();\r\n this.blendMode = this.data.blendMode;\r\n }\r\n /** @return May be null. */\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the attachment and if it changed, resets {@link #getAttachmentTime()} and clears {@link #getAttachmentVertices()}.\r\n * @param attachment May be null. */\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.attachmentVertices.length = 0;\r\n };\r\n Slot.prototype.setAttachmentTime = function (time) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n };\r\n /** Returns the time since the attachment was set. */\r\n Slot.prototype.getAttachmentTime = function () {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n };\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor != null)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar RegionAttachment = /** @class */ (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Region;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.scaleX = 1;\r\n _this.scaleY = 1;\r\n _this.rotation = 0;\r\n _this.width = 0;\r\n _this.height = 0;\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.offset = Utils.newFloatArray(8);\r\n _this.uvs = Utils.newFloatArray(8);\r\n _this.tempColor = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n RegionAttachment.prototype.updateOffset = function () {\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var localXCos = localX * cos + this.x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + this.y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + this.x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + this.y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[RegionAttachment.OX1] = localXCos - localYSin;\r\n offset[RegionAttachment.OY1] = localYCos + localXSin;\r\n offset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n offset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n offset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n offset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n };\r\n RegionAttachment.prototype.setRegion = function (region) {\r\n this.region = region;\r\n var uvs = this.uvs;\r\n if (region.rotate) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n var vertexOffset = this.offset;\r\n var mat = bone instanceof Slot ? bone.bone.matrix : bone.matrix;\r\n var x = mat.tx, y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[RegionAttachment.OX1];\r\n offsetY = vertexOffset[RegionAttachment.OY1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // br\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX2];\r\n offsetY = vertexOffset[RegionAttachment.OY2];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // bl\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX3];\r\n offsetY = vertexOffset[RegionAttachment.OY3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ul\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX4];\r\n offsetY = vertexOffset[RegionAttachment.OY4];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ur\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.OX1 = 0;\r\n RegionAttachment.OY1 = 1;\r\n RegionAttachment.OX2 = 2;\r\n RegionAttachment.OY2 = 3;\r\n RegionAttachment.OX3 = 4;\r\n RegionAttachment.OY3 = 5;\r\n RegionAttachment.OX4 = 6;\r\n RegionAttachment.OY4 = 7;\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar JitterEffect = /** @class */ (function () {\r\n function JitterEffect(jitterX, jitterY) {\r\n this.jitterX = 0;\r\n this.jitterY = 0;\r\n this.jitterX = jitterX;\r\n this.jitterY = jitterY;\r\n }\r\n JitterEffect.prototype.begin = function (skeleton) {\r\n };\r\n JitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n position.x += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n position.y += MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n };\r\n JitterEffect.prototype.end = function () {\r\n };\r\n return JitterEffect;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SwirlEffect = /** @class */ (function () {\r\n function SwirlEffect(radius) {\r\n this.centerX = 0;\r\n this.centerY = 0;\r\n this.radius = 0;\r\n this.angle = 0;\r\n this.worldX = 0;\r\n this.worldY = 0;\r\n this.radius = radius;\r\n }\r\n SwirlEffect.prototype.begin = function (skeleton) {\r\n this.worldX = skeleton.x + this.centerX;\r\n this.worldY = skeleton.y + this.centerY;\r\n };\r\n SwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n var radAngle = this.angle * MathUtils.degreesToRadians;\r\n var x = position.x - this.worldX;\r\n var y = position.y - this.worldY;\r\n var dist = Math.sqrt(x * x + y * y);\r\n if (dist < this.radius) {\r\n var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n var cos = Math.cos(theta);\r\n var sin = Math.sin(theta);\r\n position.x = cos * x - sin * y + this.worldX;\r\n position.y = sin * x + cos * y + this.worldY;\r\n }\r\n };\r\n SwirlEffect.prototype.end = function () {\r\n };\r\n SwirlEffect.interpolation = new PowOut(2);\r\n return SwirlEffect;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Animation = /** @class */ (function () {\r\n function Animation(name, timelines, duration) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (timelines == null)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.duration = duration;\r\n }\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n Animation.binarySearch = function (values, target, step) {\r\n if (step === void 0) { step = 1; }\r\n var low = 0;\r\n var high = values.length / step - 2;\r\n if (high == 0)\r\n return step;\r\n var current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high)\r\n return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n };\r\n Animation.linearSearch = function (values, target, step) {\r\n for (var i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target)\r\n return i;\r\n return -1;\r\n };\r\n return Animation;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TimelineType;\r\n(function (TimelineType) {\r\n TimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n TimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n TimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n TimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n TimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n TimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n TimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n TimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n TimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n TimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n TimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n TimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n TimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n TimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n TimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n})(TimelineType || (TimelineType = {}));\r\n/**\r\n * @public\r\n */\r\nvar CurveTimeline = /** @class */ (function () {\r\n function CurveTimeline(frameCount) {\r\n if (frameCount <= 0)\r\n throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n CurveTimeline.prototype.getFrameCount = function () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n };\r\n CurveTimeline.prototype.setLinear = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n };\r\n CurveTimeline.prototype.setStepped = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n };\r\n CurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n var index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length)\r\n return CurveTimeline.LINEAR;\r\n var type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR)\r\n return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED)\r\n return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n };\r\n /** Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next.\r\n * cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of\r\n * the difference between the keyframe's values. */\r\n CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n var x = dfx, y = dfy;\r\n for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n };\r\n CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n percent = MathUtils.clamp(percent, 0, 1);\r\n var curves = this.curves;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var type = curves[i];\r\n if (type == CurveTimeline.LINEAR)\r\n return percent;\r\n if (type == CurveTimeline.STEPPED)\r\n return 0;\r\n i++;\r\n var x = 0;\r\n for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n var prevX = void 0, prevY = void 0;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n }\r\n else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n var y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1.\r\n };\r\n CurveTimeline.LINEAR = 0;\r\n CurveTimeline.STEPPED = 1;\r\n CurveTimeline.BEZIER = 2;\r\n CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n return CurveTimeline;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar RotateTimeline = /** @class */ (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount << 1);\r\n return _this;\r\n }\r\n RotateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.rotate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time and angle of the specified keyframe. */\r\n RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n };\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n var r_1 = bone.data.rotation - bone.rotation;\r\n bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) { // Time is after last frame.\r\n var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r_2 * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r_2 += bone.data.rotation - bone.rotation;\r\n r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360; // Wrap within -180 and 180.\r\n case MixBlend.add:\r\n bone.rotation += r_2 * alpha;\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n var r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n }\r\n };\r\n RotateTimeline.ENTRIES = 2;\r\n RotateTimeline.PREV_TIME = -2;\r\n RotateTimeline.PREV_ROTATION = -1;\r\n RotateTimeline.ROTATION = 1;\r\n return RotateTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar TranslateTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.translate << 24) + this.boneIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n };\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + TranslateTimeline.PREV_X];\r\n y = frames[frames.length + TranslateTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n x = frames[frame + TranslateTimeline.PREV_X];\r\n y = frames[frame + TranslateTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n x += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n y += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n TranslateTimeline.ENTRIES = 3;\r\n TranslateTimeline.PREV_TIME = -3;\r\n TranslateTimeline.PREV_X = -2;\r\n TranslateTimeline.PREV_Y = -1;\r\n TranslateTimeline.X = 1;\r\n TranslateTimeline.Y = 2;\r\n return TranslateTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar ScaleTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ScaleTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.scale << 24) + this.boneIndex;\r\n };\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n x = frames[frame + ScaleTimeline.PREV_X];\r\n y = frames[frame + ScaleTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n }\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = MathUtils.signum(x);\r\n by = MathUtils.signum(y);\r\n bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n}(TranslateTimeline));\r\n/**\r\n * @public\r\n */\r\nvar ShearTimeline = /** @class */ (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ShearTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.shear << 24) + this.boneIndex;\r\n };\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) { // Time is after last frame.\r\n x = frames[frames.length + ShearTimeline.PREV_X];\r\n y = frames[frames.length + ShearTimeline.PREV_Y];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n x = frames[frame + ShearTimeline.PREV_X];\r\n y = frames[frame + ShearTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n x = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n y = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n}(TranslateTimeline));\r\n/**\r\n * @public\r\n */\r\nvar ColorTimeline = /** @class */ (function (_super) {\r\n __extends(ColorTimeline, _super);\r\n function ColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n ColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.color << 24) + this.slotIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n };\r\n ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n return;\r\n case MixBlend.first:\r\n var color = slot.color, setup = slot.data.color;\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n if (alpha == 1)\r\n slot.color.set(r, g, b, a);\r\n else {\r\n var color = slot.color;\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n ColorTimeline.ENTRIES = 5;\r\n ColorTimeline.PREV_TIME = -5;\r\n ColorTimeline.PREV_R = -4;\r\n ColorTimeline.PREV_G = -3;\r\n ColorTimeline.PREV_B = -2;\r\n ColorTimeline.PREV_A = -1;\r\n ColorTimeline.R = 1;\r\n ColorTimeline.G = 2;\r\n ColorTimeline.B = 3;\r\n ColorTimeline.A = 4;\r\n return ColorTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar TwoColorTimeline = /** @class */ (function (_super) {\r\n __extends(TwoColorTimeline, _super);\r\n function TwoColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TwoColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.twoColor << 24) + this.slotIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n frameIndex *= TwoColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TwoColorTimeline.R] = r;\r\n this.frames[frameIndex + TwoColorTimeline.G] = g;\r\n this.frames[frameIndex + TwoColorTimeline.B] = b;\r\n this.frames[frameIndex + TwoColorTimeline.A] = a;\r\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n };\r\n TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n slot.darkColor.setFromColor(slot.data.darkColor);\r\n return;\r\n case MixBlend.first:\r\n var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n r = frames[i + TwoColorTimeline.PREV_R];\r\n g = frames[i + TwoColorTimeline.PREV_G];\r\n b = frames[i + TwoColorTimeline.PREV_B];\r\n a = frames[i + TwoColorTimeline.PREV_A];\r\n r2 = frames[i + TwoColorTimeline.PREV_R2];\r\n g2 = frames[i + TwoColorTimeline.PREV_G2];\r\n b2 = frames[i + TwoColorTimeline.PREV_B2];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n r = frames[frame + TwoColorTimeline.PREV_R];\r\n g = frames[frame + TwoColorTimeline.PREV_G];\r\n b = frames[frame + TwoColorTimeline.PREV_B];\r\n a = frames[frame + TwoColorTimeline.PREV_A];\r\n r2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n g2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n b2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n g += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n b += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n a += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n }\r\n if (alpha == 1) {\r\n slot.color.set(r, g, b, a);\r\n slot.darkColor.set(r2, g2, b2, 1);\r\n }\r\n else {\r\n var light = slot.color, dark = slot.darkColor;\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n dark.setFromColor(slot.data.darkColor);\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n }\r\n };\r\n TwoColorTimeline.ENTRIES = 8;\r\n TwoColorTimeline.PREV_TIME = -8;\r\n TwoColorTimeline.PREV_R = -7;\r\n TwoColorTimeline.PREV_G = -6;\r\n TwoColorTimeline.PREV_B = -5;\r\n TwoColorTimeline.PREV_A = -4;\r\n TwoColorTimeline.PREV_R2 = -3;\r\n TwoColorTimeline.PREV_G2 = -2;\r\n TwoColorTimeline.PREV_B2 = -1;\r\n TwoColorTimeline.R = 1;\r\n TwoColorTimeline.G = 2;\r\n TwoColorTimeline.B = 3;\r\n TwoColorTimeline.A = 4;\r\n TwoColorTimeline.R2 = 5;\r\n TwoColorTimeline.G2 = 6;\r\n TwoColorTimeline.B2 = 7;\r\n return TwoColorTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar AttachmentTimeline = /** @class */ (function () {\r\n function AttachmentTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n AttachmentTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.attachment << 24) + this.slotIndex;\r\n };\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (direction == MixDirection.mixOut && blend == MixBlend.setup) {\r\n var attachmentName_1 = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName_1 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_1));\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first) {\r\n var attachmentName_2 = slot.data.attachmentName;\r\n slot.setAttachment(attachmentName_2 == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName_2));\r\n }\r\n return;\r\n }\r\n var frameIndex = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n var attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n return AttachmentTimeline;\r\n}());\r\nvar zeros = null;\r\n/**\r\n * @public\r\n */\r\nvar DeformTimeline = /** @class */ (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount);\r\n _this.frameVertices = new Array(frameCount);\r\n if (zeros == null)\r\n zeros = Utils.newFloatArray(64);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n };\r\n /** Sets the time of the specified keyframe. */\r\n DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n var slotAttachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof VertexAttachment) || !slotAttachment.applyDeform(this.attachment))\r\n return;\r\n var verticesArray = slot.attachmentVertices;\r\n if (verticesArray.length == 0)\r\n blend = MixBlend.setup;\r\n var frameVertices = this.frameVertices;\r\n var vertexCount = frameVertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var vertexAttachment = slotAttachment;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n verticesArray.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n verticesArray.length = 0;\r\n break;\r\n }\r\n var vertices_1 = Utils.setArraySize(verticesArray, vertexCount);\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices_1[i] += (setupVertices[i] - vertices_1[i]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets.\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices_1[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n var vertices = Utils.setArraySize(verticesArray, vertexCount);\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n var lastVertices = frameVertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n vertices[i] += lastVertices[i] - setupVertices[i];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] += lastVertices[i];\r\n }\r\n }\r\n else {\r\n Utils.arrayCopy(lastVertices, 0, vertices, 0, vertexCount);\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (vertexAttachment_1.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var setup = setupVertices[i];\r\n vertices[i] = setup + (lastVertices[i] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] = lastVertices[i] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] += (lastVertices[i] - vertices[i]) * alpha;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n vertices[i] += (lastVertices[i] - setupVertices[i]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++)\r\n vertices[i] += lastVertices[i] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time);\r\n var prevVertices = frameVertices[frame - 1];\r\n var nextVertices = frameVertices[frame];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += prev + (nextVertices[i] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] = prev + (nextVertices[i] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (vertexAttachment_2.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i], setup = setupVertices[i];\r\n vertices[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i = 0; i < vertexCount; i++) {\r\n var prev = prevVertices[i];\r\n vertices[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar EventTimeline = /** @class */ (function () {\r\n function EventTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n EventTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.event << 24;\r\n };\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time of the specified keyframe. */\r\n EventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n };\r\n /** Fires events for frames > lastTime and <= time. */\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (firedEvents == null)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0])\r\n return; // Time is before first frame.\r\n var frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n var frameTime = frames[frame];\r\n while (frame > 0) { // Fire multiple events with the same frame.\r\n if (frames[frame - 1] != frameTime)\r\n break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n };\r\n return EventTimeline;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar DrawOrderTimeline = /** @class */ (function () {\r\n function DrawOrderTimeline(frameCount) {\r\n this.frames = Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array(frameCount);\r\n }\r\n DrawOrderTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.drawOrder << 24;\r\n };\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time of the specified keyframe.\r\n * @param drawOrder May be null to use bind pose draw order. */\r\n DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n if (direction == MixDirection.mixOut && blend == MixBlend.setup) {\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frame = 0;\r\n if (time >= frames[frames.length - 1]) // Time is after last frame.\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n var drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n return DrawOrderTimeline;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar IkConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n };\r\n /** Sets the time, mix and bend direction of the specified keyframe. */\r\n IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, bendDirection, compress, stretch) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n var mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n };\r\n IkConstraintTimeline.ENTRIES = 5;\r\n IkConstraintTimeline.PREV_TIME = -5;\r\n IkConstraintTimeline.PREV_MIX = -4;\r\n IkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n IkConstraintTimeline.PREV_COMPRESS = -2;\r\n IkConstraintTimeline.PREV_STRETCH = -1;\r\n IkConstraintTimeline.MIX = 1;\r\n IkConstraintTimeline.BEND_DIRECTION = 2;\r\n IkConstraintTimeline.COMPRESS = 3;\r\n IkConstraintTimeline.STRETCH = 4;\r\n return IkConstraintTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar TransformConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n };\r\n /** Sets the time and mixes of the specified keyframe. */\r\n TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0, scale = 0, shear = 0;\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) { // Time is after last frame.\r\n var i = frames.length;\r\n rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n }\r\n };\r\n TransformConstraintTimeline.ENTRIES = 5;\r\n TransformConstraintTimeline.PREV_TIME = -5;\r\n TransformConstraintTimeline.PREV_ROTATE = -4;\r\n TransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n TransformConstraintTimeline.PREV_SCALE = -2;\r\n TransformConstraintTimeline.PREV_SHEAR = -1;\r\n TransformConstraintTimeline.ROTATE = 1;\r\n TransformConstraintTimeline.TRANSLATE = 2;\r\n TransformConstraintTimeline.SCALE = 3;\r\n TransformConstraintTimeline.SHEAR = 4;\r\n return TransformConstraintTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintPositionTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n };\r\n /** Sets the time and value of the specified keyframe. */\r\n PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n };\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = 0;\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES]) // Time is after last frame.\r\n position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n PathConstraintPositionTimeline.ENTRIES = 2;\r\n PathConstraintPositionTimeline.PREV_TIME = -2;\r\n PathConstraintPositionTimeline.PREV_VALUE = -1;\r\n PathConstraintPositionTimeline.VALUE = 1;\r\n return PathConstraintPositionTimeline;\r\n}(CurveTimeline));\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintSpacingTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = 0;\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES]) // Time is after last frame.\r\n spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n}(PathConstraintPositionTimeline));\r\n/**\r\n * @public\r\n */\r\nvar PathConstraintMixTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n };\r\n /** Sets the time and mixes of the specified keyframe. */\r\n PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = constraint.data.rotateMix;\r\n constraint.translateMix = constraint.data.translateMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0;\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) { // Time is after last frame.\r\n rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n }\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n }\r\n };\r\n PathConstraintMixTimeline.ENTRIES = 3;\r\n PathConstraintMixTimeline.PREV_TIME = -3;\r\n PathConstraintMixTimeline.PREV_ROTATE = -2;\r\n PathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n PathConstraintMixTimeline.ROTATE = 1;\r\n PathConstraintMixTimeline.TRANSLATE = 2;\r\n return PathConstraintMixTimeline;\r\n}(CurveTimeline));\n\n/**\r\n * @public\r\n */\r\nvar AnimationState = /** @class */ (function () {\r\n function AnimationState(data) {\r\n this.tracks = new Array();\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new IntSet();\r\n this.animationsChanged = false;\r\n this.timeScale = 1;\r\n this.trackEntryPool = new Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next != null) {\r\n // When the next entry's delay is passed, change to the next entry, preserving leftover time.\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime = current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom != null) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n // End mixing from entries once all have completed.\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from != null)\r\n from.mixingTo = null;\r\n while (from != null) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (from == null)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n // Require mixTime > 0 to ensure the mixing from entry was applied at least once.\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom != null)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i == 0 ? MixBlend.first : current.mixBlend;\r\n // Apply mixing from entries first.\r\n var mix = current.alpha;\r\n if (current.mixingFrom != null)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && current.next == null)\r\n mix = 0;\r\n // Apply current entry.\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n var timelineCount = current.animation.timelines.length;\r\n var timelines = current.animation.timelines;\r\n if ((i == 0 && mix == 1) || blend == MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n // Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\r\n // to sometimes stop rendering when using color correction, as their RGBA values become NaN.\r\n // (https://github.com/pixijs/pixi-spine/issues/302)\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timelines[ii].apply(skeleton, animationLast, animationTime, events, mix, blend, MixDirection.mixIn);\r\n }\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var firstFrame = current.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = current.timelinesRotation;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : MixBlend.setup;\r\n if (timeline instanceof RotateTimeline) {\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timeline.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, MixDirection.mixIn);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom != null)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\r\n mix = 1;\r\n if (blend == MixBlend.first)\r\n blend = MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var events = mix < from.eventThreshold ? this.events : null;\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n var timelineCount = from.animation.timelines.length;\r\n var timelines = from.animation.timelines;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n if (blend == MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, MixDirection.mixOut);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var firstFrame = from.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = from.timelinesRotation;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = MixDirection.mixOut;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case AnimationState.SUBSEQUENT:\r\n if (!attachments && timeline instanceof AttachmentTimeline)\r\n continue;\r\n if (!drawOrder && timeline instanceof DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.HOLD:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (timeline instanceof RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(alpha, blend);\r\n if (timelineBlend == MixBlend.setup) {\r\n if (timeline instanceof AttachmentTimeline) {\r\n if (attachments)\r\n direction = MixDirection.mixOut;\r\n }\r\n else if (timeline instanceof DrawOrderTimeline) {\r\n if (drawOrder)\r\n direction = MixDirection.mixOut;\r\n }\r\n }\r\n timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\r\n return;\r\n }\r\n var rotateTimeline = timeline;\r\n var frames = rotateTimeline.frames;\r\n var bone = skeleton.bones[rotateTimeline.boneIndex];\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) // Time is after last frame.\r\n r2 = bone.data.rotation + frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n else {\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n r2 = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n r2 = prevRotation + r2 * percent + bone.data.rotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n }\r\n }\r\n // Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops.\r\n lastDiff = timelinesRotation[i + 1]; // Difference between bones.\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n // Detect cross at 0 (not 180).\r\n if (MathUtils.signum(lastDiff) != MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n // A cross after a 360 rotation is a loop.\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360; // Store loops as part of lastTotal.\r\n if (dir != current)\r\n total += 360 * MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n r1 += total * alpha;\r\n bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n // Queue events before complete.\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_1);\r\n }\r\n // Queue complete if completed a loop iteration or the animation.\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n // Queue events after complete.\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, events[i]);\r\n }\r\n };\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (current == null)\r\n return;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (from == null)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n if (from != null) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n // Store the interrupted mix percentage.\r\n if (from.mixingFrom != null && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\r\n }\r\n this.queue.start(current);\r\n };\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current != null) {\r\n if (current.nextTrackLast == -1) {\r\n // Don't mix from an entry that was never applied.\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.disposeNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (last == null) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n if (delay <= 0) {\r\n var duration = last.animationEnd - last.animationStart;\r\n if (duration != 0) {\r\n if (last.loop)\r\n delay += duration * (1 + ((last.trackTime / duration) | 0));\r\n else\r\n delay += Math.max(duration, last.trackTime);\r\n delay -= this.data.getMix(last.animation, animation);\r\n }\r\n else\r\n delay = last.trackTime;\r\n }\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (delay <= 0)\r\n delay -= mixDuration;\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current != null)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n Utils.ensureArrayCapacity(this.tracks, index - this.tracks.length + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.interruptAlpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n return entry;\r\n };\r\n AnimationState.prototype.disposeNext = function (entry) {\r\n var next = entry.next;\r\n while (next != null) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var entry = this.tracks[i];\r\n if (entry == null)\r\n continue;\r\n while (entry.mixingFrom != null)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (entry.mixingFrom == null || entry.mixBlend != MixBlend.add)\r\n this.setTimelineModes(entry);\r\n entry = entry.mixingTo;\r\n } while (entry != null);\r\n }\r\n };\r\n AnimationState.prototype.setTimelineModes = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n entry.timelineHoldMix.length = 0;\r\n var timelineDipMix = Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n var propertyIDs = this.propertyIDs;\r\n if (to != null && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++) {\r\n propertyIDs.add(timelines[i].getPropertyId());\r\n timelineMode[i] = AnimationState.HOLD;\r\n }\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var id = timelines[i].getPropertyId();\r\n if (!propertyIDs.add(id))\r\n timelineMode[i] = AnimationState.SUBSEQUENT;\r\n else if (to == null || !this.hasTimeline(to, id))\r\n timelineMode[i] = AnimationState.FIRST;\r\n else {\r\n for (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n if (this.hasTimeline(next, id))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = AnimationState.HOLD_MIX;\r\n timelineDipMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = AnimationState.HOLD;\r\n }\r\n }\r\n };\r\n AnimationState.prototype.hasTimeline = function (entry, id) {\r\n var timelines = entry.animation.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n if (timelines[i].getPropertyId() == id)\r\n return true;\r\n return false;\r\n };\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (listener == null)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n /** Removes the listener added with {@link #addListener(AnimationStateListener)}. */\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.prototype.setAnimationByName = function (trackIndex, animationName, loop) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n };\r\n AnimationState.prototype.addAnimationByName = function (trackIndex, animationName, loop, delay) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n };\r\n AnimationState.prototype.hasAnimation = function (animationName) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n };\r\n AnimationState.prototype.hasAnimationByName = function (animationName) {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n return this.hasAnimation(animationName);\r\n };\r\n AnimationState.emptyAnimation = new Animation(\"<empty>\", [], 0);\r\n AnimationState.SUBSEQUENT = 0;\r\n AnimationState.FIRST = 1;\r\n AnimationState.HOLD = 2;\r\n AnimationState.HOLD_MIX = 3;\r\n AnimationState.deprecatedWarning1 = false;\r\n AnimationState.deprecatedWarning2 = false;\r\n AnimationState.deprecatedWarning3 = false;\r\n return AnimationState;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar TrackEntry = /** @class */ (function () {\r\n function TrackEntry() {\r\n this.mixBlend = MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n Object.defineProperty(TrackEntry.prototype, \"time\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TrackEntry.prototype, \"endTime\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n TrackEntry.prototype.loopsCount = function () {\r\n return Math.floor(this.trackTime / this.trackEnd);\r\n };\r\n TrackEntry.deprecatedWarning1 = false;\r\n TrackEntry.deprecatedWarning2 = false;\r\n return TrackEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.deprecateStuff = function () {\r\n if (!EventQueue.deprecatedWarning1) {\r\n EventQueue.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: onComplete, onStart, onEnd, onEvent art deprecated, please use listeners from now on. 'state.addListener({ complete: function(track, event) { } })'\");\r\n }\r\n return true;\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener != null && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].start)\r\n listeners[ii].start(entry);\r\n //deprecation\r\n entry.onStart && this.deprecateStuff() && entry.onStart(entry.trackIndex);\r\n this.animState.onStart && this.deprecateStuff() && this.deprecateStuff && this.animState.onStart(entry.trackIndex);\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener != null && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].interrupt)\r\n listeners[ii].interrupt(entry);\r\n break;\r\n case EventType.end:\r\n if (entry.listener != null && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].end)\r\n listeners[ii].end(entry);\r\n //deprecation\r\n entry.onEnd && this.deprecateStuff() && entry.onEnd(entry.trackIndex);\r\n this.animState.onEnd && this.deprecateStuff() && this.animState.onEnd(entry.trackIndex);\r\n // Fall through.\r\n case EventType.dispose:\r\n if (entry.listener != null && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].dispose)\r\n listeners[ii].dispose(entry);\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener != null && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].complete)\r\n listeners[ii].complete(entry);\r\n //deprecation\r\n var count = MathUtils.toInt(entry.loopsCount());\r\n entry.onComplete && this.deprecateStuff() && entry.onComplete(entry.trackIndex, count);\r\n this.animState.onComplete && this.deprecateStuff() && this.animState.onComplete(entry.trackIndex, count);\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener != null && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].event)\r\n listeners[ii].event(entry, event_3);\r\n //deprecation\r\n entry.onEvent && this.deprecateStuff() && entry.onEvent(entry.trackIndex, event_3);\r\n this.animState.onEvent && this.deprecateStuff() && this.animState.onEvent(entry.trackIndex, event_3);\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n EventQueue.deprecatedWarning1 = false;\r\n return EventQueue;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventType;\r\n(function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n})(EventType || (EventType = {}));\r\n/**\r\n * @public\r\n */\r\nvar AnimationStateAdapter2 = /** @class */ (function () {\r\n function AnimationStateAdapter2() {\r\n }\r\n AnimationStateAdapter2.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter2.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter2;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AnimationStateData = /** @class */ (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n this.defaultMix = 0;\r\n if (skeletonData == null)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (from == null)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (to == null)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n AnimationStateData.prototype.setMixByName = function (fromName, toName, duration) {\r\n if (!AnimationStateData.deprecatedWarning1) {\r\n AnimationStateData.deprecatedWarning1 = true;\r\n console.warn(\"Deprecation Warning: AnimationStateData.setMixByName is deprecated, please use setMix from now on.\");\r\n }\r\n this.setMix(fromName, toName, duration);\r\n };\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (from == null)\r\n throw new Error(\"from cannot be null.\");\r\n if (to == null)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n AnimationStateData.deprecatedWarning1 = false;\r\n return AnimationStateData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AtlasAttachmentLoader = /** @class */ (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n var attachment = new RegionAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n var attachment = new MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n /** @return May be null to not load an attachment. */\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new BoundingBoxAttachment(name);\r\n };\r\n /** @return May be null to not load an attachment */\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Bone = /** @class */ (function () {\r\n /** @param parent May be null. */\r\n function Bone(data, skeleton, parent) {\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n this.matrix = new Matrix();\r\n this.children = new Array();\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 0;\r\n this.scaleY = 0;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.ax = 0;\r\n this.ay = 0;\r\n this.arotation = 0;\r\n this.ascaleX = 0;\r\n this.ascaleY = 0;\r\n this.ashearX = 0;\r\n this.ashearY = 0;\r\n this.appliedValid = false;\r\n this.sorted = false;\r\n /** NOT USED IN 3.7. Needed for the debug graph code */\r\n this.active = true;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Object.defineProperty(Bone.prototype, \"worldX\", {\r\n get: function () {\r\n return this.matrix.tx;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bone.prototype, \"worldY\", {\r\n get: function () {\r\n return this.matrix.ty;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local transform. */\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and the specified local transform. */\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n var sx = this.skeleton.scaleX;\r\n var sy = settings.yDown ? -this.skeleton.scaleY : this.skeleton.scaleY;\r\n if (parent == null) { // Root bone.\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n m.tx = x * sx + skeleton.x;\r\n m.ty = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n switch (this.data.transformMode) {\r\n case TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = MathUtils.cosDeg(rx) * scaleX;\r\n var lb = MathUtils.cosDeg(ry) * scaleY;\r\n var lc = MathUtils.sinDeg(rx) * scaleX;\r\n var ld = MathUtils.sinDeg(ry) * scaleY;\r\n m.a = pa * la - pb * lc;\r\n m.c = pa * lb - pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection: {\r\n var cos = MathUtils.cosDeg(rotation);\r\n var sin = MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / sx;\r\n var zc = (pc * cos + pd * sin) / sy;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (settings.yDown ?\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY > 0) :\r\n (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(90 + shearY) * scaleY;\r\n m.a = za * la + zb * lc;\r\n m.c = za * lb + zb * ld;\r\n m.b = zc * la + zd * lc;\r\n m.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n m.a *= sx;\r\n m.c *= sx;\r\n m.b *= sy;\r\n m.d *= sy;\r\n };\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldScaleX = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.a * m.a + m.c * m.c);\r\n };\r\n Bone.prototype.getWorldScaleY = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.b * m.b + m.d * m.d);\r\n };\r\n /** Computes the individual applied transform values from the world transform. This can be useful to perform processing using\r\n * the applied transform after the world transform has been modified directly (eg, by a constraint).\r\n * <p>\r\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. */\r\n Bone.prototype.updateAppliedTransform = function () {\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n if (parent == null) {\r\n this.ax = m.tx;\r\n this.ay = m.ty;\r\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\r\n return;\r\n }\r\n var pm = parent.matrix;\r\n var pid = 1 / (pm.a * pm.d - pm.b * pm.c);\r\n var dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\r\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\r\n var ia = pid * pm.d;\r\n var id = pid * pm.a;\r\n var ib = pid * pm.c;\r\n var ic = pid * pm.b;\r\n var ra = ia * m.a - ib * m.b;\r\n var rb = ia * m.c - ib * m.d;\r\n var rc = id * m.b - ic * m.a;\r\n var rd = id * m.d - ic * m.c;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n };\r\n Bone.prototype.worldToLocal = function (world) {\r\n var m = this.matrix;\r\n var a = m.a, b = m.c, c = m.b, d = m.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n Bone.prototype.localToWorld = function (local) {\r\n var m = this.matrix;\r\n var x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n };\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(mat.a * sin - mat.b * cos, mat.d * cos - mat.c * sin) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n var sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(cos * mat.b + sin * mat.d, cos * mat.a + sin * mat.c) * MathUtils.radDeg;\r\n };\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var mat = this.matrix;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n this.appliedValid = false;\r\n };\r\n return Bone;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar BoneData = /** @class */ (function () {\r\n function BoneData(index, name, parent) {\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.transformMode = TransformMode.Normal;\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Event = /** @class */ (function () {\r\n function Event(time, data) {\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar EventData = /** @class */ (function () {\r\n function EventData(name) {\r\n this.name = name;\r\n }\r\n return EventData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraint = /** @class */ (function () {\r\n function IkConstraint(data, skeleton) {\r\n this.bendDirection = 0;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.mix = 1;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n IkConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n IkConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n IkConstraint.prototype.update = function () {\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.mix);\r\n break;\r\n }\r\n };\r\n /** Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified in the world\r\n * coordinate system. */\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var p = bone.parent.matrix;\r\n var id = 1 / (p.a * p.d - p.b * p.c);\r\n var x = targetX - p.tx, y = targetY - p.ty;\r\n var tx = (x * p.d - y * p.c) * id - bone.ax, ty = (y * p.a - x * p.b) * id - bone.ay;\r\n var rotationIK = Math.atan2(ty, tx) * MathUtils.radDeg - bone.ashearX - bone.arotation;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n /** Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as possible. The\r\n * target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, alpha) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n if (!parent.appliedValid)\r\n parent.updateAppliedTransform();\r\n if (!child.appliedValid)\r\n child.updateAppliedTransform();\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n var pmat = parent.matrix;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pmat.a, b = pmat.c, c = pmat.b, d = pmat.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + pmat.tx;\r\n cwy = c * cx + pmat.ty;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + pmat.tx;\r\n cwy = c * cx + d * cy + pmat.ty;\r\n }\r\n var pp = parent.parent.matrix;\r\n a = pp.a;\r\n b = pp.c;\r\n c = pp.b;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = targetX - pp.tx, y = targetY - pp.ty;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py, dd = tx * tx + ty * ty;\r\n x = cwx - pp.tx;\r\n y = cwy - pp.ty;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1 = 0, a2 = 0;\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) {\r\n cos = 1;\r\n if (stretch && l1 + l2 > 0.0001)\r\n sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n }\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) / 2;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180)\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180)\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar IkConstraintData = /** @class */ (function () {\r\n function IkConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.bendDirection = 1;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.uniform = false;\r\n this.mix = 1;\r\n this.name = name;\r\n }\r\n return IkConstraintData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar PathConstraintData = /** @class */ (function () {\r\n function PathConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.name = name;\r\n }\r\n return PathConstraintData;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar SpacingMode;\r\n(function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n})(SpacingMode || (SpacingMode = {}));\n\n/**\r\n * @public\r\n */\r\nvar PathConstraint = /** @class */ (function () {\r\n function PathConstraint(data, skeleton) {\r\n this.position = 0;\r\n this.spacing = 0;\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n PathConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n var translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate)\r\n return;\r\n var data = this.data;\r\n var spacingMode = data.spacingMode;\r\n var lengthSpacing = spacingMode == SpacingMode.Length;\r\n var rotateMode = data.rotateMode;\r\n var tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;\r\n var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var bones = this.bones;\r\n var spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n var spacing = this.spacing;\r\n if (scale || lengthSpacing) {\r\n if (scale)\r\n lengths = Utils.setArraySize(this.lengths, boneCount);\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = 0;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_1;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_1 / setupLength;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == PositionMode.Percent, spacingMode == SpacingMode.Percent);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = rotateMode == RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone.matrix;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n mat.tx += (boneX - mat.tx) * translateMix;\r\n mat.ty += (boneY - mat.ty) * translateMix;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_2 = lengths[i];\r\n if (length_2 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_2 - 1) * rotateMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_3 = bone.data.length;\r\n boneX += (length_3 * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length_3 * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n bone.appliedValid = false;\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (percentPosition)\r\n position *= pathLength_1;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength_1;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_4 = lengths[curve];\r\n if (p > length_4)\r\n continue;\r\n if (curve == 0)\r\n p /= length_4;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_4 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n // Curve lengths.\r\n var curves = Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition)\r\n position *= pathLength;\r\n if (percentSpacing) {\r\n for (var i = 0; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_5 = curves[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_6 = segments[segment];\r\n if (p > length_6)\r\n continue;\r\n if (segment == 0)\r\n p /= length_6;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p))\r\n p = 0.0001;\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents)\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n };\r\n PathConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraint = /** @class */ (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.temp = new Vector2();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n TransformConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += (temp.x - mat.tx) * translateMix;\r\n mat.ty += (temp.y - mat.ty) * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = Math.sqrt(mat.a * mat.a + mat.b * mat.b);\r\n var ts = Math.sqrt(ta * ta + tc * tc);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = Math.sqrt(mat.c * mat.c + mat.d * mat.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var b = mat.c, d = mat.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(mat.b, mat.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r = by + (r + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n var mat = bone.matrix;\r\n if (rotateMix != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += temp.x * translateMix;\r\n mat.ty += temp.y * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n mat.c *= s;\r\n mat.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI)\r\n r += MathUtils.PI2;\r\n var b = mat.c, d = mat.d;\r\n r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * rotateMix;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax - x + this.data.offsetX) * translateMix;\r\n y += (target.ay - y + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n if (scaleY > 0.00001)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n bone.shearY += r * shearMix;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0)\r\n rotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax + this.data.offsetX) * translateMix;\r\n y += (target.ay + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix > 0) {\r\n if (scaleX > 0.00001)\r\n scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n if (scaleY > 0.00001)\r\n scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix > 0)\r\n shearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.getOrder = function () {\r\n return this.data.order;\r\n };\r\n return TransformConstraint;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Skeleton = /** @class */ (function () {\r\n function Skeleton(data) {\r\n this._updateCache = new Array();\r\n this.updateCacheReset = new Array();\r\n this.time = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.x = 0;\r\n this.y = 0;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (boneData.parent == null)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n this.updateCacheReset.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].sorted = false;\r\n // IK first, lowest hierarchy depth first.\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length > 1) {\r\n var child = constrained[constrained.length - 1];\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin != null)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n var i = 0;\r\n while (i < pathBones.length) {\r\n var boneCount = pathBones[i++];\r\n for (var n = i + boneCount; i < n; i++) {\r\n var boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent != null)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n /** Updates the world transform for each bone and applies constraints. */\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var updateCacheReset = this.updateCacheReset;\r\n for (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n var bone = updateCacheReset[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n bone.appliedValid = true;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n /** Sets the bones and constraints to their setup pose values. */\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.mix = constraint.data.mix;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n };\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n /** @return May return null. */\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** @return -1 if the bone was not found. */\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Sets a skin by name.\r\n * @see #setSkin(Skin) */\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() default skin}.\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n * @param newSkin May be null. */\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1 != null) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (attachmentName == null)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin != null)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n /** @param attachmentName May be null. */\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** @return May be null. */\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size The width and height of the AABB.\r\n * @param temp Working memory */\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (offset == null)\r\n throw new Error(\"offset cannot be null.\");\r\n if (size == null)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices != null) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Skeleton.prototype.update = function (delta) {\r\n this.time += delta;\r\n };\r\n Object.defineProperty(Skeleton.prototype, \"flipX\", {\r\n get: function () {\r\n return this.scaleX == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleX = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Skeleton.prototype, \"flipY\", {\r\n get: function () {\r\n return this.scaleY == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleY = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Skeleton.deprecatedWarning1 = false;\r\n return Skeleton;\r\n}());\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBounds = /** @class */ (function (_super) {\r\n __extends(SkeletonBounds, _super);\r\n function SkeletonBounds() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return SkeletonBounds;\r\n}(SkeletonBoundsBase));\n\n/**\r\n * @public\r\n */\r\nvar SkeletonData = /** @class */ (function () {\r\n function SkeletonData() {\r\n this.bones = new Array(); // Ordered parents first.\r\n this.slots = new Array(); // Setup pose draw order.\r\n this.skins = new Array();\r\n this.events = new Array();\r\n this.animations = new Array();\r\n this.ikConstraints = new Array();\r\n this.transformConstraints = new Array();\r\n this.pathConstraints = new Array();\r\n // Nonessential\r\n this.fps = 0;\r\n }\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (skinName == null)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (eventDataName == null)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.name == eventDataName)\r\n return event_1;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (animationName == null)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SlotData = /** @class */ (function () {\r\n function SlotData(index, name, boneData) {\r\n this.color = new Color(1, 1, 1, 1);\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (boneData == null)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar TransformConstraintData = /** @class */ (function () {\r\n function TransformConstraintData(name) {\r\n this.order = 0;\r\n this.bones = new Array();\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.offsetRotation = 0;\r\n this.offsetX = 0;\r\n this.offsetY = 0;\r\n this.offsetScaleX = 0;\r\n this.offsetScaleY = 0;\r\n this.offsetShearY = 0;\r\n this.relative = false;\r\n this.local = false;\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return TransformConstraintData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Skin = /** @class */ (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n Skin.prototype.addAttachment = function (slotIndex, name, attachment) {\r\n if (attachment == null)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n /** @return May be null. */\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar SkeletonJson = /** @class */ (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n // Skeleton\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n // Bones\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_1 = null;\r\n var parentName = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_1 = skeletonData.findBone(parentName);\r\n if (parent_1 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new BoneData(skeletonData.bones.length, boneMap.name, parent_1);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n // Slots.\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var slotName = slotMap.name;\r\n var boneName = slotMap.bone;\r\n var boneData = skeletonData.findBone(boneName);\r\n if (boneData == null)\r\n throw new Error(\"Slot bone not found: \" + boneName);\r\n var data = new SlotData(skeletonData.slots.length, slotName, boneData);\r\n var color = this.getValue(slotMap, \"color\", null);\r\n if (color != null)\r\n data.color.setFromString(color);\r\n var dark = this.getValue(slotMap, \"dark\", null);\r\n if (dark != null) {\r\n data.darkColor = new Color(1, 1, 1, 1);\r\n data.darkColor.setFromString(dark);\r\n }\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n // IK constraints\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new IkConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"IK target bone not found: \" + targetName);\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new TransformConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n data.local = this.getValue(constraintMap, \"local\", false);\r\n data.relative = this.getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n // Path constraints.\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new PathConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Path target slot not found: \" + targetName);\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n // Skins.\r\n if (root.skins) {\r\n for (var skinName in root.skins) {\r\n var skinMap = root.skins[skinName];\r\n var skin = new Skin(skinName);\r\n for (var slotName in skinMap) {\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotMap = skinMap[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slotIndex, entryName, skeletonData);\r\n if (attachment != null)\r\n skin.addAttachment(slotIndex, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_2 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n //linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n data.audioPath = this.getValue(eventMap, \"audio\", null);\r\n if (data.audioPath != null) {\r\n data.volume = this.getValue(eventMap, \"volume\", 1);\r\n data.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n // Animations.\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n var type = this.getValue(map, \"type\", \"region\");\r\n switch (type) {\r\n case \"region\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n region.color.setFromString(color);\r\n //region.updateOffset();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n mesh.color.setFromString(color);\r\n var parent_3 = this.getValue(map, \"parent\", null);\r\n if (parent_3 != null) {\r\n mesh.inheritDeform = this.getValue(map, \"deform\", true);\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_3));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n //mesh.updateUVs();\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = this.getValue(map, \"x\", 0) * scale;\r\n point.y = this.getValue(map, \"y\", 0) * scale;\r\n point.rotation = this.getValue(map, \"rotation\", 0);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n var end = this.getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n var duration = 0;\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (timelineName == \"attachment\") {\r\n var timeline = new AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, valueMap.time, valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n else if (timelineName == \"color\") {\r\n var timeline = new ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var color = new Color();\r\n color.setFromString(valueMap.color || \"ffffffff\");\r\n timeline.setFrame(frameIndex, valueMap.time, color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * ColorTimeline.ENTRIES]);\r\n }\r\n else if (timelineName == \"twoColor\") {\r\n var timeline = new TwoColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var light = new Color();\r\n var dark = new Color();\r\n light.setFromString(valueMap.light);\r\n dark.setFromString(valueMap.dark);\r\n timeline.setFrame(frameIndex, valueMap.time, light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TwoColorTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n var timeline = new RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, valueMap.angle);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * RotateTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"scale\")\r\n timeline = new ScaleTimeline(timelineMap.length);\r\n else if (timelineName === \"shear\")\r\n timeline = new ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var x = this.getValue(valueMap, \"x\", 0), y = this.getValue(valueMap, \"y\", 0);\r\n timeline.setFrame(frameIndex, valueMap.time, x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TranslateTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n var timeline = new IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var constraintMap = map.transform[constraintName];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n var timeline = new TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n // Path constraint timelines.\r\n if (map.paths) {\r\n for (var constraintName in map.paths) {\r\n var constraintMap = map.paths[constraintName];\r\n var index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintPositionTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, valueMap.time, this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n if (map.deform) {\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var skin = skeletonData.findSkin(deformName);\r\n if (skin == null) {\r\n if (settings.FAIL_ON_NON_EXISTING_SKIN) {\r\n throw new Error(\"Skin not found: \" + deformName);\r\n }\r\n else {\r\n continue;\r\n }\r\n }\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n var attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null)\r\n throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n var frameIndex = 0;\r\n for (var j = 0; j < timelineMap.length; j++) {\r\n var valueMap = timelineMap[j];\r\n var deform = void 0;\r\n var verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = this.getValue(valueMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, valueMap.time, deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null)\r\n drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n var timeline = new DrawOrderTimeline(drawOrderNode.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frameIndex = 0;\r\n for (var j = 0; j < drawOrderNode.length; j++) {\r\n var drawOrderMap = drawOrderNode[j];\r\n var drawOrder = null;\r\n var offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n var unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var i = 0; i < offsets.length; i++) {\r\n var offsetMap = offsets[i];\r\n var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1)\r\n drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, drawOrderMap.time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n // Event timeline.\r\n if (map.events) {\r\n var timeline = new EventTimeline(map.events.length);\r\n var frameIndex = 0;\r\n for (var i = 0; i < map.events.length; i++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_1 = new Event(Utils.toSinglePrecision(eventMap.time), eventData);\r\n event_1.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event_1.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event_1.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_1.data.audioPath != null) {\r\n event_1.volume = this.getValue(eventMap, \"volume\", 1);\r\n event_1.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frameIndex++, event_1);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n if (!map.curve)\r\n return;\r\n if (map.curve === \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else if (Object.prototype.toString.call(map.curve) === '[object Array]') {\r\n var curve = map.curve;\r\n timeline.setCurve(frameIndex, curve[0], curve[1], curve[2], curve[3]);\r\n }\r\n };\r\n SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return BLEND_MODES.NORMAL;\r\n if (str == \"additive\")\r\n return BLEND_MODES.ADD;\r\n if (str == \"multiply\")\r\n return BLEND_MODES.MULTIPLY;\r\n if (str == \"screen\")\r\n return BLEND_MODES.SCREEN;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n SkeletonJson.positionModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\")\r\n return PositionMode.Fixed;\r\n if (str == \"percent\")\r\n return PositionMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.spacingModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"length\")\r\n return SpacingMode.Length;\r\n if (str == \"fixed\")\r\n return SpacingMode.Fixed;\r\n if (str == \"percent\")\r\n return SpacingMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.rotateModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\")\r\n return RotateMode.Tangent;\r\n if (str == \"chain\")\r\n return RotateMode.Chain;\r\n if (str == \"chainscale\")\r\n return RotateMode.ChainScale;\r\n throw new Error(\"Unknown rotate mode: \" + str);\r\n };\r\n SkeletonJson.transformModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return TransformMode.Normal;\r\n if (str == \"onlytranslation\")\r\n return TransformMode.OnlyTranslation;\r\n if (str == \"norotationorreflection\")\r\n return TransformMode.NoRotationOrReflection;\r\n if (str == \"noscale\")\r\n return TransformMode.NoScale;\r\n if (str == \"noscaleorreflection\")\r\n return TransformMode.NoScaleOrReflection;\r\n throw new Error(\"Unknown transform mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n}());\r\nvar LinkedMesh = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n }\r\n return LinkedMesh;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n this.skeleton = new Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new AnimationStateData(spineData);\r\n this.state = new AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { Animation, AnimationState, AnimationStateAdapter2, AnimationStateData, AtlasAttachmentLoader, Attachment, AttachmentTimeline, Bone, BoneData, BoundingBoxAttachment, ClippingAttachment, ColorTimeline, CurveTimeline, DeformTimeline, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, IkConstraint, IkConstraintData, IkConstraintTimeline, JitterEffect, MeshAttachment, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PointAttachment, RegionAttachment, RotateTimeline, ScaleTimeline, ShearTimeline, Skeleton, SkeletonBounds, SkeletonData, SkeletonJson, Skin, Slot, SlotData, SpacingMode, Spine, SwirlEffect, TimelineType, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TranslateTimeline, TwoColorTimeline, VertexAttachment };\n//# sourceMappingURL=runtime-3.7.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/runtime-4.1 - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:32 UTC\n *\n * @pixi-spine/runtime-4.1 is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev <ivan.popelyshev@gmail.com>, All Rights Reserved\n */\nimport { Utils, AttachmentType, Color, MathUtils, MixBlend, MixDirection, StringSet, Pool, settings, TransformMode, PositionMode, RotateMode, Vector2, BinaryInput, SkeletonBoundsBase, SpineBase } from '@pixi-spine/base';\nimport { Matrix } from '@pixi/math';\nimport { BLEND_MODES } from '@pixi/constants';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * The base class for all attachments.\r\n * @public\r\n */\r\nvar Attachment = /** @class */ (function () {\r\n function Attachment(name) {\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n}());\r\n/**\r\n * Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's\r\n * {@link Slot#deform}.\r\n * @public\r\n */\r\nvar VertexAttachment = /** @class */ (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n /** The unique ID for this attachment. */\r\n _this.id = VertexAttachment.nextID++;\r\n /** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting\r\n * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null\r\n * if this attachment has no weights. */\r\n _this.bones = null;\r\n /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`\r\n * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting\r\n * each vertex. */\r\n _this.vertices = [];\r\n /** The maximum number of world vertex values that can be output by\r\n * {@link #computeWorldVertices()} using the `count` parameter. */\r\n _this.worldVerticesLength = 0;\r\n /** Timelines for the timeline attachment are also applied to this attachment.\r\n * May be null if no attachment-specific timelines should be applied. */\r\n _this.timelineAttachment = _this;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVerticesOld = function (slot, worldVertices) {\r\n this.computeWorldVertices(slot, 0, this.worldVerticesLength, worldVertices, 0, 2);\r\n };\r\n /** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is\r\n * not empty, it is used to deform the vertices.\r\n *\r\n * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\r\n * Runtimes Guide.\r\n * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.\r\n * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.\r\n * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *\r\n * `stride` / 2.\r\n * @param offset The `worldVertices` index to begin writing values.\r\n * @param stride The number of `worldVertices` entries between the value pairs written. */\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.deform;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (!bones) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var mat = slot.bone.matrix;\r\n var x = mat.tx;\r\n var y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var mat = skeletonBones[bones[v]].matrix;\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * mat.a + vy * mat.c + mat.tx) * weight;\r\n wy += (vx * mat.b + vy * mat.d + mat.ty) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n /** Does not copy id (generated) or name (set on construction). **/\r\n VertexAttachment.prototype.copyTo = function (attachment) {\r\n if (this.bones) {\r\n attachment.bones = new Array(this.bones.length);\r\n Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\r\n }\r\n else\r\n attachment.bones = null;\r\n if (this.vertices) {\r\n attachment.vertices = Utils.newFloatArray(this.vertices.length);\r\n Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\r\n }\r\n attachment.worldVerticesLength = this.worldVerticesLength;\r\n attachment.timelineAttachment = this.timelineAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar BoundingBoxAttachment = /** @class */ (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.BoundingBox;\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n BoundingBoxAttachment.prototype.copy = function () {\r\n var copy = new BoundingBoxAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return BoundingBoxAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar ClippingAttachment = /** @class */ (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Clipping;\r\n /** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of\r\n * the skeleton's rendering. */\r\n _this.endSlot = null;\r\n // Nonessential.\r\n /** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons\r\n * are not usually rendered at runtime. */\r\n _this.color = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\r\n return _this;\r\n }\r\n ClippingAttachment.prototype.copy = function () {\r\n var copy = new ClippingAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.endSlot = this.endSlot;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return ClippingAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar MeshAttachment = /** @class */ (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name, path) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Mesh;\r\n _this.region = null;\r\n /** Triplets of vertex indices which describe the mesh's triangulation. */\r\n _this.triangles = [];\r\n /** The color to tint the mesh. */\r\n _this.color = new Color(1, 1, 1, 1);\r\n /** The width of the mesh's image. Available only when nonessential data was exported. */\r\n _this.width = 0;\r\n /** The height of the mesh's image. Available only when nonessential data was exported. */\r\n _this.height = 0;\r\n /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */\r\n _this.hullLength = 0;\r\n /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if\r\n * nonessential data was exported. Triangulation is not performed at runtime. */\r\n _this.edges = [];\r\n _this.parentMesh = null;\r\n _this.sequence = null;\r\n _this.tempColor = new Color(0, 0, 0, 0);\r\n _this.path = path;\r\n return _this;\r\n }\r\n /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},\r\n * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the\r\n * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n /** @param parentMesh May be null. */\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n MeshAttachment.prototype.copy = function () {\r\n if (this.parentMesh)\r\n return this.newLinkedMesh();\r\n var copy = new MeshAttachment(this.name, this.path);\r\n copy.region = this.region;\r\n copy.color.setFromColor(this.color);\r\n this.copyTo(copy);\r\n copy.regionUVs = new Float32Array(this.regionUVs.length);\r\n Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\r\n copy.triangles = new Array(this.triangles.length);\r\n Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\r\n copy.hullLength = this.hullLength;\r\n copy.sequence = this.sequence != null ? this.sequence.copy() : null;\r\n // Nonessential.\r\n if (this.edges) {\r\n copy.edges = new Array(this.edges.length);\r\n Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\r\n }\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n return copy;\r\n };\r\n MeshAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n if (this.sequence != null)\r\n this.sequence.apply(slot, this);\r\n _super.prototype.computeWorldVertices.call(this, slot, start, count, worldVertices, offset, stride);\r\n };\r\n /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/\r\n MeshAttachment.prototype.newLinkedMesh = function () {\r\n var copy = new MeshAttachment(this.name, this.path);\r\n copy.region = this.region;\r\n copy.color.setFromColor(this.color);\r\n copy.timelineAttachment = this.timelineAttachment;\r\n copy.setParentMesh(this.parentMesh ? this.parentMesh : this);\r\n // if (copy.region != null) copy.updateRegion();\r\n return copy;\r\n };\r\n return MeshAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PathAttachment = /** @class */ (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Path;\r\n /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */\r\n _this.lengths = [];\r\n /** If true, the start and end knots are connected. */\r\n _this.closed = false;\r\n /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer\r\n * calculations are performed but calculating positions along the path is less accurate. */\r\n _this.constantSpeed = false;\r\n /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually\r\n * rendered at runtime. */\r\n _this.color = new Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n PathAttachment.prototype.copy = function () {\r\n var copy = new PathAttachment(this.name);\r\n this.copyTo(copy);\r\n copy.lengths = new Array(this.lengths.length);\r\n Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\r\n copy.closed = closed;\r\n copy.constantSpeed = this.constantSpeed;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PathAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar PointAttachment = /** @class */ (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Point;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.rotation = 0;\r\n /** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments\r\n * are not usually rendered at runtime. */\r\n _this.color = new Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n var mat = bone.matrix;\r\n point.x = this.x * mat.a + this.y * mat.c + bone.worldX;\r\n point.y = this.x * mat.b + this.y * mat.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var mat = bone.matrix;\r\n var cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\r\n var x = cos * mat.a + sin * mat.c;\r\n var y = cos * mat.b + sin * mat.d;\r\n return Math.atan2(y, x) * MathUtils.radDeg;\r\n };\r\n PointAttachment.prototype.copy = function () {\r\n var copy = new PointAttachment(this.name);\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.rotation = this.rotation;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PointAttachment;\r\n}(VertexAttachment));\n\n/**\r\n * @public\r\n */\r\nvar RegionAttachment = /** @class */ (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name, path) {\r\n var _this = _super.call(this, name) || this;\r\n _this.type = AttachmentType.Region;\r\n /** The local x translation. */\r\n _this.x = 0;\r\n /** The local y translation. */\r\n _this.y = 0;\r\n /** The local scaleX. */\r\n _this.scaleX = 1;\r\n /** The local scaleY. */\r\n _this.scaleY = 1;\r\n /** The local rotation. */\r\n _this.rotation = 0;\r\n /** The width of the region attachment in Spine. */\r\n _this.width = 0;\r\n /** The height of the region attachment in Spine. */\r\n _this.height = 0;\r\n /** The color to tint the region attachment. */\r\n _this.color = new Color(1, 1, 1, 1);\r\n _this.rendererObject = null;\r\n _this.region = null;\r\n _this.sequence = null;\r\n /** For each of the 4 vertices, a pair of <code>x,y</code> values that is the local position of the vertex.\r\n *\r\n * See {@link #updateOffset()}. */\r\n _this.offset = Utils.newFloatArray(8);\r\n _this.uvs = Utils.newFloatArray(8);\r\n _this.tempColor = new Color(1, 1, 1, 1);\r\n _this.path = path;\r\n return _this;\r\n }\r\n /** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */\r\n RegionAttachment.prototype.updateRegion = function () {\r\n if (!this.region)\r\n throw new Error(\"Region not set.\");\r\n var region = this.region;\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var x = this.x, y = this.y;\r\n var localXCos = localX * cos + x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[0] = localXCos - localYSin;\r\n offset[1] = localYCos + localXSin;\r\n offset[2] = localXCos - localY2Sin;\r\n offset[3] = localY2Cos + localXSin;\r\n offset[4] = localX2Cos - localY2Sin;\r\n offset[5] = localY2Cos + localX2Sin;\r\n offset[6] = localX2Cos - localYSin;\r\n offset[7] = localYCos + localX2Sin;\r\n var uvs = this.uvs;\r\n if (region.degrees == 90) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n /** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may\r\n * be changed.\r\n * <p>\r\n * See <a href=\"http://esotericsoftware.com/spine-runtime-skeletons#World-transforms\">World transforms</a> in the Spine\r\n * Runtimes Guide.\r\n * @param worldVertices The output world vertices. Must have a length >= <code>offset</code> + 8.\r\n * @param offset The <code>worldVertices</code> index to begin writing values.\r\n * @param stride The number of <code>worldVertices</code> entries between the value pairs written. */\r\n RegionAttachment.prototype.computeWorldVertices = function (slot, worldVertices, offset, stride) {\r\n if (this.sequence != null)\r\n this.sequence.apply(slot, this);\r\n var bone = slot.bone;\r\n var vertexOffset = this.offset;\r\n var mat = bone.matrix;\r\n var x = mat.tx, y = mat.ty;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[0];\r\n offsetY = vertexOffset[1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // br\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[2];\r\n offsetY = vertexOffset[3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // bl\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[4];\r\n offsetY = vertexOffset[5];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ul\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[6];\r\n offsetY = vertexOffset[7];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x; // ur\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.prototype.copy = function () {\r\n var copy = new RegionAttachment(this.name, this.path);\r\n copy.region = this.region;\r\n copy.rendererObject = this.rendererObject;\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.scaleX = this.scaleX;\r\n copy.scaleY = this.scaleY;\r\n copy.rotation = this.rotation;\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\r\n Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\r\n copy.color.setFromColor(this.color);\r\n copy.sequence = this.sequence != null ? this.sequence.copy() : null;\r\n return copy;\r\n };\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n}(Attachment));\n\n/**\r\n * @public\r\n */\r\nvar Sequence = /** @class */ (function () {\r\n function Sequence(count) {\r\n this.id = Sequence.nextID();\r\n this.start = 0;\r\n this.digits = 0;\r\n /** The index of the region to show for the setup pose. */\r\n this.setupIndex = 0;\r\n this.regions = new Array(count);\r\n }\r\n Sequence.prototype.copy = function () {\r\n var copy = new Sequence(this.regions.length);\r\n Utils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length);\r\n copy.start = this.start;\r\n copy.digits = this.digits;\r\n copy.setupIndex = this.setupIndex;\r\n return copy;\r\n };\r\n Sequence.prototype.apply = function (slot, attachment) {\r\n var index = slot.sequenceIndex;\r\n if (index == -1)\r\n index = this.setupIndex;\r\n if (index >= this.regions.length)\r\n index = this.regions.length - 1;\r\n var region = this.regions[index];\r\n if (attachment.region != region) {\r\n attachment.region = region;\r\n // attachment.updateRegion();\r\n }\r\n };\r\n Sequence.prototype.getPath = function (basePath, index) {\r\n var result = basePath;\r\n var frame = (this.start + index).toString();\r\n for (var i = this.digits - frame.length; i > 0; i--)\r\n result += \"0\";\r\n result += frame;\r\n return result;\r\n };\r\n Sequence.nextID = function () {\r\n return Sequence._nextID++;\r\n };\r\n Sequence._nextID = 0;\r\n return Sequence;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar SequenceMode;\r\n(function (SequenceMode) {\r\n SequenceMode[SequenceMode[\"hold\"] = 0] = \"hold\";\r\n SequenceMode[SequenceMode[\"once\"] = 1] = \"once\";\r\n SequenceMode[SequenceMode[\"loop\"] = 2] = \"loop\";\r\n SequenceMode[SequenceMode[\"pingpong\"] = 3] = \"pingpong\";\r\n SequenceMode[SequenceMode[\"onceReverse\"] = 4] = \"onceReverse\";\r\n SequenceMode[SequenceMode[\"loopReverse\"] = 5] = \"loopReverse\";\r\n SequenceMode[SequenceMode[\"pingpongReverse\"] = 6] = \"pingpongReverse\";\r\n})(SequenceMode || (SequenceMode = {}));\r\n/**\r\n * @public\r\n */\r\nvar SequenceModeValues = [\r\n SequenceMode.hold,\r\n SequenceMode.once,\r\n SequenceMode.loop,\r\n SequenceMode.pingpong,\r\n SequenceMode.onceReverse,\r\n SequenceMode.loopReverse,\r\n SequenceMode.pingpongReverse\r\n];\n\n/**\r\n * A simple container for a list of timelines and a name.\r\n * @public\r\n * */\r\nvar Animation = /** @class */ (function () {\r\n function Animation(name, timelines, duration) {\r\n this.timelines = [];\r\n this.timelineIds = new StringSet();\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n this.setTimelines(timelines);\r\n this.duration = duration;\r\n }\r\n Animation.prototype.setTimelines = function (timelines) {\r\n if (!timelines)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.timelines = timelines;\r\n this.timelineIds.clear();\r\n for (var i = 0; i < timelines.length; i++)\r\n this.timelineIds.addAll(timelines[i].getPropertyIds());\r\n };\r\n Animation.prototype.hasTimeline = function (ids) {\r\n for (var i = 0; i < ids.length; i++)\r\n if (this.timelineIds.contains(ids[i]))\r\n return true;\r\n return false;\r\n };\r\n /** Applies all the animation's timelines to the specified skeleton.\r\n *\r\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\r\n * @param loop If true, the animation repeats after {@link #getDuration()}.\r\n * @param events May be null to ignore fired events. */\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n return Animation;\r\n}());\r\nvar Property = {\r\n rotate: 0,\r\n x: 1,\r\n y: 2,\r\n scaleX: 3,\r\n scaleY: 4,\r\n shearX: 5,\r\n shearY: 6,\r\n rgb: 7,\r\n alpha: 8,\r\n rgb2: 9,\r\n attachment: 10,\r\n deform: 11,\r\n event: 12,\r\n drawOrder: 13,\r\n ikConstraint: 14,\r\n transformConstraint: 15,\r\n pathConstraintPosition: 16,\r\n pathConstraintSpacing: 17,\r\n pathConstraintMix: 18,\r\n sequence: 19\r\n};\r\n/** The interface for all timelines.\r\n * @public\r\n * */\r\nvar Timeline = /** @class */ (function () {\r\n function Timeline(frameCount, propertyIds) {\r\n this.propertyIds = propertyIds;\r\n this.frames = Utils.newFloatArray(frameCount * this.getFrameEntries());\r\n }\r\n Timeline.prototype.getPropertyIds = function () {\r\n return this.propertyIds;\r\n };\r\n Timeline.prototype.getFrameEntries = function () {\r\n return 1;\r\n };\r\n Timeline.prototype.getFrameCount = function () {\r\n return this.frames.length / this.getFrameEntries();\r\n };\r\n Timeline.prototype.getDuration = function () {\r\n return this.frames[this.frames.length - this.getFrameEntries()];\r\n };\r\n Timeline.search1 = function (frames, time) {\r\n var n = frames.length;\r\n for (var i = 1; i < n; i++)\r\n if (frames[i] > time)\r\n return i - 1;\r\n return n - 1;\r\n };\r\n Timeline.search = function (frames, time, step) {\r\n var n = frames.length;\r\n for (var i = step; i < n; i += step)\r\n if (frames[i] > time)\r\n return i - step;\r\n return n - step;\r\n };\r\n return Timeline;\r\n}());\r\n/** The base class for timelines that use interpolation between key frame values.\r\n * @public\r\n * */\r\nvar CurveTimeline = /** @class */ (function (_super) {\r\n __extends(CurveTimeline, _super);\r\n function CurveTimeline(frameCount, bezierCount, propertyIds) {\r\n var _this = _super.call(this, frameCount, propertyIds) || this;\r\n _this.curves = Utils.newFloatArray(frameCount + bezierCount * 18 /*BEZIER_SIZE*/);\r\n _this.curves[frameCount - 1] = 1 /*STEPPED*/;\r\n return _this;\r\n }\r\n /** Sets the specified key frame to linear interpolation. */\r\n CurveTimeline.prototype.setLinear = function (frame) {\r\n this.curves[frame] = 0 /*LINEAR*/;\r\n };\r\n /** Sets the specified key frame to stepped interpolation. */\r\n CurveTimeline.prototype.setStepped = function (frame) {\r\n this.curves[frame] = 1 /*STEPPED*/;\r\n };\r\n /** Shrinks the storage for Bezier curves, for use when <code>bezierCount</code> (specified in the constructor) was larger\r\n * than the actual number of Bezier curves. */\r\n CurveTimeline.prototype.shrink = function (bezierCount) {\r\n var size = this.getFrameCount() + bezierCount * 18 /*BEZIER_SIZE*/;\r\n if (this.curves.length > size) {\r\n var newCurves = Utils.newFloatArray(size);\r\n Utils.arrayCopy(this.curves, 0, newCurves, 0, size);\r\n this.curves = newCurves;\r\n }\r\n };\r\n /** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than\r\n * one curve per frame.\r\n * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and <code>bezierCount - 1</code> (specified\r\n * in the constructor), inclusive.\r\n * @param frame Between 0 and <code>frameCount - 1</code>, inclusive.\r\n * @param value The index of the value for this frame that this curve is used for.\r\n * @param time1 The time for the first key.\r\n * @param value1 The value for the first key.\r\n * @param cx1 The time for the first Bezier handle.\r\n * @param cy1 The value for the first Bezier handle.\r\n * @param cx2 The time of the second Bezier handle.\r\n * @param cy2 The value for the second Bezier handle.\r\n * @param time2 The time for the second key.\r\n * @param value2 The value for the second key. */\r\n CurveTimeline.prototype.setBezier = function (bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) {\r\n var curves = this.curves;\r\n var i = this.getFrameCount() + bezier * 18 /*BEZIER_SIZE*/;\r\n if (value == 0)\r\n curves[frame] = 2 /*BEZIER*/ + i;\r\n var tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03;\r\n var dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 0.006;\r\n var ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\r\n var dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667;\r\n var x = time1 + dx, y = value1 + dy;\r\n for (var n = i + 18 /*BEZIER_SIZE*/; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dx += ddx;\r\n dy += ddy;\r\n ddx += dddx;\r\n ddy += dddy;\r\n x += dx;\r\n y += dy;\r\n }\r\n };\r\n /** Returns the Bezier interpolated value for the specified time.\r\n * @param frameIndex The index into {@link #getFrames()} for the values of the frame before <code>time</code>.\r\n * @param valueOffset The offset from <code>frameIndex</code> to the value this curve is used for.\r\n * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */\r\n CurveTimeline.prototype.getBezierValue = function (time, frameIndex, valueOffset, i) {\r\n var curves = this.curves;\r\n if (curves[i] > time) {\r\n var x_1 = this.frames[frameIndex], y_1 = this.frames[frameIndex + valueOffset];\r\n return y_1 + (time - x_1) / (curves[i] - x_1) * (curves[i + 1] - y_1);\r\n }\r\n var n = i + 18 /*BEZIER_SIZE*/;\r\n for (i += 2; i < n; i += 2) {\r\n if (curves[i] >= time) {\r\n var x_2 = curves[i - 2], y_2 = curves[i - 1];\r\n return y_2 + (time - x_2) / (curves[i] - x_2) * (curves[i + 1] - y_2);\r\n }\r\n }\r\n frameIndex += this.getFrameEntries();\r\n var x = curves[n - 2], y = curves[n - 1];\r\n return y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y);\r\n };\r\n return CurveTimeline;\r\n}(Timeline));\r\n/**\r\n * @public\r\n */\r\nvar CurveTimeline1 = /** @class */ (function (_super) {\r\n __extends(CurveTimeline1, _super);\r\n function CurveTimeline1(frameCount, bezierCount, propertyId) {\r\n return _super.call(this, frameCount, bezierCount, [propertyId]) || this;\r\n }\r\n CurveTimeline1.prototype.getFrameEntries = function () {\r\n return 2 /*ENTRIES*/;\r\n };\r\n /** Sets the time and value for the specified frame.\r\n * @param frame Between 0 and <code>frameCount</code>, inclusive.\r\n * @param time The frame time in seconds. */\r\n CurveTimeline1.prototype.setFrame = function (frame, time, value) {\r\n frame <<= 1;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*VALUE*/] = value;\r\n };\r\n /** Returns the interpolated value for the specified time. */\r\n CurveTimeline1.prototype.getCurveValue = function (time) {\r\n var frames = this.frames;\r\n var i = frames.length - 2;\r\n for (var ii = 2; ii <= i; ii += 2) {\r\n if (frames[ii] > time) {\r\n i = ii - 2;\r\n break;\r\n }\r\n }\r\n var curveType = this.curves[i >> 1];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i], value = frames[i + 1 /*VALUE*/];\r\n return value + (time - before) / (frames[i + 2 /*ENTRIES*/] - before) * (frames[i + 2 /*ENTRIES*/ + 1 /*VALUE*/] - value);\r\n case 1 /*STEPPED*/:\r\n return frames[i + 1 /*VALUE*/];\r\n }\r\n return this.getBezierValue(time, i, 1 /*VALUE*/, curveType - 2 /*BEZIER*/);\r\n };\r\n return CurveTimeline1;\r\n}(CurveTimeline));\r\n/** The base class for a {@link CurveTimeline} which sets two properties.\r\n * @public\r\n * */\r\nvar CurveTimeline2 = /** @class */ (function (_super) {\r\n __extends(CurveTimeline2, _super);\r\n /** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}.\r\n * @param propertyIds Unique identifiers for the properties the timeline modifies. */\r\n function CurveTimeline2(frameCount, bezierCount, propertyId1, propertyId2) {\r\n return _super.call(this, frameCount, bezierCount, [propertyId1, propertyId2]) || this;\r\n }\r\n CurveTimeline2.prototype.getFrameEntries = function () {\r\n return 3 /*ENTRIES*/;\r\n };\r\n /** Sets the time and values for the specified frame.\r\n * @param frame Between 0 and <code>frameCount</code>, inclusive.\r\n * @param time The frame time in seconds. */\r\n CurveTimeline2.prototype.setFrame = function (frame, time, value1, value2) {\r\n frame *= 3 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*VALUE1*/] = value1;\r\n this.frames[frame + 2 /*VALUE2*/] = value2;\r\n };\r\n return CurveTimeline2;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#rotation}.\r\n * @public\r\n * */\r\nvar RotateTimeline = /** @class */ (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.rotate + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n bone.rotation += (bone.data.rotation - bone.rotation) * alpha;\r\n }\r\n return;\r\n }\r\n var r = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += r * alpha;\r\n }\r\n };\r\n return RotateTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#x} and {@link Bone#y}.\r\n * @public\r\n * */\r\nvar TranslateTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.x + \"|\" + boneIndex, Property.y + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n var i = Timeline.search(frames, time, 3 /*ENTRIES*/);\r\n var curveType = this.curves[i / 3 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n var t = (time - before) / (frames[i + 3 /*ENTRIES*/] - before);\r\n x += (frames[i + 3 /*ENTRIES*/ + 1 /*VALUE1*/] - x) * t;\r\n y += (frames[i + 3 /*ENTRIES*/ + 2 /*VALUE2*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n break;\r\n default:\r\n x = this.getBezierValue(time, i, 1 /*VALUE1*/, curveType - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 2 /*VALUE2*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n return TranslateTimeline;\r\n}(CurveTimeline2));\r\n/** Changes a bone's local {@link Bone#x}.\r\n * @public\r\n * */\r\nvar TranslateXTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateXTimeline, _super);\r\n function TranslateXTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.x + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n TranslateXTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n }\r\n return;\r\n }\r\n var x = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n }\r\n };\r\n return TranslateXTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#x}.\r\n * @public\r\n * */\r\nvar TranslateYTimeline = /** @class */ (function (_super) {\r\n __extends(TranslateYTimeline, _super);\r\n function TranslateYTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.y + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n TranslateYTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var y = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.y += y * alpha;\r\n }\r\n };\r\n return TranslateYTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}.\r\n * @public\r\n * */\r\nvar ScaleTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.scaleX + \"|\" + boneIndex, Property.scaleY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x, y;\r\n var i = Timeline.search(frames, time, 3 /*ENTRIES*/);\r\n var curveType = this.curves[i / 3 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n var t = (time - before) / (frames[i + 3 /*ENTRIES*/] - before);\r\n x += (frames[i + 3 /*ENTRIES*/ + 1 /*VALUE1*/] - x) * t;\r\n y += (frames[i + 3 /*ENTRIES*/ + 2 /*VALUE2*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n break;\r\n default:\r\n x = this.getBezierValue(time, i, 1 /*VALUE1*/, curveType - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 2 /*VALUE2*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n x *= bone.data.scaleX;\r\n y *= bone.data.scaleY;\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n}(CurveTimeline2));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}.\r\n * @public\r\n * */\r\nvar ScaleXTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleXTimeline, _super);\r\n function ScaleXTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.scaleX + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ScaleXTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n }\r\n return;\r\n }\r\n var x = this.getCurveValue(time) * bone.data.scaleX;\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add)\r\n bone.scaleX += x - bone.data.scaleX;\r\n else\r\n bone.scaleX = x;\r\n }\r\n else {\r\n // Mixing out uses sign of setup or current pose, else use sign of key.\r\n var bx = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * MathUtils.signum(x);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleX += (x - bone.data.scaleX) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleXTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}.\r\n * @public\r\n * */\r\nvar ScaleYTimeline = /** @class */ (function (_super) {\r\n __extends(ScaleYTimeline, _super);\r\n function ScaleYTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.scaleY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ScaleYTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var y = this.getCurveValue(time) * bone.data.scaleY;\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add)\r\n bone.scaleY += y - bone.data.scaleY;\r\n else\r\n bone.scaleY = y;\r\n }\r\n else {\r\n // Mixing out uses sign of setup or current pose, else use sign of key.\r\n var by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n by = bone.data.scaleY;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n by = bone.scaleY;\r\n bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n by = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n by = Math.abs(bone.scaleY) * MathUtils.signum(y);\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.scaleY += (y - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleYTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar ShearTimeline = /** @class */ (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.shearX + \"|\" + boneIndex, Property.shearY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n var i = Timeline.search(frames, time, 3 /*ENTRIES*/);\r\n var curveType = this.curves[i / 3 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n var t = (time - before) / (frames[i + 3 /*ENTRIES*/] - before);\r\n x += (frames[i + 3 /*ENTRIES*/ + 1 /*VALUE1*/] - x) * t;\r\n y += (frames[i + 3 /*ENTRIES*/ + 2 /*VALUE2*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n x = frames[i + 1 /*VALUE1*/];\r\n y = frames[i + 2 /*VALUE2*/];\r\n break;\r\n default:\r\n x = this.getBezierValue(time, i, 1 /*VALUE1*/, curveType - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 2 /*VALUE2*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n}(CurveTimeline2));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar ShearXTimeline = /** @class */ (function (_super) {\r\n __extends(ShearXTimeline, _super);\r\n function ShearXTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.shearX + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ShearXTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n }\r\n return;\r\n }\r\n var x = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n }\r\n };\r\n return ShearXTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar ShearYTimeline = /** @class */ (function (_super) {\r\n __extends(ShearYTimeline, _super);\r\n function ShearYTimeline(frameCount, bezierCount, boneIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.shearY + \"|\" + boneIndex) || this;\r\n _this.boneIndex = 0;\r\n _this.boneIndex = boneIndex;\r\n return _this;\r\n }\r\n ShearYTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var y = this.getCurveValue(time);\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearYTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a slot's {@link Slot#color}.\r\n * @public\r\n * */\r\nvar RGBATimeline = /** @class */ (function (_super) {\r\n __extends(RGBATimeline, _super);\r\n function RGBATimeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex,\r\n Property.alpha + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGBATimeline.prototype.getFrameEntries = function () {\r\n return 5 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\r\n RGBATimeline.prototype.setFrame = function (frame, time, r, g, b, a) {\r\n frame *= 5 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n this.frames[frame + 4 /*A*/] = a;\r\n };\r\n RGBATimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var color = slot.color;\r\n if (time < frames[0]) {\r\n var setup = slot.data.color;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n color.setFromColor(setup);\r\n return;\r\n case MixBlend.first:\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n var i = Timeline.search(frames, time, 5 /*ENTRIES*/);\r\n var curveType = this.curves[i / 5 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n var t = (time - before) / (frames[i + 5 /*ENTRIES*/] - before);\r\n r += (frames[i + 5 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 5 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 5 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n a += (frames[i + 5 /*ENTRIES*/ + 4 /*A*/] - a) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n a = this.getBezierValue(time, i, 4 /*A*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1)\r\n color.set(r, g, b, a);\r\n else {\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n return RGBATimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#color}.\r\n * @public\r\n * */\r\nvar RGBTimeline = /** @class */ (function (_super) {\r\n __extends(RGBTimeline, _super);\r\n function RGBTimeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGBTimeline.prototype.getFrameEntries = function () {\r\n return 4 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\r\n RGBTimeline.prototype.setFrame = function (frame, time, r, g, b) {\r\n frame <<= 2;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n };\r\n RGBTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var color = slot.color;\r\n if (time < frames[0]) {\r\n var setup = slot.data.color;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n color.r = setup.r;\r\n color.g = setup.g;\r\n color.b = setup.b;\r\n return;\r\n case MixBlend.first:\r\n color.r += (setup.r - color.r) * alpha;\r\n color.g += (setup.g - color.g) * alpha;\r\n color.b += (setup.b - color.b) * alpha;\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0;\r\n var i = Timeline.search(frames, time, 4 /*ENTRIES*/);\r\n var curveType = this.curves[i >> 2];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n var t = (time - before) / (frames[i + 4 /*ENTRIES*/] - before);\r\n r += (frames[i + 4 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 4 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 4 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1) {\r\n color.r = r;\r\n color.g = g;\r\n color.b = b;\r\n }\r\n else {\r\n if (blend == MixBlend.setup) {\r\n var setup = slot.data.color;\r\n color.r = setup.r;\r\n color.g = setup.g;\r\n color.b = setup.b;\r\n }\r\n color.r += (r - color.r) * alpha;\r\n color.g += (g - color.g) * alpha;\r\n color.b += (b - color.b) * alpha;\r\n }\r\n };\r\n return RGBTimeline;\r\n}(CurveTimeline));\r\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}.\r\n * @public\r\n * */\r\nvar AlphaTimeline = /** @class */ (function (_super) {\r\n __extends(AlphaTimeline, _super);\r\n function AlphaTimeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.alpha + \"|\" + slotIndex) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n AlphaTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var color = slot.color;\r\n if (time < this.frames[0]) { // Time is before first frame.\r\n var setup = slot.data.color;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n color.a = setup.a;\r\n return;\r\n case MixBlend.first:\r\n color.a += (setup.a - color.a) * alpha;\r\n }\r\n return;\r\n }\r\n var a = this.getCurveValue(time);\r\n if (alpha == 1)\r\n color.a = a;\r\n else {\r\n if (blend == MixBlend.setup)\r\n color.a = slot.data.color.a;\r\n color.a += (a - color.a) * alpha;\r\n }\r\n };\r\n return AlphaTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting.\r\n * @public\r\n * */\r\nvar RGBA2Timeline = /** @class */ (function (_super) {\r\n __extends(RGBA2Timeline, _super);\r\n function RGBA2Timeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex,\r\n Property.alpha + \"|\" + slotIndex,\r\n Property.rgb2 + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGBA2Timeline.prototype.getFrameEntries = function () {\r\n return 8 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, light, and dark colors for the specified key frame. */\r\n RGBA2Timeline.prototype.setFrame = function (frame, time, r, g, b, a, r2, g2, b2) {\r\n frame <<= 3;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n this.frames[frame + 4 /*A*/] = a;\r\n this.frames[frame + 5 /*R2*/] = r2;\r\n this.frames[frame + 6 /*G2*/] = g2;\r\n this.frames[frame + 7 /*B2*/] = b2;\r\n };\r\n RGBA2Timeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var light = slot.color, dark = slot.darkColor;\r\n if (time < frames[0]) {\r\n var setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n light.setFromColor(setupLight);\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n return;\r\n case MixBlend.first:\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.r += (setupDark.r - dark.r) * alpha;\r\n dark.g += (setupDark.g - dark.g) * alpha;\r\n dark.b += (setupDark.b - dark.b) * alpha;\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n var i = Timeline.search(frames, time, 8 /*ENTRIES*/);\r\n var curveType = this.curves[i >> 3];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n r2 = frames[i + 5 /*R2*/];\r\n g2 = frames[i + 6 /*G2*/];\r\n b2 = frames[i + 7 /*B2*/];\r\n var t = (time - before) / (frames[i + 8 /*ENTRIES*/] - before);\r\n r += (frames[i + 8 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 8 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 8 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n a += (frames[i + 8 /*ENTRIES*/ + 4 /*A*/] - a) * t;\r\n r2 += (frames[i + 8 /*ENTRIES*/ + 5 /*R2*/] - r2) * t;\r\n g2 += (frames[i + 8 /*ENTRIES*/ + 6 /*G2*/] - g2) * t;\r\n b2 += (frames[i + 8 /*ENTRIES*/ + 7 /*B2*/] - b2) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n a = frames[i + 4 /*A*/];\r\n r2 = frames[i + 5 /*R2*/];\r\n g2 = frames[i + 6 /*G2*/];\r\n b2 = frames[i + 7 /*B2*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n a = this.getBezierValue(time, i, 4 /*A*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n r2 = this.getBezierValue(time, i, 5 /*R2*/, curveType + 18 /*BEZIER_SIZE*/ * 4 - 2 /*BEZIER*/);\r\n g2 = this.getBezierValue(time, i, 6 /*G2*/, curveType + 18 /*BEZIER_SIZE*/ * 5 - 2 /*BEZIER*/);\r\n b2 = this.getBezierValue(time, i, 7 /*B2*/, curveType + 18 /*BEZIER_SIZE*/ * 6 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1) {\r\n light.set(r, g, b, a);\r\n dark.r = r2;\r\n dark.g = g2;\r\n dark.b = b2;\r\n }\r\n else {\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n var setupDark = slot.data.darkColor;\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.r += (r2 - dark.r) * alpha;\r\n dark.g += (g2 - dark.g) * alpha;\r\n dark.b += (b2 - dark.b) * alpha;\r\n }\r\n };\r\n return RGBA2Timeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting.\r\n * @public\r\n * */\r\nvar RGB2Timeline = /** @class */ (function (_super) {\r\n __extends(RGB2Timeline, _super);\r\n function RGB2Timeline(frameCount, bezierCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.rgb + \"|\" + slotIndex,\r\n Property.rgb2 + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n return _this;\r\n }\r\n RGB2Timeline.prototype.getFrameEntries = function () {\r\n return 7 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, light, and dark colors for the specified key frame. */\r\n RGB2Timeline.prototype.setFrame = function (frame, time, r, g, b, r2, g2, b2) {\r\n frame *= 7 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*R*/] = r;\r\n this.frames[frame + 2 /*G*/] = g;\r\n this.frames[frame + 3 /*B*/] = b;\r\n this.frames[frame + 4 /*R2*/] = r2;\r\n this.frames[frame + 5 /*G2*/] = g2;\r\n this.frames[frame + 6 /*B2*/] = b2;\r\n };\r\n RGB2Timeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n var light = slot.color, dark = slot.darkColor;\r\n if (time < frames[0]) {\r\n var setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n light.r = setupLight.r;\r\n light.g = setupLight.g;\r\n light.b = setupLight.b;\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n return;\r\n case MixBlend.first:\r\n light.r += (setupLight.r - light.r) * alpha;\r\n light.g += (setupLight.g - light.g) * alpha;\r\n light.b += (setupLight.b - light.b) * alpha;\r\n dark.r += (setupDark.r - dark.r) * alpha;\r\n dark.g += (setupDark.g - dark.g) * alpha;\r\n dark.b += (setupDark.b - dark.b) * alpha;\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, r2 = 0, g2 = 0, b2 = 0;\r\n var i = Timeline.search(frames, time, 7 /*ENTRIES*/);\r\n var curveType = this.curves[i / 7 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n r2 = frames[i + 4 /*R2*/];\r\n g2 = frames[i + 5 /*G2*/];\r\n b2 = frames[i + 6 /*B2*/];\r\n var t = (time - before) / (frames[i + 7 /*ENTRIES*/] - before);\r\n r += (frames[i + 7 /*ENTRIES*/ + 1 /*R*/] - r) * t;\r\n g += (frames[i + 7 /*ENTRIES*/ + 2 /*G*/] - g) * t;\r\n b += (frames[i + 7 /*ENTRIES*/ + 3 /*B*/] - b) * t;\r\n r2 += (frames[i + 7 /*ENTRIES*/ + 4 /*R2*/] - r2) * t;\r\n g2 += (frames[i + 7 /*ENTRIES*/ + 5 /*G2*/] - g2) * t;\r\n b2 += (frames[i + 7 /*ENTRIES*/ + 6 /*B2*/] - b2) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n r = frames[i + 1 /*R*/];\r\n g = frames[i + 2 /*G*/];\r\n b = frames[i + 3 /*B*/];\r\n r2 = frames[i + 4 /*R2*/];\r\n g2 = frames[i + 5 /*G2*/];\r\n b2 = frames[i + 6 /*B2*/];\r\n break;\r\n default:\r\n r = this.getBezierValue(time, i, 1 /*R*/, curveType - 2 /*BEZIER*/);\r\n g = this.getBezierValue(time, i, 2 /*G*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n b = this.getBezierValue(time, i, 3 /*B*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n r2 = this.getBezierValue(time, i, 4 /*R2*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n g2 = this.getBezierValue(time, i, 5 /*G2*/, curveType + 18 /*BEZIER_SIZE*/ * 4 - 2 /*BEZIER*/);\r\n b2 = this.getBezierValue(time, i, 6 /*B2*/, curveType + 18 /*BEZIER_SIZE*/ * 5 - 2 /*BEZIER*/);\r\n }\r\n if (alpha == 1) {\r\n light.r = r;\r\n light.g = g;\r\n light.b = b;\r\n dark.r = r2;\r\n dark.g = g2;\r\n dark.b = b2;\r\n }\r\n else {\r\n if (blend == MixBlend.setup) {\r\n var setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.r = setupLight.r;\r\n light.g = setupLight.g;\r\n light.b = setupLight.b;\r\n dark.r = setupDark.r;\r\n dark.g = setupDark.g;\r\n dark.b = setupDark.b;\r\n }\r\n light.r += (r - light.r) * alpha;\r\n light.g += (g - light.g) * alpha;\r\n light.b += (b - light.b) * alpha;\r\n dark.r += (r2 - dark.r) * alpha;\r\n dark.g += (g2 - dark.g) * alpha;\r\n dark.b += (b2 - dark.b) * alpha;\r\n }\r\n };\r\n return RGB2Timeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#attachment}.\r\n * @public\r\n * */\r\nvar AttachmentTimeline = /** @class */ (function (_super) {\r\n __extends(AttachmentTimeline, _super);\r\n function AttachmentTimeline(frameCount, slotIndex) {\r\n var _this = _super.call(this, frameCount, [\r\n Property.attachment + \"|\" + slotIndex\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n _this.attachmentNames = new Array(frameCount);\r\n return _this;\r\n }\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the attachment name for the specified key frame. */\r\n AttachmentTimeline.prototype.setFrame = function (frame, time, attachmentName) {\r\n this.frames[frame] = time;\r\n this.attachmentNames[frame] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n if (time < this.frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n this.setAttachment(skeleton, slot, this.attachmentNames[Timeline.search1(this.frames, time)]);\r\n };\r\n AttachmentTimeline.prototype.setAttachment = function (skeleton, slot, attachmentName) {\r\n slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n return AttachmentTimeline;\r\n}(Timeline));\r\n/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}.\r\n * @public\r\n * */\r\nvar DeformTimeline = /** @class */ (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount, bezierCount, slotIndex, attachment) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.deform + \"|\" + slotIndex + \"|\" + attachment.id\r\n ]) || this;\r\n _this.slotIndex = 0;\r\n _this.slotIndex = slotIndex;\r\n _this.attachment = attachment;\r\n _this.vertices = new Array(frameCount);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the vertices for the specified key frame.\r\n * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\r\n DeformTimeline.prototype.setFrame = function (frame, time, vertices) {\r\n this.frames[frame] = time;\r\n this.vertices[frame] = vertices;\r\n };\r\n /** @param value1 Ignored (0 is used for a deform timeline).\r\n * @param value2 Ignored (1 is used for a deform timeline). */\r\n DeformTimeline.prototype.setBezier = function (bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) {\r\n var curves = this.curves;\r\n var i = this.getFrameCount() + bezier * 18 /*BEZIER_SIZE*/;\r\n if (value == 0)\r\n curves[frame] = 2 /*BEZIER*/ + i;\r\n var tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06;\r\n var dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = (cy1 - cy2 + 0.33333333) * 0.018;\r\n var ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\r\n var dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667;\r\n var x = time1 + dx, y = dy;\r\n for (var n = i + 18 /*BEZIER_SIZE*/; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dx += ddx;\r\n dy += ddy;\r\n ddx += dddx;\r\n ddy += dddy;\r\n x += dx;\r\n y += dy;\r\n }\r\n };\r\n DeformTimeline.prototype.getCurvePercent = function (time, frame) {\r\n var curves = this.curves;\r\n var i = curves[frame];\r\n switch (i) {\r\n case 0 /*LINEAR*/:\r\n var x_3 = this.frames[frame];\r\n return (time - x_3) / (this.frames[frame + this.getFrameEntries()] - x_3);\r\n case 1 /*STEPPED*/:\r\n return 0;\r\n }\r\n i -= 2 /*BEZIER*/;\r\n if (curves[i] > time) {\r\n var x_4 = this.frames[frame];\r\n return curves[i + 1] * (time - x_4) / (curves[i] - x_4);\r\n }\r\n var n = i + 18 /*BEZIER_SIZE*/;\r\n for (i += 2; i < n; i += 2) {\r\n if (curves[i] >= time) {\r\n var x_5 = curves[i - 2], y_3 = curves[i - 1];\r\n return y_3 + (time - x_5) / (curves[i] - x_5) * (curves[i + 1] - y_3);\r\n }\r\n }\r\n var x = curves[n - 2], y = curves[n - 1];\r\n return y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var slotAttachment = slot.getAttachment();\r\n if (!slotAttachment)\r\n return;\r\n if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != this.attachment)\r\n return;\r\n var deform = slot.deform;\r\n if (deform.length == 0)\r\n blend = MixBlend.setup;\r\n var vertices = this.vertices;\r\n var vertexCount = vertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n deform.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n deform.length = 0;\r\n return;\r\n }\r\n deform.length = vertexCount;\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform[i] += (setupVertices[i] - deform[i]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets.\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n deform.length = vertexCount;\r\n if (time >= frames[frames.length - 1]) { // Time is after last frame.\r\n var lastVertices = vertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_1 = 0; i_1 < vertexCount; i_1++)\r\n deform[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n deform[i_2] += lastVertices[i_2];\r\n }\r\n }\r\n else\r\n Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (!vertexAttachment_1.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n var setup = setupVertices[i_3];\r\n deform[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n deform[i_4] = lastVertices[i_4] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_6 = 0; i_6 < vertexCount; i_6++)\r\n deform[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n deform[i_7] += lastVertices[i_7] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n // Interpolate between the previous frame and the current frame.\r\n var frame = Timeline.search1(frames, time);\r\n var percent = this.getCurvePercent(time, frame);\r\n var prevVertices = vertices[frame];\r\n var nextVertices = vertices[frame + 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n var prev = prevVertices[i_8];\r\n deform[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n var prev = prevVertices[i_9];\r\n deform[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n var prev = prevVertices[i_10];\r\n deform[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (!vertexAttachment_2.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n var prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n deform[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n var prev = prevVertices[i_12];\r\n deform[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n var prev = prevVertices[i_13];\r\n deform[i_13] += (prev + (nextVertices[i_13] - prev) * percent - deform[i_13]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (!vertexAttachment.bones) {\r\n // Unweighted vertex positions, with alpha.\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n var prev = prevVertices[i_14];\r\n deform[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n }\r\n }\r\n else {\r\n // Weighted deform offsets, with alpha.\r\n for (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n var prev = prevVertices[i_15];\r\n deform[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n}(CurveTimeline));\r\n/** Fires an {@link Event} when specific animation times are reached.\r\n * @public\r\n * */\r\nvar EventTimeline = /** @class */ (function (_super) {\r\n __extends(EventTimeline, _super);\r\n function EventTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount, EventTimeline.propertyIds) || this;\r\n _this.events = new Array(frameCount);\r\n return _this;\r\n }\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the event for the specified key frame. */\r\n EventTimeline.prototype.setFrame = function (frame, event) {\r\n this.frames[frame] = event.time;\r\n this.events[frame] = event;\r\n };\r\n /** Fires events for frames > `lastTime` and <= `time`. */\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (!firedEvents)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) { // Fire events after last time for looped animations.\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\r\n return;\r\n if (time < frames[0])\r\n return; // Time is before first frame.\r\n var i = 0;\r\n if (lastTime < frames[0])\r\n i = 0;\r\n else {\r\n i = Timeline.search1(frames, lastTime) + 1;\r\n var frameTime = frames[i];\r\n while (i > 0) { // Fire multiple events with the same frame.\r\n if (frames[i - 1] != frameTime)\r\n break;\r\n i--;\r\n }\r\n }\r\n for (; i < frameCount && time >= frames[i]; i++)\r\n firedEvents.push(this.events[i]);\r\n };\r\n EventTimeline.propertyIds = [\"\" + Property.event];\r\n return EventTimeline;\r\n}(Timeline));\r\n/** Changes a skeleton's {@link Skeleton#drawOrder}.\r\n * @public\r\n * */\r\nvar DrawOrderTimeline = /** @class */ (function (_super) {\r\n __extends(DrawOrderTimeline, _super);\r\n function DrawOrderTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount, DrawOrderTimeline.propertyIds) || this;\r\n _this.drawOrders = new Array(frameCount);\r\n return _this;\r\n }\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n /** Sets the time in seconds and the draw order for the specified key frame.\r\n * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\r\n * draw order. */\r\n DrawOrderTimeline.prototype.setFrame = function (frame, time, drawOrder) {\r\n this.frames[frame] = time;\r\n this.drawOrders[frame] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n if (time < this.frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var idx = Timeline.search1(this.frames, time);\r\n var drawOrderToSetupIndex = this.drawOrders[idx];\r\n if (!drawOrderToSetupIndex)\r\n Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n else {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n DrawOrderTimeline.propertyIds = [\"\" + Property.drawOrder];\r\n return DrawOrderTimeline;\r\n}(Timeline));\r\n/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},\r\n * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}.\r\n * @public\r\n * */\r\nvar IkConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount, bezierCount, ikConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.ikConstraint + \"|\" + ikConstraintIndex\r\n ]) || this;\r\n /** The index of the IK constraint slot in {@link Skeleton#ikConstraints} that will be changed. */\r\n _this.ikConstraintIndex = 0;\r\n _this.ikConstraintIndex = ikConstraintIndex;\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getFrameEntries = function () {\r\n return 6 /*ENTRIES*/;\r\n };\r\n /** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */\r\n IkConstraintTimeline.prototype.setFrame = function (frame, time, mix, softness, bendDirection, compress, stretch) {\r\n frame *= 6 /*ENTRIES*/;\r\n this.frames[frame] = time;\r\n this.frames[frame + 1 /*MIX*/] = mix;\r\n this.frames[frame + 2 /*SOFTNESS*/] = softness;\r\n this.frames[frame + 3 /*BEND_DIRECTION*/] = bendDirection;\r\n this.frames[frame + 4 /*COMPRESS*/] = compress ? 1 : 0;\r\n this.frames[frame + 5 /*STRETCH*/] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.softness += (constraint.data.softness - constraint.softness) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n var mix = 0, softness = 0;\r\n var i = Timeline.search(frames, time, 6 /*ENTRIES*/);\r\n var curveType = this.curves[i / 6 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n mix = frames[i + 1 /*MIX*/];\r\n softness = frames[i + 2 /*SOFTNESS*/];\r\n var t = (time - before) / (frames[i + 6 /*ENTRIES*/] - before);\r\n mix += (frames[i + 6 /*ENTRIES*/ + 1 /*MIX*/] - mix) * t;\r\n softness += (frames[i + 6 /*ENTRIES*/ + 2 /*SOFTNESS*/] - softness) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n mix = frames[i + 1 /*MIX*/];\r\n softness = frames[i + 2 /*SOFTNESS*/];\r\n break;\r\n default:\r\n mix = this.getBezierValue(time, i, 1 /*MIX*/, curveType - 2 /*BEZIER*/);\r\n softness = this.getBezierValue(time, i, 2 /*SOFTNESS*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness + (softness - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[i + 3 /*BEND_DIRECTION*/];\r\n constraint.compress = frames[i + 4 /*COMPRESS*/] != 0;\r\n constraint.stretch = frames[i + 5 /*STRETCH*/] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix - constraint.mix) * alpha;\r\n constraint.softness += (softness - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[i + 3 /*BEND_DIRECTION*/];\r\n constraint.compress = frames[i + 4 /*COMPRESS*/] != 0;\r\n constraint.stretch = frames[i + 5 /*STRETCH*/] != 0;\r\n }\r\n }\r\n };\r\n return IkConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},\r\n * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}.\r\n * @public\r\n * */\r\nvar TransformConstraintTimeline = /** @class */ (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount, bezierCount, transformConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.transformConstraint + \"|\" + transformConstraintIndex\r\n ]) || this;\r\n /** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */\r\n _this.transformConstraintIndex = 0;\r\n _this.transformConstraintIndex = transformConstraintIndex;\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getFrameEntries = function () {\r\n return 7 /*ENTRIES*/;\r\n };\r\n /** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */\r\n TransformConstraintTimeline.prototype.setFrame = function (frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY) {\r\n var frames = this.frames;\r\n frame *= 7 /*ENTRIES*/;\r\n frames[frame] = time;\r\n frames[frame + 1 /*ROTATE*/] = mixRotate;\r\n frames[frame + 2 /*X*/] = mixX;\r\n frames[frame + 3 /*Y*/] = mixY;\r\n frames[frame + 4 /*SCALEX*/] = mixScaleX;\r\n frames[frame + 5 /*SCALEY*/] = mixScaleY;\r\n frames[frame + 6 /*SHEARY*/] = mixShearY;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mixRotate = data.mixRotate;\r\n constraint.mixX = data.mixX;\r\n constraint.mixY = data.mixY;\r\n constraint.mixScaleX = data.mixScaleX;\r\n constraint.mixScaleY = data.mixScaleY;\r\n constraint.mixShearY = data.mixShearY;\r\n return;\r\n case MixBlend.first:\r\n constraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (data.mixX - constraint.mixX) * alpha;\r\n constraint.mixY += (data.mixY - constraint.mixY) * alpha;\r\n constraint.mixScaleX += (data.mixScaleX - constraint.mixScaleX) * alpha;\r\n constraint.mixScaleY += (data.mixScaleY - constraint.mixScaleY) * alpha;\r\n constraint.mixShearY += (data.mixShearY - constraint.mixShearY) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate, x, y, scaleX, scaleY, shearY;\r\n var i = Timeline.search(frames, time, 7 /*ENTRIES*/);\r\n var curveType = this.curves[i / 7 /*ENTRIES*/];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n scaleX = frames[i + 4 /*SCALEX*/];\r\n scaleY = frames[i + 5 /*SCALEY*/];\r\n shearY = frames[i + 6 /*SHEARY*/];\r\n var t = (time - before) / (frames[i + 7 /*ENTRIES*/] - before);\r\n rotate += (frames[i + 7 /*ENTRIES*/ + 1 /*ROTATE*/] - rotate) * t;\r\n x += (frames[i + 7 /*ENTRIES*/ + 2 /*X*/] - x) * t;\r\n y += (frames[i + 7 /*ENTRIES*/ + 3 /*Y*/] - y) * t;\r\n scaleX += (frames[i + 7 /*ENTRIES*/ + 4 /*SCALEX*/] - scaleX) * t;\r\n scaleY += (frames[i + 7 /*ENTRIES*/ + 5 /*SCALEY*/] - scaleY) * t;\r\n shearY += (frames[i + 7 /*ENTRIES*/ + 6 /*SHEARY*/] - shearY) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n scaleX = frames[i + 4 /*SCALEX*/];\r\n scaleY = frames[i + 5 /*SCALEY*/];\r\n shearY = frames[i + 6 /*SHEARY*/];\r\n break;\r\n default:\r\n rotate = this.getBezierValue(time, i, 1 /*ROTATE*/, curveType - 2 /*BEZIER*/);\r\n x = this.getBezierValue(time, i, 2 /*X*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 3 /*Y*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n scaleX = this.getBezierValue(time, i, 4 /*SCALEX*/, curveType + 18 /*BEZIER_SIZE*/ * 3 - 2 /*BEZIER*/);\r\n scaleY = this.getBezierValue(time, i, 5 /*SCALEY*/, curveType + 18 /*BEZIER_SIZE*/ * 4 - 2 /*BEZIER*/);\r\n shearY = this.getBezierValue(time, i, 6 /*SHEARY*/, curveType + 18 /*BEZIER_SIZE*/ * 5 - 2 /*BEZIER*/);\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\r\n constraint.mixX = data.mixX + (x - data.mixX) * alpha;\r\n constraint.mixY = data.mixY + (y - data.mixY) * alpha;\r\n constraint.mixScaleX = data.mixScaleX + (scaleX - data.mixScaleX) * alpha;\r\n constraint.mixScaleY = data.mixScaleY + (scaleY - data.mixScaleY) * alpha;\r\n constraint.mixShearY = data.mixShearY + (shearY - data.mixShearY) * alpha;\r\n }\r\n else {\r\n constraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (x - constraint.mixX) * alpha;\r\n constraint.mixY += (y - constraint.mixY) * alpha;\r\n constraint.mixScaleX += (scaleX - constraint.mixScaleX) * alpha;\r\n constraint.mixScaleY += (scaleY - constraint.mixScaleY) * alpha;\r\n constraint.mixShearY += (shearY - constraint.mixShearY) * alpha;\r\n }\r\n };\r\n return TransformConstraintTimeline;\r\n}(CurveTimeline));\r\n/** Changes a path constraint's {@link PathConstraint#position}.\r\n * @public\r\n * */\r\nvar PathConstraintPositionTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount, bezierCount, pathConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.pathConstraintPosition + \"|\" + pathConstraintIndex) || this;\r\n /** The index of the path constraint slot in {@link Skeleton#pathConstraints} that will be changed. */\r\n _this.pathConstraintIndex = 0;\r\n _this.pathConstraintIndex = pathConstraintIndex;\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = this.getCurveValue(time);\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n return PathConstraintPositionTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a path constraint's {@link PathConstraint#spacing}.\r\n * @public\r\n * */\r\nvar PathConstraintSpacingTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount, bezierCount, pathConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, Property.pathConstraintSpacing + \"|\" + pathConstraintIndex) || this;\r\n /** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */\r\n _this.pathConstraintIndex = 0;\r\n _this.pathConstraintIndex = pathConstraintIndex;\r\n return _this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = this.getCurveValue(time);\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n}(CurveTimeline1));\r\n/** Changes a transform constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and\r\n * {@link PathConstraint#getMixY()}.\r\n * @public\r\n * */\r\nvar PathConstraintMixTimeline = /** @class */ (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount, bezierCount, pathConstraintIndex) {\r\n var _this = _super.call(this, frameCount, bezierCount, [\r\n Property.pathConstraintMix + \"|\" + pathConstraintIndex\r\n ]) || this;\r\n /** The index of the path constraint slot in {@link Skeleton#getPathConstraints()} that will be changed. */\r\n _this.pathConstraintIndex = 0;\r\n _this.pathConstraintIndex = pathConstraintIndex;\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getFrameEntries = function () {\r\n return 4 /*ENTRIES*/;\r\n };\r\n PathConstraintMixTimeline.prototype.setFrame = function (frame, time, mixRotate, mixX, mixY) {\r\n var frames = this.frames;\r\n frame <<= 2;\r\n frames[frame] = time;\r\n frames[frame + 1 /*ROTATE*/] = mixRotate;\r\n frames[frame + 2 /*X*/] = mixX;\r\n frames[frame + 3 /*Y*/] = mixY;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mixRotate = constraint.data.mixRotate;\r\n constraint.mixX = constraint.data.mixX;\r\n constraint.mixY = constraint.data.mixY;\r\n return;\r\n case MixBlend.first:\r\n constraint.mixRotate += (constraint.data.mixRotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (constraint.data.mixX - constraint.mixX) * alpha;\r\n constraint.mixY += (constraint.data.mixY - constraint.mixY) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate, x, y;\r\n var i = Timeline.search(frames, time, 4 /*ENTRIES*/);\r\n var curveType = this.curves[i >> 2];\r\n switch (curveType) {\r\n case 0 /*LINEAR*/:\r\n var before = frames[i];\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n var t = (time - before) / (frames[i + 4 /*ENTRIES*/] - before);\r\n rotate += (frames[i + 4 /*ENTRIES*/ + 1 /*ROTATE*/] - rotate) * t;\r\n x += (frames[i + 4 /*ENTRIES*/ + 2 /*X*/] - x) * t;\r\n y += (frames[i + 4 /*ENTRIES*/ + 3 /*Y*/] - y) * t;\r\n break;\r\n case 1 /*STEPPED*/:\r\n rotate = frames[i + 1 /*ROTATE*/];\r\n x = frames[i + 2 /*X*/];\r\n y = frames[i + 3 /*Y*/];\r\n break;\r\n default:\r\n rotate = this.getBezierValue(time, i, 1 /*ROTATE*/, curveType - 2 /*BEZIER*/);\r\n x = this.getBezierValue(time, i, 2 /*X*/, curveType + 18 /*BEZIER_SIZE*/ - 2 /*BEZIER*/);\r\n y = this.getBezierValue(time, i, 3 /*Y*/, curveType + 18 /*BEZIER_SIZE*/ * 2 - 2 /*BEZIER*/);\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\r\n constraint.mixX = data.mixX + (x - data.mixX) * alpha;\r\n constraint.mixY = data.mixY + (y - data.mixY) * alpha;\r\n }\r\n else {\r\n constraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\r\n constraint.mixX += (x - constraint.mixX) * alpha;\r\n constraint.mixY += (y - constraint.mixY) * alpha;\r\n }\r\n };\r\n return PathConstraintMixTimeline;\r\n}(CurveTimeline));\r\n/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}.\r\n * @public\r\n * */\r\nvar SequenceTimeline = /** @class */ (function (_super) {\r\n __extends(SequenceTimeline, _super);\r\n function SequenceTimeline(frameCount, slotIndex, attachment) {\r\n var _this = _super.call(this, frameCount, [\r\n Property.sequence + \"|\" + slotIndex + \"|\" + attachment.sequence.id\r\n ]) || this;\r\n _this.slotIndex = slotIndex;\r\n _this.attachment = attachment;\r\n return _this;\r\n }\r\n SequenceTimeline.prototype.getFrameEntries = function () {\r\n return SequenceTimeline.ENTRIES;\r\n };\r\n SequenceTimeline.prototype.getSlotIndex = function () {\r\n return this.slotIndex;\r\n };\r\n SequenceTimeline.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the time, mode, index, and frame time for the specified frame.\r\n * @param frame Between 0 and <code>frameCount</code>, inclusive.\r\n * @param time Seconds between frames. */\r\n SequenceTimeline.prototype.setFrame = function (frame, time, mode, index, delay) {\r\n var frames = this.frames;\r\n frame *= SequenceTimeline.ENTRIES;\r\n frames[frame] = time;\r\n frames[frame + SequenceTimeline.MODE] = mode | (index << 4);\r\n frames[frame + SequenceTimeline.DELAY] = delay;\r\n };\r\n SequenceTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var slotAttachment = slot.attachment;\r\n var attachment = this.attachment;\r\n if (slotAttachment != attachment) {\r\n if (!(slotAttachment instanceof VertexAttachment)\r\n || slotAttachment.timelineAttachment != attachment)\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) { // Time is before first frame.\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n slot.sequenceIndex = -1;\r\n return;\r\n }\r\n var i = Timeline.search(frames, time, SequenceTimeline.ENTRIES);\r\n var before = frames[i];\r\n var modeAndIndex = frames[i + SequenceTimeline.MODE];\r\n var delay = frames[i + SequenceTimeline.DELAY];\r\n if (!this.attachment.sequence)\r\n return;\r\n var index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length;\r\n var mode = SequenceModeValues[modeAndIndex & 0xf];\r\n if (mode != SequenceMode.hold) {\r\n index += (((time - before) / delay + 0.00001) | 0);\r\n switch (mode) {\r\n case SequenceMode.once:\r\n index = Math.min(count - 1, index);\r\n break;\r\n case SequenceMode.loop:\r\n index %= count;\r\n break;\r\n case SequenceMode.pingpong: {\r\n var n = (count << 1) - 2;\r\n index = n == 0 ? 0 : index % n;\r\n if (index >= count)\r\n index = n - index;\r\n break;\r\n }\r\n case SequenceMode.onceReverse:\r\n index = Math.max(count - 1 - index, 0);\r\n break;\r\n case SequenceMode.loopReverse:\r\n index = count - 1 - (index % count);\r\n break;\r\n case SequenceMode.pingpongReverse: {\r\n var n = (count << 1) - 2;\r\n index = n == 0 ? 0 : (index + count - 1) % n;\r\n if (index >= count)\r\n index = n - index;\r\n }\r\n }\r\n }\r\n slot.sequenceIndex = index;\r\n };\r\n SequenceTimeline.ENTRIES = 3;\r\n SequenceTimeline.MODE = 1;\r\n SequenceTimeline.DELAY = 2;\r\n return SequenceTimeline;\r\n}(Timeline));\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\r\n * multiple animations on top of each other (layering).\r\n *\r\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide.\r\n * @public\r\n * */\r\nvar AnimationState = /** @class */ (function () {\r\n function AnimationState(data) {\r\n /** The list of tracks that currently have animations, which may contain null entries. */\r\n this.tracks = new Array();\r\n /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\r\n * or faster. Defaults to 1.\r\n *\r\n * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\r\n this.timeScale = 1;\r\n this.unkeyedState = 0;\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new StringSet();\r\n this.animationsChanged = false;\r\n this.trackEntryPool = new Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n AnimationState.emptyAnimation = function () {\r\n return AnimationState._emptyAnimation;\r\n };\r\n /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (!current)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next) {\r\n // When the next entry's delay is passed, change to the next entry, preserving leftover time.\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.clearNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom && this.updateMixingFrom(current, delta)) {\r\n // End mixing from entries once all have completed.\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from)\r\n from.mixingTo = null;\r\n while (from) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n /** Returns true when all mixing from entries are complete. */\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (!from)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n // Require mixTime > 0 to ensure the mixing from entry was applied at least once.\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame).\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\r\n * animation state can be applied to multiple skeletons to pose them identically.\r\n * @returns True if any animations were applied. */\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i_1 = 0, n_1 = tracks.length; i_1 < n_1; i_1++) {\r\n var current = tracks[i_1];\r\n if (!current || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i_1 == 0 ? MixBlend.first : current.mixBlend;\r\n // Apply mixing from entries first.\r\n var mix = current.alpha;\r\n if (current.mixingFrom)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && !current.next)\r\n mix = 0;\r\n // Apply current entry.\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime;\r\n var applyEvents = events;\r\n if (current.reverse) {\r\n applyTime = current.animation.duration - applyTime;\r\n applyEvents = null;\r\n }\r\n var timelines = current.animation.timelines;\r\n var timelineCount = timelines.length;\r\n if ((i_1 == 0 && mix == 1) || blend == MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n // Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\r\n // to sometimes stop rendering when using color correction, as their RGBA values become NaN.\r\n // (https://github.com/pixijs/pixi-spine/issues/302)\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n var timeline = timelines[ii];\r\n if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, true);\r\n else\r\n timeline.apply(skeleton, animationLast, applyTime, applyEvents, mix, blend, MixDirection.mixIn);\r\n }\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var shortestRotation = current.shortestRotation;\r\n var firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1;\r\n if (firstFrame)\r\n current.timelinesRotation.length = timelineCount << 1;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline_1 = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;\r\n if (!shortestRotation && timeline_1 instanceof RotateTimeline) {\r\n this.applyRotateTimeline(timeline_1, skeleton, applyTime, mix, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else if (timeline_1 instanceof AttachmentTimeline) {\r\n this.applyAttachmentTimeline(timeline_1, skeleton, applyTime, blend, true);\r\n }\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(mix, blend);\r\n timeline_1.apply(skeleton, animationLast, applyTime, applyEvents, mix, timelineBlend, MixDirection.mixIn);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n // Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\r\n // subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\r\n // the time is before the first key).\r\n var setupState = this.unkeyedState + SETUP;\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = skeleton.slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.attachmentState == setupState) {\r\n var attachmentName = slot.data.attachmentName;\r\n slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n }\r\n }\r\n this.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\r\n mix = 1;\r\n if (blend == MixBlend.first)\r\n blend = MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var timelines = from.animation.timelines;\r\n var timelineCount = timelines.length;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime;\r\n var events = null;\r\n if (from.reverse)\r\n applyTime = from.animation.duration - applyTime;\r\n else if (mix < from.eventThreshold)\r\n events = this.events;\r\n if (blend == MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, MixDirection.mixOut);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var shortestRotation = from.shortestRotation;\r\n var firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1;\r\n if (firstFrame)\r\n from.timelinesRotation.length = timelineCount << 1;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = MixDirection.mixOut;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case SUBSEQUENT:\r\n if (!drawOrder && timeline instanceof DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case HOLD_SUBSEQUENT:\r\n timelineBlend = blend;\r\n alpha = alphaHold;\r\n break;\r\n case HOLD_FIRST:\r\n timelineBlend = MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (!shortestRotation && timeline instanceof RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);\r\n else if (timeline instanceof AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments);\r\n else {\r\n // This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\r\n Utils.webkit602BugfixHelper(alpha, blend);\r\n if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)\r\n direction = MixDirection.mixIn;\r\n timeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyAttachmentTimeline = function (timeline, skeleton, time, blend, attachments) {\r\n var slot = skeleton.slots[timeline.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n if (time < timeline.frames[0]) { // Time is before first frame.\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\r\n }\r\n else\r\n this.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search1(timeline.frames, time)], attachments);\r\n // If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\r\n if (slot.attachmentState <= this.unkeyedState)\r\n slot.attachmentState = this.unkeyedState + SETUP;\r\n };\r\n AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {\r\n slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n if (attachments)\r\n slot.attachmentState = this.unkeyedState + CURRENT;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\r\n return;\r\n }\r\n var bone = skeleton.bones[timeline.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var frames = timeline.frames;\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n r2 = bone.data.rotation + timeline.getCurveValue(time);\r\n }\r\n // Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops.\r\n lastDiff = timelinesRotation[i + 1]; // Difference between bones.\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n // Detect cross at 0 (not 180).\r\n if (MathUtils.signum(lastDiff) != MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n // A cross after a 360 rotation is a loop.\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360; // Store loops as part of lastTotal.\r\n if (dir != current)\r\n total += 360 * MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n bone.rotation = r1 + total * alpha;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n // Queue events before complete.\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_1);\r\n }\r\n // Queue complete if completed a loop iteration or the animation.\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n // Queue events after complete.\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue; // Discard events outside animation start/end.\r\n this.queue.event(entry, event_2);\r\n }\r\n };\r\n /** Removes all animations from all tracks, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n /** Removes all animations from the track, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose. */\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (!current)\r\n return;\r\n this.queue.end(current);\r\n this.clearNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (!from)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n current.previous = null;\r\n if (from) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n // Store the interrupted mix percentage.\r\n if (from.mixingFrom && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\r\n }\r\n this.queue.start(current);\r\n };\r\n /** Sets an animation by name.\r\n *\r\n * See {@link #setAnimationWith()}. */\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n if (loop === void 0) { loop = false; }\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (!animation)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never\r\n * applied to a skeleton, it is replaced (not mixed from).\r\n * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\r\n * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (loop === void 0) { loop = false; }\r\n if (!animation)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current) {\r\n if (current.nextTrackLast == -1) {\r\n // Don't mix from an entry that was never applied.\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.clearNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.clearNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n /** Queues an animation by name.\r\n *\r\n * See {@link #addAnimationWith()}. */\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n if (loop === void 0) { loop = false; }\r\n if (delay === void 0) { delay = 0; }\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (!animation)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is\r\n * equivalent to calling {@link #setAnimationWith()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix\r\n * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the\r\n * previous entry is looping, its next loop completion is used instead of its duration.\r\n * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (loop === void 0) { loop = false; }\r\n if (delay === void 0) { delay = 0; }\r\n if (!animation)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last) {\r\n while (last.next)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (!last) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n entry.previous = last;\r\n if (delay <= 0)\r\n delay += last.getTrackComplete() - entry.mixDuration;\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\r\n * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n *\r\n * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\r\n * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\r\n * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\r\n * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\r\n * 0 still mixes out over one frame.\r\n *\r\n * Mixing in is done by first setting an empty animation, then adding an animation using\r\n * {@link #addAnimation()} and on the returned track entry, set the\r\n * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\r\n * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\r\n * setup pose value if no lower tracks key the property to the value keyed in the new animation. */\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n if (mixDuration === void 0) { mixDuration = 0; }\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation(), false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\r\n * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling\r\n * {@link #setEmptyAnimation()}.\r\n *\r\n * See {@link #setEmptyAnimation()}.\r\n * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\r\n * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or\r\n * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next\r\n * loop completion is used instead of its duration.\r\n * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\r\n * after the {@link AnimationStateListener#dispose()} event occurs. */\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (mixDuration === void 0) { mixDuration = 0; }\r\n if (delay === void 0) { delay = 0; }\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation(), false, delay);\r\n if (delay <= 0)\r\n entry.delay += entry.mixDuration - mixDuration;\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix\r\n * duration. */\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n if (mixDuration === void 0) { mixDuration = 0; }\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n /** @param last May be null. */\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.reset();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.reverse = false;\r\n entry.shortestRotation = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation);\r\n entry.interruptAlpha = 1;\r\n entry.totalAlpha = 0;\r\n entry.mixBlend = MixBlend.replace;\r\n return entry;\r\n };\r\n /** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */\r\n AnimationState.prototype.clearNext = function (entry) {\r\n var next = entry.next;\r\n while (next) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var entry = tracks[i];\r\n if (!entry)\r\n continue;\r\n while (entry.mixingFrom)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (!entry.mixingTo || entry.mixBlend != MixBlend.add)\r\n this.computeHold(entry);\r\n entry = entry.mixingTo;\r\n } while (entry);\r\n }\r\n };\r\n AnimationState.prototype.computeHold = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = entry.timelineMode;\r\n timelineMode.length = timelinesCount;\r\n var timelineHoldMix = entry.timelineHoldMix;\r\n timelineHoldMix.length = 0;\r\n var propertyIDs = this.propertyIDs;\r\n if (to && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++)\r\n timelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT;\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var timeline = timelines[i];\r\n var ids = timeline.getPropertyIds();\r\n if (!propertyIDs.addAll(ids))\r\n timelineMode[i] = SUBSEQUENT;\r\n else if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\r\n || timeline instanceof EventTimeline || !to.animation.hasTimeline(ids)) {\r\n timelineMode[i] = FIRST;\r\n }\r\n else {\r\n for (var next = to.mixingTo; next; next = next.mixingTo) {\r\n if (next.animation.hasTimeline(ids))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = HOLD_MIX;\r\n timelineHoldMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = HOLD_FIRST;\r\n }\r\n }\r\n };\r\n /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n /** Adds a listener to receive events for all track entries. */\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (!listener)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n /** Removes the listener added with {@link #addListener()}. */\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n /** Removes all listeners added with {@link #addListener()}. */\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\r\n * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\r\n * are not wanted because new animations are being set. */\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.prototype.setAnimationByName = function (trackIndex, animationName, loop) {\r\n if (!AnimationState.deprecatedWarning1) {\r\n AnimationState.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.setAnimationByName is deprecated, please use setAnimation from now on.\");\r\n }\r\n this.setAnimation(trackIndex, animationName, loop);\r\n };\r\n AnimationState.prototype.addAnimationByName = function (trackIndex, animationName, loop, delay) {\r\n if (!AnimationState.deprecatedWarning2) {\r\n AnimationState.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.addAnimationByName is deprecated, please use addAnimation from now on.\");\r\n }\r\n this.addAnimation(trackIndex, animationName, loop, delay);\r\n };\r\n AnimationState.prototype.hasAnimation = function (animationName) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n return animation !== null;\r\n };\r\n AnimationState.prototype.hasAnimationByName = function (animationName) {\r\n if (!AnimationState.deprecatedWarning3) {\r\n AnimationState.deprecatedWarning3 = true;\r\n console.warn(\"Spine Deprecation Warning: AnimationState.hasAnimationByName is deprecated, please use hasAnimation from now on.\");\r\n }\r\n return this.hasAnimation(animationName);\r\n };\r\n AnimationState._emptyAnimation = new Animation(\"<empty>\", [], 0);\r\n AnimationState.deprecatedWarning1 = false;\r\n AnimationState.deprecatedWarning2 = false;\r\n AnimationState.deprecatedWarning3 = false;\r\n return AnimationState;\r\n}());\r\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\r\n *\r\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs.\r\n * @public\r\n * */\r\nvar TrackEntry = /** @class */ (function () {\r\n function TrackEntry() {\r\n /** The animation to apply for this track entry. */\r\n this.animation = null;\r\n this.previous = null;\r\n /** The animation queued to start after this animation, or null. `next` makes up a linked list. */\r\n this.next = null;\r\n /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no\r\n * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */\r\n this.mixingFrom = null;\r\n /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is\r\n * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */\r\n this.mixingTo = null;\r\n /** The listener for events generated by this track entry, or null.\r\n *\r\n * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation\r\n * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */\r\n this.listener = null;\r\n /** The index of the track where this track entry is either current or queued.\r\n *\r\n * See {@link AnimationState#getCurrent()}. */\r\n this.trackIndex = 0;\r\n /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\r\n * duration. */\r\n this.loop = false;\r\n /** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead\r\n * of being mixed out.\r\n *\r\n * When mixing between animations that key the same property, if a lower track also keys that property then the value will\r\n * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%\r\n * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation\r\n * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which\r\n * keys the property, only when a higher track also keys the property.\r\n *\r\n * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the\r\n * previous animation. */\r\n this.holdPrevious = false;\r\n this.reverse = false;\r\n this.shortestRotation = false;\r\n /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\r\n * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event\r\n * timelines are not applied while this animation is being mixed out. */\r\n this.eventThreshold = 0;\r\n /** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the\r\n * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to\r\n * 0, so attachment timelines are not applied while this animation is being mixed out. */\r\n this.attachmentThreshold = 0;\r\n /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\r\n * `drawOrderThreshold`, draw order timelines are applied while this animation is being mixed out. Defaults to 0,\r\n * so draw order timelines are not applied while this animation is being mixed out. */\r\n this.drawOrderThreshold = 0;\r\n /** Seconds when this animation starts, both initially and after looping. Defaults to 0.\r\n *\r\n * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same\r\n * value to prevent timeline keys before the start time from triggering. */\r\n this.animationStart = 0;\r\n /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will\r\n * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */\r\n this.animationEnd = 0;\r\n /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this\r\n * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and\r\n * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation\r\n * is applied. */\r\n this.animationLast = 0;\r\n this.nextAnimationLast = 0;\r\n /** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`\r\n * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from\r\n * the start of the previous animation to when this track entry will become the current track entry (ie when the previous\r\n * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).\r\n *\r\n * {@link #timeScale} affects the delay. */\r\n this.delay = 0;\r\n /** Current time in seconds this track entry has been the current track entry. The track time determines\r\n * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting\r\n * looping. */\r\n this.trackTime = 0;\r\n this.trackLast = 0;\r\n this.nextTrackLast = 0;\r\n /** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float\r\n * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time\r\n * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the\r\n * properties keyed by the animation are set to the setup pose and the track is cleared.\r\n *\r\n * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation\r\n * abruptly cease being applied. */\r\n this.trackEnd = 0;\r\n /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or\r\n * faster. Defaults to 1.\r\n *\r\n * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to\r\n * match the animation speed.\r\n *\r\n * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\r\n * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If\r\n * the time scale is not 1, the delay may need to be adjusted.\r\n *\r\n * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */\r\n this.timeScale = 0;\r\n /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults\r\n * to 1, which overwrites the skeleton's current pose with this animation.\r\n *\r\n * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to\r\n * use alpha on track 0 if the skeleton pose is from the last frame render. */\r\n this.alpha = 0;\r\n /** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be\r\n * slightly more than `mixDuration` when the mix is complete. */\r\n this.mixTime = 0;\r\n /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData\r\n * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).\r\n *\r\n * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the\r\n * properties it was animating.\r\n *\r\n * The `mixDuration` can be set manually rather than use the value from\r\n * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new\r\n * track entry only before {@link AnimationState#update(float)} is first called.\r\n *\r\n * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\r\n * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set\r\n * afterward. */\r\n this.mixDuration = 0;\r\n this.interruptAlpha = 0;\r\n this.totalAlpha = 0;\r\n /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\r\n * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\r\n * the values from the lower tracks.\r\n *\r\n * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first\r\n * called. */\r\n this.mixBlend = MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.previous = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\r\n * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\r\n * `animationStart` time. */\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n /** Returns true if at least one loop has been completed.\r\n *\r\n * See {@link AnimationStateListener#complete()}. */\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\r\n * long way around when using {@link #alpha} and starting animations on other tracks.\r\n *\r\n * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\r\n * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\r\n * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\r\n * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n TrackEntry.prototype.getTrackComplete = function () {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration != 0) {\r\n if (this.loop)\r\n return duration * (1 + ((this.trackTime / duration) | 0)); // Completion of next loop.\r\n if (this.trackTime < duration)\r\n return duration; // Before duration.\r\n }\r\n return this.trackTime; // Next update.\r\n };\r\n Object.defineProperty(TrackEntry.prototype, \"time\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning1) {\r\n TrackEntry.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.time is deprecated, please use trackTime from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TrackEntry.prototype, \"endTime\", {\r\n get: function () {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n return this.trackTime;\r\n },\r\n set: function (value) {\r\n if (!TrackEntry.deprecatedWarning2) {\r\n TrackEntry.deprecatedWarning2 = true;\r\n console.warn(\"Spine Deprecation Warning: TrackEntry.endTime is deprecated, please use trackEnd from now on.\");\r\n }\r\n this.trackTime = value;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n TrackEntry.prototype.loopsCount = function () {\r\n return Math.floor(this.trackTime / this.trackEnd);\r\n };\r\n TrackEntry.deprecatedWarning1 = false;\r\n TrackEntry.deprecatedWarning2 = false;\r\n return TrackEntry;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventQueue = /** @class */ (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.start)\r\n listener.start(entry);\r\n }\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.interrupt)\r\n listener.interrupt(entry);\r\n }\r\n break;\r\n case EventType.end:\r\n if (entry.listener && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.end)\r\n listener.end(entry);\r\n }\r\n // Fall through.\r\n case EventType.dispose:\r\n if (entry.listener && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.dispose)\r\n listener.dispose(entry);\r\n }\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.complete)\r\n listener.complete(entry);\r\n }\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++) {\r\n var listener = listeners[ii];\r\n if (listener.event)\r\n listener.event(entry, event_3);\r\n }\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n return EventQueue;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar EventType;\r\n(function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n})(EventType || (EventType = {}));\r\n/**\r\n * @public\r\n */\r\nvar AnimationStateAdapter = /** @class */ (function () {\r\n function AnimationStateAdapter() {\r\n }\r\n AnimationStateAdapter.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter;\r\n}());\r\n/** 1. A previously applied timeline has set this property.\r\n *\r\n * Result: Mix from the current pose to the timeline pose. */\r\nvar SUBSEQUENT = 0;\r\n/** 1. This is the first timeline to set this property.\r\n * 2. The next track entry applied after this one does not have a timeline to set this property.\r\n *\r\n * Result: Mix from the setup pose to the timeline pose. */\r\nvar FIRST = 1;\r\n/** 1) A previously applied timeline has set this property.<br>\r\n * 2) The next track entry to be applied does have a timeline to set this property.<br>\r\n * 3) The next track entry after that one does not have a timeline to set this property.<br>\r\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\r\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\r\nvar HOLD_SUBSEQUENT = 2;\r\n/** 1) This is the first timeline to set this property.<br>\r\n * 2) The next track entry to be applied does have a timeline to set this property.<br>\r\n * 3) The next track entry after that one does not have a timeline to set this property.<br>\r\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\r\n * that key the same property. A subsequent timeline will set this property using a mix. */\r\nvar HOLD_FIRST = 3;\r\n/** 1. This is the first timeline to set this property.\r\n * 2. The next track entry to be applied does have a timeline to set this property.\r\n * 3. The next track entry after that one does have a timeline to set this property.\r\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\r\n *\r\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\r\n * 2 track entries in a row have a timeline that sets the same property.\r\n *\r\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\r\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\r\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\r\n * place. */\r\nvar HOLD_MIX = 4;\r\nvar SETUP = 1;\r\nvar CURRENT = 2;\n\n/** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed.\r\n * @public\r\n * */\r\nvar AnimationStateData = /** @class */ (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n /** The mix duration to use when no mix duration has been defined between two animations. */\r\n this.defaultMix = 0;\r\n if (!skeletonData)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n /** Sets a mix duration by animation name.\r\n *\r\n * See {@link #setMixWith()}. */\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (!from)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (!to)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n /** Sets the mix duration when changing from the specified animation to the other.\r\n *\r\n * See {@link TrackEntry#mixDuration}. */\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (!from)\r\n throw new Error(\"from cannot be null.\");\r\n if (!to)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n /** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if\r\n * no mix duration has been set. */\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n return AnimationStateData;\r\n}());\n\n/**\r\n * @public\r\n */\r\nvar AtlasAttachmentLoader = /** @class */ (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n AtlasAttachmentLoader.prototype.loadSequence = function (name, basePath, sequence) {\r\n var regions = sequence.regions;\r\n for (var i = 0, n = regions.length; i < n; i++) {\r\n var path = sequence.getPath(basePath, i);\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (sequence: \" + name + \")\");\r\n regions[i] = region;\r\n regions[i].renderObject = regions[i];\r\n }\r\n };\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path, sequence) {\r\n var attachment = new RegionAttachment(name, path);\r\n if (sequence != null) {\r\n this.loadSequence(name, path, sequence);\r\n }\r\n else {\r\n var region = this.atlas.findRegion(path);\r\n if (!region)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n attachment.region = region;\r\n }\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path, sequence) {\r\n var attachment = new MeshAttachment(name, path);\r\n if (sequence != null) {\r\n this.loadSequence(name, path, sequence);\r\n }\r\n else {\r\n var region = this.atlas.findRegion(path);\r\n if (!region)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n attachment.region = region;\r\n }\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new BoundingBoxAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n}());\n\n/** Stores a bone's current pose.\r\n *\r\n * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a\r\n * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a\r\n * constraint or application code modifies the world transform after it was computed from the local transform.\r\n * @public\r\n * */\r\nvar Bone = /** @class */ (function () {\r\n /** @param parent May be null. */\r\n function Bone(data, skeleton, parent) {\r\n //be careful! Spine b,c is c,b in pixi matrix\r\n this.matrix = new Matrix();\r\n /** The parent bone, or null if this is the root bone. */\r\n this.parent = null;\r\n /** The immediate children of this bone. */\r\n this.children = new Array();\r\n /** The local x translation. */\r\n this.x = 0;\r\n /** The local y translation. */\r\n this.y = 0;\r\n /** The local rotation in degrees, counter clockwise. */\r\n this.rotation = 0;\r\n /** The local scaleX. */\r\n this.scaleX = 0;\r\n /** The local scaleY. */\r\n this.scaleY = 0;\r\n /** The local shearX. */\r\n this.shearX = 0;\r\n /** The local shearY. */\r\n this.shearY = 0;\r\n /** The applied local x translation. */\r\n this.ax = 0;\r\n /** The applied local y translation. */\r\n this.ay = 0;\r\n /** The applied local rotation in degrees, counter clockwise. */\r\n this.arotation = 0;\r\n /** The applied local scaleX. */\r\n this.ascaleX = 0;\r\n /** The applied local scaleY. */\r\n this.ascaleY = 0;\r\n /** The applied local shearX. */\r\n this.ashearX = 0;\r\n /** The applied local shearY. */\r\n this.ashearY = 0;\r\n this.sorted = false;\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Object.defineProperty(Bone.prototype, \"worldX\", {\r\n get: function () {\r\n return this.matrix.tx;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Bone.prototype, \"worldY\", {\r\n get: function () {\r\n return this.matrix.ty;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the\r\n * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */\r\n Bone.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local applied transform. */\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.ax, this.ay, this.arotation, this.ascaleX, this.ascaleY, this.ashearX, this.ashearY);\r\n };\r\n /** Computes the world transform using the parent bone and this bone's local transform.\r\n *\r\n * See {@link #updateWorldTransformWith()}. */\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n /** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the\r\n * specified local transform. Child bones are not updated.\r\n *\r\n * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\r\n * Runtimes Guide. */\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n var sx = this.skeleton.scaleX;\r\n var sy = settings.yDown ? -this.skeleton.scaleY : this.skeleton.scaleY;\r\n if (!parent) { // Root bone.\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n m.tx = x * sx + skeleton.x;\r\n m.ty = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n m.tx = pa * x + pb * y + parent.matrix.tx;\r\n m.ty = pc * x + pd * y + parent.matrix.ty;\r\n switch (this.data.transformMode) {\r\n case TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * scaleY;\r\n m.a = pa * la + pb * lc;\r\n m.c = pa * lb + pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n m.a = MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n m.c = MathUtils.cosDeg(rotationY) * scaleY;\r\n m.b = MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n m.d = MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pa /= sx;\r\n pc /= sy;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = MathUtils.cosDeg(rx) * scaleX;\r\n var lb = MathUtils.cosDeg(ry) * scaleY;\r\n var lc = MathUtils.sinDeg(rx) * scaleX;\r\n var ld = MathUtils.sinDeg(ry) * scaleY;\r\n m.a = pa * la - pb * lc;\r\n m.c = pa * lb - pb * ld;\r\n m.b = pc * la + pd * lc;\r\n m.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection: {\r\n var cos = MathUtils.cosDeg(rotation);\r\n var sin = MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / sx;\r\n var zc = (pc * cos + pd * sin) / sy;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = MathUtils.sinDeg(90 + shearY) * scaleY;\r\n m.a = za * la + zb * lc;\r\n m.c = za * lb + zb * ld;\r\n m.b = zc * la + zd * lc;\r\n m.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n m.a *= sx;\r\n m.c *= sx;\r\n m.b *= sy;\r\n m.d *= sy;\r\n };\r\n /** Sets this bone's local transform to the setup pose. */\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.matrix.b, this.matrix.a) * MathUtils.radDeg;\r\n };\r\n /** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.matrix.d, this.matrix.c) * MathUtils.radDeg;\r\n };\r\n /** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */\r\n Bone.prototype.getWorldScaleX = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.a * m.a + m.b * m.b);\r\n };\r\n /** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */\r\n Bone.prototype.getWorldScaleY = function () {\r\n var m = this.matrix;\r\n return Math.sqrt(m.c * m.c + m.d * m.d);\r\n };\r\n /** Computes the applied transform values from the world transform.\r\n *\r\n * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so\r\n * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other\r\n * constraints).\r\n *\r\n * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after\r\n * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */\r\n Bone.prototype.updateAppliedTransform = function () {\r\n var parent = this.parent;\r\n var m = this.matrix;\r\n if (!parent) {\r\n this.ax = m.tx - this.skeleton.x;\r\n this.ay = m.ty - this.skeleton.y;\r\n this.arotation = Math.atan2(m.b, m.a) * MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(m.a * m.a + m.b * m.b);\r\n this.ascaleY = Math.sqrt(m.c * m.c + m.d * m.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(m.a * m.c + m.b * m.d, m.a * m.d - m.b * m.c) * MathUtils.radDeg;\r\n return;\r\n }\r\n var pm = parent.matrix;\r\n var pid = 1 / (pm.a * pm.d - pm.b * pm.c);\r\n var dx = m.tx - pm.tx, dy = m.ty - pm.ty;\r\n this.ax = (dx * pm.d * pid - dy * pm.c * pid);\r\n this.ay = (dy * pm.a * pid - dx * pm.b * pid);\r\n var ia = pid * pm.d;\r\n var id = pid * pm.a;\r\n var ib = pid * pm.c;\r\n var ic = pid * pm.b;\r\n var ra = ia * m.a - ib * m.b;\r\n var rb = ia * m.c - ib * m.d;\r\n var rc = id * m.b - ic * m.a;\r\n var rd = id * m.d - ic * m.c;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\r\n }\r\n };\r\n /** Transforms a point from world coordinates to the bone's local coordinates. */\r\n Bone.prototype.worldToLocal = function (world) {\r\n var m = this.matrix;\r\n var a = m.a, b = m.c, c = m.b, d = m.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - m.tx, y = world.y - m.ty;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n /** Transforms a point from the bone's local coordinates to world coordinates. */\r\n Bone.prototype.localToWorld = function (local) {\r\n var m = this.matrix;\r\n var x = local.x, y = local.y;\r\n local.x = x * m.a + y * m.c + m.tx;\r\n local.y = x * m.b + y * m.d + m.ty;\r\n return local;\r\n };\r\n /** Transforms a world rotation to a local rotation. */\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(mat.a * sin - mat.b * cos, mat.d * cos - mat.c * sin) * MathUtils.radDeg;\r\n };\r\n /** Transforms a local rotation to a world rotation. */\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n localRotation -= this.rotation - this.shearX;\r\n var sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\r\n var mat = this.matrix;\r\n return Math.atan2(cos * mat.b + sin * mat.d, cos * mat.a + sin * mat.c) * MathUtils.radDeg;\r\n };\r\n /** Rotates the world transform the specified amount.\r\n * <p>\r\n * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and {@link #update()} will\r\n * need to be called on any child bones, recursively. */\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var mat = this.matrix;\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var cos = MathUtils.cosDeg(degrees), sin = MathUtils.sinDeg(degrees);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n };\r\n return Bone;\r\n}());\n\n/** Stores the setup pose for a {@link Bone}.\r\n * @public\r\n * */\r\nvar BoneData = /** @class */ (function () {\r\n function BoneData(index, name, parent) {\r\n /** The index of the bone in {@link Skeleton#getBones()}. */\r\n this.index = 0;\r\n /** @returns May be null. */\r\n this.parent = null;\r\n /** The bone's length. */\r\n this.length = 0;\r\n /** The local x translation. */\r\n this.x = 0;\r\n /** The local y translation. */\r\n this.y = 0;\r\n /** The local rotation. */\r\n this.rotation = 0;\r\n /** The local scaleX. */\r\n this.scaleX = 1;\r\n /** The local scaleY. */\r\n this.scaleY = 1;\r\n /** The local shearX. */\r\n this.shearX = 0;\r\n /** The local shearX. */\r\n this.shearY = 0;\r\n /** The transform mode for how parent world transforms affect this bone. */\r\n this.transformMode = TransformMode.Normal;\r\n /** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this\r\n * bone.\r\n * @see Skin#bones */\r\n this.skinRequired = false;\r\n /** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually\r\n * rendered at runtime. */\r\n this.color = new Color();\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n}());\n\n/** The base class for all constraint datas.\r\n * @public\r\n * */\r\nvar ConstraintData = /** @class */ (function () {\r\n function ConstraintData(name, order, skinRequired) {\r\n this.name = name;\r\n this.order = order;\r\n this.skinRequired = skinRequired;\r\n }\r\n return ConstraintData;\r\n}());\n\n/** Stores the current pose values for an {@link Event}.\r\n *\r\n * See Timeline {@link Timeline#apply()},\r\n * AnimationStateListener {@link AnimationStateListener#event()}, and\r\n * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar Event = /** @class */ (function () {\r\n function Event(time, data) {\r\n this.intValue = 0;\r\n this.floatValue = 0;\r\n this.stringValue = null;\r\n this.time = 0;\r\n this.volume = 0;\r\n this.balance = 0;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n}());\n\n/** Stores the setup pose values for an {@link Event}.\r\n *\r\n * See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar EventData = /** @class */ (function () {\r\n function EventData(name) {\r\n this.intValue = 0;\r\n this.floatValue = 0;\r\n this.stringValue = null;\r\n this.audioPath = null;\r\n this.volume = 0;\r\n this.balance = 0;\r\n this.name = name;\r\n }\r\n return EventData;\r\n}());\n\n/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of\r\n * the last bone is as close to the target bone as possible.\r\n *\r\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar IkConstraint = /** @class */ (function () {\r\n function IkConstraint(data, skeleton) {\r\n /** Controls the bend direction of the IK bones, either 1 or -1. */\r\n this.bendDirection = 0;\r\n /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\r\n this.compress = false;\r\n /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\r\n * and the parent bone has local nonuniform scale, stretch is not applied. */\r\n this.stretch = false;\r\n /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\r\n this.mix = 1;\r\n /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\r\n this.softness = 0;\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.softness = data.softness;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var bone = skeleton.findBone(data.bones[i].name);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + data.bones[i].name);\r\n this.bones.push(bone);\r\n }\r\n var target = skeleton.findBone(data.target.name);\r\n if (!target)\r\n throw new Error(\"Couldn't find bone \" + data.target.name);\r\n this.target = target;\r\n }\r\n IkConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n IkConstraint.prototype.update = function () {\r\n if (this.mix == 0)\r\n return;\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.data.uniform, this.softness, this.mix);\r\n break;\r\n }\r\n };\r\n /** Applies 1 bone IK. The target is specified in the world coordinate system. */\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n var p = bone.parent.matrix;\r\n if (!p)\r\n throw new Error(\"IK bone must have parent.\");\r\n var pa = p.a, pb = p.c, pc = p.b, pd = p.d;\r\n var rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\r\n var skelX = bone.skeleton.scaleX;\r\n var skelY = settings.yDown ? -bone.skeleton.scaleY : bone.skeleton.scaleY;\r\n switch (bone.data.transformMode) {\r\n case TransformMode.OnlyTranslation:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n //TODO: possible bug in spine-ts runtime!\r\n if (settings.yDown) {\r\n ty = -ty;\r\n }\r\n break;\r\n case TransformMode.NoRotationOrReflection:\r\n var s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\r\n var sa = pa / skelX;\r\n var sc = pc / skelY;\r\n pb = -sc * s * skelX;\r\n pd = sa * s * skelY;\r\n rotationIK += Math.atan2(sc, sa) * MathUtils.radDeg;\r\n // Fall through\r\n default:\r\n var x = targetX - p.tx, y = targetY - p.ty;\r\n var d = pa * pd - pb * pc;\r\n tx = (x * pd - y * pb) / d - bone.ax;\r\n ty = (y * pa - x * pc) / d - bone.ay;\r\n }\r\n rotationIK += Math.atan2(ty, tx) * MathUtils.radDeg;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n switch (bone.data.transformMode) {\r\n case TransformMode.NoScale:\r\n case TransformMode.NoScaleOrReflection:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n }\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n /** Applies 2 bone IK. The target is specified in the world coordinate system.\r\n * @param child A direct descendant of the parent bone. */\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, uniform, softness, alpha) {\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX;\r\n var pmat = parent.matrix;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = pmat.a, b = pmat.c, c = pmat.b, d = pmat.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u || stretch) {\r\n cy = 0;\r\n cwx = a * cx + pmat.tx;\r\n cwy = c * cx + pmat.ty;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + pmat.tx;\r\n cwy = c * cx + d * cy + pmat.ty;\r\n }\r\n var pp = parent.parent.matrix;\r\n if (!pp)\r\n throw new Error(\"IK parent must itself have a parent.\");\r\n a = pp.a;\r\n b = pp.c;\r\n c = pp.b;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = cwx - pp.tx, y = cwy - pp.ty;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\r\n if (l1 < 0.0001) {\r\n this.apply1(parent, targetX, targetY, false, stretch, false, alpha);\r\n child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n return;\r\n }\r\n x = targetX - pp.tx;\r\n y = targetY - pp.ty;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\r\n var dd = tx * tx + ty * ty;\r\n if (softness != 0) {\r\n softness *= psx * (csx + 1) * 0.5;\r\n var td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\r\n if (sd > 0) {\r\n var p = Math.min(1, sd / (softness * 2)) - 1;\r\n p = (sd - softness * (1 - p * p)) / td;\r\n tx -= p * tx;\r\n ty -= p * ty;\r\n dd = tx * tx + ty * ty;\r\n }\r\n }\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1) {\r\n cos = -1;\r\n a2 = Math.PI * bendDir;\r\n }\r\n else if (cos > 1) {\r\n cos = 1;\r\n a2 = 0;\r\n if (stretch) {\r\n a = (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n sx *= a;\r\n if (uniform)\r\n sy *= a;\r\n }\r\n }\r\n else\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) * 0.5;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) * 0.5) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180) //\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, sy, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180) //\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n}());\n\n/** Stores the setup pose for an {@link IkConstraint}.\r\n * <p>\r\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar IkConstraintData = /** @class */ (function (_super) {\r\n __extends(IkConstraintData, _super);\r\n function IkConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n /** The bones that are constrained by this IK constraint. */\r\n _this.bones = new Array();\r\n /** The bone that is the IK target. */\r\n _this._target = null;\r\n /** Controls the bend direction of the IK bones, either 1 or -1. */\r\n _this.bendDirection = 1;\r\n /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\r\n _this.compress = false;\r\n /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\r\n * and the parent bone has local nonuniform scale, stretch is not applied. */\r\n _this.stretch = false;\r\n /** When true, only a single bone is being constrained, and {@link #getCompress()} or {@link #getStretch()} is used, the bone\r\n * is scaled on both the X and Y axes. */\r\n _this.uniform = false;\r\n /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\r\n _this.mix = 1;\r\n /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\r\n _this.softness = 0;\r\n return _this;\r\n }\r\n Object.defineProperty(IkConstraintData.prototype, \"target\", {\r\n get: function () {\r\n if (!this._target)\r\n throw new Error(\"BoneData not set.\");\r\n else\r\n return this._target;\r\n },\r\n set: function (boneData) { this._target = boneData; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return IkConstraintData;\r\n}(ConstraintData));\n\n/** Stores the setup pose for a {@link PathConstraint}.\r\n *\r\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar PathConstraintData = /** @class */ (function (_super) {\r\n __extends(PathConstraintData, _super);\r\n function PathConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n /** The bones that will be modified by this path constraint. */\r\n _this.bones = new Array();\r\n /** The slot whose path attachment will be used to constrained the bones. */\r\n _this._target = null;\r\n /** The mode for positioning the first bone on the path. */\r\n _this.positionMode = PositionMode.Fixed;\r\n /** The mode for positioning the bones after the first bone on the path. */\r\n _this.spacingMode = SpacingMode.Fixed;\r\n /** The mode for adjusting the rotation of the bones. */\r\n _this.rotateMode = RotateMode.Chain;\r\n /** An offset added to the constrained bone rotation. */\r\n _this.offsetRotation = 0;\r\n /** The position along the path. */\r\n _this.position = 0;\r\n /** The spacing between bones. */\r\n _this.spacing = 0;\r\n _this.mixRotate = 0;\r\n _this.mixX = 0;\r\n _this.mixY = 0;\r\n return _this;\r\n }\r\n Object.defineProperty(PathConstraintData.prototype, \"target\", {\r\n get: function () {\r\n if (!this._target)\r\n throw new Error(\"SlotData not set.\");\r\n else\r\n return this._target;\r\n },\r\n set: function (slotData) { this._target = slotData; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return PathConstraintData;\r\n}(ConstraintData));\r\n/** Controls how bones after the first bone are positioned along the path.\r\n *\r\n * [Spacing mode](http://esotericsoftware.com/spine-path-constraints#Spacing-mode) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar SpacingMode;\r\n(function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n SpacingMode[SpacingMode[\"Proportional\"] = 3] = \"Proportional\";\r\n})(SpacingMode || (SpacingMode = {}));\n\n/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the\r\n * constrained bones so they follow a {@link PathAttachment}.\r\n *\r\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar PathConstraint = /** @class */ (function () {\r\n function PathConstraint(data, skeleton) {\r\n /** The position along the path. */\r\n this.position = 0;\r\n /** The spacing between bones. */\r\n this.spacing = 0;\r\n this.mixRotate = 0;\r\n this.mixX = 0;\r\n this.mixY = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++) {\r\n var bone = skeleton.findBone(data.bones[i].name);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + data.bones[i].name + \".\");\r\n this.bones.push(bone);\r\n }\r\n var target = skeleton.findSlot(data.target.name);\r\n if (!target)\r\n throw new Error(\"Couldn't find target bone \" + data.target.name);\r\n this.target = target;\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.mixRotate = data.mixRotate;\r\n this.mixX = data.mixX;\r\n this.mixY = data.mixY;\r\n }\r\n PathConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;\r\n if (mixRotate == 0 && mixX == 0 && mixY == 0)\r\n return;\r\n var data = this.data;\r\n var tangents = data.rotateMode == RotateMode.Tangent, scale = data.rotateMode == RotateMode.ChainScale;\r\n var bones = this.bones;\r\n var boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : [];\r\n var spacing = this.spacing;\r\n switch (data.spacingMode) {\r\n case SpacingMode.Percent:\r\n if (scale) {\r\n for (var i = 0, n = spacesCount - 1; i < n; i++) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon)\r\n lengths[i] = 0;\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n lengths[i] = Math.sqrt(x * x + y * y);\r\n }\r\n }\r\n }\r\n Utils.arrayFill(spaces, 1, spacesCount, spacing);\r\n break;\r\n case SpacingMode.Proportional:\r\n var sum = 0;\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = spacing;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_1;\r\n spaces[++i] = length_1;\r\n sum += length_1;\r\n }\r\n }\r\n if (sum > 0) {\r\n sum = spacesCount / sum * spacing;\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] *= sum;\r\n }\r\n break;\r\n default:\r\n var lengthSpacing = data.spacingMode == SpacingMode.Length;\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = spacing;\r\n }\r\n else {\r\n var x = setupLength * bone.matrix.a, y = setupLength * bone.matrix.b;\r\n var length_2 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_2;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\r\n }\r\n }\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = data.rotateMode == RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone.matrix;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n mat.tx += (boneX - mat.tx) * mixX;\r\n mat.ty += (boneY - mat.ty) * mixY;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_3 = lengths[i];\r\n if (length_3 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * mixRotate + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (mixRotate > 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_4 = bone.data.length;\r\n boneX += (length_4 * (cos * a - sin * c) - dx) * mixRotate;\r\n boneY += (length_4 * (sin * a + cos * c) - dy) * mixRotate;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= mixRotate;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n bone.updateAppliedTransform();\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = this.world;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (this.data.positionMode == PositionMode.Percent)\r\n position *= pathLength_1;\r\n var multiplier_1;\r\n switch (this.data.spacingMode) {\r\n case SpacingMode.Percent:\r\n multiplier_1 = pathLength_1;\r\n break;\r\n case SpacingMode.Proportional:\r\n multiplier_1 = pathLength_1 / spacesCount;\r\n break;\r\n default:\r\n multiplier_1 = 1;\r\n }\r\n world = Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i] * multiplier_1;\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_5 = lengths[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n // World vertices.\r\n if (closed) {\r\n verticesLength += 2;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n // Curve lengths.\r\n var curves = Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (this.data.positionMode == PositionMode.Percent)\r\n position *= pathLength;\r\n var multiplier;\r\n switch (this.data.spacingMode) {\r\n case SpacingMode.Percent:\r\n multiplier = pathLength;\r\n break;\r\n case SpacingMode.Proportional:\r\n multiplier = pathLength / spacesCount;\r\n break;\r\n default:\r\n multiplier = 1;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i] * multiplier;\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n // Determine curve containing position.\r\n for (;; curve++) {\r\n var length_6 = curves[curve];\r\n if (p > length_6)\r\n continue;\r\n if (curve == 0)\r\n p /= length_6;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n // Curve segment lengths.\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n // Weight by segment length.\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_7 = segments[segment];\r\n if (p > length_7)\r\n continue;\r\n if (segment == 0)\r\n p /= length_7;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_7 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p)) {\r\n out[o] = x1;\r\n out[o + 1] = y1;\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n return;\r\n }\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents) {\r\n if (p < 0.001)\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n else\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n }\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n}());\n\n/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store\r\n * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared\r\n * across multiple skeletons.\r\n * @public\r\n * */\r\nvar Slot = /** @class */ (function () {\r\n function Slot(data, bone) {\r\n /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\r\n * color's alpha is not used. */\r\n this.darkColor = null;\r\n this.attachment = null;\r\n this.attachmentState = 0;\r\n /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the\r\n * {@link Sequence#getSetupIndex()}. */\r\n this.sequenceIndex = -1;\r\n /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a\r\n * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.\r\n *\r\n * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */\r\n this.deform = new Array();\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!bone)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new Color();\r\n this.darkColor = !data.darkColor ? null : new Color();\r\n this.setToSetupPose();\r\n this.blendMode = this.data.blendMode;\r\n }\r\n /** The skeleton this slot belongs to. */\r\n Slot.prototype.getSkeleton = function () {\r\n return this.bone.skeleton;\r\n };\r\n /** The current attachment for the slot, or null if the slot has no attachment. */\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.\r\n * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the\r\n * specified attachment. */\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)\r\n || attachment.timelineAttachment != this.attachment.timelineAttachment) {\r\n this.deform.length = 0;\r\n }\r\n this.attachment = attachment;\r\n this.sequenceIndex = -1;\r\n };\r\n /** Sets this slot to the setup pose. */\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (!this.data.attachmentName)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n}());\n\n/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained\r\n * bones to match that of the target bone.\r\n *\r\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar TransformConstraint = /** @class */ (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.mixRotate = 0;\r\n this.mixX = 0;\r\n this.mixY = 0;\r\n this.mixScaleX = 0;\r\n this.mixScaleY = 0;\r\n this.mixShearY = 0;\r\n this.temp = new Vector2();\r\n this.active = false;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n if (!skeleton)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mixRotate = data.mixRotate;\r\n this.mixX = data.mixX;\r\n this.mixY = data.mixY;\r\n this.mixScaleX = data.mixScaleX;\r\n this.mixScaleY = data.mixScaleY;\r\n this.mixShearY = data.mixShearY;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var bone = skeleton.findBone(data.bones[i].name);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + data.bones[i].name + \".\");\r\n this.bones.push(bone);\r\n }\r\n var target = skeleton.findBone(data.target.name);\r\n if (!target)\r\n throw new Error(\"Couldn't find target bone \" + data.target.name + \".\");\r\n this.target = target;\r\n }\r\n TransformConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.mixRotate == 0 && this.mixX == 0 && this.mixY == 0 && this.mixScaleX == 0 && this.mixScaleX == 0 && this.mixShearY == 0)\r\n return;\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var translate = mixX != 0 || mixY != 0;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n if (mixRotate != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= mixRotate;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n if (translate) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += (temp.x - mat.tx) * mixX;\r\n mat.ty += (temp.y - mat.ty) * mixY;\r\n }\r\n if (mixScaleX != 0) {\r\n var s = Math.sqrt(mat.a * mat.a + mat.b * mat.b);\r\n if (s != 0)\r\n s = (s + (Math.sqrt(ta * ta + tc * tc) - s + this.data.offsetScaleX) * mixScaleX) / s;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n if (mixScaleY != 0) {\r\n var s = Math.sqrt(mat.c * mat.c + mat.d * mat.d);\r\n if (s != 0)\r\n s = (s + (Math.sqrt(tb * tb + td * td) - s + this.data.offsetScaleY) * mixScaleY) / s;\r\n mat.c *= s;\r\n mat.d *= s;\r\n }\r\n if (mixShearY > 0) {\r\n var b = mat.c, d = mat.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(mat.b, mat.a));\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r = by + (r + offsetShearY) * mixShearY;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n }\r\n bone.updateAppliedTransform();\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var translate = mixX != 0 || mixY != 0;\r\n var target = this.target;\r\n var targetMat = target.matrix;\r\n var ta = targetMat.a, tb = targetMat.c, tc = targetMat.b, td = targetMat.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var mat = bone.matrix;\r\n if (mixRotate != 0) {\r\n var a = mat.a, b = mat.c, c = mat.b, d = mat.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n r *= mixRotate;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n mat.a = cos * a - sin * c;\r\n mat.c = cos * b - sin * d;\r\n mat.b = sin * a + cos * c;\r\n mat.d = sin * b + cos * d;\r\n }\r\n if (translate) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n mat.tx += temp.x * mixX;\r\n mat.ty += temp.y * mixY;\r\n }\r\n if (mixScaleX != 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * mixScaleX + 1;\r\n mat.a *= s;\r\n mat.b *= s;\r\n }\r\n if (mixScaleY != 0) {\r\n var s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * mixScaleY + 1;\r\n mat.c *= s;\r\n mat.d *= s;\r\n }\r\n if (mixShearY > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > MathUtils.PI)\r\n r -= MathUtils.PI2;\r\n else if (r < -MathUtils.PI) //\r\n r += MathUtils.PI2;\r\n var b = mat.c, d = mat.d;\r\n r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * mixShearY;\r\n var s = Math.sqrt(b * b + d * d);\r\n mat.c = Math.cos(r) * s;\r\n mat.d = Math.sin(r) * s;\r\n }\r\n bone.updateAppliedTransform();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var target = this.target;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var rotation = bone.arotation;\r\n if (mixRotate != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * mixRotate;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n x += (target.ax - x + this.data.offsetX) * mixX;\r\n y += (target.ay - y + this.data.offsetY) * mixY;\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (mixScaleX != 0 && scaleX != 0)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * mixScaleX) / scaleX;\r\n if (mixScaleY != 0 && scaleY != 0)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;\r\n var shearY = bone.ashearY;\r\n if (mixShearY != 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n shearY += r * mixShearY;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\r\n var target = this.target;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var rotation = bone.arotation + (target.arotation + this.data.offsetRotation) * mixRotate;\r\n var x = bone.ax + (target.ax + this.data.offsetX) * mixX;\r\n var y = bone.ay + (target.ay + this.data.offsetY) * mixY;\r\n var scaleX = bone.ascaleX * (((target.ascaleX - 1 + this.data.offsetScaleX) * mixScaleX) + 1);\r\n var scaleY = bone.ascaleY * (((target.ascaleY - 1 + this.data.offsetScaleY) * mixScaleY) + 1);\r\n var shearY = bone.ashearY + (target.ashearY + this.data.offsetShearY) * mixShearY;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n return TransformConstraint;\r\n}());\n\n/** Stores the current pose for a skeleton.\r\n *\r\n * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide.\r\n * @public\r\n * */\r\nvar Skeleton = /** @class */ (function () {\r\n function Skeleton(data) {\r\n /** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */\r\n this._updateCache = new Array();\r\n /** The skeleton's current skin. May be null. */\r\n this.skin = null;\r\n /** Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale\r\n * inheritance. */\r\n this.scaleX = 1;\r\n /** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale\r\n * inheritance. */\r\n this.scaleY = 1;\r\n /** Sets the skeleton X position, which is added to the root bone worldX position. */\r\n this.x = 0;\r\n /** Sets the skeleton Y position, which is added to the root bone worldY position. */\r\n this.y = 0;\r\n if (!data)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (!boneData.parent)\r\n bone = new Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n /** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones,\r\n * constraints, or weighted path attachments are added or removed. */\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n bone.sorted = bone.data.skinRequired;\r\n bone.active = !bone.sorted;\r\n }\r\n if (this.skin) {\r\n var skinBones = this.skin.bones;\r\n for (var i = 0, n = this.skin.bones.length; i < n; i++) {\r\n var bone = this.bones[skinBones[i].index];\r\n do {\r\n bone.sorted = false;\r\n bone.active = true;\r\n bone = bone.parent;\r\n } while (bone);\r\n }\r\n }\r\n // IK first, lowest hierarchy depth first.\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length == 1) {\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n }\r\n else {\r\n var child = constrained[constrained.length - 1];\r\n this.sortBone(child);\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n child.sorted = true;\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n this.sortBone(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (!pathBones)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n for (var i = 0, n = pathBones.length; i < n;) {\r\n var nn = pathBones[i++];\r\n nn += i;\r\n while (i < nn)\r\n this.sortBone(bones[pathBones[i++]]);\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (!bone)\r\n return;\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.active)\r\n continue;\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n /** Updates the world transform for each bone and applies all constraints.\r\n *\r\n * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\r\n * Runtimes Guide. */\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n Skeleton.prototype.updateWorldTransformWith = function (parent) {\r\n // Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection.\r\n var rootBone = this.getRootBone();\r\n var pa = parent.matrix.a, pb = parent.matrix.c, pc = parent.matrix.b, pd = parent.matrix.d;\r\n rootBone.matrix.tx = pa * this.x + pb * this.y + parent.worldX;\r\n rootBone.matrix.ty = pc * this.x + pd * this.y + parent.worldY;\r\n var rotationY = rootBone.rotation + 90 + rootBone.shearY;\r\n var la = MathUtils.cosDeg(rootBone.rotation + rootBone.shearX) * rootBone.scaleX;\r\n var lb = MathUtils.cosDeg(rotationY) * rootBone.scaleY;\r\n var lc = MathUtils.sinDeg(rootBone.rotation + rootBone.shearX) * rootBone.scaleX;\r\n var ld = MathUtils.sinDeg(rotationY) * rootBone.scaleY;\r\n var sx = this.scaleX;\r\n var sy = settings.yDown ? -this.scaleY : this.scaleY;\r\n rootBone.matrix.a = (pa * la + pb * lc) * sx;\r\n rootBone.matrix.c = (pa * lb + pb * ld) * sx;\r\n rootBone.matrix.b = (pc * la + pd * lc) * sy;\r\n rootBone.matrix.d = (pc * lb + pd * ld) * sy;\r\n // Update everything except root bone.\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++) {\r\n var updatable = updateCache[i];\r\n if (updatable != rootBone)\r\n updatable.update();\r\n }\r\n };\r\n /** Sets the bones, constraints, and slots to their setup pose values. */\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n /** Sets the bones and constraints to their setup pose values. */\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.mixRotate = data.mixRotate;\r\n constraint.mixX = data.mixX;\r\n constraint.mixY = data.mixY;\r\n constraint.mixScaleX = data.mixScaleX;\r\n constraint.mixScaleY = data.mixScaleY;\r\n constraint.mixShearY = data.mixShearY;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.mixRotate = data.mixRotate;\r\n constraint.mixX = data.mixX;\r\n constraint.mixY = data.mixY;\r\n }\r\n };\r\n /** Sets the slots and draw order to their setup pose values. */\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n /** @returns May return null. */\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n /** @returns May be null. */\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** @returns -1 if the bone was not found. */\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\r\n * repeatedly.\r\n * @returns May be null. */\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** @returns -1 if the bone was not found. */\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Sets a skin by name.\r\n *\r\n * See {@link #setSkin()}. */\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (!skin)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the\r\n * skin is changed, {@link #updateCache()} is called.\r\n *\r\n * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\r\n * old skin, each slot's setup mode attachment is attached from the new skin.\r\n *\r\n * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling\r\n * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the\r\n * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.\r\n * @param newSkin May be null. */\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin == this.skin)\r\n return;\r\n if (newSkin) {\r\n if (this.skin)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n this.updateCache();\r\n };\r\n /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment\r\n * name.\r\n *\r\n * See {@link #getAttachment()}.\r\n * @returns May be null. */\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n var slot = this.data.findSlot(slotName);\r\n if (!slot)\r\n throw new Error(\"Can't find slot with name \" + slotName);\r\n return this.getAttachment(slot.index, attachmentName);\r\n };\r\n /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and\r\n * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.\r\n *\r\n * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\r\n * @returns May be null. */\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (!attachmentName)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n /** A convenience method to set an attachment by finding the slot with {@link #findSlot()}, finding the attachment with\r\n * {@link #getAttachment()}, then setting the slot's {@link Slot#attachment}.\r\n * @param attachmentName May be null to clear the slot's attachment. */\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (!attachment)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\r\n * than to call it repeatedly.\r\n * @return May be null. */\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\r\n * this method than to call it repeatedly.\r\n * @return May be null. */\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\r\n * than to call it repeatedly.\r\n * @return May be null. */\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`.\r\n * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */\r\n Skeleton.prototype.getBoundsRect = function () {\r\n var offset = new Vector2();\r\n var size = new Vector2();\r\n this.getBounds(offset, size);\r\n return { x: offset.x, y: offset.y, width: size.x, height: size.y };\r\n };\r\n /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.\r\n * @param size An output value, the width and height of the AABB.\r\n * @param temp Working memory to temporarily store attachments' computed world vertices. */\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (temp === void 0) { temp = new Array(2); }\r\n if (!offset)\r\n throw new Error(\"offset cannot be null.\");\r\n if (!size)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Object.defineProperty(Skeleton.prototype, \"flipX\", {\r\n get: function () {\r\n return this.scaleX == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleX = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Skeleton.prototype, \"flipY\", {\r\n get: function () {\r\n return this.scaleY == -1;\r\n },\r\n set: function (value) {\r\n if (!Skeleton.deprecatedWarning1) {\r\n Skeleton.deprecatedWarning1 = true;\r\n console.warn(\"Spine Deprecation Warning: `Skeleton.flipX/flipY` was deprecated, please use scaleX/scaleY\");\r\n }\r\n this.scaleY = value ? 1.0 : -1.0;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Skeleton.deprecatedWarning1 = false;\r\n return Skeleton;\r\n}());\n\n/** Stores the setup pose and all of the stateless data for a skeleton.\r\n *\r\n * See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes\r\n * Guide.\r\n * @public\r\n * */\r\nvar SkeletonData = /** @class */ (function () {\r\n function SkeletonData() {\r\n /** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */\r\n this.name = null;\r\n /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\r\n this.bones = new Array(); // Ordered parents first.\r\n /** The skeleton's slots. */\r\n this.slots = new Array(); // Setup pose draw order.\r\n this.skins = new Array();\r\n /** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.\r\n *\r\n * See {@link Skeleton#getAttachmentByName()}.\r\n * May be null. */\r\n this.defaultSkin = null;\r\n /** The skeleton's events. */\r\n this.events = new Array();\r\n /** The skeleton's animations. */\r\n this.animations = new Array();\r\n /** The skeleton's IK constraints. */\r\n this.ikConstraints = new Array();\r\n /** The skeleton's transform constraints. */\r\n this.transformConstraints = new Array();\r\n /** The skeleton's path constraints. */\r\n this.pathConstraints = new Array();\r\n /** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.x = 0;\r\n /** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.y = 0;\r\n /** The width of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.width = 0;\r\n /** The height of the skeleton's axis aligned bounding box in the setup pose. */\r\n this.height = 0;\r\n /** The Spine version used to export the skeleton data, or null. */\r\n this.version = null;\r\n /** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */\r\n this.hash = null;\r\n // Nonessential\r\n /** The dopesheet FPS in Spine. Available only when nonessential data was exported. */\r\n this.fps = 0;\r\n /** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */\r\n this.imagesPath = null;\r\n /** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */\r\n this.audioPath = null;\r\n }\r\n /** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n /** removed from spine-ts runtime **/\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (!boneName)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n /** removed from spine-ts runtime **/\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (!slotName)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n /** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (!skinName)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n /** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it\r\n * multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (!eventDataName)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.name == eventDataName)\r\n return event_1;\r\n }\r\n return null;\r\n };\r\n /** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to\r\n * call it multiple times.\r\n * @returns May be null. */\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (!animationName)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\r\n * than to call it multiple times.\r\n * @return May be null. */\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\r\n * this method than to call it multiple times.\r\n * @return May be null. */\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\r\n * than to call it multiple times.\r\n * @return May be null. */\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (!constraintName)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n /** removed from spine-ts runtime **/ SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n}());\n\n/** Stores the setup pose for a {@link Slot}.\r\n * @public\r\n * */\r\nvar SlotData = /** @class */ (function () {\r\n function SlotData(index, name, boneData) {\r\n /** The index of the slot in {@link Skeleton#getSlots()}. */\r\n this.index = 0;\r\n /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\r\n * color tinting. */\r\n this.color = new Color(1, 1, 1, 1);\r\n /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\r\n * color's alpha is not used. */\r\n this.darkColor = null;\r\n /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */\r\n this.attachmentName = null;\r\n /** The blend mode for drawing the slot's attachment. */\r\n this.blendMode = BLEND_MODES.NORMAL;\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n if (!boneData)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n}());\n\n/** Stores the setup pose for a {@link TransformConstraint}.\r\n *\r\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide.\r\n * @public\r\n * */\r\nvar TransformConstraintData = /** @class */ (function (_super) {\r\n __extends(TransformConstraintData, _super);\r\n function TransformConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n /** The bones that will be modified by this transform constraint. */\r\n _this.bones = new Array();\r\n /** The target bone whose world transform will be copied to the constrained bones. */\r\n _this._target = null;\r\n _this.mixRotate = 0;\r\n _this.mixX = 0;\r\n _this.mixY = 0;\r\n _this.mixScaleX = 0;\r\n _this.mixScaleY = 0;\r\n _this.mixShearY = 0;\r\n /** An offset added to the constrained bone rotation. */\r\n _this.offsetRotation = 0;\r\n /** An offset added to the constrained bone X translation. */\r\n _this.offsetX = 0;\r\n /** An offset added to the constrained bone Y translation. */\r\n _this.offsetY = 0;\r\n /** An offset added to the constrained bone scaleX. */\r\n _this.offsetScaleX = 0;\r\n /** An offset added to the constrained bone scaleY. */\r\n _this.offsetScaleY = 0;\r\n /** An offset added to the constrained bone shearY. */\r\n _this.offsetShearY = 0;\r\n _this.relative = false;\r\n _this.local = false;\r\n return _this;\r\n }\r\n Object.defineProperty(TransformConstraintData.prototype, \"target\", {\r\n get: function () {\r\n if (!this._target)\r\n throw new Error(\"BoneData not set.\");\r\n else\r\n return this._target;\r\n },\r\n set: function (boneData) { this._target = boneData; },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return TransformConstraintData;\r\n}(ConstraintData));\n\n/** Stores an entry in the skin consisting of the slot index, name, and attachment\r\n * @public\r\n * **/\r\nvar SkinEntry = /** @class */ (function () {\r\n function SkinEntry(slotIndex, name, attachment) {\r\n this.slotIndex = slotIndex;\r\n this.name = name;\r\n this.attachment = attachment;\r\n }\r\n return SkinEntry;\r\n}());\r\n/** Stores attachments by slot index and attachment name.\r\n *\r\n * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and\r\n * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\r\n * @public\r\n * */\r\nvar Skin = /** @class */ (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n this.bones = Array();\r\n this.constraints = new Array();\r\n if (!name)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n /** Adds an attachment to the skin for the specified slot index and name. */\r\n Skin.prototype.setAttachment = function (slotIndex, name, attachment) {\r\n if (!attachment)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n /** Adds all attachments, bones, and constraints from the specified skin to this skin. */\r\n Skin.prototype.addSkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.bones.length; ii++) {\r\n if (this.bones[ii] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.constraints.length; ii++) {\r\n if (this.constraints[ii] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n };\r\n /** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not\r\n * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */\r\n Skin.prototype.copySkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.bones.length; ii++) {\r\n if (this.bones[ii] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var ii = 0; ii < this.constraints.length; ii++) {\r\n if (this.constraints[ii] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n if (!attachment.attachment)\r\n continue;\r\n if (attachment.attachment instanceof MeshAttachment) {\r\n attachment.attachment = attachment.attachment.newLinkedMesh();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n else {\r\n attachment.attachment = attachment.attachment.copy();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n }\r\n };\r\n /** Returns the attachment for the specified slot index and name, or null. */\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n /** Removes the attachment in the skin for the specified slot index and name, if any. */\r\n Skin.prototype.removeAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n if (dictionary)\r\n delete dictionary[name];\r\n };\r\n /** Returns all attachments in this skin. */\r\n Skin.prototype.getAttachments = function () {\r\n var entries = new Array();\r\n for (var i = 0; i < this.attachments.length; i++) {\r\n var slotAttachments = this.attachments[i];\r\n if (slotAttachments) {\r\n for (var name_1 in slotAttachments) {\r\n var attachment = slotAttachments[name_1];\r\n if (attachment)\r\n entries.push(new SkinEntry(i, name_1, attachment));\r\n }\r\n }\r\n }\r\n return entries;\r\n };\r\n /** Returns all attachments in this skin for the specified slot index. */\r\n Skin.prototype.getAttachmentsForSlot = function (slotIndex, attachments) {\r\n var slotAttachments = this.attachments[slotIndex];\r\n if (slotAttachments) {\r\n for (var name_2 in slotAttachments) {\r\n var attachment = slotAttachments[name_2];\r\n if (attachment)\r\n attachments.push(new SkinEntry(slotIndex, name_2, attachment));\r\n }\r\n }\r\n };\r\n /** Clears all attachments, bones, and constraints. */\r\n Skin.prototype.clear = function () {\r\n this.attachments.length = 0;\r\n this.bones.length = 0;\r\n this.constraints.length = 0;\r\n };\r\n /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n}());\n\n/** Loads skeleton data in the Spine binary format.\r\n *\r\n * See [Spine binary format](http://esotericsoftware.com/spine-binary-format) and\r\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\r\n * Runtimes Guide.\r\n * @public\r\n * */\r\nvar SkeletonBinary = /** @class */ (function () {\r\n function SkeletonBinary(attachmentLoader) {\r\n this.ver40 = false;\r\n /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\r\n * runtime than were used in Spine.\r\n *\r\n * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonBinary.prototype.readSkeletonData = function (binary) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n skeletonData.name = \"\"; // BOZO\r\n var input = new BinaryInput(binary);\r\n var lowHash = input.readInt32();\r\n var highHash = input.readInt32();\r\n skeletonData.hash = highHash == 0 && lowHash == 0 ? null : highHash.toString(16) + lowHash.toString(16);\r\n skeletonData.version = input.readString();\r\n var verShort = skeletonData.version.substr(0, 3);\r\n if (verShort !== '4.0' && verShort !== '4.1') {\r\n var error = \"Spine 4.1 loader cant load version \" + skeletonData.version + \". Please configure your pixi-spine bundle\";\r\n console.error(error);\r\n }\r\n this.ver40 = verShort === '4.0';\r\n skeletonData.x = input.readFloat();\r\n skeletonData.y = input.readFloat();\r\n skeletonData.width = input.readFloat();\r\n skeletonData.height = input.readFloat();\r\n var nonessential = input.readBoolean();\r\n if (nonessential) {\r\n skeletonData.fps = input.readFloat();\r\n skeletonData.imagesPath = input.readString();\r\n skeletonData.audioPath = input.readString();\r\n }\r\n var n = 0;\r\n // Strings.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var str = input.readString();\r\n if (!str)\r\n throw new Error(\"String in string table must not be null.\");\r\n input.strings.push(str);\r\n }\r\n // Bones.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var name_1 = input.readString();\r\n if (!name_1)\r\n throw new Error(\"Bone name must not be null.\");\r\n var parent_1 = i == 0 ? null : skeletonData.bones[input.readInt(true)];\r\n var data = new BoneData(i, name_1, parent_1);\r\n data.rotation = input.readFloat();\r\n data.x = input.readFloat() * scale;\r\n data.y = input.readFloat() * scale;\r\n data.scaleX = input.readFloat();\r\n data.scaleY = input.readFloat();\r\n data.shearX = input.readFloat();\r\n data.shearY = input.readFloat();\r\n data.length = input.readFloat() * scale;\r\n data.transformMode = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n if (nonessential)\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n skeletonData.bones.push(data);\r\n }\r\n // Slots.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var slotName = input.readString();\r\n if (!slotName)\r\n throw new Error(\"Slot name must not be null.\");\r\n var boneData = skeletonData.bones[input.readInt(true)];\r\n var data = new SlotData(i, slotName, boneData);\r\n Color.rgba8888ToColor(data.color, input.readInt32());\r\n var darkColor = input.readInt32();\r\n if (darkColor != -1)\r\n Color.rgb888ToColor(data.darkColor = new Color(), darkColor);\r\n data.attachmentName = input.readStringRef();\r\n data.blendMode = input.readInt(true);\r\n skeletonData.slots.push(data);\r\n }\r\n // IK constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var name_2 = input.readString();\r\n if (!name_2)\r\n throw new Error(\"IK constraint data name must not be null.\");\r\n var data = new IkConstraintData(name_2);\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.mix = input.readFloat();\r\n data.softness = input.readFloat() * scale;\r\n data.bendDirection = input.readByte();\r\n data.compress = input.readBoolean();\r\n data.stretch = input.readBoolean();\r\n data.uniform = input.readBoolean();\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n // Transform constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var name_3 = input.readString();\r\n if (!name_3)\r\n throw new Error(\"Transform constraint data name must not be null.\");\r\n var data = new TransformConstraintData(name_3);\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.local = input.readBoolean();\r\n data.relative = input.readBoolean();\r\n data.offsetRotation = input.readFloat();\r\n data.offsetX = input.readFloat() * scale;\r\n data.offsetY = input.readFloat() * scale;\r\n data.offsetScaleX = input.readFloat();\r\n data.offsetScaleY = input.readFloat();\r\n data.offsetShearY = input.readFloat();\r\n data.mixRotate = input.readFloat();\r\n data.mixX = input.readFloat();\r\n data.mixY = input.readFloat();\r\n data.mixScaleX = input.readFloat();\r\n data.mixScaleY = input.readFloat();\r\n data.mixShearY = input.readFloat();\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n // Path constraints.\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var name_4 = input.readString();\r\n if (!name_4)\r\n throw new Error(\"Path constraint data name must not be null.\");\r\n var data = new PathConstraintData(name_4);\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.slots[input.readInt(true)];\r\n data.positionMode = input.readInt(true);\r\n data.spacingMode = input.readInt(true);\r\n data.rotateMode = input.readInt(true);\r\n data.offsetRotation = input.readFloat();\r\n data.position = input.readFloat();\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = input.readFloat();\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.mixRotate = input.readFloat();\r\n data.mixX = input.readFloat();\r\n data.mixY = input.readFloat();\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n // Default skin.\r\n var defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\r\n if (defaultSkin) {\r\n skeletonData.defaultSkin = defaultSkin;\r\n skeletonData.skins.push(defaultSkin);\r\n }\r\n // Skins.\r\n {\r\n var i = skeletonData.skins.length;\r\n Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\r\n for (; i < n; i++) {\r\n var skin = this.readSkin(input, skeletonData, false, nonessential);\r\n if (!skin)\r\n throw new Error(\"readSkin() should not have returned null.\");\r\n skeletonData.skins[i] = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n n = this.linkedMeshes.length;\r\n for (var i = 0; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (!skin)\r\n throw new Error(\"Not skin found for linked mesh.\");\r\n if (!linkedMesh.parent)\r\n throw new Error(\"Linked mesh parent must not be null\");\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (!parent_2)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var eventName = input.readStringRef();\r\n if (!eventName)\r\n throw new Error;\r\n var data = new EventData(eventName);\r\n data.intValue = input.readInt(false);\r\n data.floatValue = input.readFloat();\r\n data.stringValue = input.readString();\r\n data.audioPath = input.readString();\r\n if (data.audioPath) {\r\n data.volume = input.readFloat();\r\n data.balance = input.readFloat();\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n // Animations.\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var animationName = input.readString();\r\n if (!animationName)\r\n throw new Error(\"Animatio name must not be null.\");\r\n skeletonData.animations.push(this.readAnimation(input, animationName, skeletonData));\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonBinary.prototype.readSkin = function (input, skeletonData, defaultSkin, nonessential) {\r\n var skin = null;\r\n var slotCount = 0;\r\n if (defaultSkin) {\r\n slotCount = input.readInt(true);\r\n if (slotCount == 0)\r\n return null;\r\n skin = new Skin(\"default\");\r\n }\r\n else {\r\n var skinName = input.readStringRef();\r\n if (!skinName)\r\n throw new Error(\"Skin name must not be null.\");\r\n skin = new Skin(skinName);\r\n skin.bones.length = input.readInt(true);\r\n for (var i = 0, n = skin.bones.length; i < n; i++)\r\n skin.bones[i] = skeletonData.bones[input.readInt(true)];\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\r\n slotCount = input.readInt(true);\r\n }\r\n for (var i = 0; i < slotCount; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var name_5 = input.readStringRef();\r\n if (!name_5)\r\n throw new Error(\"Attachment name must not be null\");\r\n var attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name_5, nonessential);\r\n if (attachment)\r\n skin.setAttachment(slotIndex, name_5, attachment);\r\n }\r\n }\r\n return skin;\r\n };\r\n SkeletonBinary.prototype.readAttachment = function (input, skeletonData, skin, slotIndex, attachmentName, nonessential) {\r\n var scale = this.scale;\r\n var name = input.readStringRef();\r\n if (!name)\r\n name = attachmentName;\r\n switch (input.readByte()) {\r\n case AttachmentType.Region: {\r\n var path = input.readStringRef();\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var scaleX = input.readFloat();\r\n var scaleY = input.readFloat();\r\n var width = input.readFloat();\r\n var height = input.readFloat();\r\n var color = input.readInt32();\r\n var sequence = this.readSequence(input);\r\n if (!path)\r\n path = name;\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\r\n if (!region)\r\n return null;\r\n region.path = path;\r\n region.x = x * scale;\r\n region.y = y * scale;\r\n region.scaleX = scaleX;\r\n region.scaleY = scaleY;\r\n region.rotation = rotation;\r\n region.width = width * scale;\r\n region.height = height * scale;\r\n Color.rgba8888ToColor(region.color, color);\r\n region.sequence = sequence;\r\n if (sequence == null)\r\n region.updateRegion();\r\n return region;\r\n }\r\n case AttachmentType.BoundingBox: {\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (!box)\r\n return null;\r\n box.worldVerticesLength = vertexCount << 1;\r\n box.vertices = vertices.vertices;\r\n box.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(box.color, color);\r\n return box;\r\n }\r\n case AttachmentType.Mesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var vertexCount = input.readInt(true);\r\n var uvs = this.readFloatArray(input, vertexCount << 1, 1);\r\n var triangles = this.readShortArray(input);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var hullLength = input.readInt(true);\r\n var sequence = this.readSequence(input);\r\n var edges = [];\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n edges = this.readShortArray(input);\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (!path)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\r\n if (!mesh)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n mesh.bones = vertices.bones;\r\n mesh.vertices = vertices.vertices;\r\n mesh.worldVerticesLength = vertexCount << 1;\r\n mesh.triangles = triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // if (sequence == null) mesh.updateRegion();\r\n mesh.hullLength = hullLength << 1;\r\n mesh.sequence = sequence;\r\n if (nonessential) {\r\n mesh.edges = edges;\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n return mesh;\r\n }\r\n case AttachmentType.LinkedMesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var skinName = input.readStringRef();\r\n var parent_3 = input.readStringRef();\r\n var inheritTimelines = input.readBoolean();\r\n var sequence = this.readSequence(input);\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (!path)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\r\n if (!mesh)\r\n return null;\r\n mesh.path = path;\r\n Color.rgba8888ToColor(mesh.color, color);\r\n mesh.sequence = sequence;\r\n if (nonessential) {\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n this.linkedMeshes.push(new LinkedMesh$1(mesh, skinName, slotIndex, parent_3, inheritTimelines));\r\n return mesh;\r\n }\r\n case AttachmentType.Path: {\r\n var closed_1 = input.readBoolean();\r\n var constantSpeed = input.readBoolean();\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0, n = lengths.length; i < n; i++)\r\n lengths[i] = input.readFloat() * scale;\r\n var color = nonessential ? input.readInt32() : 0;\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (!path)\r\n return null;\r\n path.closed = closed_1;\r\n path.constantSpeed = constantSpeed;\r\n path.worldVerticesLength = vertexCount << 1;\r\n path.vertices = vertices.vertices;\r\n path.bones = vertices.bones;\r\n path.lengths = lengths;\r\n if (nonessential)\r\n Color.rgba8888ToColor(path.color, color);\r\n return path;\r\n }\r\n case AttachmentType.Point: {\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var color = nonessential ? input.readInt32() : 0;\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (!point)\r\n return null;\r\n point.x = x * scale;\r\n point.y = y * scale;\r\n point.rotation = rotation;\r\n if (nonessential)\r\n Color.rgba8888ToColor(point.color, color);\r\n return point;\r\n }\r\n case AttachmentType.Clipping: {\r\n var endSlotIndex = input.readInt(true);\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (!clip)\r\n return null;\r\n clip.endSlot = skeletonData.slots[endSlotIndex];\r\n clip.worldVerticesLength = vertexCount << 1;\r\n clip.vertices = vertices.vertices;\r\n clip.bones = vertices.bones;\r\n if (nonessential)\r\n Color.rgba8888ToColor(clip.color, color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonBinary.prototype.readSequence = function (input) {\r\n if (this.ver40 || !input.readBoolean())\r\n return null;\r\n var sequence = new Sequence(input.readInt(true));\r\n sequence.start = input.readInt(true);\r\n sequence.digits = input.readInt(true);\r\n sequence.setupIndex = input.readInt(true);\r\n return sequence;\r\n };\r\n SkeletonBinary.prototype.readDeformTimelineType = function (input) {\r\n if (this.ver40)\r\n return ATTACHMENT_DEFORM;\r\n return input.readByte();\r\n };\r\n SkeletonBinary.prototype.readVertices = function (input, vertexCount) {\r\n var scale = this.scale;\r\n var verticesLength = vertexCount << 1;\r\n var vertices = new Vertices();\r\n if (!input.readBoolean()) {\r\n vertices.vertices = this.readFloatArray(input, verticesLength, scale);\r\n return vertices;\r\n }\r\n var weights = new Array();\r\n var bonesArray = new Array();\r\n for (var i = 0; i < vertexCount; i++) {\r\n var boneCount = input.readInt(true);\r\n bonesArray.push(boneCount);\r\n for (var ii = 0; ii < boneCount; ii++) {\r\n bonesArray.push(input.readInt(true));\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat());\r\n }\r\n }\r\n vertices.vertices = Utils.toFloatArray(weights);\r\n vertices.bones = bonesArray;\r\n return vertices;\r\n };\r\n SkeletonBinary.prototype.readFloatArray = function (input, n, scale) {\r\n var array = new Array(n);\r\n if (scale == 1) {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat();\r\n }\r\n else {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat() * scale;\r\n }\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readShortArray = function (input) {\r\n var n = input.readInt(true);\r\n var array = new Array(n);\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readShort();\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readAnimation = function (input, name, skeletonData) {\r\n input.readInt(true); // Number of timelines.\r\n var timelines = new Array();\r\n var scale = this.scale;\r\n // Slot timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n var frameLast = frameCount - 1;\r\n switch (timelineType) {\r\n case SLOT_ATTACHMENT: {\r\n var timeline = new AttachmentTimeline(frameCount, slotIndex);\r\n for (var frame = 0; frame < frameCount; frame++)\r\n timeline.setFrame(frame, input.readFloat(), input.readStringRef());\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGBA: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGBATimeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n var a = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b, a);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n var a2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);\r\n }\r\n time = time2;\r\n r = r2;\r\n g = g2;\r\n b = b2;\r\n a = a2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGB: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGBTimeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\r\n }\r\n time = time2;\r\n r = r2;\r\n g = g2;\r\n b = b2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGBA2: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n var a = input.readUnsignedByte() / 255.0;\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b, a, r2, g2, b2);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var nr = input.readUnsignedByte() / 255.0;\r\n var ng = input.readUnsignedByte() / 255.0;\r\n var nb = input.readUnsignedByte() / 255.0;\r\n var na = input.readUnsignedByte() / 255.0;\r\n var nr2 = input.readUnsignedByte() / 255.0;\r\n var ng2 = input.readUnsignedByte() / 255.0;\r\n var nb2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);\r\n setBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);\r\n setBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);\r\n setBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);\r\n }\r\n time = time2;\r\n r = nr;\r\n g = ng;\r\n b = nb;\r\n a = na;\r\n r2 = nr2;\r\n g2 = ng2;\r\n b2 = nb2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_RGB2: {\r\n var bezierCount = input.readInt(true);\r\n var timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex);\r\n var time = input.readFloat();\r\n var r = input.readUnsignedByte() / 255.0;\r\n var g = input.readUnsignedByte() / 255.0;\r\n var b = input.readUnsignedByte() / 255.0;\r\n var r2 = input.readUnsignedByte() / 255.0;\r\n var g2 = input.readUnsignedByte() / 255.0;\r\n var b2 = input.readUnsignedByte() / 255.0;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, r, g, b, r2, g2, b2);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var nr = input.readUnsignedByte() / 255.0;\r\n var ng = input.readUnsignedByte() / 255.0;\r\n var nb = input.readUnsignedByte() / 255.0;\r\n var nr2 = input.readUnsignedByte() / 255.0;\r\n var ng2 = input.readUnsignedByte() / 255.0;\r\n var nb2 = input.readUnsignedByte() / 255.0;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);\r\n setBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);\r\n setBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);\r\n }\r\n time = time2;\r\n r = nr;\r\n g = ng;\r\n b = nb;\r\n r2 = nr2;\r\n g2 = ng2;\r\n b2 = nb2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case SLOT_ALPHA: {\r\n var timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);\r\n var time = input.readFloat(), a = input.readUnsignedByte() / 255;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, a);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n var a2 = input.readUnsignedByte() / 255;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);\r\n }\r\n time = time2;\r\n a = a2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var boneIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);\r\n switch (type) {\r\n case BONE_ROTATE:\r\n timelines.push(readTimeline1$1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_TRANSLATE:\r\n timelines.push(readTimeline2$1(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));\r\n break;\r\n case BONE_TRANSLATEX:\r\n timelines.push(readTimeline1$1(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));\r\n break;\r\n case BONE_TRANSLATEY:\r\n timelines.push(readTimeline1$1(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));\r\n break;\r\n case BONE_SCALE:\r\n timelines.push(readTimeline2$1(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SCALEX:\r\n timelines.push(readTimeline1$1(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SCALEY:\r\n timelines.push(readTimeline1$1(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SHEAR:\r\n timelines.push(readTimeline2$1(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SHEARX:\r\n timelines.push(readTimeline1$1(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));\r\n break;\r\n case BONE_SHEARY:\r\n timelines.push(readTimeline1$1(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\r\n var timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);\r\n var time = input.readFloat(), mix = input.readFloat(), softness = input.readFloat() * scale;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mix, softness, input.readByte(), input.readBoolean(), input.readBoolean());\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), mix2 = input.readFloat(), softness2 = input.readFloat() * scale;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);\r\n }\r\n time = time2;\r\n mix = mix2;\r\n softness = softness2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Transform constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\r\n var timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);\r\n var time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(), mixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat();\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(), mixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat();\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\r\n setBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\r\n setBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\r\n setBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n mixScaleX = mixScaleX2;\r\n mixScaleY = mixScaleY2;\r\n mixShearY = mixShearY2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Path constraint timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n switch (input.readByte()) {\r\n case PATH_POSITION:\r\n timelines\r\n .push(readTimeline1$1(input, new PathConstraintPositionTimeline(input.readInt(true), input.readInt(true), index), data.positionMode == PositionMode.Fixed ? scale : 1));\r\n break;\r\n case PATH_SPACING:\r\n timelines\r\n .push(readTimeline1$1(input, new PathConstraintSpacingTimeline(input.readInt(true), input.readInt(true), index), data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed ? scale : 1));\r\n break;\r\n case PATH_MIX:\r\n var timeline = new PathConstraintMixTimeline(input.readInt(true), input.readInt(true), index);\r\n var time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat();\r\n for (var frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat();\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\r\n setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n // Deform timelines.\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var skin = skeletonData.skins[input.readInt(true)];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var slotIndex = input.readInt(true);\r\n for (var iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\r\n var attachmentName = input.readStringRef();\r\n if (!attachmentName)\r\n throw new Error(\"attachmentName must not be null.\");\r\n var attachment = skin.getAttachment(slotIndex, attachmentName);\r\n var timelineType = this.readDeformTimelineType(input);\r\n var frameCount = input.readInt(true);\r\n var frameLast = frameCount - 1;\r\n switch (timelineType) {\r\n case ATTACHMENT_DEFORM: {\r\n var vertexAttachment = attachment;\r\n var weighted = vertexAttachment.bones;\r\n var vertices = vertexAttachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var bezierCount = input.readInt(true);\r\n var timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment);\r\n var time = input.readFloat();\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n var deform = void 0;\r\n var end = input.readInt(true);\r\n if (end == 0)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = input.readInt(true);\r\n end += start;\r\n if (scale == 1) {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat();\r\n }\r\n else {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat() * scale;\r\n }\r\n if (!weighted) {\r\n for (var v = 0, vn = deform.length; v < vn; v++)\r\n deform[v] += vertices[v];\r\n }\r\n }\r\n timeline.setFrame(frame, time, deform);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat();\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);\r\n }\r\n time = time2;\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n case ATTACHMENT_SEQUENCE: {\r\n var timeline = new SequenceTimeline(frameCount, slotIndex, attachment);\r\n for (var frame = 0; frame < frameCount; frame++) {\r\n var time = input.readFloat();\r\n var modeAndIndex = input.readInt32();\r\n timeline.setFrame(frame, time, SequenceModeValues[modeAndIndex & 0xf], modeAndIndex >> 4, input.readFloat());\r\n }\r\n timelines.push(timeline);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timeline.\r\n var drawOrderCount = input.readInt(true);\r\n if (drawOrderCount > 0) {\r\n var timeline = new DrawOrderTimeline(drawOrderCount);\r\n var slotCount = skeletonData.slots.length;\r\n for (var i = 0; i < drawOrderCount; i++) {\r\n var time = input.readFloat();\r\n var offsetCount = input.readInt(true);\r\n var drawOrder = Utils.newArray(slotCount, 0);\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n drawOrder[ii] = -1;\r\n var unchanged = Utils.newArray(slotCount - offsetCount, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var ii = 0; ii < offsetCount; ii++) {\r\n var slotIndex = input.readInt(true);\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + input.readInt(true)] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n if (drawOrder[ii] == -1)\r\n drawOrder[ii] = unchanged[--unchangedIndex];\r\n timeline.setFrame(i, time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Event timeline.\r\n var eventCount = input.readInt(true);\r\n if (eventCount > 0) {\r\n var timeline = new EventTimeline(eventCount);\r\n for (var i = 0; i < eventCount; i++) {\r\n var time = input.readFloat();\r\n var eventData = skeletonData.events[input.readInt(true)];\r\n var event_1 = new Event(time, eventData);\r\n event_1.intValue = input.readInt(false);\r\n event_1.floatValue = input.readFloat();\r\n event_1.stringValue = input.readBoolean() ? input.readString() : eventData.stringValue;\r\n if (event_1.data.audioPath) {\r\n event_1.volume = input.readFloat();\r\n event_1.balance = input.readFloat();\r\n }\r\n timeline.setFrame(i, event_1);\r\n }\r\n timelines.push(timeline);\r\n }\r\n var duration = 0;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n duration = Math.max(duration, timelines[i].getDuration());\r\n return new Animation(name, timelines, duration);\r\n };\r\n SkeletonBinary.BlendModeValues = [BLEND_MODES.NORMAL, BLEND_MODES.ADD, BLEND_MODES.MULTIPLY, BLEND_MODES.SCREEN];\r\n return SkeletonBinary;\r\n}());\r\nvar LinkedMesh$1 = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritTimeline = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\r\nvar Vertices = /** @class */ (function () {\r\n function Vertices(bones, vertices) {\r\n if (bones === void 0) { bones = null; }\r\n if (vertices === void 0) { vertices = null; }\r\n this.bones = bones;\r\n this.vertices = vertices;\r\n }\r\n return Vertices;\r\n}());\r\nfunction readTimeline1$1(input, timeline, scale) {\r\n var time = input.readFloat(), value = input.readFloat() * scale;\r\n for (var frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1;; frame++) {\r\n timeline.setFrame(frame, time, value);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), value2 = input.readFloat() * scale;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);\r\n }\r\n time = time2;\r\n value = value2;\r\n }\r\n return timeline;\r\n}\r\nfunction readTimeline2$1(input, timeline, scale) {\r\n var time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale;\r\n for (var frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1;; frame++) {\r\n timeline.setFrame(frame, time, value1, value2);\r\n if (frame == frameLast)\r\n break;\r\n var time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale;\r\n switch (input.readByte()) {\r\n case CURVE_STEPPED:\r\n timeline.setStepped(frame);\r\n break;\r\n case CURVE_BEZIER:\r\n setBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);\r\n setBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);\r\n }\r\n time = time2;\r\n value1 = nvalue1;\r\n value2 = nvalue2;\r\n }\r\n return timeline;\r\n}\r\nfunction setBezier(input, timeline, bezier, frame, value, time1, time2, value1, value2, scale) {\r\n timeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2);\r\n}\r\nvar BONE_ROTATE = 0;\r\nvar BONE_TRANSLATE = 1;\r\nvar BONE_TRANSLATEX = 2;\r\nvar BONE_TRANSLATEY = 3;\r\nvar BONE_SCALE = 4;\r\nvar BONE_SCALEX = 5;\r\nvar BONE_SCALEY = 6;\r\nvar BONE_SHEAR = 7;\r\nvar BONE_SHEARX = 8;\r\nvar BONE_SHEARY = 9;\r\nvar SLOT_ATTACHMENT = 0;\r\nvar SLOT_RGBA = 1;\r\nvar SLOT_RGB = 2;\r\nvar SLOT_RGBA2 = 3;\r\nvar SLOT_RGB2 = 4;\r\nvar SLOT_ALPHA = 5;\r\nvar ATTACHMENT_DEFORM = 0;\r\nvar ATTACHMENT_SEQUENCE = 1;\r\nvar PATH_POSITION = 0;\r\nvar PATH_SPACING = 1;\r\nvar PATH_MIX = 2;\r\n// const CURVE_LINEAR = 0;\r\nvar CURVE_STEPPED = 1;\r\nvar CURVE_BEZIER = 2;\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\r\n * provided along with convenience methods for doing hit detection.\r\n * @public\r\n * */\r\nvar SkeletonBounds = /** @class */ (function (_super) {\r\n __extends(SkeletonBounds, _super);\r\n function SkeletonBounds() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return SkeletonBounds;\r\n}(SkeletonBoundsBase));\n\n/** Loads skeleton data in the Spine JSON format.\r\n *\r\n * See [Spine JSON format](http://esotericsoftware.com/spine-json-format) and\r\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\r\n * Runtimes Guide.\r\n * @public\r\n * */\r\nvar SkeletonJson = /** @class */ (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\r\n * runtime than were used in Spine.\r\n *\r\n * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n // Skeleton\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n var verShort = skeletonData.version.substr(0, 3);\r\n if (verShort !== '4.0' && verShort !== '4.1') {\r\n var error = \"Spine 4.1 loader cant load version \" + skeletonMap.spine + \". Please configure your pixi-spine bundle\";\r\n console.error(error);\r\n }\r\n skeletonData.x = skeletonMap.x;\r\n skeletonData.y = skeletonMap.y;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n // Bones\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_1 = null;\r\n var parentName = getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_1 = skeletonData.findBone(parentName);\r\n if (parent_1 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new BoneData(skeletonData.bones.length, boneMap.name, parent_1);\r\n data.length = getValue(boneMap, \"length\", 0) * scale;\r\n data.x = getValue(boneMap, \"x\", 0) * scale;\r\n data.y = getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = getValue(boneMap, \"shearX\", 0);\r\n data.shearY = getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = Utils.enumValue(TransformMode, getValue(boneMap, \"transform\", \"Normal\"));\r\n data.skinRequired = getValue(boneMap, \"skin\", false);\r\n var color = getValue(boneMap, \"color\", null);\r\n if (color)\r\n data.color.setFromString(color);\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n // Slots.\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var boneData = skeletonData.findBone(slotMap.bone);\r\n if (!boneData)\r\n throw new Error(\"Couldn't find bone \" + slotMap.bone + \" for slot \" + slotMap.name);\r\n var data = new SlotData(skeletonData.slots.length, slotMap.name, boneData);\r\n var color = getValue(slotMap, \"color\", null);\r\n if (color)\r\n data.color.setFromString(color);\r\n var dark = getValue(slotMap, \"dark\", null);\r\n if (dark)\r\n data.darkColor = Color.fromString(dark);\r\n data.attachmentName = getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n // IK constraints\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new IkConstraintData(constraintMap.name);\r\n data.order = getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = getValue(constraintMap, \"skin\", false);\r\n for (var ii = 0; ii < constraintMap.bones.length; ii++) {\r\n var boneName = constraintMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n data.target = skeletonData.findBone(constraintMap.target);\r\n data.mix = getValue(constraintMap, \"mix\", 1);\r\n data.softness = getValue(constraintMap, \"softness\", 0) * scale;\r\n data.bendDirection = getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.compress = getValue(constraintMap, \"compress\", false);\r\n data.stretch = getValue(constraintMap, \"stretch\", false);\r\n data.uniform = getValue(constraintMap, \"uniform\", false);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n // Transform constraints.\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new TransformConstraintData(constraintMap.name);\r\n data.order = getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = getValue(constraintMap, \"skin\", false);\r\n for (var ii = 0; ii < constraintMap.bones.length; ii++) {\r\n var boneName = constraintMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + boneName + \" for transform constraint \" + constraintMap.name + \".\");\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n var target = skeletonData.findBone(targetName);\r\n if (!target)\r\n throw new Error(\"Couldn't find target bone \" + targetName + \" for transform constraint \" + constraintMap.name + \".\");\r\n data.target = target;\r\n data.local = getValue(constraintMap, \"local\", false);\r\n data.relative = getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = getValue(constraintMap, \"shearY\", 0);\r\n data.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\r\n data.mixX = getValue(constraintMap, \"mixX\", 1);\r\n data.mixY = getValue(constraintMap, \"mixY\", data.mixX);\r\n data.mixScaleX = getValue(constraintMap, \"mixScaleX\", 1);\r\n data.mixScaleY = getValue(constraintMap, \"mixScaleY\", data.mixScaleX);\r\n data.mixShearY = getValue(constraintMap, \"mixShearY\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n // Path constraints.\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new PathConstraintData(constraintMap.name);\r\n data.order = getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = getValue(constraintMap, \"skin\", false);\r\n for (var ii = 0; ii < constraintMap.bones.length; ii++) {\r\n var boneName = constraintMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + boneName + \" for path constraint \" + constraintMap.name + \".\");\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n var target = skeletonData.findSlot(targetName);\r\n if (!target)\r\n throw new Error(\"Couldn't find target slot \" + targetName + \" for path constraint \" + constraintMap.name + \".\");\r\n data.target = target;\r\n data.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, \"positionMode\", \"Percent\"));\r\n data.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, \"spacingMode\", \"Length\"));\r\n data.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, \"rotateMode\", \"Tangent\"));\r\n data.offsetRotation = getValue(constraintMap, \"rotation\", 0);\r\n data.position = getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\r\n data.mixX = getValue(constraintMap, \"mixX\", 1);\r\n data.mixY = getValue(constraintMap, \"mixY\", data.mixX);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n // Skins.\r\n if (root.skins) {\r\n for (var i = 0; i < root.skins.length; i++) {\r\n var skinMap = root.skins[i];\r\n var skin = new Skin(skinMap.name);\r\n if (skinMap.bones) {\r\n for (var ii = 0; ii < skinMap.bones.length; ii++) {\r\n var boneName = skinMap.bones[ii];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Couldn't find bone \" + boneName + \" for skin \" + skinMap.name + \".\");\r\n skin.bones.push(bone);\r\n }\r\n }\r\n if (skinMap.ik) {\r\n for (var ii = 0; ii < skinMap.ik.length; ii++) {\r\n var constraintName = skinMap.ik[ii];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Couldn't find IK constraint \" + constraintName + \" for skin \" + skinMap.name + \".\");\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.transform) {\r\n for (var ii = 0; ii < skinMap.transform.length; ii++) {\r\n var constraintName = skinMap.transform[ii];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Couldn't find transform constraint \" + constraintName + \" for skin \" + skinMap.name + \".\");\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.path) {\r\n for (var ii = 0; ii < skinMap.path.length; ii++) {\r\n var constraintName = skinMap.path[ii];\r\n var constraint = skeletonData.findPathConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Couldn't find path constraint \" + constraintName + \" for skin \" + skinMap.name + \".\");\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n for (var slotName in skinMap.attachments) {\r\n var slot = skeletonData.findSlot(slotName);\r\n if (!slot)\r\n throw new Error(\"Couldn't find slot \" + slotName + \" for skin \" + skinMap.name + \".\");\r\n var slotMap = skinMap.attachments[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\r\n if (attachment)\r\n skin.setAttachment(slot.index, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n // Linked meshes.\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (!skin)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_2 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (!parent_2)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent_2 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_2);\r\n // if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\r\n }\r\n this.linkedMeshes.length = 0;\r\n // Events.\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new EventData(eventName);\r\n data.intValue = getValue(eventMap, \"int\", 0);\r\n data.floatValue = getValue(eventMap, \"float\", 0);\r\n data.stringValue = getValue(eventMap, \"string\", \"\");\r\n data.audioPath = getValue(eventMap, \"audio\", null);\r\n if (data.audioPath) {\r\n data.volume = getValue(eventMap, \"volume\", 1);\r\n data.balance = getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n // Animations.\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = getValue(map, \"name\", name);\r\n switch (getValue(map, \"type\", \"region\")) {\r\n case \"region\": {\r\n var path = getValue(map, \"path\", name);\r\n var sequence = this.readSequence(getValue(map, \"sequence\", null));\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\r\n if (!region)\r\n return null;\r\n region.path = path;\r\n region.x = getValue(map, \"x\", 0) * scale;\r\n region.y = getValue(map, \"y\", 0) * scale;\r\n region.scaleX = getValue(map, \"scaleX\", 1);\r\n region.scaleY = getValue(map, \"scaleY\", 1);\r\n region.rotation = getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n region.sequence = sequence;\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n region.color.setFromString(color);\r\n // if (region.region != null) region.updateRegion();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (!box)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = getValue(map, \"path\", name);\r\n var sequence = this.readSequence(getValue(map, \"sequence\", null));\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\r\n if (!mesh)\r\n return null;\r\n mesh.path = path;\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n mesh.color.setFromString(color);\r\n mesh.width = getValue(map, \"width\", 0) * scale;\r\n mesh.height = getValue(map, \"height\", 0) * scale;\r\n mesh.sequence = sequence;\r\n var parent_3 = getValue(map, \"parent\", null);\r\n if (parent_3) {\r\n this.linkedMeshes.push(new LinkedMesh(mesh, getValue(map, \"skin\", null), slotIndex, parent_3, getValue(map, \"timelines\", true)));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = new Float32Array(uvs);\r\n // if (mesh.region != null) mesh.updateRegion();\r\n mesh.edges = getValue(map, \"edges\", null);\r\n mesh.hullLength = getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (!path)\r\n return null;\r\n path.closed = getValue(map, \"closed\", false);\r\n path.constantSpeed = getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (!point)\r\n return null;\r\n point.x = getValue(map, \"x\", 0) * scale;\r\n point.y = getValue(map, \"y\", 0) * scale;\r\n point.rotation = getValue(map, \"rotation\", 0);\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (!clip)\r\n return null;\r\n var end = getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = getValue(map, \"color\", null);\r\n if (color)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readSequence = function (map) {\r\n if (map == null)\r\n return null;\r\n var sequence = new Sequence(getValue(map, \"count\", 0));\r\n sequence.start = getValue(map, \"start\", 1);\r\n sequence.digits = getValue(map, \"digits\", 0);\r\n sequence.setupIndex = getValue(map, \"setup\", 0);\r\n return sequence;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n // Slot timelines.\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slot = skeletonData.findSlot(slotName);\r\n if (!slot)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotIndex = slot.index;\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (!timelineMap)\r\n continue;\r\n var frames_1 = timelineMap.length;\r\n if (timelineName == \"attachment\") {\r\n var timeline = new AttachmentTimeline(frames_1, slotIndex);\r\n for (var frame = 0; frame < frames_1; frame++) {\r\n var keyMap = timelineMap[frame];\r\n timeline.setFrame(frame, getValue(keyMap, \"time\", 0), getValue(keyMap, \"name\", null));\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"rgba\") {\r\n var timeline = new RGBATimeline(frames_1, frames_1 << 2, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.color);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b, color.a);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.color);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"rgb\") {\r\n var timeline = new RGBTimeline(frames_1, frames_1 * 3, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.color);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.color);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"alpha\") {\r\n timelines.push(readTimeline1(timelineMap, new AlphaTimeline(frames_1, frames_1, slotIndex), 0, 1));\r\n }\r\n else if (timelineName == \"rgba2\") {\r\n var timeline = new RGBA2Timeline(frames_1, frames_1 * 7, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.light);\r\n var color2 = Color.fromString(keyMap.dark);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.light);\r\n var newColor2 = Color.fromString(nextMap.dark);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n color2 = newColor2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineName == \"rgb2\") {\r\n var timeline = new RGB2Timeline(frames_1, frames_1 * 6, slotIndex);\r\n var keyMap = timelineMap[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var color = Color.fromString(keyMap.light);\r\n var color2 = Color.fromString(keyMap.dark);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var newColor = Color.fromString(nextMap.light);\r\n var newColor2 = Color.fromString(nextMap.dark);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1);\r\n }\r\n time = time2;\r\n color = newColor;\r\n color2 = newColor2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n // Bone timelines.\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var bone = skeletonData.findBone(boneName);\r\n if (!bone)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n var boneIndex = bone.index;\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n var frames_2 = timelineMap.length;\r\n if (frames_2 == 0)\r\n continue;\r\n if (timelineName === \"rotate\") {\r\n timelines.push(readTimeline1(timelineMap, new RotateTimeline(frames_2, frames_2, boneIndex), 0, 1));\r\n }\r\n else if (timelineName === \"translate\") {\r\n var timeline = new TranslateTimeline(frames_2, frames_2 << 1, boneIndex);\r\n timelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, scale));\r\n }\r\n else if (timelineName === \"translatex\") {\r\n var timeline = new TranslateXTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, scale));\r\n }\r\n else if (timelineName === \"translatey\") {\r\n var timeline = new TranslateYTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, scale));\r\n }\r\n else if (timelineName === \"scale\") {\r\n var timeline = new ScaleTimeline(frames_2, frames_2 << 1, boneIndex);\r\n timelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 1, 1));\r\n }\r\n else if (timelineName === \"scalex\") {\r\n var timeline = new ScaleXTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 1, 1));\r\n }\r\n else if (timelineName === \"scaley\") {\r\n var timeline = new ScaleYTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 1, 1));\r\n }\r\n else if (timelineName === \"shear\") {\r\n var timeline = new ShearTimeline(frames_2, frames_2 << 1, boneIndex);\r\n timelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, 1));\r\n }\r\n else if (timelineName === \"shearx\") {\r\n var timeline = new ShearXTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, 1));\r\n }\r\n else if (timelineName === \"sheary\") {\r\n var timeline = new ShearYTimeline(frames_2, frames_2, boneIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, 1));\r\n }\r\n }\r\n }\r\n }\r\n // IK constraint timelines.\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var keyMap = constraintMap[0];\r\n if (!keyMap)\r\n continue;\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"IK Constraint not found: \" + constraintName);\r\n var constraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1, constraintIndex);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mix = getValue(keyMap, \"mix\", 1);\r\n var softness = getValue(keyMap, \"softness\", 0) * scale;\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mix, softness, getValue(keyMap, \"bendPositive\", true) ? 1 : -1, getValue(keyMap, \"compress\", false), getValue(keyMap, \"stretch\", false));\r\n var nextMap = constraintMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var mix2 = getValue(nextMap, \"mix\", 1);\r\n var softness2 = getValue(nextMap, \"softness\", 0) * scale;\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale);\r\n }\r\n time = time2;\r\n mix = mix2;\r\n softness = softness2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n // Transform constraint timelines.\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var timelineMap = map.transform[constraintName];\r\n var keyMap = timelineMap[0];\r\n if (!keyMap)\r\n continue;\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Transform constraint not found: \" + constraintName);\r\n var constraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6, constraintIndex);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mixRotate = getValue(keyMap, \"mixRotate\", 1);\r\n var mixX = getValue(keyMap, \"mixX\", 1);\r\n var mixY = getValue(keyMap, \"mixY\", mixX);\r\n var mixScaleX = getValue(keyMap, \"mixScaleX\", 1);\r\n var mixScaleY = getValue(keyMap, \"mixScaleY\", mixScaleX);\r\n var mixShearY = getValue(keyMap, \"mixShearY\", 1);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\r\n var mixX2 = getValue(nextMap, \"mixX\", 1);\r\n var mixY2 = getValue(nextMap, \"mixY\", mixX2);\r\n var mixScaleX2 = getValue(nextMap, \"mixScaleX\", 1);\r\n var mixScaleY2 = getValue(nextMap, \"mixScaleY\", mixScaleX2);\r\n var mixShearY2 = getValue(nextMap, \"mixShearY\", 1);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n mixScaleX = mixScaleX2;\r\n mixScaleY = mixScaleY2;\r\n mixScaleX = mixScaleX2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n // Path constraint timelines.\r\n if (map.path) {\r\n for (var constraintName in map.path) {\r\n var constraintMap = map.path[constraintName];\r\n var constraint = skeletonData.findPathConstraint(constraintName);\r\n if (!constraint)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var constraintIndex = skeletonData.pathConstraints.indexOf(constraint);\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n var keyMap = timelineMap[0];\r\n if (!keyMap)\r\n continue;\r\n var frames_3 = timelineMap.length;\r\n if (timelineName === \"position\") {\r\n var timeline = new PathConstraintPositionTimeline(frames_3, frames_3, constraintIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, constraint.positionMode == PositionMode.Fixed ? scale : 1));\r\n }\r\n else if (timelineName === \"spacing\") {\r\n var timeline = new PathConstraintSpacingTimeline(frames_3, frames_3, constraintIndex);\r\n timelines.push(readTimeline1(timelineMap, timeline, 0, constraint.spacingMode == SpacingMode.Length || constraint.spacingMode == SpacingMode.Fixed ? scale : 1));\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new PathConstraintMixTimeline(frames_3, frames_3 * 3, constraintIndex);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mixRotate = getValue(keyMap, \"mixRotate\", 1);\r\n var mixX = getValue(keyMap, \"mixX\", 1);\r\n var mixY = getValue(keyMap, \"mixY\", mixX);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n timeline.setFrame(frame, time, mixRotate, mixX, mixY);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\r\n var mixX2 = getValue(nextMap, \"mixX\", 1);\r\n var mixY2 = getValue(nextMap, \"mixY\", mixX2);\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\r\n bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\r\n }\r\n time = time2;\r\n mixRotate = mixRotate2;\r\n mixX = mixX2;\r\n mixY = mixY2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n // ver40 compatibility\r\n if (map.deform) {\r\n map.attachments = {};\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var outMap = map.attachments[deformName] = {};\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var outMap2 = outMap[slotName] = {};\r\n for (var innerMapName in slotMap) {\r\n outMap2[innerMapName] = {\r\n deform: slotMap[innerMapName]\r\n };\r\n }\r\n }\r\n }\r\n }\r\n // Attachment timelines.\r\n if (map.attachments) {\r\n for (var attachmentsName in map.attachments) {\r\n var attachmentsMap = map.attachments[attachmentsName];\r\n var skin = skeletonData.findSkin(attachmentsName);\r\n if (skin == null) {\r\n if (settings.FAIL_ON_NON_EXISTING_SKIN) {\r\n throw new Error(\"Skin not found: \" + attachmentsName);\r\n }\r\n else {\r\n continue;\r\n }\r\n }\r\n for (var slotMapName in attachmentsMap) {\r\n var slotMap = attachmentsMap[slotMapName];\r\n var slot = skeletonData.findSlot(slotMapName);\r\n if (!slot)\r\n throw new Error(\"Slot not found: \" + slotMapName);\r\n var slotIndex = slot.index;\r\n for (var attachmentMapName in slotMap) {\r\n var attachmentMap = slotMap[attachmentMapName];\r\n var attachment = skin.getAttachment(slotIndex, attachmentMapName);\r\n for (var timelineMapName in attachmentMap) {\r\n var timelineMap = attachmentMap[timelineMapName];\r\n var keyMap = timelineMap[0];\r\n if (!keyMap)\r\n continue;\r\n if (timelineMapName == \"deform\") {\r\n var weighted = attachment.bones;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment);\r\n var time = getValue(keyMap, \"time\", 0);\r\n for (var frame = 0, bezier = 0;; frame++) {\r\n var deform = void 0;\r\n var verticesValue = getValue(keyMap, \"vertices\", null);\r\n if (!verticesValue)\r\n deform = weighted ? Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = Utils.newFloatArray(deformLength);\r\n var start = getValue(keyMap, \"offset\", 0);\r\n Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frame, time, deform);\r\n var nextMap = timelineMap[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n break;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var curve = keyMap.curve;\r\n if (curve)\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);\r\n time = time2;\r\n keyMap = nextMap;\r\n }\r\n timelines.push(timeline);\r\n }\r\n else if (timelineMapName == \"sequence\") {\r\n var timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment);\r\n var lastDelay = 0;\r\n for (var frame = 0; frame < timelineMap.length; frame++) {\r\n var delay = getValue(keyMap, \"delay\", lastDelay);\r\n var time = getValue(keyMap, \"time\", 0);\r\n var mode = SequenceMode[getValue(keyMap, \"mode\", \"hold\")];\r\n var index = getValue(keyMap, \"index\", 0);\r\n timeline.setFrame(frame, time, mode, index, delay);\r\n lastDelay = delay;\r\n keyMap = timelineMap[frame + 1];\r\n }\r\n timelines.push(timeline);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // Draw order timelines.\r\n if (map.drawOrder) {\r\n var timeline = new DrawOrderTimeline(map.drawOrder.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frame = 0;\r\n for (var i = 0; i < map.drawOrder.length; i++, frame++) {\r\n var drawOrderMap = map.drawOrder[i];\r\n var drawOrder = null;\r\n var offsets = getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets) {\r\n drawOrder = Utils.newArray(slotCount, -1);\r\n var unchanged = Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var ii = 0; ii < offsets.length; ii++) {\r\n var offsetMap = offsets[ii];\r\n var slot = skeletonData.findSlot(offsetMap.slot);\r\n if (!slot)\r\n throw new Error(\"Slot not found: \" + slot);\r\n var slotIndex = slot.index;\r\n // Collect unchanged items.\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Set changed items.\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n // Collect remaining unchanged items.\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n // Fill in unchanged items.\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n if (drawOrder[ii] == -1)\r\n drawOrder[ii] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frame, getValue(drawOrderMap, \"time\", 0), drawOrder);\r\n }\r\n timelines.push(timeline);\r\n }\r\n // Event timelines.\r\n if (map.events) {\r\n var timeline = new EventTimeline(map.events.length);\r\n var frame = 0;\r\n for (var i = 0; i < map.events.length; i++, frame++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (!eventData)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_1 = new Event(Utils.toSinglePrecision(getValue(eventMap, \"time\", 0)), eventData);\r\n event_1.intValue = getValue(eventMap, \"int\", eventData.intValue);\r\n event_1.floatValue = getValue(eventMap, \"float\", eventData.floatValue);\r\n event_1.stringValue = getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_1.data.audioPath) {\r\n event_1.volume = getValue(eventMap, \"volume\", 1);\r\n event_1.balance = getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frame, event_1);\r\n }\r\n timelines.push(timeline);\r\n }\r\n var duration = 0;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n duration = Math.max(duration, timelines[i].getDuration());\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return BLEND_MODES.NORMAL;\r\n if (str == \"additive\")\r\n return BLEND_MODES.ADD;\r\n if (str == \"multiply\")\r\n return BLEND_MODES.MULTIPLY;\r\n if (str == \"screen\")\r\n return BLEND_MODES.SCREEN;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n}());\r\nvar LinkedMesh = /** @class */ (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritTimeline = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n}());\r\nfunction readTimeline1(keys, timeline, defaultValue, scale) {\r\n var keyMap = keys[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var value = getValue(keyMap, \"value\", defaultValue) * scale;\r\n var bezier = 0;\r\n for (var frame = 0;; frame++) {\r\n timeline.setFrame(frame, time, value);\r\n var nextMap = keys[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n return timeline;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var value2 = getValue(nextMap, \"value\", defaultValue) * scale;\r\n if (keyMap.curve)\r\n bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale);\r\n time = time2;\r\n value = value2;\r\n keyMap = nextMap;\r\n }\r\n}\r\nfunction readTimeline2(keys, timeline, name1, name2, defaultValue, scale) {\r\n var keyMap = keys[0];\r\n var time = getValue(keyMap, \"time\", 0);\r\n var value1 = getValue(keyMap, name1, defaultValue) * scale;\r\n var value2 = getValue(keyMap, name2, defaultValue) * scale;\r\n var bezier = 0;\r\n for (var frame = 0;; frame++) {\r\n timeline.setFrame(frame, time, value1, value2);\r\n var nextMap = keys[frame + 1];\r\n if (!nextMap) {\r\n timeline.shrink(bezier);\r\n return timeline;\r\n }\r\n var time2 = getValue(nextMap, \"time\", 0);\r\n var nvalue1 = getValue(nextMap, name1, defaultValue) * scale;\r\n var nvalue2 = getValue(nextMap, name2, defaultValue) * scale;\r\n var curve = keyMap.curve;\r\n if (curve) {\r\n bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale);\r\n bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale);\r\n }\r\n time = time2;\r\n value1 = nvalue1;\r\n value2 = nvalue2;\r\n keyMap = nextMap;\r\n }\r\n}\r\nfunction readCurve(curve, timeline, bezier, frame, value, time1, time2, value1, value2, scale) {\r\n if (curve == \"stepped\") {\r\n timeline.setStepped(frame);\r\n return bezier;\r\n }\r\n var i = value << 2;\r\n var cx1 = curve[i];\r\n var cy1 = curve[i + 1] * scale;\r\n var cx2 = curve[i + 2];\r\n var cy2 = curve[i + 3] * scale;\r\n timeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);\r\n return bezier + 1;\r\n}\r\nfunction getValue(map, property, defaultValue) {\r\n return map[property] !== undefined ? map[property] : defaultValue;\r\n}\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n this.skeleton = new Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new AnimationStateData(spineData);\r\n this.state = new AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { AlphaTimeline, Animation, AnimationState, AnimationStateAdapter, AnimationStateData, AtlasAttachmentLoader, Attachment, AttachmentTimeline, Bone, BoneData, BoundingBoxAttachment, ClippingAttachment, ConstraintData, CurveTimeline, CurveTimeline1, CurveTimeline2, DeformTimeline, DrawOrderTimeline, Event, EventData, EventQueue, EventTimeline, EventType, IkConstraint, IkConstraintData, IkConstraintTimeline, MeshAttachment, PathAttachment, PathConstraint, PathConstraintData, PathConstraintMixTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PointAttachment, RGB2Timeline, RGBA2Timeline, RGBATimeline, RGBTimeline, RegionAttachment, RotateTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, Sequence, SequenceMode, SequenceModeValues, SequenceTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, Skeleton, SkeletonBinary, SkeletonBounds, SkeletonData, SkeletonJson, Skin, SkinEntry, Slot, SlotData, SpacingMode, Spine, Timeline, TrackEntry, TransformConstraint, TransformConstraintData, TransformConstraintTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, VertexAttachment };\n//# sourceMappingURL=runtime-4.1.es.js.map\n","/* eslint-disable */\n \n/*!\n * @pixi-spine/loader-uni - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:38 UTC\n *\n * @pixi-spine/loader-uni is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Mat Groves, All Rights Reserved\n */\nimport { AbstractSpineParser } from '@pixi-spine/loader-base';\nimport { BinaryInput, SpineBase } from '@pixi-spine/base';\nimport { Loader } from '@pixi/loaders';\nimport * as spine38 from '@pixi-spine/runtime-3.8';\nimport * as spine37 from '@pixi-spine/runtime-3.7';\nimport * as spine41 from '@pixi-spine/runtime-4.1';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\n\n/**\r\n * @public\r\n */\r\nvar SPINE_VERSION;\r\n(function (SPINE_VERSION) {\r\n SPINE_VERSION[SPINE_VERSION[\"UNKNOWN\"] = 0] = \"UNKNOWN\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER37\"] = 37] = \"VER37\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER38\"] = 38] = \"VER38\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER40\"] = 40] = \"VER40\";\r\n SPINE_VERSION[SPINE_VERSION[\"VER41\"] = 41] = \"VER41\";\r\n})(SPINE_VERSION || (SPINE_VERSION = {}));\r\n/**\r\n * @public\r\n */\r\nfunction detectSpineVersion(version) {\r\n var ver3 = version.substr(0, 3);\r\n var verNum = Math.floor(+ver3 * 10 + 1e-3);\r\n if (ver3 === '3.7') {\r\n return SPINE_VERSION.VER37;\r\n }\r\n if (ver3 === '3.8') {\r\n return SPINE_VERSION.VER38;\r\n }\r\n if (ver3 === '4.0') {\r\n return SPINE_VERSION.VER40;\r\n }\r\n if (ver3 === '4.1') {\r\n return SPINE_VERSION.VER41;\r\n }\r\n // try parse old versions with 3.7\r\n if (verNum < SPINE_VERSION.VER37) {\r\n return SPINE_VERSION.VER37;\r\n }\r\n return SPINE_VERSION.UNKNOWN;\r\n}\n\nvar UniBinaryParser = /** @class */ (function () {\r\n function UniBinaryParser() {\r\n this.scale = 1;\r\n }\r\n UniBinaryParser.prototype.readSkeletonData = function (atlas, dataToParse) {\r\n var parser = null;\r\n var version = this.readVersionOldFormat(dataToParse);\r\n var ver = detectSpineVersion(version);\r\n if (ver === SPINE_VERSION.VER38) {\r\n parser = new spine38.SkeletonBinary(new spine38.AtlasAttachmentLoader(atlas));\r\n }\r\n version = this.readVersionNewFormat(dataToParse);\r\n ver = detectSpineVersion(version);\r\n if (ver === SPINE_VERSION.VER40 || ver === SPINE_VERSION.VER41) {\r\n parser = new spine41.SkeletonBinary(new spine41.AtlasAttachmentLoader(atlas));\r\n }\r\n if (!parser) {\r\n var error = \"Unsupported version of spine model \" + version + \", please update pixi-spine\";\r\n console.error(error);\r\n }\r\n parser.scale = this.scale;\r\n return parser.readSkeletonData(dataToParse);\r\n };\r\n UniBinaryParser.prototype.readVersionOldFormat = function (dataToParse) {\r\n var input = new BinaryInput(dataToParse);\r\n var version;\r\n try {\r\n input.readString();\r\n version = input.readString();\r\n }\r\n catch (e) {\r\n version = \"\";\r\n }\r\n return version || \"\";\r\n };\r\n UniBinaryParser.prototype.readVersionNewFormat = function (dataToParse) {\r\n var input = new BinaryInput(dataToParse);\r\n input.readInt32();\r\n input.readInt32();\r\n var version;\r\n try {\r\n version = input.readString();\r\n }\r\n catch (e) {\r\n version = \"\";\r\n }\r\n return version || \"\";\r\n };\r\n return UniBinaryParser;\r\n}());\r\nvar UniJsonParser = /** @class */ (function () {\r\n function UniJsonParser() {\r\n this.scale = 1;\r\n }\r\n UniJsonParser.prototype.readSkeletonData = function (atlas, dataToParse) {\r\n var version = dataToParse.skeleton.spine;\r\n var ver = detectSpineVersion(version);\r\n var parser = null;\r\n if (ver === SPINE_VERSION.VER37) {\r\n parser = new spine37.SkeletonJson(new spine37.AtlasAttachmentLoader(atlas));\r\n }\r\n if (ver === SPINE_VERSION.VER38) {\r\n parser = new spine38.SkeletonJson(new spine38.AtlasAttachmentLoader(atlas));\r\n }\r\n if (ver === SPINE_VERSION.VER40 || ver === SPINE_VERSION.VER41) {\r\n parser = new spine41.SkeletonJson(new spine41.AtlasAttachmentLoader(atlas));\r\n }\r\n if (!parser) {\r\n var error = \"Unsupported version of spine model \" + version + \", please update pixi-spine\";\r\n console.error(error);\r\n }\r\n parser.scale = this.scale;\r\n return parser.readSkeletonData(dataToParse);\r\n };\r\n return UniJsonParser;\r\n}());\r\n/**\r\n * @public\r\n */\r\nvar SpineParser = /** @class */ (function (_super) {\r\n __extends(SpineParser, _super);\r\n function SpineParser() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SpineParser.prototype.createBinaryParser = function () {\r\n return new UniBinaryParser();\r\n };\r\n SpineParser.prototype.createJsonParser = function () {\r\n return new UniJsonParser();\r\n };\r\n SpineParser.prototype.parseData = function (resource, parser, atlas, dataToParse) {\r\n var parserCast = parser;\r\n resource.spineData = parserCast.readSkeletonData(atlas, dataToParse);\r\n resource.spineAtlas = atlas;\r\n };\r\n SpineParser.registerLoaderPlugin = function () {\r\n Loader.registerPlugin(SpineParser);\r\n };\r\n SpineParser.use = new SpineParser().genMiddleware().use;\r\n return SpineParser;\r\n}(AbstractSpineParser));\n\n/**\r\n * @public\r\n */\r\nvar Spine = /** @class */ (function (_super) {\r\n __extends(Spine, _super);\r\n function Spine() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Spine.prototype.createSkeleton = function (spineData) {\r\n var ver = detectSpineVersion(spineData.version);\r\n var spine = null;\r\n if (ver === SPINE_VERSION.VER37) {\r\n spine = spine37;\r\n }\r\n if (ver === SPINE_VERSION.VER38) {\r\n spine = spine38;\r\n }\r\n if (ver === SPINE_VERSION.VER40 || ver === SPINE_VERSION.VER41) {\r\n spine = spine41;\r\n }\r\n if (!spine) {\r\n var error = \"Cant detect version of spine model \" + spineData.version;\r\n console.error(error);\r\n }\r\n this.skeleton = new spine.Skeleton(spineData);\r\n this.skeleton.updateWorldTransform();\r\n this.stateData = new spine.AnimationStateData(spineData);\r\n this.state = new spine.AnimationState(this.stateData);\r\n };\r\n return Spine;\r\n}(SpineBase));\n\nexport { SPINE_VERSION, Spine, SpineParser, detectSpineVersion };\n//# sourceMappingURL=loader-uni.es.js.map\n","/* eslint-disable */\n \n/*!\n * pixi-spine - v3.1.2\n * Compiled Tue, 10 Jan 2023 14:17:40 UTC\n *\n * pixi-spine is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license\n * \n * Copyright 2019-2020, Ivan Igorevich Popelyshev <ivan.popelyshev@gmail.com>, All Rights Reserved\n */\nimport { SpineParser } from '@pixi-spine/loader-uni';\nexport { Spine, SpineParser } from '@pixi-spine/loader-uni';\nexport * from '@pixi-spine/base';\nexport { SkeletonBounds } from '@pixi-spine/runtime-4.1';\n\nSpineParser.registerLoaderPlugin();\n//# sourceMappingURL=all.es.js.map\n","import * as PIXI from 'pixi.js';\nimport { v4 as uuid } from 'uuid';\nimport { webgalStore } from '@/store/store';\nimport { setStage, stageActions } from '@/store/stageReducer';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { IEffect, IFigureAssociatedAnimation } from '@/store/stageInterface';\nimport { logger } from '@/Core/util/logger';\nimport { isIOS } from '@/Core/initializeScript';\nimport { WebGALPixiContainer } from '@/Core/controller/stage/pixi/WebGALPixiContainer';\nimport { WebGAL } from '@/Core/WebGAL';\nimport 'pixi-spine'; // Do this once at the very start of your code. This registers the loader!\nimport { Spine } from 'pixi-spine';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n// import { figureCash } from '@/Core/gameScripts/vocal/conentsCash'; // 如果要使用 Live2D,取消这里的注释\n// import { Live2DModel, SoundManager } from 'pixi-live2d-display'; // 如果要使用 Live2D,取消这里的注释\n\nexport interface IAnimationObject {\n setStartState: Function;\n setEndState: Function;\n tickerFunc: PIXI.TickerCallback<number>;\n getEndFilterEffect?: Function;\n}\n\ninterface IStageAnimationObject {\n // 唯一标识\n uuid: string;\n // 一般与作用目标有关\n key: string;\n targetKey?: string;\n type: 'common' | 'preset';\n animationObject: IAnimationObject;\n}\n\nexport interface IStageObject {\n // 唯一标识\n uuid: string;\n // 一般与作用目标有关\n key: string;\n pixiContainer: WebGALPixiContainer;\n // 相关的源 url\n sourceUrl: string;\n sourceExt: string;\n sourceType: 'img' | 'live2d' | 'spine' | 'gif' | 'video';\n}\n\nexport interface ILive2DRecord {\n target: string;\n motion: string;\n expression: string;\n}\n\n// export interface IRegisterTickerOpr {\n// tickerGeneratorFn: (targetKey: string, duration: number) => PIXI.TickerCallback<number>;\n// key: string;\n// target: string;\n// duration: number;\n// }\n\n// @ts-ignore\nwindow.PIXI = PIXI;\n\nexport default class PixiStage {\n /**\n * 当前的 PIXI App\n */\n public currentApp: PIXI.Application | null = null;\n public readonly effectsContainer: PIXI.Container;\n public frameDuration = 16.67;\n public notUpdateBacklogEffects = false;\n private readonly figureContainer: PIXI.Container;\n private figureObjects: Array<IStageObject> = [];\n private readonly backgroundContainer: PIXI.Container;\n private backgroundObjects: Array<IStageObject> = [];\n\n // 注册到 Ticker 上的函数\n private stageAnimations: Array<IStageAnimationObject> = [];\n private assetLoader = new PIXI.Loader();\n private loadQueue: { url: string; callback: () => void; name?: string }[] = [];\n private live2dFigureRecorder: Array<ILive2DRecord> = [];\n\n // 锁定变换对象(对象可能正在执行动画,不能应用变换)\n private lockTransformTarget: Array<string> = [];\n private stageWidth = SCREEN_CONSTANTS.width;\n private stageHeight = SCREEN_CONSTANTS.height;\n /**\n * 暂时没用上,以后可能用\n * @private\n */\n private MAX_TEX_COUNT = 10;\n\n public constructor() {\n const app = new PIXI.Application({\n backgroundAlpha: 0,\n preserveDrawingBuffer: true,\n });\n // @ts-ignore\n\n window.PIXIapp = this; // @ts-ignore\n window.__PIXI_APP__ = app;\n // 清空原节点\n const pixiContainer = document.getElementById('pixiContianer');\n if (pixiContainer) {\n pixiContainer.innerHTML = '';\n pixiContainer.appendChild(app.view);\n }\n\n // 设置样式\n app.renderer.view.style.position = 'absolute';\n app.renderer.view.style.display = 'block';\n app.renderer.view.id = 'pixiCanvas';\n // @ts-ignore\n app.renderer.autoResize = true;\n const appRoot = document.getElementById('root');\n if (appRoot) {\n app.renderer.resize(appRoot.clientWidth, appRoot.clientHeight);\n }\n if (isIOS) {\n app.renderer.view.style.zIndex = '-5';\n }\n\n // 设置可排序\n app.stage.sortableChildren = true;\n\n // 添加 3 个 Container 用于做渲染\n this.effectsContainer = new PIXI.Container();\n this.effectsContainer.zIndex = 3;\n this.figureContainer = new PIXI.Container();\n this.figureContainer.zIndex = 2;\n this.backgroundContainer = new PIXI.Container();\n this.backgroundContainer.zIndex = 0;\n app.stage.addChild(this.effectsContainer, this.figureContainer, this.backgroundContainer);\n this.currentApp = app;\n // 每 5s 获取帧率,并且防 loader 死\n const update = () => {\n this.updateFps();\n setTimeout(update, 10000);\n };\n update();\n // loader 防死\n const reload = () => {\n setTimeout(reload, 500);\n this.callLoader();\n };\n reload();\n }\n\n public getFigureObjects() {\n return this.figureObjects;\n }\n\n public getAllLockedObject() {\n return this.lockTransformTarget;\n }\n\n /**\n * 注册动画\n * @param animationObject\n * @param key\n * @param target\n */\n public registerAnimation(animationObject: IAnimationObject | null, key: string, target = 'default') {\n if (!animationObject) return;\n this.stageAnimations.push({ uuid: uuid(), animationObject, key: key, targetKey: target, type: 'common' });\n // 上锁\n this.lockStageObject(target);\n animationObject.setStartState();\n this.currentApp?.ticker.add(animationObject.tickerFunc);\n }\n\n /**\n * 注册预设动画\n * @param animationObject\n * @param key\n * @param target\n * @param currentEffects\n */\n // eslint-disable-next-line max-params\n public registerPresetAnimation(\n animationObject: IAnimationObject | null,\n key: string,\n target = 'default',\n currentEffects: IEffect[],\n ) {\n if (!animationObject) return;\n const effect = currentEffects.find((effect) => effect.target === target);\n if (effect) {\n const targetPixiContainer = this.getStageObjByKey(target);\n if (targetPixiContainer) {\n const container = targetPixiContainer.pixiContainer;\n Object.assign(container, effect.transform);\n }\n return;\n }\n this.stageAnimations.push({ uuid: uuid(), animationObject, key: key, targetKey: target, type: 'preset' });\n // 上锁\n this.lockStageObject(target);\n animationObject.setStartState();\n this.currentApp?.ticker.add(animationObject.tickerFunc);\n }\n\n public stopPresetAnimationOnTarget(target: string) {\n const targetPresetAnimations = this.stageAnimations.find((e) => e.targetKey === target && e.type === 'preset');\n if (targetPresetAnimations) {\n this.removeAnimation(targetPresetAnimations.key);\n }\n }\n\n /**\n * 移除动画\n * @param key\n */\n public removeAnimation(key: string) {\n const index = this.stageAnimations.findIndex((e) => e.key === key);\n if (index >= 0) {\n const thisTickerFunc = this.stageAnimations[index];\n this.currentApp?.ticker.remove(thisTickerFunc.animationObject.tickerFunc);\n thisTickerFunc.animationObject.setEndState();\n this.unlockStageObject(thisTickerFunc.targetKey ?? 'default');\n this.stageAnimations.splice(index, 1);\n }\n }\n\n public removeAnimationWithSetEffects(key: string) {\n const index = this.stageAnimations.findIndex((e) => e.key === key);\n if (index >= 0) {\n const thisTickerFunc = this.stageAnimations[index];\n this.currentApp?.ticker.remove(thisTickerFunc.animationObject.tickerFunc);\n thisTickerFunc.animationObject.setEndState();\n const webgalFilters = thisTickerFunc.animationObject.getEndFilterEffect?.() ?? {};\n this.unlockStageObject(thisTickerFunc.targetKey ?? 'default');\n if (thisTickerFunc.targetKey) {\n const target = this.getStageObjByKey(thisTickerFunc.targetKey);\n if (target) {\n const targetTransform = {\n alpha: target.pixiContainer.alphaFilterVal,\n scale: {\n x: target.pixiContainer.scale.x,\n y: target.pixiContainer.scale.y,\n },\n // pivot: {\n // x: target.pixiContainer.pivot.x,\n // y: target.pixiContainer.pivot.y,\n // },\n position: {\n x: target.pixiContainer.x,\n y: target.pixiContainer.y,\n },\n rotation: target.pixiContainer.rotation,\n // @ts-ignore\n blur: target.pixiContainer.blur,\n ...webgalFilters,\n };\n let effect: IEffect = {\n target: thisTickerFunc.targetKey,\n transform: targetTransform,\n };\n webgalStore.dispatch(stageActions.updateEffect(effect));\n // if (!this.notUpdateBacklogEffects) updateCurrentBacklogEffects(webgalStore.getState().stage.effects);\n }\n }\n this.stageAnimations.splice(index, 1);\n }\n }\n\n // eslint-disable-next-line max-params\n public performMouthSyncAnimation(\n key: string,\n targetAnimation: IFigureAssociatedAnimation,\n mouthState: string,\n presetPosition: string,\n ) {\n const currentFigure = this.getStageObjByKey(key)?.pixiContainer as WebGALPixiContainer;\n\n if (!currentFigure) {\n return;\n }\n\n const mouthTextureUrls: any = {\n open: targetAnimation.mouthAnimation.open,\n half_open: targetAnimation.mouthAnimation.halfOpen,\n closed: targetAnimation.mouthAnimation.close,\n };\n\n // Load mouth texture (reuse if already loaded)\n this.loadAsset(mouthTextureUrls[mouthState], () => {\n const texture = this.assetLoader.resources[mouthTextureUrls[mouthState]].texture;\n const sprite = currentFigure?.children?.[0] as PIXI.Sprite;\n if (!texture || !sprite) {\n return;\n }\n sprite.texture = texture;\n });\n }\n\n // eslint-disable-next-line max-params\n public performBlinkAnimation(\n key: string,\n targetAnimation: IFigureAssociatedAnimation,\n blinkState: string,\n presetPosition: string,\n ) {\n const currentFigure = this.getStageObjByKey(key)?.pixiContainer as WebGALPixiContainer;\n\n if (!currentFigure) {\n return;\n }\n const blinkTextureUrls: any = {\n open: targetAnimation.blinkAnimation.open,\n closed: targetAnimation.blinkAnimation.close,\n };\n\n // Load eye texture (reuse if already loaded)\n this.loadAsset(blinkTextureUrls[blinkState], () => {\n const texture = this.assetLoader.resources[blinkTextureUrls[blinkState]].texture;\n const sprite = currentFigure?.children?.[0] as PIXI.Sprite;\n if (!texture || !sprite) {\n return;\n }\n sprite.texture = texture;\n });\n }\n\n /**\n * 添加背景\n * @param key 背景的标识,一般和背景类型有关\n * @param url 背景图片url\n */\n public addBg(key: string, url: string) {\n // const loader = this.assetLoader;\n const loader = this.assetLoader;\n // 准备用于存放这个背景的 Container\n const thisBgContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的背景\n const setBgIndex = this.backgroundObjects.findIndex((e) => e.key === key);\n const isBgSet = setBgIndex >= 0;\n\n // 已经有一个这个 key 的背景存在了\n if (isBgSet) {\n // 挤占\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.backgroundContainer.addChild(thisBgContainer);\n const bgUuid = uuid();\n this.backgroundObjects.push({\n uuid: bgUuid,\n key: key,\n pixiContainer: thisBgContainer,\n sourceUrl: url,\n sourceType: 'img',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n\n setTimeout(() => {\n const texture = loader.resources?.[url]?.texture;\n if (texture && this.getStageObjByUuid(bgUuid)) {\n /**\n * 重设大小\n */\n const originalWidth = texture.width;\n const originalHeight = texture.height;\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n const targetScale = Math.max(scaleX, scaleY);\n const bgSprite = new PIXI.Sprite(texture);\n bgSprite.scale.x = targetScale;\n bgSprite.scale.y = targetScale;\n bgSprite.anchor.set(0.5);\n bgSprite.position.y = this.stageHeight / 2;\n thisBgContainer.setBaseX(this.stageWidth / 2);\n thisBgContainer.setBaseY(this.stageHeight / 2);\n thisBgContainer.pivot.set(0, this.stageHeight / 2);\n\n // 挂载\n thisBgContainer.addChild(bgSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]?.texture) {\n this.loadAsset(url, setup);\n } else {\n // 复用\n setup();\n }\n }\n\n public addSpineBg(key: string, url: string) {\n const spineId = `spine-${url}`;\n const loader = this.assetLoader;\n // 准备用于存放这个背景的 Container\n const thisBgContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的背景\n const setBgIndex = this.backgroundObjects.findIndex((e) => e.key === key);\n const isBgSet = setBgIndex >= 0;\n\n // 已经有一个这个 key 的背景存在了\n if (isBgSet) {\n // 挤占\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.backgroundContainer.addChild(thisBgContainer);\n const bgUuid = uuid();\n this.backgroundObjects.push({\n uuid: bgUuid,\n key: key,\n pixiContainer: thisBgContainer,\n sourceUrl: url,\n sourceType: 'live2d',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n const spineResource: any = this.assetLoader.resources?.[spineId];\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n setTimeout(() => {\n if (spineResource && this.getStageObjByUuid(bgUuid)) {\n const bgSpine = new Spine(spineResource.spineData);\n const transY = spineResource?.spineData?.y ?? 0;\n /**\n * 重设大小\n */\n const originalWidth = bgSpine.width; // TODO: 视图大小可能小于画布大小,应提供参数指定视图大小\n const originalHeight = bgSpine.height; // TODO: 视图大小可能小于画布大小,应提供参数指定视图大小\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n logger.debug('bgSpine state', bgSpine.state);\n // TODO: 也许应该使用 setAnimation 播放初始动画\n if (bgSpine.spineData.animations.length > 0) {\n // 播放首个动画\n bgSpine.state.setAnimation(0, bgSpine.spineData.animations[0].name, true);\n }\n const targetScale = Math.max(scaleX, scaleY);\n const bgSprite = new PIXI.Sprite();\n bgSprite.addChild(bgSpine);\n bgSprite.scale.x = targetScale;\n bgSprite.scale.y = targetScale;\n bgSprite.anchor.set(0.5);\n bgSprite.position.y = this.stageHeight / 2;\n thisBgContainer.setBaseX(this.stageWidth / 2);\n thisBgContainer.setBaseY(this.stageHeight / 2);\n thisBgContainer.pivot.set(0, this.stageHeight / 2);\n\n // 挂载\n thisBgContainer.addChild(bgSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]) {\n this.loadAsset(url, setup, spineId);\n } else {\n // 复用\n setup();\n }\n }\n\n /**\n * 添加立绘\n * @param key 立绘的标识,一般和立绘位置有关\n * @param url 立绘图片url\n * @param presetPosition\n */\n public addFigure(key: string, url: string, presetPosition: 'left' | 'center' | 'right' = 'center') {\n const loader = this.assetLoader;\n // 准备用于存放这个立绘的 Container\n const thisFigureContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的立绘\n const setFigIndex = this.figureObjects.findIndex((e) => e.key === key);\n const isFigSet = setFigIndex >= 0;\n\n // 已经有一个这个 key 的立绘存在了\n if (isFigSet) {\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.figureContainer.addChild(thisFigureContainer);\n const figureUuid = uuid();\n this.figureObjects.push({\n uuid: figureUuid,\n key: key,\n pixiContainer: thisFigureContainer,\n sourceUrl: url,\n sourceType: 'img',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n setTimeout(() => {\n const texture = loader.resources?.[url]?.texture;\n if (texture && this.getStageObjByUuid(figureUuid)) {\n /**\n * 重设大小\n */\n const originalWidth = texture.width;\n const originalHeight = texture.height;\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n const targetScale = Math.min(scaleX, scaleY);\n const figureSprite = new PIXI.Sprite(texture);\n figureSprite.scale.x = targetScale;\n figureSprite.scale.y = targetScale;\n figureSprite.anchor.set(0.5);\n figureSprite.position.y = this.stageHeight / 2;\n const targetWidth = originalWidth * targetScale;\n const targetHeight = originalHeight * targetScale;\n thisFigureContainer.setBaseY(this.stageHeight / 2);\n if (targetHeight < this.stageHeight) {\n thisFigureContainer.setBaseY(this.stageHeight / 2 + this.stageHeight - targetHeight / 2);\n }\n if (presetPosition === 'center') {\n thisFigureContainer.setBaseX(this.stageWidth / 2);\n }\n if (presetPosition === 'left') {\n thisFigureContainer.setBaseX(targetWidth / 2);\n }\n if (presetPosition === 'right') {\n thisFigureContainer.setBaseX(this.stageWidth - targetWidth / 2);\n }\n thisFigureContainer.pivot.set(0, this.stageHeight / 2);\n thisFigureContainer.addChild(figureSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]?.texture) {\n this.loadAsset(url, setup);\n } else {\n // 复用\n setup();\n }\n }\n\n /**\n * 添加 Spine 立绘\n * @param key 立绘的标识,一般和立绘位置有关\n * @param url 立绘图片url\n * @param presetPosition\n */\n public addSpineFigure(key: string, url: string, presetPosition: 'left' | 'center' | 'right' = 'center') {\n const spineId = `spine-${url}`;\n const loader = this.assetLoader;\n // 准备用于存放这个立绘的 Container\n const thisFigureContainer = new WebGALPixiContainer();\n\n // 是否有相同 key 的立绘\n const setFigIndex = this.figureObjects.findIndex((e) => e.key === key);\n const isFigSet = setFigIndex >= 0;\n\n // 已经有一个这个 key 的立绘存在了\n if (isFigSet) {\n this.removeStageObjectByKey(key);\n }\n\n // 挂载\n this.figureContainer.addChild(thisFigureContainer);\n const figureUuid = uuid();\n this.figureObjects.push({\n uuid: figureUuid,\n key: key,\n pixiContainer: thisFigureContainer,\n sourceUrl: url,\n sourceType: 'live2d',\n sourceExt: this.getExtName(url),\n });\n\n // 完成图片加载后执行的函数\n const setup = () => {\n const spineResource: any = this.assetLoader.resources?.[spineId];\n // TODO:找一个更好的解法,现在的解法是无论是否复用原来的资源,都设置一个延时以让动画工作正常!\n setTimeout(() => {\n if (spineResource && this.getStageObjByUuid(figureUuid)) {\n const figureSpine = new Spine(spineResource.spineData);\n const transY = spineResource?.spineData?.y ?? 0;\n /**\n * 重设大小\n */\n const originalWidth = figureSpine.width;\n const originalHeight = figureSpine.height;\n const scaleX = this.stageWidth / originalWidth;\n const scaleY = this.stageHeight / originalHeight;\n // 我也不知道为什么啊啊啊啊\n figureSpine.y = -(scaleY * transY) / 2;\n figureSpine.state.setAnimation(0, '07', true);\n const targetScale = Math.min(scaleX, scaleY);\n const figureSprite = new PIXI.Sprite();\n figureSprite.addChild(figureSpine);\n figureSprite.scale.x = targetScale;\n figureSprite.scale.y = targetScale;\n figureSprite.anchor.set(0.5);\n figureSprite.position.y = this.stageHeight / 2;\n const targetWidth = originalWidth * targetScale;\n const targetHeight = originalHeight * targetScale;\n thisFigureContainer.setBaseY(this.stageHeight / 2);\n if (targetHeight < this.stageHeight) {\n thisFigureContainer.setBaseY(this.stageHeight / 2 + this.stageHeight - targetHeight / 2);\n }\n if (presetPosition === 'center') {\n thisFigureContainer.setBaseX(this.stageWidth / 2);\n }\n if (presetPosition === 'left') {\n thisFigureContainer.setBaseX(targetWidth / 2);\n }\n if (presetPosition === 'right') {\n thisFigureContainer.setBaseX(this.stageWidth - targetWidth / 2);\n }\n thisFigureContainer.pivot.set(0, this.stageHeight / 2);\n thisFigureContainer.addChild(figureSprite);\n }\n }, 0);\n };\n\n /**\n * 加载器部分\n */\n this.cacheGC();\n if (!loader.resources?.[url]) {\n this.loadAsset(url, setup, spineId);\n } else {\n // 复用\n setup();\n }\n }\n\n /**\n * Live2d立绘,如果要使用 Live2D,取消这里的注释\n * @param jsonPath\n */\n // eslint-disable-next-line max-params\n // public addLive2dFigure(key: string, jsonPath: string, pos: string, motion: string, expression: string) {\n // let stageWidth = this.stageWidth;\n // let stageHeight = this.stageHeight;\n // logger.debug('Using motion:', motion);\n //\n // figureCash.push(jsonPath);\n //\n // const loader = this.assetLoader;\n // // 准备用于存放这个立绘的 Container\n // const thisFigureContainer = new WebGALPixiContainer();\n //\n // // 是否有相同 key 的立绘\n // const setFigIndex = this.figureObjects.findIndex((e) => e.key === key);\n // const isFigSet = setFigIndex >= 0;\n //\n // // 已经有一个这个 key 的立绘存在了\n // if (isFigSet) {\n // this.removeStageObjectByKey(key);\n // }\n //\n // // 挂载\n // this.figureContainer.addChild(thisFigureContainer);\n // this.figureObjects.push({\n // uuid: uuid(),\n // key: key,\n // pixiContainer: thisFigureContainer,\n // sourceUrl: jsonPath,\n // sourceType: 'live2d',\n // sourceExt: 'json',\n // });\n // // eslint-disable-next-line @typescript-eslint/no-this-alias\n // const instance = this;\n //\n // const setup = () => {\n // if (thisFigureContainer) {\n // (async function () {\n // const models = await Promise.all([Live2DModel.from(jsonPath, { autoInteract: false })]);\n //\n // models.forEach((model) => {\n // const scaleX = stageWidth / model.width;\n // const scaleY = stageHeight / model.height;\n // const targetScale = Math.min(scaleX, scaleY) * 1.5;\n // const targetWidth = model.width * targetScale;\n // // const targetHeight = model.height * targetScale;\n //\n // model.scale.set(targetScale);\n // model.anchor.set(0.5);\n // model.position.x = stageWidth / 2;\n // model.position.y = stageHeight / 1.2;\n //\n // if (pos === 'left') {\n // model.position.x = targetWidth / 2;\n // }\n // if (pos === 'right') {\n // model.position.x = stageWidth - targetWidth / 2;\n // }\n //\n // let motionToSet = motion;\n // let animation_index = 0;\n // let priority_number = 3;\n // // var audio_link = voiceCash.pop();\n //\n // // model.motion(category_name, animation_index, priority_number,location.href + audio_link);\n // /**\n // * 检查 Motion 和 Expression\n // */\n // const motionFromState = webgalStore.getState().stage.live2dMotion.find((e) => e.target === key);\n // const expressionFromState = webgalStore.getState().stage.live2dExpression.find((e) => e.target === key);\n // if (motionFromState) {\n // motionToSet = motionFromState.motion;\n // }\n // instance.updateL2dMotionByKey(key, motionToSet);\n // model.motion(motionToSet, animation_index, priority_number);\n // let expressionToSet = expression;\n // if (expressionFromState) {\n // expressionToSet = expressionFromState.expression;\n // }\n // instance.updateL2dExpressionByKey(key, expressionToSet);\n // model.expression(expressionToSet);\n // // @ts-ignore\n // if (model.internalModel.eyeBlink) {\n // // @ts-ignore\n // model.internalModel.eyeBlink.blinkInterval = 1000 * 60 * 60 * 24; // @ts-ignore\n // model.internalModel.eyeBlink.nextBlinkTimeLeft = 1000 * 60 * 60 * 24;\n // }\n //\n // // lip-sync is still a problem and you can not.\n // SoundManager.volume = 0; // @ts-ignore\n // if (model.internalModel.angleXParamIndex !== undefined) model.internalModel.angleXParamIndex = 999; // @ts-ignore\n // if (model.internalModel.angleYParamIndex !== undefined) model.internalModel.angleYParamIndex = 999; // @ts-ignore\n // if (model.internalModel.angleZParamIndex !== undefined) model.internalModel.angleZParamIndex = 999;\n // thisFigureContainer.addChild(model);\n // });\n // })();\n // }\n // };\n //\n // /**\n // * 加载器部分\n // */\n // const resourses = Object.keys(loader.resources);\n // this.cacheGC();\n // if (!resourses.includes(jsonPath)) {\n // this.loadAsset(jsonPath, setup);\n // } else {\n // // 复用\n // setup();\n // }\n // }\n\n public changeModelMotionByKey(key: string, motion: string) {\n // logger.debug(`Applying motion ${motion} to ${key}`);\n const target = this.figureObjects.find((e) => e.key === key);\n if (target?.sourceType !== 'live2d') return;\n const figureRecordTarget = this.live2dFigureRecorder.find((e) => e.target === key);\n if (target && figureRecordTarget?.motion !== motion) {\n const container = target.pixiContainer;\n const children = container.children;\n for (const model of children) {\n let category_name = motion;\n let animation_index = 0;\n let priority_number = 3; // @ts-ignore\n const internalModel = model?.internalModel ?? undefined; // 安全访问\n internalModel?.motionManager?.stopAllMotions?.();\n // @ts-ignore\n model.motion(category_name, animation_index, priority_number);\n }\n this.updateL2dMotionByKey(key, motion);\n }\n }\n\n public changeModelExpressionByKey(key: string, expression: string) {\n // logger.debug(`Applying expression ${expression} to ${key}`);\n const target = this.figureObjects.find((e) => e.key === key);\n if (target?.sourceType !== 'live2d') return;\n const figureRecordTarget = this.live2dFigureRecorder.find((e) => e.target === key);\n if (target && figureRecordTarget?.expression !== expression) {\n const container = target.pixiContainer;\n const children = container.children;\n for (const model of children) {\n // @ts-ignore\n model.expression(expression);\n }\n this.updateL2dExpressionByKey(key, expression);\n }\n }\n\n public setModelMouthY(key: string, y: number) {\n function mapToZeroOne(value: number) {\n return value < 50 ? 0 : (value - 50) / 50;\n }\n\n const paramY = mapToZeroOne(y);\n const target = this.figureObjects.find((e) => e.key === key);\n if (target) {\n const container = target.pixiContainer;\n const children = container.children;\n for (const model of children) {\n // @ts-ignore\n if (model?.internalModel) {\n // @ts-ignore\n if (model?.internalModel?.coreModel?.setParamFloat)\n // @ts-ignore\n model?.internalModel?.coreModel?.setParamFloat?.('PARAM_MOUTH_OPEN_Y', paramY);\n // @ts-ignore\n if (model?.internalModel?.coreModel?.setParameterValueById)\n // @ts-ignore\n model?.internalModel?.coreModel?.setParameterValueById('ParamMouthOpenY', paramY);\n }\n }\n }\n }\n\n /**\n * 根据 key 获取舞台上的对象\n * @param key\n */\n public getStageObjByKey(key: string) {\n return [...this.figureObjects, ...this.backgroundObjects].find((e) => e.key === key);\n }\n\n public getStageObjByUuid(objUuid: string) {\n return [...this.figureObjects, ...this.backgroundObjects].find((e) => e.uuid === objUuid);\n }\n\n public getAllStageObj() {\n return [...this.figureObjects, ...this.backgroundObjects];\n }\n\n /**\n * 根据 key 删除舞台上的对象\n * @param key\n */\n public removeStageObjectByKey(key: string) {\n const indexFig = this.figureObjects.findIndex((e) => e.key === key);\n const indexBg = this.backgroundObjects.findIndex((e) => e.key === key);\n if (indexFig >= 0) {\n const bgSprite = this.figureObjects[indexFig];\n for (const element of bgSprite.pixiContainer.children) {\n element.destroy();\n }\n bgSprite.pixiContainer.destroy();\n this.figureContainer.removeChild(bgSprite.pixiContainer);\n this.figureObjects.splice(indexFig, 1);\n }\n if (indexBg >= 0) {\n const bgSprite = this.backgroundObjects[indexBg];\n for (const element of bgSprite.pixiContainer.children) {\n element.destroy();\n }\n bgSprite.pixiContainer.destroy();\n this.backgroundContainer.removeChild(bgSprite.pixiContainer);\n this.backgroundObjects.splice(indexBg, 1);\n }\n // /**\n // * 删掉相关 Effects,因为已经移除了\n // */\n // const prevEffects = webgalStore.getState().stage.effects;\n // const newEffects = __.cloneDeep(prevEffects);\n // const index = newEffects.findIndex((e) => e.target === key);\n // if (index >= 0) {\n // newEffects.splice(index, 1);\n // }\n // updateCurrentEffects(newEffects);\n }\n\n public cacheGC() {\n PIXI.utils.clearTextureCache();\n }\n\n private updateL2dMotionByKey(target: string, motion: string) {\n const figureTargetIndex = this.live2dFigureRecorder.findIndex((e) => e.target === target);\n if (figureTargetIndex >= 0) {\n this.live2dFigureRecorder[figureTargetIndex].motion = motion;\n } else {\n this.live2dFigureRecorder.push({ target, motion, expression: '' });\n }\n }\n\n private updateL2dExpressionByKey(target: string, expression: string) {\n const figureTargetIndex = this.live2dFigureRecorder.findIndex((e) => e.target === target);\n if (figureTargetIndex >= 0) {\n this.live2dFigureRecorder[figureTargetIndex].expression = expression;\n } else {\n this.live2dFigureRecorder.push({ target, motion: '', expression });\n }\n }\n\n private loadAsset(url: string, callback: () => void, name?: string) {\n /**\n * Loader 复用疑似有问题,转而采用先前的单独方式\n */\n this.loadQueue.unshift({ url, callback, name });\n /**\n * 尝试启动加载\n */\n this.callLoader();\n }\n\n private callLoader() {\n if (!this.assetLoader.loading) {\n const front = this.loadQueue.shift();\n if (front) {\n try {\n if (this.assetLoader.resources[front.url]) {\n front.callback();\n this.callLoader();\n } else {\n if (front.name) {\n this.assetLoader.add(front.name, front.url).load(() => {\n front.callback();\n this.callLoader();\n });\n } else {\n this.assetLoader.add(front.url).load(() => {\n front.callback();\n this.callLoader();\n });\n }\n }\n } catch (error) {\n logger.fatal('PIXI Loader 故障', error);\n front.callback();\n // this.assetLoader.reset(); // 暂时先不用重置\n this.callLoader();\n }\n }\n }\n }\n\n private updateFps() {\n getScreenFps?.(120).then((fps) => {\n this.frameDuration = 1000 / (fps as number);\n // logger.info('当前帧率', fps);\n });\n }\n\n private lockStageObject(targetName: string) {\n this.lockTransformTarget.push(targetName);\n }\n\n private unlockStageObject(targetName: string) {\n const index = this.lockTransformTarget.findIndex((name) => name === targetName);\n if (index >= 0) this.lockTransformTarget.splice(index, 1);\n }\n\n private getExtName(url: string) {\n return url.split('.').pop() ?? 'png';\n }\n}\n\nfunction updateCurrentBacklogEffects(newEffects: IEffect[]) {\n /**\n * 更新当前 backlog 条目的 effects 记录\n */\n setTimeout(() => {\n WebGAL.backlogManager.editLastBacklogItemEffect(cloneDeep(newEffects));\n }, 50);\n\n webgalStore.dispatch(setStage({ key: 'effects', value: newEffects }));\n}\n\n/**\n * @param {number} targetCount 不小于1的整数,表示经过targetCount帧之后返回结果\n * @return {Promise<number>}\n */\nconst getScreenFps = (() => {\n // 先做一下兼容性处理\n const nextFrame = [\n window.requestAnimationFrame,\n // @ts-ignore\n window.webkitRequestAnimationFrame,\n // @ts-ignore\n window.mozRequestAnimationFrame,\n ].find((fn) => fn);\n if (!nextFrame) {\n console.error('requestAnimationFrame is not supported!');\n return;\n }\n return (targetCount = 60) => {\n // 判断参数是否合规\n if (targetCount < 1) throw new Error('targetCount cannot be less than 1.');\n const beginDate = Date.now();\n let count = 0;\n return new Promise((resolve) => {\n (function log() {\n nextFrame(() => {\n if (++count >= targetCount) {\n const diffDate = Date.now() - beginDate;\n const fps = (count / diffDate) * 1000;\n return resolve(fps);\n }\n log();\n });\n })();\n });\n };\n})();\n","export const __INFO = {\n version: 'WebGAL 4.5.6',\n contributors: [\n // 现在改为跳转到 GitHub 了\n ],\n};\n","/**\n * @file 引擎初始化时会执行的脚本,包括获取游戏信息,初始化运行时变量,初始化用户数据存储\n */\nimport { logger } from './util/logger';\nimport { infoFetcher } from './util/coreInitialFunction/infoFetcher';\nimport { assetSetter, fileType } from './util/gameAssetsAccess/assetSetter';\nimport { sceneFetcher } from './controller/scene/sceneFetcher';\nimport { sceneParser } from './parser/sceneParser';\nimport { bindExtraFunc } from '@/Core/util/coreInitialFunction/bindExtraFunc';\nimport { webSocketFunc } from '@/Core/util/syncWithEditor/webSocketFunc';\nimport uniqWith from 'lodash/uniqWith';\nimport { scenePrefetcher } from './util/prefetcher/scenePrefetcher';\nimport PixiStage from '@/Core/controller/stage/pixi/PixiController';\nimport axios from 'axios';\nimport { __INFO } from '@/config/info';\nimport { WebGAL } from '@/Core/WebGAL';\n\nconst u = navigator.userAgent;\nexport const isIOS = !!u.match(/\\(i[^;]+;( U;)? CPU.+Mac OS X/); // 判断是否是 iOS终端\n\n/**\n * 引擎初始化函数\n */\nexport const initializeScript = (): void => {\n // 打印初始log信息\n logger.info(__INFO.version);\n logger.info('Github: https://github.com/OpenWebGAL/WebGAL ');\n logger.info('Made with ❤ by OpenWebGAL');\n // 激活强制缩放\n // 在调整窗口大小时重新计算宽高,设计稿按照 1600*900。\n if (isIOS) {\n /**\n * iOS\n */\n alert(\n `iOS 用户请横屏使用以获得最佳体验\n| Please use landscape mode on iOS for the best experience\n| iOS ユーザーは横画面での使用をお勧めします`,\n );\n }\n\n // 获得 userAnimation\n loadStyle('./game/userStyleSheet.css');\n // 获得 user Animation\n getUserAnimation();\n // 获取游戏信息\n infoFetcher('./game/config.txt');\n // 获取start场景\n const sceneUrl: string = assetSetter('start.txt', fileType.scene);\n // 场景写入到运行时\n sceneFetcher(sceneUrl).then((rawScene) => {\n WebGAL.sceneManager.sceneData.currentScene = sceneParser(rawScene, 'start.txt', sceneUrl);\n // 开始场景的预加载\n const subSceneList = WebGAL.sceneManager.sceneData.currentScene.subSceneList;\n WebGAL.sceneManager.settledScenes.push(sceneUrl); // 放入已加载场景列表,避免递归加载相同场景\n const subSceneListUniq = uniqWith(subSceneList); // 去重\n scenePrefetcher(subSceneListUniq);\n });\n /**\n * 启动Pixi\n */\n WebGAL.gameplay.pixiStage = new PixiStage();\n\n /**\n * iOS 设备 卸载所有 Service Worker\n */\n // if ('serviceWorker' in navigator && isIOS) {\n // navigator.serviceWorker.getRegistrations().then((registrations) => {\n // for (const registration of registrations) {\n // registration.unregister().then(() => {\n // logger.info('已卸载 Service Worker');\n // });\n // }\n // });\n // }\n\n /**\n * 绑定工具函数\n */\n bindExtraFunc();\n webSocketFunc();\n};\n\nfunction loadStyle(url: string) {\n const link = document.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n const head = document.getElementsByTagName('head')[0];\n head.appendChild(link);\n}\n\nfunction getUserAnimation() {\n axios.get('./game/animation/animationTable.json').then((res) => {\n const animations: Array<string> = res.data;\n for (const animationName of animations) {\n axios.get(`./game/animation/${animationName}.json`).then((res) => {\n if (res.data) {\n const userAnimation = {\n name: animationName,\n effects: res.data,\n };\n WebGAL.animationManager.addAnimation(userAnimation);\n }\n });\n }\n });\n}\n","var _excluded = [\"size\", \"strokeWidth\", \"strokeLinecap\", \"strokeLinejoin\", \"theme\", \"fill\", \"className\", \"spin\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { createContext, useContext, useMemo } from 'react';\nexport var DEFAULT_ICON_CONFIGS = {\n size: '1em',\n strokeWidth: 4,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n rtl: false,\n theme: 'outline',\n colors: {\n outline: {\n fill: '#333',\n background: 'transparent'\n },\n filled: {\n fill: '#333',\n background: '#FFF'\n },\n twoTone: {\n fill: '#333',\n twoTone: '#2F88FF'\n },\n multiColor: {\n outStrokeColor: '#333',\n outFillColor: '#2F88FF',\n innerStrokeColor: '#FFF',\n innerFillColor: '#43CCF8'\n }\n },\n prefix: 'i'\n};\n\nfunction guid() {\n return 'icon-' + ((1 + Math.random()) * 0x100000000 | 0).toString(16).substring(1);\n}\n\nexport function IconConverter(id, icon, config) {\n var fill = typeof icon.fill === 'string' ? [icon.fill] : icon.fill || [];\n var colors = [];\n var theme = icon.theme || config.theme;\n\n switch (theme) {\n case 'outline':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push('none');\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push('none');\n break;\n\n case 'filled':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push('#FFF');\n colors.push('#FFF');\n break;\n\n case 'two-tone':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[1] === 'string' ? fill[1] : config.colors.twoTone.twoTone);\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[1] === 'string' ? fill[1] : config.colors.twoTone.twoTone);\n break;\n\n case 'multi-color':\n colors.push(typeof fill[0] === 'string' ? fill[0] : 'currentColor');\n colors.push(typeof fill[1] === 'string' ? fill[1] : config.colors.multiColor.outFillColor);\n colors.push(typeof fill[2] === 'string' ? fill[2] : config.colors.multiColor.innerStrokeColor);\n colors.push(typeof fill[3] === 'string' ? fill[3] : config.colors.multiColor.innerFillColor);\n break;\n }\n\n return {\n size: icon.size || config.size,\n strokeWidth: icon.strokeWidth || config.strokeWidth,\n strokeLinecap: icon.strokeLinecap || config.strokeLinecap,\n strokeLinejoin: icon.strokeLinejoin || config.strokeLinejoin,\n colors: colors,\n id: id\n };\n}\nvar IconContext = /*#__PURE__*/createContext(DEFAULT_ICON_CONFIGS);\nexport var IconProvider = IconContext.Provider;\nexport function IconWrapper(name, rtl, render) {\n return function (props) {\n var size = props.size,\n strokeWidth = props.strokeWidth,\n strokeLinecap = props.strokeLinecap,\n strokeLinejoin = props.strokeLinejoin,\n theme = props.theme,\n fill = props.fill,\n className = props.className,\n spin = props.spin,\n extra = _objectWithoutProperties(props, _excluded);\n\n var ICON_CONFIGS = useContext(IconContext);\n var id = useMemo(guid, []);\n var svgProps = IconConverter(id, {\n size: size,\n strokeWidth: strokeWidth,\n strokeLinecap: strokeLinecap,\n strokeLinejoin: strokeLinejoin,\n theme: theme,\n fill: fill\n }, ICON_CONFIGS);\n var cls = [ICON_CONFIGS.prefix + '-icon'];\n cls.push(ICON_CONFIGS.prefix + '-icon' + '-' + name);\n\n if (rtl && ICON_CONFIGS.rtl) {\n cls.push(ICON_CONFIGS.prefix + '-icon-rtl');\n }\n\n if (spin) {\n cls.push(ICON_CONFIGS.prefix + '-icon-spin');\n }\n\n if (className) {\n cls.push(className);\n }\n\n return /*#__PURE__*/React.createElement(\"span\", _objectSpread(_objectSpread({}, extra), {}, {\n className: cls.join(' ')\n }), render(svgProps));\n };\n}","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('align-text-left-one', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39 6H9C7.34315 6 6 7.34315 6 9V39C6 40.6569 7.34315 42 9 42H39C40.6569 42 42 40.6569 42 39V9C42 7.34315 40.6569 6 39 6Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M26 24H14\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 15H14\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32 33H14\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('close-small', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 14L34 34\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 34L34 14\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('double-down', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36 12L24 24L12 12\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M36 24L24 36L12 24\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('double-right', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 12L24 24L12 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 12L36 24L24 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('double-up', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 24L24 12L36 24\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 36L24 24L36 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('folder-open', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4 9V41L9 21H39.5V15C39.5 13.8954 38.6046 13 37.5 13H24L19 7H6C4.89543 7 4 7.89543 4 9Z\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M40 41L44 21H8.8125L4 41H40Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('go-end', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 12L26 24L14 36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 12V36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('go-start', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 36L22 24L34 12\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 12V36\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('hamburger-button', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.94971 11.9497H39.9497\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.94971 23.9497H39.9497\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.94971 35.9497H39.9497\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('home', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 18V42H39V18L24 6L9 18Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19 29V42H29V29H19Z\",\n fill: props.colors[3],\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 42H39\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('left', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M31 36L19 24L31 12\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('lock', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: \"6\",\n y: \"22\",\n width: \"36\",\n height: \"22\",\n rx: \"2\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 22V14C14 8.47715 18.4772 4 24 4C29.5228 4 34 8.47715 34 14V22\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 30V36\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('logout', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M23.9917 6H6V42H24\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M33 33L42 24L33 15\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 23.9917H42\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('music-list', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 19H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 10H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 38H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 28H40\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8 10L16 15L8 20V10Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('play-one', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15 24V11.8756L25.5 17.9378L36 24L25.5 30.0622L15 36.1244V24Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('preview-close-one', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M42 42L6 6\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('preview-open', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 36C35.0457 36 44 24 44 24C44 24 35.0457 12 24 12C12.9543 12 4 24 4 24C4 24 12.9543 36 24 36Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 29C26.7614 29 29 26.7614 29 24C29 21.2386 26.7614 19 24 19C21.2386 19 19 21.2386 19 24C19 26.7614 21.2386 29 24 29Z\",\n fill: props.colors[3],\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('replay-music', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M21 24V18L26 21L31 24L26 27L21 30V24Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M11.2721 36.7279C14.5294 39.9853 19.0294 42 24 42C33.9411 42 42 33.9411 42 24C42 14.0589 33.9411 6 24 6C19.0294 6 14.5294 8.01472 11.2721 11.2721C9.6141 12.9301 6 17 6 17\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 9V17H14\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('return', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12.9998 8L6 14L12.9998 21\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('save', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6 9C6 7.34315 7.34315 6 9 6H34.2814L42 13.2065V39C42 40.6569 40.6569 42 39 42H9C7.34315 42 6 40.6569 6 39V9Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M24.0083 6L24 13.3846C24 13.7245 23.5523 14 23 14H15C14.4477 14 14 13.7245 14 13.3846L14 6\",\n fill: props.colors[3]\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24.0083 6L24 13.3846C24 13.7245 23.5523 14 23 14H15C14.4477 14 14 13.7245 14 13.3846L14 6H24.0083Z\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 6H34.2814\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 26H34\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 34H24.0083\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('setting-two', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M18.2838 43.1713C14.9327 42.1736 11.9498 40.3213 9.58787 37.867C10.469 36.8227 11 35.4734 11 34.0001C11 30.6864 8.31371 28.0001 5 28.0001C4.79955 28.0001 4.60139 28.01 4.40599 28.0292C4.13979 26.7277 4 25.3803 4 24.0001C4 21.9095 4.32077 19.8938 4.91579 17.9995C4.94381 17.9999 4.97188 18.0001 5 18.0001C8.31371 18.0001 11 15.3138 11 12.0001C11 11.0488 10.7786 10.1493 10.3846 9.35011C12.6975 7.1995 15.5205 5.59002 18.6521 4.72314C19.6444 6.66819 21.6667 8.00013 24 8.00013C26.3333 8.00013 28.3556 6.66819 29.3479 4.72314C32.4795 5.59002 35.3025 7.1995 37.6154 9.35011C37.2214 10.1493 37 11.0488 37 12.0001C37 15.3138 39.6863 18.0001 43 18.0001C43.0281 18.0001 43.0562 17.9999 43.0842 17.9995C43.6792 19.8938 44 21.9095 44 24.0001C44 25.3803 43.8602 26.7277 43.594 28.0292C43.3986 28.01 43.2005 28.0001 43 28.0001C39.6863 28.0001 37 30.6864 37 34.0001C37 35.4734 37.531 36.8227 38.4121 37.867C36.0502 40.3213 33.0673 42.1736 29.7162 43.1713C28.9428 40.752 26.676 39.0001 24 39.0001C21.324 39.0001 19.0572 40.752 18.2838 43.1713Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 31C27.866 31 31 27.866 31 24C31 20.134 27.866 17 24 17C20.134 17 17 20.134 17 24C17 27.866 20.134 31 24 31Z\",\n fill: props.colors[3],\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('square-small', false, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34 12H14C12.8954 12 12 12.8954 12 14V34C12 35.1046 12.8954 36 14 36H34C35.1046 36 36 35.1046 36 34V14C36 12.8954 35.1046 12 34 12Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('unlock', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: \"7\",\n y: \"22.0476\",\n width: \"34\",\n height: \"22\",\n rx: \"2\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 22V14.0047C13.9948 8.87022 17.9227 4.56718 23.0859 4.05117C28.249 3.53516 32.9673 6.97408 34 12.0059\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 30V36\",\n stroke: props.colors[2],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }));\n});","import React from 'react';\nimport { IconWrapper } from '../runtime';\nexport default IconWrapper('volume-notice', true, function (props) {\n return /*#__PURE__*/React.createElement(\"svg\", {\n width: props.size,\n height: props.size,\n viewBox: \"0 0 48 48\",\n fill: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M24 6V42C17 42 11.7985 32.8391 11.7985 32.8391H6C4.89543 32.8391 4 31.9437 4 30.8391V17.0108C4 15.9062 4.89543 15.0108 6 15.0108H11.7985C11.7985 15.0108 17 6 24 6Z\",\n fill: props.colors[1],\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M32 15L32 15C32.6232 15.5565 33.1881 16.1797 33.6841 16.8588C35.1387 18.8504 36 21.3223 36 24C36 26.6545 35.1535 29.1067 33.7218 31.0893C33.2168 31.7885 32.6391 32.4293 32 33\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap,\n strokeLinejoin: props.strokeLinejoin\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M34.2359 41.1857C40.0836 37.6953 44 31.305 44 24C44 16.8085 40.2043 10.5035 34.507 6.97906\",\n stroke: props.colors[0],\n strokeWidth: props.strokeWidth,\n strokeLinecap: props.strokeLinecap\n }));\n});","import { IMenuPanel } from '@/UI/Menu/MenuPanel/menuPanelInterface';\nimport { FolderOpen, Home, Logout, Save, SettingTwo } from '@icon-park/react';\n\n/**\n * 通过图标名称返回正确的图标\n * @param props\n * @constructor\n */\nexport const MenuIconMap = (props: IMenuPanel) => {\n let returnIcon;\n switch (props.iconName) {\n case 'save':\n returnIcon = <Save theme=\"outline\" size=\"1.2em\" fill={props.iconColor} strokeWidth={2} />;\n break;\n case 'load':\n returnIcon = <FolderOpen theme=\"outline\" size=\"1.2em\" fill={props.iconColor} strokeWidth={2} />;\n break;\n case 'option':\n returnIcon = <SettingTwo theme=\"outline\" size=\"1.2em\" fill={props.iconColor} strokeWidth={2} />;\n break;\n case 'title':\n returnIcon = <Home theme=\"outline\" size=\"1.2em\" fill={props.iconColor} strokeWidth={2} />;\n break;\n case 'exit':\n returnIcon = <Logout theme=\"outline\" size=\"1.2em\" fill={props.iconColor} strokeWidth={2} />;\n break;\n default:\n returnIcon = <div />;\n }\n\n return returnIcon;\n};\n","import styles from './menuPanel.module.scss';\nimport { MenuIconMap } from './MenuIconMap';\nimport { IMenuPanel } from '@/UI/Menu/MenuPanel/menuPanelInterface';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\n/**\n * 菜单标签页切换按钮\n * @param props\n * @constructor\n */\nexport const MenuPanelButton = (props: IMenuPanel) => {\n const { playSePageChange, playSeEnter } = useSoundEffect();\n let buttonClassName = styles.MenuPanel_button;\n if (props.hasOwnProperty('buttonOnClassName')) {\n buttonClassName = buttonClassName + props.buttonOnClassName;\n }\n return (\n <div\n className={buttonClassName}\n onClick={() => {\n props.clickFunc();\n // playSePageChange();\n }}\n onMouseEnter={playSeEnter}\n style={{ ...props.style, color: props.tagColor }}\n >\n <div className={styles.MenuPanel_button_icon}>\n <MenuIconMap iconName={props.iconName} iconColor={props.iconColor} />\n </div>\n {props.tagName}\n </div>\n );\n};\n","import { webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { stopAllPerform } from '@/Core/controller/gamePlay/stopAllPerform';\nimport { stopAuto } from '@/Core/controller/gamePlay/autoPlay';\nimport { stopFast } from '@/Core/controller/gamePlay/fastSkip';\nimport { setEbg } from '@/Core/gameScripts/changeBg/setEbg';\n\nexport const backToTitle = () => {\n const dispatch = webgalStore.dispatch;\n stopAllPerform();\n stopAuto();\n stopFast();\n // 清除语音\n dispatch(setStage({ key: 'playVocal', value: '' }));\n // 重新打开标题界面\n dispatch(setVisibility({ component: 'showTitle', visibility: true }));\n /**\n * 重设为标题背景\n */\n setEbg(webgalStore.getState().GUI.titleBg);\n};\n","import styles from './globalDialog.module.scss';\nimport ReactDOM from 'react-dom';\nimport { useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { useSEByWebgalStore } from '@/hooks/useSoundEffect';\n\nexport default function GlobalDialog() {\n const isGlobalDialogShow = useSelector((state: RootState) => state.GUI.showGlobalDialog);\n return <>{isGlobalDialogShow && <div id=\"globalDialogContainer\" />}</>;\n}\n\ninterface IShowGlobalDialogProps {\n title: string;\n leftText: string;\n rightText: string;\n leftFunc: Function;\n rightFunc: Function;\n}\n\nexport function showGlogalDialog(props: IShowGlobalDialogProps) {\n const { playSeClick, playSeEnter } = useSEByWebgalStore();\n webgalStore.dispatch(setVisibility({ component: 'showGlobalDialog', visibility: true }));\n const handleLeft = () => {\n playSeClick();\n props.leftFunc();\n hideGlobalDialog();\n };\n const handleRight = () => {\n playSeClick();\n props.rightFunc();\n hideGlobalDialog();\n };\n const renderElement = (\n <div className={styles.GlobalDialog_main}>\n <div className={styles.glabalDialog_container}>\n <div className={styles.glabalDialog_container_inner}>\n <div className={styles.title}>{props.title}</div>\n <div className={styles.button_list}>\n <div className={styles.button} onClick={handleLeft} onMouseEnter={playSeEnter}>\n {props.leftText}\n </div>\n <div className={styles.button} onClick={handleRight} onMouseEnter={playSeEnter}>\n {props.rightText}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n setTimeout(() => {\n // eslint-disable-next-line react/no-deprecated\n ReactDOM.render(renderElement, document.getElementById('globalDialogContainer'));\n }, 100);\n}\n\nexport function hideGlobalDialog() {\n webgalStore.dispatch(setVisibility({ component: 'showGlobalDialog', visibility: false }));\n}\n\nexport function showControls() {\n webgalStore.dispatch(setVisibility({ component: 'showControls', visibility: true }));\n}\n\nexport function hideControls() {\n webgalStore.dispatch(setVisibility({ component: 'showControls', visibility: false }));\n}\n\nexport function switchControls() {\n if (webgalStore.getState().GUI.showControls === true) {\n hideControls();\n } else {\n showControls();\n }\n}\n","import styles from './menuPanel.module.scss';\nimport { MenuPanelButton } from './MenuPanelButton';\nimport { playBgm } from '@/Core/controller/stage/playBgm';\nimport { MenuPanelTag } from '@/store/guiInterface';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setMenuPanelTag, setVisibility } from '@/store/GUIReducer';\nimport { backToTitle } from '@/Core/controller/gamePlay/backToTitle';\nimport useTrans from '@/hooks/useTrans';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';\n\n/**\n * Menu页的底栏\n * @constructor\n */\nexport const MenuPanel = () => {\n // 国际化\n const t = useTrans('menu.');\n\n const { playSeClick, playSeDialogOpen, playSePageChange } = useSoundEffect();\n const GUIState = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n // 设置Menu按钮的高亮\n const SaveTagOn = GUIState.currentMenuTag === MenuPanelTag.Save ? ` ${styles.MenuPanel_button_hl}` : ``;\n const LoadTagOn = GUIState.currentMenuTag === MenuPanelTag.Load ? ` ${styles.MenuPanel_button_hl}` : ``;\n const OptionTagOn = GUIState.currentMenuTag === MenuPanelTag.Option ? ` ${styles.MenuPanel_button_hl}` : ``;\n\n // 设置Menu按钮的颜色\n const SaveTagColor = GUIState.currentMenuTag === MenuPanelTag.Save ? `rgba(74, 34, 93, 0.9)` : `rgba(123,144,169,1)`;\n const LoadTagColor = GUIState.currentMenuTag === MenuPanelTag.Load ? `rgba(11, 52, 110, 0.9)` : `rgba(123,144,169,1)`;\n const OptionTagColor =\n GUIState.currentMenuTag === MenuPanelTag.Option ? `rgba(81, 110, 65, 0.9)` : `rgba(123,144,169,1)`;\n\n // 设置Menu图标的颜色\n const SaveIconColor = GUIState.currentMenuTag === MenuPanelTag.Save ? `rgba(74, 34, 93, 0.9)` : `rgba(123,144,169,1)`;\n const LoadIconColor =\n GUIState.currentMenuTag === MenuPanelTag.Load ? `rgba(11, 52, 110, 0.9)` : `rgba(123,144,169,1)`;\n const OptionIconColor =\n GUIState.currentMenuTag === MenuPanelTag.Option ? `rgba(81, 110, 65, 0.9)` : `rgba(123,144,169,1)`;\n\n return (\n <div className={styles.MenuPanel_main}>\n <MenuPanelButton\n iconName=\"save\"\n buttonOnClassName={SaveTagOn}\n iconColor={SaveIconColor}\n tagColor={SaveTagColor}\n clickFunc={() => {\n playSePageChange();\n if (GUIState.showTitle) return;\n dispatch(setMenuPanelTag(MenuPanelTag.Save));\n }}\n tagName={t('saving.title')}\n key=\"saveButton\"\n />\n <MenuPanelButton\n iconName=\"load\"\n buttonOnClassName={LoadTagOn}\n iconColor={LoadIconColor}\n tagColor={LoadTagColor}\n clickFunc={() => {\n playSePageChange();\n dispatch(setMenuPanelTag(MenuPanelTag.Load));\n }}\n tagName={t('loadSaving.title')}\n key=\"loadButton\"\n />\n <MenuPanelButton\n iconName=\"title\"\n iconColor=\"rgba(123,144,169,1)\"\n tagColor=\"rgba(123,144,169,1)\"\n clickFunc={() => {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('$gaming.buttons.titleTips'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n backToTitle();\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: false }));\n },\n rightFunc: () => {},\n });\n }}\n tagName={t('title.title')}\n key=\"titleIcon\"\n />\n <MenuPanelButton\n iconName=\"option\"\n style={{ marginLeft: 'auto' }}\n buttonOnClassName={OptionTagOn}\n iconColor={OptionIconColor}\n tagColor={OptionTagColor}\n clickFunc={() => {\n playSePageChange();\n dispatch(setMenuPanelTag(MenuPanelTag.Option));\n }}\n tagName={t('options.title')}\n key=\"optionButton\"\n />\n\n <MenuPanelButton\n iconName=\"exit\"\n iconColor=\"rgba(123,144,169,1)\"\n tagColor=\"rgba(123,144,169,1)\"\n clickFunc={() => {\n playSeClick();\n dispatch(setVisibility({ component: 'showMenuPanel', visibility: false }));\n }}\n tagName={t('exit.title')}\n key=\"exitIcon\"\n />\n </div>\n );\n};\n","import { CSSProperties, FC, useEffect } from 'react';\nimport styles from '../SaveAndLoad.module.scss';\nimport { saveGame } from '@/Core/controller/storage/saveGame';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setSlPage } from '@/store/userDataReducer';\nimport { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';\nimport useTrans from '@/hooks/useTrans';\nimport { useTranslation } from 'react-i18next';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { getSavesFromStorage } from '@/Core/controller/storage/savesController';\n\nexport const Save: FC = () => {\n const { playSePageChange, playSeEnter, playSeDialogOpen } = useSoundEffect();\n const userDataState = useSelector((state: RootState) => state.userData);\n const savesDataState = useSelector((state: RootState) => state.saveData);\n const dispatch = useDispatch();\n const page = [];\n for (let i = 1; i <= 20; i++) {\n let classNameOfElement = styles.Save_Load_top_button;\n if (i === userDataState.optionData.slPage) {\n classNameOfElement = classNameOfElement + ' ' + styles.Save_Load_top_button_on;\n }\n const element = (\n <div\n onClick={() => {\n dispatch(setSlPage(i));\n setStorage();\n playSePageChange();\n }}\n onMouseEnter={playSeEnter}\n key={'Save_element_page' + i}\n className={classNameOfElement}\n >\n <div className={styles.Save_Load_top_button_text}>{i}</div>\n </div>\n );\n page.push(element);\n }\n\n const tCommon = useTrans('common.');\n\n const showSaves = [];\n // 现在尝试设置10个存档每页\n const start = (userDataState.optionData.slPage - 1) * 10 + 1;\n const end = start + 9;\n\n useEffect(() => {\n getSavesFromStorage(start, end);\n }, [start, end]);\n\n let animationIndex = 0;\n for (let i = start; i <= end; i++) {\n animationIndex++;\n const saveData = savesDataState.saveData[i];\n let saveElementContent = <div />;\n if (saveData) {\n const speaker = saveData.nowStageState.showName === '' ? '\\u00A0' : `${saveData.nowStageState.showName}`;\n saveElementContent = (\n <>\n <div className={styles.Save_Load_content_element_top}>\n <div className={styles.Save_Load_content_element_top_index}>{saveData.index}</div>\n <div className={styles.Save_Load_content_element_top_date}>{saveData.saveTime}</div>\n </div>\n <div className={styles.Save_Load_content_miniRen}>\n <img className={styles.Save_Load_content_miniRen_bg} alt=\"Save_img_preview\" src={saveData.previewImage} />\n </div>\n <div className={styles.Save_Load_content_text}>\n <div className={styles.Save_Load_content_speaker}>{speaker}</div>\n <div className={styles.Save_Load_content_text_padding}>{saveData.nowStageState.showText}</div>\n </div>\n </>\n );\n }\n // else {\n\n // }\n const saveElement = (\n <div\n onClick={() => {\n if (savesDataState.saveData[i]) {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('saving.isOverwrite'),\n leftText: tCommon('yes'),\n rightText: tCommon('no'),\n leftFunc: () => {\n saveGame(i);\n setStorage();\n },\n rightFunc: () => {},\n });\n } else {\n playSePageChange();\n saveGame(i);\n }\n }}\n onMouseEnter={playSeEnter}\n key={'saveElement_' + i}\n className={styles.Save_Load_content_element}\n style={{ animationDelay: `${animationIndex * 30}ms` }}\n >\n {saveElementContent}\n </div>\n );\n showSaves.push(saveElement);\n }\n\n const t = useTrans('menu.');\n\n return (\n <div className={styles.Save_Load_main}>\n <div className={styles.Save_Load_top}>\n <div className={styles.Save_Load_title}>\n <div className={styles.Save_title_text}>{t('saving.title')}</div>\n </div>\n <div className={styles.Save_Load_top_buttonList}>{page}</div>\n </div>\n <div className={styles.Save_Load_content} id={'Save_content_page_' + userDataState.optionData.slPage}>\n {showSaves}\n </div>\n </div>\n );\n};\n","import { CSSProperties, FC, useEffect } from 'react';\nimport { loadGame } from '@/Core/controller/storage/loadGame';\nimport styles from '../SaveAndLoad.module.scss';\n// import {saveGame} from '@/Core/controller/storage/saveGame';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setSlPage } from '@/store/userDataReducer';\nimport useTrans from '@/hooks/useTrans';\nimport { useTranslation } from 'react-i18next';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { getSavesFromStorage } from '@/Core/controller/storage/savesController';\n\nexport const Load: FC = () => {\n const { playSeClick, playSeEnter, playSePageChange } = useSoundEffect();\n const userDataState = useSelector((state: RootState) => state.userData);\n const saveDataState = useSelector((state: RootState) => state.saveData);\n const dispatch = useDispatch();\n const page = [];\n for (let i = 1; i <= 20; i++) {\n let classNameOfElement = styles.Save_Load_top_button + ' ' + styles.Load_top_button;\n if (i === userDataState.optionData.slPage) {\n classNameOfElement = classNameOfElement + ' ' + styles.Save_Load_top_button_on + ' ' + styles.Load_top_button_on;\n }\n const element = (\n <div\n onClick={() => {\n dispatch(setSlPage(i));\n setStorage();\n playSePageChange();\n }}\n onMouseEnter={playSeEnter}\n key={'Load_element_page' + i}\n className={classNameOfElement}\n >\n <div className={styles.Save_Load_top_button_text}>{i}</div>\n </div>\n );\n page.push(element);\n }\n\n const showSaves = [];\n // 现在尝试设置10个存档每页\n const start = (userDataState.optionData.slPage - 1) * 10 + 1;\n const end = start + 9;\n\n useEffect(() => {\n getSavesFromStorage(start, end);\n }, [start, end]);\n\n let animationIndex = 0;\n for (let i = start; i <= end; i++) {\n animationIndex++;\n const saveData = saveDataState.saveData[i];\n let saveElementContent = <div />;\n if (saveData) {\n const speaker = saveData.nowStageState.showName === '' ? '\\u00A0' : `${saveData.nowStageState.showName}`;\n saveElementContent = (\n <>\n <div className={styles.Save_Load_content_element_top}>\n <div className={styles.Save_Load_content_element_top_index + ' ' + styles.Load_content_elememt_top_index}>\n {saveData.index}\n </div>\n <div className={styles.Save_Load_content_element_top_date + ' ' + styles.Load_content_element_top_date}>\n {saveData.saveTime}\n </div>\n </div>\n <div className={styles.Save_Load_content_miniRen}>\n <img className={styles.Save_Load_content_miniRen_bg} alt=\"Save_img_preview\" src={saveData.previewImage} />\n </div>\n <div className={styles.Save_Load_content_text}>\n <div className={styles.Save_Load_content_speaker + ' ' + styles.Load_content_speaker}>{speaker}</div>\n <div className={styles.Save_Load_content_text_padding}>{saveData.nowStageState.showText}</div>\n </div>\n </>\n );\n }\n // else {\n\n // }\n const saveElement = (\n <div\n onClick={() => {\n loadGame(i);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n key={'loadElement_' + i}\n className={styles.Save_Load_content_element}\n style={{ animationDelay: `${animationIndex * 30}ms` }}\n >\n {saveElementContent}\n </div>\n );\n showSaves.push(saveElement);\n }\n\n const t = useTrans('menu.');\n\n return (\n <div className={styles.Save_Load_main}>\n <div className={styles.Save_Load_top}>\n <div className={styles.Save_Load_title}>\n <div className={styles.Load_title_text}>{t('loadSaving.title')}</div>\n </div>\n <div className={styles.Save_Load_top_buttonList}>{page}</div>\n </div>\n <div className={styles.Save_Load_content} id={'Load_content_page_' + userDataState.optionData.slPage}>\n {showSaves}\n </div>\n </div>\n );\n};\n","import styles from './normalOption.module.scss';\n\nexport const NormalOption = (props: any) => {\n return (\n <div className={styles.NormalOption} style={{ width: props.full ? '100%' : 'auto' }}>\n {/* <div className={styles.NormalOption_title_sd}>{props.title}</div> */}\n {/* <div className={styles.NormalOption_title_bef}>{props.title}</div> */}\n <div className={styles.NormalOption_title}>{props.title}</div>\n <div className={styles.NormalOption_buttonList} style={{ width: props.full ? '100%' : 'auto' }}>\n {props.children}\n </div>\n </div>\n );\n};\n","import { ReactElement } from 'react';\nimport { INormalButton } from '@/UI/Menu/Options/OptionInterface';\nimport styles from './normalButton.module.scss';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport const NormalButton = (props: INormalButton) => {\n const len: number = props.textList.length;\n const buttonList: Array<ReactElement> = [];\n const { playSeEnter, playSeSwitch } = useSoundEffect();\n for (let i = 0; i < len; i++) {\n if (i === props.currentChecked) {\n const t = (\n <div\n key={props.textList[i] + i + props}\n className={styles.NormalButton + ' ' + styles.NormalButtonChecked}\n onClick={() => {\n playSeSwitch();\n props.functionList[i]();\n }}\n onMouseEnter={playSeEnter}\n >\n {props.textList[i]}\n </div>\n );\n buttonList.push(t);\n } else {\n const t = (\n <div\n key={props.textList[i] + i}\n className={styles.NormalButton}\n onClick={() => {\n playSeSwitch();\n props.functionList[i]();\n }}\n onMouseEnter={playSeEnter}\n >\n {props.textList[i]}\n </div>\n );\n buttonList.push(t);\n }\n }\n return <>{buttonList}</>;\n};\n","import { RootState } from '@/store/store';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { useTranslation } from 'react-i18next';\nimport { useDispatch } from 'react-redux';\nimport { useGenSyncRef } from './useGenSyncRef';\nimport { logger } from '@/Core/util/logger';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { language } from '@/config/language';\n\nexport function getLanguageName(lang: language): string {\n return language[lang];\n}\n\nexport default function useLanguage() {\n const { i18n } = useTranslation();\n const userDataRef = useGenSyncRef((state: RootState) => state.userData);\n const dispatch = useDispatch();\n\n return (_lang?: language, isSyncStorage = true) => {\n const lang = _lang ?? userDataRef.current?.optionData.language ?? language.zhCn;\n\n const languageName = getLanguageName(lang);\n i18n.changeLanguage(languageName);\n\n dispatch(setOptionData({ key: 'language', value: lang }));\n logger.info('设置语言: ' + languageName);\n window?.localStorage.setItem('lang', lang.toString());\n if (isSyncStorage) {\n setStorage();\n }\n };\n}\n","import useTrans from '@/hooks/useTrans';\nimport { Left } from '@icon-park/react';\nimport s from './about.module.scss';\nimport { __INFO } from '@/config/info';\n\nexport default function About(props: { onClose: () => void }) {\n const t = useTrans('menu.options.pages.system.options.about.');\n return (\n <div className={s.about}>\n <div className={s.backButton} onClick={props.onClose}>\n <Left className={s.icon} theme=\"outline\" size=\"35\" strokeWidth={3} fill=\"#333\" />\n </div>\n <div className={s.title}>{t('subTitle')}</div>\n <div className={s.title}>{t('version')}</div>\n <div className={s.text}>{__INFO.version}</div>\n <div className={s.title}>{t('source')}</div>\n <div className={s.text}>\n <a target=\"_blank\" href=\"https://github.com/OpenWebGAL/WebGAL\">\n https://github.com/OpenWebGAL/WebGAL\n </a>\n </div>\n <div className={s.title}>{t('contributors')}</div>\n <div className={s.text}>\n <a target=\"_blank\" href=\"https://github.com/OpenWebGAL/WebGAL/graphs/contributors\">\n https://github.com/OpenWebGAL/WebGAL/graphs/contributors\n </a>\n </div>\n <div className={s.title}>{t('website')}</div>\n <div className={s.text}>\n <a target=\"_blank\" href=\"https://openwebgal.com/\">\n https://openwebgal.com/\n </a>\n </div>\n </div>\n );\n}\n","import styles from '@/UI/Menu/Options/options.module.scss';\nimport { NormalOption } from '@/UI/Menu/Options/NormalOption';\nimport { NormalButton } from '@/UI/Menu/Options/NormalButton';\nimport { resetAllData, resetOptionSet, setOptionData } from '@/store/userDataReducer';\nimport { IUserData, playSpeed } from '@/store/userDataInterface';\nimport { getStorage, setStorage, dumpToStorageFast } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { showGlogalDialog } from '@/UI/GlobalDialog/GlobalDialog';\nimport localforage from 'localforage';\nimport { logger } from '@/Core/util/logger';\nimport useTrans from '@/hooks/useTrans';\nimport useLanguage from '@/hooks/useLanguage';\nimport languages, { language } from '@/config/language';\nimport { useState } from 'react';\nimport About from '@/UI/Menu/Options/System/About';\nimport { WebGAL } from '@/Core/WebGAL';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport savesReducer, { ISavesData, saveActions } from '@/store/savesReducer';\nimport { dumpFastSaveToStorage, dumpSavesToStorage } from '@/Core/controller/storage/savesController';\n\ninterface IExportGameData {\n userData: IUserData;\n saves: ISavesData;\n}\n\nexport function System() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const userSavesState = useSelector((state: RootState) => state.saveData);\n const dispatch = useDispatch();\n const setLanguage = useLanguage();\n const t = useTrans('menu.options.pages.system.options.');\n const { playSeDialogOpen } = useSoundEffect();\n\n function exportSaves() {\n const gameData: IExportGameData = {\n userData: userDataState,\n saves: userSavesState,\n };\n\n const saves = JSON.stringify(gameData);\n if (saves !== null) {\n // @ts-ignore\n const blob = new Blob([saves], { type: 'application/json' });\n const blobUrl = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = blobUrl;\n a.download = 'saves.json';\n a.click();\n a.remove();\n }\n }\n\n function importSavesEventHandler(ev: any) {\n // const t = useTrans('menu.options.pages.system.options.');\n\n const file = ev.target.files[0];\n const reader = new FileReader();\n reader.onload = (evR) => {\n const saves = evR!.target!.result as string;\n try {\n const saveAsObj: IExportGameData = JSON.parse(saves);\n playSeDialogOpen();\n showGlogalDialog({\n title: t('gameSave.dialogs.import.title'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: async () => {\n await localforage.setItem(WebGAL.gameKey, saveAsObj.userData).then(() => {\n logger.info(t('gameSave.dialogs.import.tip'));\n });\n getStorage();\n webgalStore.dispatch(saveActions.replaceSaveGame(saveAsObj.saves.saveData));\n webgalStore.dispatch(saveActions.setFastSave(saveAsObj.saves.quickSaveData));\n dumpFastSaveToStorage();\n dumpSavesToStorage(0, 200);\n },\n rightFunc: () => {},\n });\n } catch (e) {\n logger.error(t('gameSave.dialogs.import.error'), e);\n }\n // window.location.reload(); // dirty: 强制刷新 UI\n };\n reader.readAsText(file, 'UTF-8');\n }\n\n function importSaves() {\n const inputElement = document.createElement('input');\n inputElement.type = 'file';\n inputElement.onchange = importSavesEventHandler;\n inputElement.click();\n }\n\n const [showAbout, setShowAbout] = useState(false);\n\n function toggleAbout() {\n setShowAbout(!showAbout);\n }\n\n return (\n <div className={styles.Options_main_content_half}>\n {showAbout && <About onClose={toggleAbout} />}\n {!showAbout && (\n <>\n <NormalOption key=\"option1\" title={t('autoSpeed.title')}>\n <NormalButton\n textList={t('autoSpeed.options.slow', 'autoSpeed.options.medium', 'autoSpeed.options.fast')}\n functionList={[\n () => {\n dispatch(setOptionData({ key: 'autoSpeed', value: playSpeed.slow }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'autoSpeed', value: playSpeed.normal }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'autoSpeed', value: playSpeed.fast }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.autoSpeed}\n />\n </NormalOption>\n <NormalOption key=\"option7\" title={t('language.title')}>\n <NormalButton\n currentChecked={userDataState.optionData.language}\n textList={Object.values(languages)}\n functionList={Object.keys(languages).map(\n (k) => () => setLanguage(language[k as unknown as number] as unknown as language),\n )}\n />\n </NormalOption>\n <NormalOption key=\"option2\" title={t('resetData.title')}>\n <NormalButton\n textList={t(\n 'resetData.options.clearGameSave',\n 'resetData.options.resetSettings',\n 'resetData.options.clearAll',\n )}\n functionList={[\n () => {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('resetData.dialogs.clearGameSave'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n dispatch(saveActions.resetSaves());\n dumpSavesToStorage(0, 200);\n dumpFastSaveToStorage();\n },\n rightFunc: () => {},\n });\n },\n () => {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('resetData.dialogs.resetSettings'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n dispatch(resetOptionSet());\n dumpToStorageFast();\n },\n rightFunc: () => {},\n });\n },\n () => {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('resetData.dialogs.clearAll'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n dispatch(resetAllData());\n dumpToStorageFast();\n dispatch(saveActions.resetSaves());\n dumpSavesToStorage(0, 200);\n dumpFastSaveToStorage();\n },\n rightFunc: () => {},\n });\n },\n ]}\n currentChecked={3}\n />\n </NormalOption>\n <NormalOption key=\"option3\" title={t('gameSave.title')}>\n <NormalButton\n textList={t('gameSave.options.export', 'gameSave.options.import')}\n functionList={[exportSaves, importSaves]}\n currentChecked={2}\n />\n </NormalOption>\n <div className={styles.About_title_text} onClick={toggleAbout}>\n <span className={styles.About_text}>{t('about.title')}</span>\n </div>\n </>\n )}\n </div>\n );\n}\n","import styles from './textPreview.module.scss';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useFontFamily } from '@/hooks/useFontFamily';\nimport { useTextAnimationDuration, useTextDelay } from '@/hooks/useTextOptions';\nimport useTrans from '@/hooks/useTrans';\nimport { getTextSize } from '@/UI/getTextSize';\nimport IMSSTextbox from '@/Stage/TextBox/IMSSTextbox';\nimport { compileSentence } from '@/Stage/TextBox/TextBox';\n\nexport const TextPreview = (props: any) => {\n const t = useTrans('menu.options.pages.display.options.');\n const userDataState = useSelector((state: RootState) => state.userData);\n const stageState = useSelector((state: RootState) => state.stage);\n const previewBackground = stageState.bgName;\n const textDelay = useTextDelay(userDataState.optionData.textSpeed);\n const textDuration = useTextAnimationDuration(userDataState.optionData.textSpeed);\n const textboxOpacity = userDataState.optionData.textboxOpacity;\n const size = getTextSize(userDataState.optionData.textSize) + '%';\n const font = useFontFamily();\n const userAgent = navigator.userAgent;\n const isFirefox = /firefox/i.test(userAgent);\n const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);\n const previewText = t('textPreview.text');\n const previewTextArray = compileSentence(previewText, 3);\n\n const Textbox = IMSSTextbox;\n\n const textboxProps = {\n textArray: previewTextArray,\n isText: true,\n textDelay: textDelay,\n showName: t('textPreview.title'),\n currentConcatDialogPrev: '',\n fontSize: size,\n currentDialogKey: '',\n isSafari: isSafari,\n isFirefox: isFirefox,\n miniAvatar: '',\n textDuration: textDuration,\n font: font,\n textSizeState: size as unknown as number,\n lineLimit: 3,\n isUseStroke: true,\n textboxOpacity: textboxOpacity,\n };\n\n return (\n <div\n className={styles.textPreviewMain}\n style={{\n background: previewBackground ? `bottom / cover no-repeat url(${previewBackground})` : 'rgba(0, 0, 0, 0.1)',\n }}\n >\n <div key={`previewTextbox-${textDelay}`} className={styles.textbox}>\n <Textbox {...textboxProps} />\n </div>\n </div>\n );\n};\n","import './slider.css';\nimport { ISlider } from '@/UI/Menu/Options/OptionInterface';\nimport { useEffect } from 'react';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport const OptionSlider = (props: ISlider) => {\n const { playSeEnter } = useSoundEffect();\n useEffect(() => {\n setTimeout(() => {\n const input = document.getElementById(props.uniqueID);\n if (input !== null) input.setAttribute('value', props.initValue.toString());\n }, 1);\n }, []);\n return (\n <div className=\"Option_WebGAL_slider\">\n <input\n id={props.uniqueID}\n type=\"range\"\n onChange={props.onChange}\n onFocus={playSeEnter}\n onMouseEnter={playSeEnter}\n />\n </div>\n );\n};\n","import styles from '@/UI/Menu/Options/options.module.scss';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { NormalOption } from '@/UI/Menu/Options/NormalOption';\nimport { NormalButton } from '@/UI/Menu/Options/NormalButton';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { fullScreenOption, playSpeed, textFont, textSize } from '@/store/userDataInterface';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { TextPreview } from '@/UI/Menu/Options/TextPreview/TextPreview';\nimport useTrans from '@/hooks/useTrans';\nimport { OptionSlider } from '../OptionSlider';\n\nexport function Display() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const dispatch = useDispatch();\n const t = useTrans('menu.options.pages.display.options.');\n\n return (\n <div className={styles.Options_main_content_half}>\n <NormalOption key=\"fullScreen\" title={t('fullScreen.title')}>\n <NormalButton\n textList={t('fullScreen.options.on', 'fullScreen.options.off')}\n functionList={[\n () => {\n dispatch(setOptionData({ key: 'fullScreen', value: fullScreenOption.on }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'fullScreen', value: fullScreenOption.off }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.fullScreen}\n />\n </NormalOption>\n <NormalOption key=\"textSpeed\" title={t('textSpeed.title')}>\n <NormalButton\n textList={t('textSpeed.options.slow', 'textSpeed.options.medium', 'textSpeed.options.fast')}\n functionList={[\n () => {\n dispatch(setOptionData({ key: 'textSpeed', value: playSpeed.slow }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSpeed', value: playSpeed.normal }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSpeed', value: playSpeed.fast }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.textSpeed}\n />\n </NormalOption>\n <NormalOption key=\"textSize\" title={t('textSize.title')}>\n <NormalButton\n textList={t('textSize.options.small', 'textSize.options.medium', 'textSize.options.large')}\n functionList={[\n () => {\n dispatch(setOptionData({ key: 'textSize', value: textSize.small }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSize', value: textSize.medium }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textSize', value: textSize.large }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.textSize}\n />\n </NormalOption>\n <NormalOption key=\"textFont\" title={t('textFont.title')}>\n <NormalButton\n textList={t('textFont.options.siYuanSimSun', 'textFont.options.SimHei', 'textFont.options.lxgw')}\n functionList={[\n () => {\n dispatch(setOptionData({ key: 'textboxFont', value: textFont.song }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textboxFont', value: textFont.hei }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'textboxFont', value: textFont.lxgw }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.textboxFont}\n />\n </NormalOption>\n <NormalOption key=\"textboxOpacity\" title={t('textboxOpacity.title')}>\n <OptionSlider\n initValue={userDataState.optionData.textboxOpacity}\n uniqueID={t('textboxOpacity.title')}\n onChange={(event) => {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'textboxOpacity', value: Number(newValue) }));\n setStorage();\n }}\n />\n </NormalOption>\n <NormalOption full key=\"textPreview\" title={t('textPreview.title')}>\n {/* 这是一个临时的组件,用于模拟文本预览的效果 */}\n <TextPreview />\n </NormalOption>\n </div>\n );\n}\n","import styles from '@/UI/Menu/Options/options.module.scss';\nimport { NormalOption } from '@/UI/Menu/Options/NormalOption';\nimport { OptionSlider } from '@/UI/Menu/Options/OptionSlider';\nimport { NormalButton } from '@/UI/Menu/Options//NormalButton';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { setStorage } from '@/Core/controller/storage/storageController';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport useTrans from '@/hooks/useTrans';\nimport { voiceOption } from '@/store/userDataInterface';\n\nexport function Sound() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const dispatch = useDispatch();\n const t = useTrans('menu.options.pages.sound.options.');\n\n return (\n <div className={styles.Options_main_content_half}>\n <NormalOption key=\"option4\" title={t('volumeMain.title')}>\n <OptionSlider\n initValue={userDataState.optionData.volumeMain}\n uniqueID={t('volumeMain.title')}\n onChange={(event) => {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'volumeMain', value: Number(newValue) }));\n setStorage();\n }}\n />\n </NormalOption>\n <NormalOption key=\"option5\" title={t('vocalVolume.title')}>\n <OptionSlider\n initValue={userDataState.optionData.vocalVolume}\n uniqueID={t('vocalVolume.title')}\n onChange={(event) => {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'vocalVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n </NormalOption>\n <NormalOption key=\"option6\" title={t('bgmVolume.title')}>\n <OptionSlider\n initValue={userDataState.optionData.bgmVolume}\n uniqueID={t('bgmVolume.title')}\n onChange={(event) => {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'bgmVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n </NormalOption>\n <NormalOption key=\"option7\" title={t('seVolume.title')}>\n <OptionSlider\n initValue={userDataState.optionData.seVolume}\n uniqueID={t('seVolume.title')}\n onChange={(event) => {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'seVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n </NormalOption>\n <NormalOption key=\"option8\" title={t('uiSeVolume.title')}>\n <OptionSlider\n initValue={userDataState.optionData.uiSeVolume}\n uniqueID={t('uiSeVolume.title')}\n onChange={(event) => {\n const newValue = event.target.value;\n dispatch(setOptionData({ key: 'uiSeVolume', value: Number(newValue) }));\n setStorage();\n }}\n />\n </NormalOption>\n <NormalOption key=\"option9\" title={t('voiceOption.title')}>\n <NormalButton\n textList={t('voiceStop.title', 'voiceContinue.title')}\n functionList={[\n () => {\n dispatch(setOptionData({ key: 'voiceInterruption', value: voiceOption.yes }));\n setStorage();\n },\n () => {\n dispatch(setOptionData({ key: 'voiceInterruption', value: voiceOption.no }));\n setStorage();\n },\n ]}\n currentChecked={userDataState.optionData.voiceInterruption}\n />\n </NormalOption>\n </div>\n );\n}\n","import { FC, useEffect } from 'react';\nimport styles from './options.module.scss';\nimport { getStorage } from '@/Core/controller/storage/storageController';\nimport { useValue } from '@/hooks/useValue';\nimport { System } from '@/UI/Menu/Options/System/System';\nimport { Display } from '@/UI/Menu/Options/Display/Display';\nimport { Sound } from '@/UI/Menu/Options/Sound/Sound';\nimport useTrans from '@/hooks/useTrans';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nenum optionPage {\n 'System',\n 'Display',\n 'Sound',\n}\n\nexport const Options: FC = () => {\n const { playSeEnter, playSeSwitch } = useSoundEffect();\n const currentOptionPage = useValue(optionPage.System);\n useEffect(getStorage, []);\n\n function getClassName(page: optionPage) {\n if (page === currentOptionPage.value) {\n return styles.Options_page_button + ' ' + styles.Options_page_button_active;\n } else return styles.Options_page_button;\n }\n\n const t = useTrans('menu.options.');\n\n return (\n <div className={styles.Options_main}>\n <div className={styles.Options_top}>\n <div className={styles.Options_title}>\n <div className={styles.Option_title_text}>{t('title')}</div>\n </div>\n </div>\n <div className={styles.Options_page_container}>\n <div className={styles.Options_button_list}>\n <div\n onClick={() => {\n currentOptionPage.set(optionPage.System);\n playSeSwitch();\n }}\n className={getClassName(optionPage.System)}\n onMouseEnter={playSeEnter}\n >\n {t('pages.system.title')}\n </div>\n <div\n onClick={() => {\n currentOptionPage.set(optionPage.Display);\n playSeSwitch();\n }}\n className={getClassName(optionPage.Display)}\n onMouseEnter={playSeEnter}\n >\n {t('pages.display.title')}\n </div>\n <div\n onClick={() => {\n currentOptionPage.set(optionPage.Sound);\n playSeSwitch();\n }}\n className={getClassName(optionPage.Sound)}\n onMouseEnter={playSeEnter}\n >\n {t('pages.sound.title')}\n </div>\n </div>\n <div className={styles.Options_main_content}>\n {currentOptionPage.value === optionPage.Display && <Display />}\n {currentOptionPage.value === optionPage.System && <System />}\n {currentOptionPage.value === optionPage.Sound && <Sound />}\n </div>\n </div>\n </div>\n );\n};\n","import { FC } from 'react';\nimport styles from './menu.module.scss';\nimport { MenuPanel } from './MenuPanel/MenuPanel';\nimport { Save } from './SaveAndLoad/Save/Save';\nimport { Load } from './SaveAndLoad/Load/Load';\nimport { Options } from './Options/Options';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { MenuPanelTag } from '@/store/guiInterface';\n\n/**\n * Menu 页面,包括存读档、选项等\n * @constructor\n */\nconst Menu: FC = () => {\n const GUIState = useSelector((state: RootState) => state.GUI);\n let currentTag;\n // let menuBgColor = 'linear-gradient(135deg, rgba(253,251,251,0.95) 0%, rgba(235,237,238,1) 100%)';\n switch (GUIState.currentMenuTag) {\n case MenuPanelTag.Save:\n currentTag = <Save />;\n // menuBgColor = 'linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%)';\n break;\n case MenuPanelTag.Load:\n currentTag = <Load />;\n // menuBgColor = 'linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%)';\n break;\n case MenuPanelTag.Option:\n currentTag = <Options />;\n // menuBgColor = 'linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%)';\n break;\n }\n return (\n <>\n {GUIState.showMenuPanel && (\n <div className={styles.Menu_main}>\n <div className={styles.Menu_TagContent}>{currentTag}</div>\n <MenuPanel />\n </div>\n )}\n </>\n );\n};\n\nexport default Menu;\n","import { useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { setStage } from '@/store/stageReducer';\nimport { useEffect, useState } from 'react';\nimport { logger } from '@/Core/util/logger';\n\nexport const AudioContainer = () => {\n const stageStore = useSelector((webgalStore: RootState) => webgalStore.stage);\n const titleBgm = useSelector((webgalStore: RootState) => webgalStore.GUI.titleBgm);\n const isShowTitle = useSelector((webgalStore: RootState) => webgalStore.GUI.showTitle);\n const userDataState = useSelector((state: RootState) => state.userData);\n const mainVol = userDataState.optionData.volumeMain;\n const vocalVol = mainVol * 0.01 * userDataState.optionData.vocalVolume * 0.01 * stageStore.vocalVolume * 0.01;\n const bgmVol = mainVol * 0.01 * userDataState.optionData.bgmVolume * 0.01 * stageStore.bgm.volume * 0.01;\n const bgmEnter = stageStore.bgm.enter;\n const uiSoundEffects = stageStore.uiSe;\n const seVol = mainVol * 0.01 * (userDataState.optionData?.seVolume ?? 100) * 0.01;\n const uiSeVol = mainVol * 0.01 * (userDataState.optionData.uiSeVolume ?? 50) * 0.01;\n const isEnterGame = useSelector((state: RootState) => state.GUI.isEnterGame);\n\n // 淡入淡出定时器\n const [fadeTimer, setFadeTimer] = useState(setTimeout(() => {}, 0));\n\n /**\n * 淡入BGM\n * @param bgm 背景音乐\n * @param maxVol 最大音量\n * @param time 淡入时间\n */\n const bgmFadeIn = (bgm: HTMLAudioElement, maxVol: number, time: number) => {\n // 设置初始音量\n time >= 0 ? (bgm.volume = 0) : (bgm.volume = maxVol);\n // 设置音量递增时间间隔\n const duration = 10;\n // 计算每duration的音量增量\n const volumeStep = (maxVol / time) * duration;\n // 基于递归调用实现淡入淡出效果\n const fade = () => {\n const timer = setTimeout(() => {\n if (bgm.volume + volumeStep >= maxVol) {\n // 如果音量接近或达到最大值,则设置最终音量(淡入)\n bgm.volume = maxVol;\n } else if (bgm.volume + volumeStep <= 0) {\n // 如果音量接近或达到最小值,则设置最终音量(淡出)\n bgm.volume = 0;\n // 淡出效果结束后,将 bgm 置空\n webgalStore.dispatch(setStage({ key: 'bgm', value: { src: '', enter: 0, volume: 100 } }));\n } else {\n // 否则增加音量,并递归调用\n bgm.volume += volumeStep;\n fade();\n }\n }, duration);\n // 将定时器引用存储到 fadeTimer 中\n setFadeTimer(timer);\n };\n // 调用淡入淡出函数\n fade();\n };\n\n useEffect(() => {\n // 清除之前的淡入淡出定时器\n clearTimeout(fadeTimer);\n // 获取当前背景音乐元素\n const bgmElement = document.getElementById('currentBgm') as HTMLAudioElement;\n // 如果当前背景音乐元素存在,则淡入淡出\n if (bgmElement) {\n bgmEnter === 0 ? (bgmElement.volume = bgmVol) : bgmFadeIn(bgmElement, bgmVol, bgmEnter);\n }\n }, [isShowTitle, titleBgm, stageStore.bgm.src, bgmVol, bgmEnter]);\n\n useEffect(() => {\n logger.debug(`设置背景音量:${bgmVol}`);\n }, [bgmVol]);\n\n useEffect(() => {\n logger.debug(`设置背景音量淡入时间: ${bgmEnter}`);\n }, [bgmEnter]);\n\n useEffect(() => {\n logger.debug(`设置语音音量:${vocalVol}`);\n const vocalElement: any = document.getElementById('currentVocal');\n if (vocalElement) {\n vocalElement.volume = vocalVol.toString();\n }\n }, [vocalVol]);\n\n useEffect(() => {\n if (uiSoundEffects === '') return;\n const uiSeAudioElement = document.createElement('audio');\n uiSeAudioElement.src = uiSoundEffects;\n uiSeAudioElement.loop = false;\n // 设置音量\n if (!isNaN(uiSeVol)) {\n uiSeAudioElement.volume = uiSeVol;\n } else {\n // 针对原来使用 WebGAL version <= 4.4.2 的用户数据中不存在UI音效音量的情况\n logger.error('UI SE Vol is NaN');\n uiSeAudioElement.volume = isNaN(seVol) ? mainVol / 100 : seVol / 100;\n }\n // 播放UI音效\n uiSeAudioElement.play();\n uiSeAudioElement.addEventListener('ended', () => {\n // Processing after sound effects are played\n uiSeAudioElement.remove();\n });\n webgalStore.dispatch(setStage({ key: 'uiSe', value: '' }));\n }, [uiSoundEffects]);\n\n useEffect(() => {\n logger.debug(`设置音效音量: ${seVol}`);\n }, [seVol]);\n\n useEffect(() => {\n logger.debug(`设置用户界面音效音量: ${uiSeVol}`);\n }, [uiSeVol]);\n\n return (\n <div>\n <audio\n key={isShowTitle.toString() + titleBgm}\n id=\"currentBgm\"\n src={isShowTitle ? titleBgm : stageStore.bgm.src}\n loop={true}\n autoPlay={isEnterGame}\n />\n <audio id=\"currentVocal\" src={stageStore.playVocal} />\n </div>\n );\n};\n","import styles from './fullScreenPerform.module.scss';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\n\nexport const FullScreenPerform = () => {\n const stageState = useSelector((state: RootState) => state.stage);\n let stageWidth = '100%';\n let stageHeight = '100%';\n let top = '0';\n if (stageState.enableFilm !== '') {\n stageHeight = '76%';\n top = '12%';\n }\n return (\n <div className={styles.FullScreenPerform_main} style={{ width: stageWidth, height: stageHeight, top: top }}>\n <div id=\"videoContainer\" />\n </div>\n );\n};\n","import styles from './textboxFilm.module.scss';\nimport { useEffect } from 'react';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\n\nimport { PERFORM_CONFIG } from '@/config';\n\nexport const TextBoxFilm = () => {\n const stageState = useSelector((state: RootState) => state.stage);\n const userDataState = useSelector((state: RootState) => state.userData);\n useEffect(() => {});\n const textDelay = PERFORM_CONFIG.textInitialDelay - 20 * userDataState.optionData.textSpeed;\n const size = userDataState.optionData.textSize * 50 + 200 + '%';\n\n // 拆字\n const textArray: Array<string> = stageState.showText.split('');\n const textElementList = textArray.map((e, index) => {\n let delay = index * textDelay;\n let prevLength = stageState.currentConcatDialogPrev.length;\n if (stageState.currentConcatDialogPrev !== '' && index >= prevLength) {\n delay = delay - prevLength * textDelay;\n }\n if (index < prevLength) {\n return (\n <span\n id={`${delay}`}\n className={styles.TextBox_textElement_Settled}\n key={stageState.currentDialogKey + index}\n style={{ animationDelay: `${delay}ms` }}\n >\n {e}\n </span>\n );\n }\n return (\n <span\n id={`${delay}`}\n className={styles.TextBox_textElement_start}\n key={stageState.currentDialogKey + index}\n style={{ animationDelay: `${delay}ms` }}\n >\n {e}\n </span>\n );\n });\n return (\n <div id=\"textBoxMain\" className={styles.TextBox_main}>\n {/* <div id=\"miniAvatar\" className={styles.miniAvatarContainer}> */}\n {/* {stageState.miniAvatar !== '' && */}\n {/* <img className={styles.miniAvatarImg} alt=\"miniAvatar\" src={stageState.miniAvatar}/>} */}\n {/* </div> */}\n {/* {stageState.showName !== '' && */}\n {/* <div className={styles.TextBox_showName} style={{fontSize: '200%'}}>{stageState.showName}</div>} */}\n <div style={{ fontSize: size }}>{textElementList}</div>\n </div>\n );\n};\n","import { IStageState } from '@/store/stageInterface';\nimport { useEffect } from 'react';\nimport { logger } from '@/Core/util/logger';\nimport { IStageObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { setEbg } from '@/Core/gameScripts/changeBg/setEbg';\n\nimport { getEnterExitAnimation } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport function useSetBg(stageState: IStageState) {\n const bgName = stageState.bgName;\n\n /**\n * 设置背景\n */\n useEffect(() => {\n const thisBgKey = 'bg-main';\n if (bgName !== '') {\n const currentBg = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisBgKey);\n if (currentBg) {\n if (currentBg.sourceUrl !== bgName) {\n removeBg(currentBg);\n }\n }\n addBg(undefined, thisBgKey, bgName);\n setEbg(bgName);\n logger.debug('重设背景');\n const { duration, animation } = getEnterExitAnimation('bg-main', 'enter', true);\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, 'bg-main-softin', thisBgKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects('bg-main-softin'), duration);\n } else {\n const currentBg = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisBgKey);\n if (currentBg) {\n removeBg(currentBg);\n }\n }\n }, [bgName]);\n}\n\nfunction removeBg(bgObject: IStageObject) {\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects('bg-main-softin');\n const oldBgKey = bgObject.key;\n bgObject.key = 'bg-main-off';\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(oldBgKey);\n const { duration, animation } = getEnterExitAnimation('bg-main-off', 'exit', true);\n WebGAL.gameplay.pixiStage!.registerAnimation(animation, 'bg-main-softoff', 'bg-main-off');\n setTimeout(() => {\n WebGAL.gameplay.pixiStage?.removeAnimation('bg-main-softoff');\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey('bg-main-off');\n }, duration);\n}\n\nfunction addBg(type?: 'image' | 'spine', ...args: any[]) {\n const url = args[1];\n if (url.endsWith('.skel')) {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addSpineBg(...args);\n } else {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addBg(...args);\n }\n}\n","import { IEffect, IStageState } from '@/store/stageInterface';\nimport { useEffect } from 'react';\nimport { logger } from '@/Core/util/logger';\nimport { generateUniversalSoftInAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftIn';\nimport { IStageObject } from '@/Core/controller/stage/pixi/PixiController';\nimport { generateUniversalSoftOffAnimationObj } from '@/Core/controller/stage/pixi/animations/universalSoftOff';\n\nimport { getEnterExitAnimation } from '@/Core/Modules/animationFunctions';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport function useSetFigure(stageState: IStageState) {\n const { figNameLeft, figName, figNameRight, freeFigure, live2dMotion, live2dExpression } = stageState;\n\n /**\n * 同步 motion\n */\n useEffect(() => {\n for (const motion of live2dMotion) {\n WebGAL.gameplay.pixiStage?.changeModelMotionByKey(motion.target, motion.motion);\n }\n }, [live2dMotion]);\n\n /**\n * 同步 expression\n */\n useEffect(() => {\n for (const expression of live2dExpression) {\n WebGAL.gameplay.pixiStage?.changeModelExpressionByKey(expression.target, expression.expression);\n }\n }, [live2dExpression]);\n\n /**\n * 设置立绘\n */\n useEffect(() => {\n /**\n * 特殊处理:中间立绘\n */\n const thisFigKey = 'fig-center';\n const softInAniKey = 'fig-center-softin';\n if (figName !== '') {\n const currentFigCenter = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigCenter) {\n if (currentFigCenter.sourceUrl !== figName) {\n removeFig(currentFigCenter, softInAniKey, stageState.effects);\n }\n }\n addFigure(undefined, thisFigKey, figName, 'center');\n logger.debug('中立绘已重设');\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n } else {\n logger.debug('移除中立绘');\n const currentFigCenter = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigCenter) {\n if (currentFigCenter.sourceUrl !== figName) {\n removeFig(currentFigCenter, softInAniKey, stageState.effects);\n }\n }\n }\n }, [figName]);\n\n useEffect(() => {\n /**\n * 特殊处理:左侧立绘\n */\n const thisFigKey = 'fig-left';\n const softInAniKey = 'fig-left-softin';\n if (figNameLeft !== '') {\n const currentFigLeft = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigLeft) {\n if (currentFigLeft.sourceUrl !== figNameLeft) {\n removeFig(currentFigLeft, softInAniKey, stageState.effects);\n }\n }\n addFigure(undefined, thisFigKey, figNameLeft, 'left');\n logger.debug('左立绘已重设');\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n } else {\n logger.debug('移除左立绘');\n const currentFigLeft = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigLeft) {\n if (currentFigLeft.sourceUrl !== figNameLeft) {\n removeFig(currentFigLeft, softInAniKey, stageState.effects);\n }\n }\n }\n }, [figNameLeft]);\n\n useEffect(() => {\n /**\n * 特殊处理:右侧立绘\n */\n const thisFigKey = 'fig-right';\n const softInAniKey = 'fig-right-softin';\n if (figNameRight !== '') {\n const currentFigRight = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigRight) {\n if (currentFigRight.sourceUrl !== figNameRight) {\n removeFig(currentFigRight, softInAniKey, stageState.effects);\n }\n }\n addFigure(undefined, thisFigKey, figNameRight, 'right');\n logger.debug('右立绘已重设');\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n } else {\n const currentFigRight = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigRight) {\n if (currentFigRight.sourceUrl !== figNameRight) {\n removeFig(currentFigRight, softInAniKey, stageState.effects);\n }\n }\n }\n }, [figNameRight]);\n\n useEffect(() => {\n // 自由立绘\n for (const fig of freeFigure) {\n /**\n * 特殊处理:自由立绘\n */\n const thisFigKey = `${fig.key}`;\n const softInAniKey = `${fig.key}-softin`;\n /**\n * 非空\n */\n if (fig.name !== '') {\n const currentFigThisKey = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigThisKey) {\n if (currentFigThisKey.sourceUrl !== fig.name) {\n removeFig(currentFigThisKey, softInAniKey, stageState.effects);\n addFigure(undefined, thisFigKey, fig.name, fig.basePosition);\n logger.debug(`${fig.key}立绘已重设`);\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n }\n } else {\n addFigure(undefined, thisFigKey, fig.name, fig.basePosition);\n logger.debug(`${fig.key}立绘已重设`);\n const { duration, animation } = getEnterExitAnimation(thisFigKey, 'enter');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, softInAniKey, thisFigKey, stageState.effects);\n setTimeout(() => WebGAL.gameplay.pixiStage!.removeAnimationWithSetEffects(softInAniKey), duration);\n }\n } else {\n const currentFigThisKey = WebGAL.gameplay.pixiStage?.getStageObjByKey(thisFigKey);\n if (currentFigThisKey) {\n if (currentFigThisKey.sourceUrl !== fig.name) {\n removeFig(currentFigThisKey, softInAniKey, stageState.effects);\n }\n }\n }\n }\n\n /**\n * 移除不在状态表中的立绘\n */\n const currentFigures = WebGAL.gameplay.pixiStage?.getFigureObjects();\n if (currentFigures) {\n for (const existFigure of currentFigures) {\n if (\n existFigure.key === 'fig-left' ||\n existFigure.key === 'fig-center' ||\n existFigure.key === 'fig-right' ||\n existFigure.key.endsWith('-off')\n ) {\n // 什么也不做\n } else {\n const existKey = existFigure.key;\n const existFigInState = freeFigure.findIndex((fig) => fig.key === existKey);\n if (existFigInState < 0) {\n const softInAniKey = `${existFigure.key}-softin`;\n removeFig(existFigure, softInAniKey, stageState.effects);\n }\n }\n }\n }\n }, [freeFigure]);\n}\n\nfunction removeFig(figObj: IStageObject, enterTikerKey: string, effects: IEffect[]) {\n WebGAL.gameplay.pixiStage?.removeAnimationWithSetEffects(enterTikerKey);\n // 快进,跳过退出动画\n if (WebGAL.gameplay.isFast) {\n logger.debug('快速模式,立刻关闭立绘');\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(figObj.key);\n return;\n }\n const oldFigKey = figObj.key;\n figObj.key = figObj.key + '-off';\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(oldFigKey);\n const figKey = figObj.key;\n const leaveKey = figKey + '-softoff';\n const { duration, animation } = getEnterExitAnimation(figKey, 'exit');\n WebGAL.gameplay.pixiStage!.registerPresetAnimation(animation, leaveKey, figKey, effects);\n setTimeout(() => {\n WebGAL.gameplay.pixiStage?.removeAnimation(leaveKey);\n WebGAL.gameplay.pixiStage?.removeStageObjectByKey(figKey);\n }, duration);\n}\n\nfunction addFigure(type?: 'image' | 'live2D' | 'spine', ...args: any[]) {\n const url = args[1];\n if (url.endsWith('.json')) {\n return addLive2dFigure(...args);\n } else if (url.endsWith('.skel')) {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addSpineFigure(...args);\n } else {\n // @ts-ignore\n return WebGAL.gameplay.pixiStage?.addFigure(...args);\n }\n}\n\n/**\n * 如果要使用 Live2D,取消这里的注释\n * @param args\n */\nfunction addLive2dFigure(...args: any[]) {\n // @ts-ignore\n // return WebGAL.gameplay.pixiStage?.addLive2dFigure(...args);\n}\n","import { baseTransform, IEffect, IStageState, ITransform } from '@/store/stageInterface';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport function setStageObjectEffects(stageState: IStageState) {\n const effects = stageState.effects;\n setTimeout(() => {\n setStageEffects(effects);\n }, 10);\n}\n\nexport function setStageEffects(effects: IEffect[]) {\n const stageObjects = WebGAL.gameplay.pixiStage?.getAllStageObj() ?? [];\n for (const stageObj of stageObjects) {\n const key = stageObj.key;\n const effect = effects.find((effect) => effect.target === key);\n const lockedStageTargets = WebGAL.gameplay.pixiStage?.getAllLockedObject() ?? [];\n if (!lockedStageTargets.includes(key)) {\n if (effect) {\n // logger.debug('应用effects', key);\n const targetPixiContainer = WebGAL.gameplay.pixiStage?.getStageObjByKey(key);\n if (targetPixiContainer) {\n const container = targetPixiContainer.pixiContainer;\n Object.assign(container, convertTransform(effect.transform));\n }\n } else {\n const targetPixiContainer = WebGAL.gameplay.pixiStage?.getStageObjByKey(key);\n if (targetPixiContainer) {\n const container = targetPixiContainer.pixiContainer;\n Object.assign(container, convertTransform(baseTransform));\n }\n }\n }\n }\n}\n\nfunction convertTransform(transform: ITransform | undefined) {\n if (!transform) {\n return {};\n }\n const { position, alpha, ...rest } = transform;\n return { ...rest, x: position.x, y: position.y, alphaFilterVal: alpha };\n}\n","import { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useSetBg } from '@/Stage/MainStage/useSetBg';\nimport { useSetFigure } from '@/Stage/MainStage/useSetFigure';\nimport { setStageObjectEffects } from '@/Stage/MainStage/useSetEffects';\n\nexport function MainStage() {\n const stageState = useSelector((state: RootState) => state.stage);\n useSetBg(stageState);\n useSetFigure(stageState);\n setStageObjectEffects(stageState);\n return <div style={{ display: 'none' }} />;\n}\n","import styles from './introContainer.module.scss';\n\nexport default function IntroContainer() {\n return <div className={styles.introContainer} id=\"introContainer\" />;\n}\n","import React, { FC } from 'react';\nimport styles from './stage.module.scss';\nimport { TextBox } from './TextBox/TextBox';\nimport { AudioContainer } from './AudioContainer/AudioContainer';\nimport { FullScreenPerform } from './FullScreenPerform/FullScreenPerform';\nimport { nextSentence } from '@/Core/controller/gamePlay/nextSentence';\nimport { stopAll } from '@/Core/controller/gamePlay/fastSkip';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { TextBoxFilm } from '@/Stage/TextBox/TextBoxFilm';\nimport { useHotkey } from '@/hooks/useHotkey';\nimport { MainStage } from '@/Stage/MainStage/MainStage';\nimport IntroContainer from '@/Stage/introContainer/IntroContainer';\nimport { isIOS } from '@/Core/initializeScript';\nimport { WebGAL } from '@/Core/WebGAL';\nimport { IGuiState } from '@/store/guiInterface';\nimport { IStageState } from '@/store/stageInterface';\n// import OldStage from '@/Components/Stage/OldStage/OldStage';\n\nfunction inTextBox(event: React.MouseEvent) {\n const tb = document.getElementById('textBoxMain');\n if (!tb) {\n return false;\n }\n let bounds = tb.getBoundingClientRect();\n return (\n event.clientX > bounds.left &&\n event.clientX < bounds.right &&\n event.clientY > bounds.top &&\n event.clientY < bounds.bottom\n );\n}\n\nfunction checkMousePosition(event: React.MouseEvent, GUIState: IGuiState, dispatch: ReturnType<typeof useDispatch>) {\n if (!GUIState.controlsVisibility && inTextBox(event)) {\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: true }));\n }\n if (GUIState.controlsVisibility && !inTextBox(event)) {\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: false }));\n }\n}\n\nfunction isTextboxHidden(stageState: IStageState, GUIState: IGuiState) {\n if (!GUIState.showTextBox) {\n return true;\n }\n\n if (stageState.isDisableTextbox) {\n return true;\n }\n\n const isText = stageState.showText !== '' || stageState.showName !== '';\n if (!isText) {\n return true;\n }\n\n const isInIntro = document.getElementById('introContainer')?.style.display === 'block';\n if (isInIntro) {\n return true;\n }\n\n return false;\n}\n\nlet timeoutEventHandle: ReturnType<typeof setTimeout> | null = null;\n\n/**\n * 检查并更新控制可见性\n * @param event 鼠标移动事件\n * @param stageState 场景状态\n * @param GUIState GUI状态\n * @param dispatch Redux dispatch函数\n */\n// eslint-disable-next-line max-params\nfunction updateControlsVisibility(\n event: React.MouseEvent,\n stageState: IStageState,\n GUIState: IGuiState,\n dispatch: ReturnType<typeof useDispatch>,\n) {\n if (isTextboxHidden(stageState, GUIState)) {\n // 当文本框被隐藏时\n // 逻辑:鼠标移动时显示,一段时间(默认:1秒)后隐藏\n if (timeoutEventHandle) {\n clearTimeout(timeoutEventHandle);\n }\n\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: true }));\n timeoutEventHandle = setTimeout(() => {\n dispatch(setVisibility({ component: 'controlsVisibility', visibility: false }));\n }, 1000);\n } else {\n // 当文本框正常显示时\n // 逻辑:鼠标位置在文本框内时显示\n checkMousePosition(event, GUIState, dispatch);\n }\n}\n\nexport const Stage: FC = () => {\n const stageState = useSelector((state: RootState) => state.stage);\n const GUIState = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n\n useHotkey();\n\n return (\n <div className={styles.MainStage_main}>\n <FullScreenPerform />\n {/* 已弃用旧的立绘与背景舞台 */}\n {/* <OldStage /> */}\n <MainStage />\n <div id=\"pixiContianer\" className={styles.pixiContainer} style={{ zIndex: isIOS ? '-5' : undefined }} />\n <div id=\"chooseContainer\" className={styles.chooseContainer} />\n {GUIState.showTextBox && stageState.enableFilm === '' && !stageState.isDisableTextbox && <TextBox />}\n {GUIState.showTextBox && stageState.enableFilm !== '' && <TextBoxFilm />}\n <AudioContainer />\n <div\n onClick={() => {\n // 如果文本框没有显示,则显示文本框\n if (!GUIState.showTextBox) {\n dispatch(setVisibility({ component: 'showTextBox', visibility: true }));\n return;\n }\n stopAll();\n nextSentence();\n }}\n onDoubleClick={() => {\n WebGAL.events.fullscreenDbClick.emit();\n }}\n id=\"FullScreenClick\"\n style={{ width: '100%', height: '100%', position: 'absolute', zIndex: '12', top: '0' }}\n onMouseMove={(e) => !GUIState.showControls && updateControlsVisibility(e, stageState, GUIState, dispatch)}\n />\n <IntroContainer />\n </div>\n );\n};\n","import {\n AlignTextLeftOne,\n DoubleRight,\n FolderOpen,\n Home,\n PlayOne,\n PreviewCloseOne,\n PreviewOpen,\n ReplayMusic,\n Save,\n SettingTwo,\n DoubleDown,\n DoubleUp,\n Lock,\n Unlock,\n} from '@icon-park/react';\nimport styles from './bottomControlPanel.module.scss';\nimport { switchAuto } from '@/Core/controller/gamePlay/autoPlay';\nimport { switchFast } from '@/Core/controller/gamePlay/fastSkip';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setMenuPanelTag, setVisibility } from '@/store/GUIReducer';\nimport { componentsVisibility, MenuPanelTag } from '@/store/guiInterface';\nimport { backToTitle } from '@/Core/controller/gamePlay/backToTitle';\nimport { saveGame } from '@/Core/controller/storage/saveGame';\nimport { loadGame } from '@/Core/controller/storage/loadGame';\nimport useTrans from '@/hooks/useTrans';\nimport { useTranslation } from 'react-i18next';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { showGlogalDialog, switchControls } from '@/UI/GlobalDialog/GlobalDialog';\nimport { useEffect } from 'react';\nimport { getSavesFromStorage } from '@/Core/controller/storage/savesController';\n\nexport const BottomControlPanel = () => {\n const t = useTrans('gaming.');\n const strokeWidth = 2.5;\n const { i18n } = useTranslation();\n const { playSeEnter, playSeClick, playSeDialogOpen } = useSoundEffect();\n const lang = i18n.language;\n const isFr = lang === 'fr';\n let size = 42;\n let fontSize = '150%';\n if (isFr) {\n fontSize = '125%';\n size = 40;\n }\n const GUIStore = useSelector((state: RootState) => state.GUI);\n const stageState = useSelector((state: RootState) => state.stage);\n const dispatch = useDispatch();\n const setComponentVisibility = (component: keyof componentsVisibility, visibility: boolean) => {\n dispatch(setVisibility({ component, visibility }));\n };\n const setMenuPanel = (menuPanel: MenuPanelTag) => {\n dispatch(setMenuPanelTag(menuPanel));\n };\n\n const saveData = useSelector((state: RootState) => state.saveData.saveData);\n let fastSlPreview = (\n <div style={{ height: '100%', width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>\n <div style={{ fontSize: '125%' }}>{t('noSaving')}</div>\n </div>\n );\n if (saveData[0]) {\n const data = saveData[0];\n fastSlPreview = (\n <div className={styles.slPreviewMain}>\n <div className={styles.imgContainer}>\n <img style={{ height: '100%' }} alt=\"q-save-preview image\" src={data.previewImage} />\n </div>\n <div className={styles.textContainer}>\n <div>{data.nowStageState.showName}</div>\n <div style={{ fontSize: '75%', color: 'rgb(55,60,56)' }}>{data.nowStageState.showText}</div>\n </div>\n </div>\n );\n }\n\n return (\n // <div className={styles.ToCenter}>\n <>\n {GUIStore.showTextBox && stageState.enableFilm === '' && (\n <div className={styles.main} style={{ visibility: GUIStore.controlsVisibility ? 'visible' : 'hidden' }}>\n {GUIStore.showTextBox && (\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n setComponentVisibility('showTextBox', false);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <PreviewCloseOne\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.hide')}</span>\n </span>\n )}\n {!GUIStore.showTextBox && (\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n setComponentVisibility('showTextBox', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <PreviewOpen\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.show')}</span>\n </span>\n )}\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n setComponentVisibility('showBacklog', true);\n setComponentVisibility('showTextBox', false);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <AlignTextLeftOne\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.backlog')}</span>\n </span>\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n let VocalControl: any = document.getElementById('currentVocal');\n if (VocalControl !== null) {\n VocalControl.currentTime = 0;\n VocalControl.pause();\n VocalControl?.play();\n }\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <ReplayMusic\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.replay')}</span>\n </span>\n <span\n id=\"Button_ControlPanel_auto\"\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n switchAuto();\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <PlayOne className={styles.button} theme=\"outline\" size={size} fill=\"#f5f5f7\" strokeWidth={strokeWidth} />\n <span className={styles.button_text}>{t('buttons.auto')}</span>\n </span>\n <span\n id=\"Button_ControlPanel_fast\"\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n switchFast();\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <DoubleRight\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.forward')}</span>\n </span>\n <span\n className={styles.singleButton + ' ' + styles.fastsave}\n style={{ fontSize }}\n onClick={() => {\n saveGame(0);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <DoubleDown\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.quicklySave')}</span>\n <div className={styles.fastSlPreview + ' ' + styles.fastSPreview}>{fastSlPreview}</div>\n </span>\n <span\n className={styles.singleButton + ' ' + styles.fastload}\n style={{ fontSize }}\n onClick={() => {\n loadGame(0);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <DoubleUp className={styles.button} theme=\"outline\" size={size} fill=\"#f5f5f7\" strokeWidth={strokeWidth} />\n <span className={styles.button_text}>{t('buttons.quicklyLoad')}</span>\n <div className={styles.fastSlPreview + ' ' + styles.fastLPreview}>{fastSlPreview}</div>\n </span>\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n setMenuPanel(MenuPanelTag.Save);\n setComponentVisibility('showMenuPanel', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <Save className={styles.button} theme=\"outline\" size={size} fill=\"#f5f5f7\" strokeWidth={strokeWidth} />\n <span className={styles.button_text}>{t('buttons.save')}</span>\n </span>\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n setMenuPanel(MenuPanelTag.Load);\n setComponentVisibility('showMenuPanel', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <FolderOpen\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.load')}</span>\n </span>\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n setMenuPanel(MenuPanelTag.Option);\n setComponentVisibility('showMenuPanel', true);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n <SettingTwo\n className={styles.button}\n theme=\"outline\"\n size={size}\n fill=\"#f5f5f7\"\n strokeWidth={strokeWidth}\n />\n <span className={styles.button_text}>{t('buttons.options')}</span>\n </span>\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n playSeDialogOpen();\n showGlogalDialog({\n title: t('buttons.titleTips'),\n leftText: t('$common.yes'),\n rightText: t('$common.no'),\n leftFunc: () => {\n backToTitle();\n },\n rightFunc: () => {},\n });\n }}\n onMouseEnter={playSeEnter}\n >\n <Home className={styles.button} theme=\"outline\" size={size} fill=\"#f5f5f7\" strokeWidth={strokeWidth} />\n <span className={styles.button_text}>{t('buttons.title')}</span>\n </span>\n <span\n className={styles.singleButton}\n style={{ fontSize }}\n onClick={() => {\n switchControls();\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n >\n {GUIStore.showControls ? (\n <Lock className={styles.button} theme=\"outline\" size={size} fill=\"#f5f5f7\" strokeWidth={strokeWidth} />\n ) : (\n <Unlock className={styles.button} theme=\"outline\" size={size} fill=\"#f5f5f7\" strokeWidth={strokeWidth} />\n )}\n </span>\n </div>\n )}\n </>\n // </div>\n );\n};\n","import styles from './backlog.module.scss';\nimport { CloseSmall, Return, VolumeNotice } from '@icon-park/react';\nimport { jumpFromBacklog } from '@/Core/controller/storage/jumpFromBacklog';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState, webgalStore } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { logger } from '@/Core/util/logger';\nimport { ReactNode, useEffect, useMemo, useRef, useState } from 'react';\nimport useTrans from '@/hooks/useTrans';\nimport { compileSentence, EnhancedNode, splitChars } from '@/Stage/TextBox/TextBox';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport const Backlog = () => {\n const t = useTrans('gaming.');\n // logger.info('Backlog render');\n const { playSeEnter, playSeClick } = useSoundEffect();\n const GUIStore = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n const iconSize = '0.8em';\n const [indexHide, setIndexHide] = useState(false);\n const [isDisableScroll, setIsDisableScroll] = useState(false);\n let timeRef = useRef<ReturnType<typeof setTimeout>>();\n // 缓存一下vdom\n const backlogList = useMemo<any>(() => {\n let backlogs = [];\n // logger.info('backlogList render');\n for (let i = 0; i < WebGAL.backlogManager.getBacklog().length; i++) {\n const backlogItem = WebGAL.backlogManager.getBacklog()[i];\n const showTextArray = compileSentence(backlogItem.currentStageState.showText, 3, true);\n const showTextArray2 = showTextArray.map((line) => {\n return line.map((c) => {\n return c.reactNode;\n });\n });\n const showTextArrayReduced = mergeStringsAndKeepObjects(showTextArray2);\n const showTextElementList = showTextArrayReduced.map((line, index) => {\n return (\n <div key={`backlog-line-${index}`}>\n {line.map((e, index) => {\n if (e === '<br />') {\n return <br key={`br${index}`} />;\n } else {\n return e;\n }\n })}\n </div>\n );\n });\n const singleBacklogView = (\n <div\n className={styles.backlog_item}\n style={{ animationDelay: `${20 * (WebGAL.backlogManager.getBacklog().length - i)}ms` }}\n key={'backlogItem' + backlogItem.currentStageState.showText + backlogItem.saveScene.currentSentenceId}\n >\n <div className={styles.backlog_func_area}>\n <div className={styles.backlog_item_button_list}>\n <div\n onClick={(e) => {\n playSeClick();\n jumpFromBacklog(i);\n e.preventDefault();\n e.stopPropagation();\n }}\n onMouseEnter={playSeEnter}\n className={styles.backlog_item_button_element}\n >\n <Return theme=\"outline\" size={iconSize} fill=\"#ffffff\" strokeWidth={3} />\n </div>\n {backlogItem.currentStageState.vocal ? (\n <div\n onClick={() => {\n playSeClick();\n // 获取到播放 backlog 语音的元素\n const backlog_audio_element: any = document.getElementById('backlog_audio_play_element_' + i);\n if (backlog_audio_element) {\n backlog_audio_element.currentTime = 0;\n const userDataStore = webgalStore.getState().userData;\n const mainVol = userDataStore.optionData.volumeMain;\n backlog_audio_element.volume = mainVol * 0.01 * userDataStore.optionData.vocalVolume * 0.01;\n backlog_audio_element?.play();\n }\n }}\n onMouseEnter={playSeEnter}\n className={styles.backlog_item_button_element}\n >\n <VolumeNotice theme=\"outline\" size={iconSize} fill=\"#ffffff\" strokeWidth={3} />\n </div>\n ) : null}\n </div>\n <div className={styles.backlog_item_content_name}>{backlogItem.currentStageState.showName}</div>\n </div>\n <div className={styles.backlog_item_content}>\n <span className={styles.backlog_item_content_text}>{showTextElementList}</span>\n </div>\n <audio id={'backlog_audio_play_element_' + i} src={backlogItem.currentStageState.vocal} />\n </div>\n );\n backlogs.unshift(singleBacklogView);\n }\n return backlogs;\n }, [\n WebGAL.backlogManager.getBacklog()[WebGAL.backlogManager.getBacklog().length - 1]?.saveScene?.currentSentenceId ??\n 0,\n ]);\n useEffect(() => {\n /* 切换为展示历史记录时触发 */\n if (GUIStore.showBacklog) {\n // logger.info('展示backlog');\n // 立即清除 防止来回滚动时可能导致的错乱\n if (timeRef.current) {\n clearTimeout(timeRef.current);\n }\n // setIsDisableScroll(false);\n // 重新把index调回正数\n setIndexHide(false);\n // 向上滑动触发回想时会带着backlog一起滑一下 我也不知道为什么,可能是我的鼠标问题 所以先ban掉滚动\n setIsDisableScroll(true);\n // nextTick开启滚动\n setTimeout(() => {\n setIsDisableScroll(false);\n }, 0);\n } else {\n /* 隐藏历史记录触发 */\n // 这里是为了让backlog的z-index降低\n timeRef.current = setTimeout(() => {\n setIndexHide(true);\n // setIsDisableScroll(false);\n // setIsDisableScroll(true);\n timeRef.current = undefined;\n // 700是和动画一样的延时 保险起见多个80ms\n // 不加也没啥 问题不大\n }, 700 + 80);\n }\n }, [GUIStore.showBacklog]);\n return (\n <>\n {\n // ${indexHide ? styles.Backlog_main_out_IndexHide : ''}\n <div\n className={`\n ${GUIStore.showBacklog ? styles.Backlog_main : styles.Backlog_main_out}\n ${indexHide ? styles.Backlog_main_out_IndexHide : ''}\n `}\n >\n <div className={styles.backlog_top}>\n <CloseSmall\n className={styles.backlog_top_icon}\n onClick={() => {\n playSeClick();\n dispatch(setVisibility({ component: 'showBacklog', visibility: false }));\n dispatch(setVisibility({ component: 'showTextBox', visibility: true }));\n }}\n onMouseEnter={playSeEnter}\n theme=\"outline\"\n size=\"4em\"\n fill=\"#ffffff\"\n strokeWidth={3}\n />\n <div\n className={styles.backlog_title}\n onClick={() => {\n logger.info('Rua! Testing');\n }}\n >\n {t('buttons.backlog')}\n </div>\n </div>\n {GUIStore.showBacklog && (\n <div className={`${styles.backlog_content} ${isDisableScroll ? styles.Backlog_main_DisableScroll : ''}`}>\n {backlogList}\n </div>\n )}\n </div>\n }\n </>\n );\n};\n\nfunction mergeStringsAndKeepObjects(arr: ReactNode[]): ReactNode[][] {\n let result = [];\n let currentString = '';\n\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < arr.length; i++) {\n const currentItem = arr[i];\n\n if (typeof currentItem === 'string') {\n currentString += currentItem;\n } else {\n if (currentString !== '') {\n result.push(currentString);\n currentString = '';\n }\n result.push(currentItem);\n }\n }\n\n if (currentString !== '') {\n result.push(currentString);\n }\n\n return result as ReactNode[][];\n}\n","import { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport React from 'react';\nimport styles from '@/UI/Extra/extra.module.scss';\nimport { useValue } from '@/hooks/useValue';\nimport { setStage } from '@/store/stageReducer';\nimport { GoEnd, GoStart, MusicList, PlayOne, SquareSmall } from '@icon-park/react';\nimport useSoundEffect from '@/hooks/useSoundEffect';\nimport { setGuiAsset } from '@/store/GUIReducer';\n\nexport function ExtraBgm() {\n const { playSeClick, playSeEnter } = useSoundEffect();\n // 检查当前正在播放的bgm是否在bgm列表内\n const currentBgmSrc = useSelector((state: RootState) => state.GUI.titleBgm);\n const extraState = useSelector((state: RootState) => state.userData.appreciationData);\n const initName = 'Title_BGM';\n // 是否展示 bgm 列表\n const isShowBgmList = useValue(false);\n let foundCurrentBgmName = initName;\n let foundCurrentBgmIndex = -1;\n const iconSize = 39;\n const bgmPlayerHeight = isShowBgmList.value ? '80%' : '10%';\n const bgmListLen = extraState.bgm.length;\n extraState.bgm.forEach((e, i) => {\n if (e.url === currentBgmSrc) {\n foundCurrentBgmName = e.name;\n foundCurrentBgmIndex = i;\n }\n });\n const currentPlayingBgmName = useValue('');\n if (foundCurrentBgmName !== initName && foundCurrentBgmName !== currentPlayingBgmName.value) {\n currentPlayingBgmName.set(foundCurrentBgmName);\n }\n const dispatch = useDispatch();\n\n function setBgmByIndex(index: number) {\n const e = extraState.bgm[index];\n currentPlayingBgmName.set(e.name);\n dispatch(setGuiAsset({ asset: 'titleBgm', value: e.url }));\n }\n\n const showBgmList = extraState.bgm.map((e, i) => {\n let className = styles.bgmElement;\n if (e.name === currentPlayingBgmName.value) {\n className = className + ' ' + styles.bgmElement_active;\n }\n return (\n <div\n onClick={() => {\n playSeClick();\n currentPlayingBgmName.set(e.name);\n dispatch(setGuiAsset({ asset: 'titleBgm', value: e.url }));\n }}\n key={e.name}\n className={className}\n style={{\n animationDelay: `${i * 150}ms`,\n }}\n onMouseEnter={playSeEnter}\n >\n {e.name}\n </div>\n );\n });\n return (\n <div className={styles.bgmContainer} style={{ maxHeight: bgmPlayerHeight }}>\n <div className={styles.bgmPlayerMain}>\n <div\n onClick={() => {\n playSeClick();\n if (foundCurrentBgmIndex <= 0) {\n setBgmByIndex(bgmListLen - 1);\n } else {\n setBgmByIndex(foundCurrentBgmIndex - 1);\n }\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n <GoStart theme=\"filled\" size={iconSize} fill=\"#fff\" strokeWidth={3} strokeLinejoin=\"miter\" />\n </div>\n <div\n onClick={() => {\n playSeClick();\n const bgmControl: HTMLAudioElement = document.getElementById('currentBgm') as HTMLAudioElement;\n bgmControl?.play().then();\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n <PlayOne theme=\"filled\" size={iconSize} fill=\"#fff\" strokeWidth={3} strokeLinejoin=\"miter\" />\n </div>\n <div\n onClick={() => {\n playSeClick();\n if (foundCurrentBgmIndex >= bgmListLen - 1) {\n setBgmByIndex(0);\n } else {\n setBgmByIndex(foundCurrentBgmIndex + 1);\n }\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n <GoEnd theme=\"filled\" size={iconSize} fill=\"#fff\" strokeWidth={3} strokeLinejoin=\"miter\" />\n </div>\n <div\n onClick={() => {\n playSeClick();\n const bgmControl: HTMLAudioElement = document.getElementById('currentBgm') as HTMLAudioElement;\n bgmControl.pause();\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n >\n <SquareSmall theme=\"filled\" size={iconSize} fill=\"#fff\" strokeWidth={3} strokeLinejoin=\"miter\" />\n </div>\n <div className={styles.bgmName}>{foundCurrentBgmName}</div>\n <div\n onClick={() => {\n playSeClick();\n isShowBgmList.set(!isShowBgmList.value);\n }}\n onMouseEnter={playSeEnter}\n className={styles.bgmControlButton}\n style={{ marginLeft: 'auto' }}\n >\n <MusicList theme=\"filled\" size={iconSize} fill=\"#fff\" strokeWidth={3} strokeLinejoin=\"miter\" />\n </div>\n </div>\n {isShowBgmList.value && <div className={styles.bgmListContainer}> {showBgmList}</div>}\n </div>\n );\n}\n","import { useValue } from '@/hooks/useValue';\nimport styles from '@/UI/Extra/extra.module.scss';\nimport React from 'react';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\ninterface IProps {\n name: string;\n imgUrl: string;\n transformDeg: number;\n index: number;\n}\n\nexport function ExtraCgElement(props: IProps) {\n const showFull = useValue(false);\n const { playSeEnter, playSeClick } = useSoundEffect();\n return (\n <>\n {showFull.value && (\n <div\n onClick={() => {\n showFull.set(!showFull.value);\n playSeClick();\n }}\n className={styles.showFullContainer}\n onMouseEnter={playSeEnter}\n >\n <div className={styles.showFullCgMain}>\n <div\n style={{\n backgroundImage: `url('${props.imgUrl}')`,\n backgroundSize: `cover`,\n backgroundPosition: 'center',\n width: '100%',\n height: '100%',\n }}\n />\n </div>\n </div>\n )}\n <div\n onClick={() => {\n showFull.set(!showFull.value);\n playSeClick();\n }}\n onMouseEnter={playSeEnter}\n style={{\n // transform: `rotate(${deg}deg)`,\n animation: `cg_softIn_${props.transformDeg} 1.5s ease-out ${100 + props.index * 100}ms forwards `,\n }}\n key={props.name}\n className={styles.cgElement}\n >\n <div\n style={{\n backgroundImage: `url('${props.imgUrl}')`,\n backgroundSize: `cover`,\n backgroundPosition: 'center',\n width: '100%',\n height: '100%',\n }}\n />\n </div>\n </>\n );\n}\n","import styles from '@/UI/Extra/extra.module.scss';\nimport React from 'react';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useValue } from '@/hooks/useValue';\nimport './extraCG_animation_List.scss';\nimport { ExtraCgElement } from '@/UI/Extra/ExtraCgElement';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport function ExtraCg() {\n const cgPerPage = 8;\n const extraState = useSelector((state: RootState) => state.userData.appreciationData);\n const pageNumber = Math.ceil(extraState.cg.length / cgPerPage);\n // const pageNumber = 10;\n const currentPage = useValue(1);\n const { playSeEnter, playSeClick } = useSoundEffect();\n\n // 开始生成立绘鉴赏的图片\n const showCgList = [];\n const len = extraState.cg.length;\n for (\n let i = (currentPage.value - 1) * cgPerPage;\n i < Math.min(len, (currentPage.value - 1) * cgPerPage + cgPerPage);\n i++\n ) {\n const index = i - (currentPage.value - 1) * cgPerPage;\n const deg = Random(-5, 5);\n const temp = (\n <ExtraCgElement\n name={extraState.cg[i].name}\n imgUrl={extraState.cg[i].url}\n transformDeg={deg}\n index={index}\n key={index.toString() + extraState.cg[i].url}\n />\n );\n showCgList.push(temp);\n }\n\n // 生成cg鉴赏的导航\n const showNav = [];\n for (let i = 1; i <= pageNumber; i++) {\n let className = styles.cgNav;\n if (currentPage.value === i) {\n className = className + ' ' + styles.cgNav_active;\n }\n const temp = (\n <div\n onClick={() => {\n currentPage.set(i);\n playSeClick();\n }}\n key={'nav' + i}\n onMouseEnter={playSeEnter}\n className={className}\n >\n {i}\n </div>\n );\n showNav.push(temp);\n }\n\n return (\n <div className={styles.cgMain}>\n <div className={styles.cgShowDiv}>\n <div className={styles.cgShowDivWarpper}>{showNav}</div>\n </div>\n <div className={styles.cgContainer}>{showCgList}</div>\n </div>\n );\n}\n\nfunction Random(min: number, max: number) {\n return Math.round(Math.random() * (max - min)) + min;\n}\n","import styles from './extra.module.scss';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setVisibility } from '@/store/GUIReducer';\nimport { CloseSmall } from '@icon-park/react';\nimport { ExtraBgm } from '@/UI/Extra/ExtraBgm';\nimport { ExtraCg } from './ExtraCg';\nimport useTrans from '@/hooks/useTrans';\nimport useSoundEffect from '@/hooks/useSoundEffect';\n\nexport function Extra() {\n const { playSeClick } = useSoundEffect();\n const showExtra = useSelector((state: RootState) => state.GUI.showExtra);\n const dispatch = useDispatch();\n\n const t = useTrans('extra.');\n return (\n <>\n {showExtra && (\n <div className={styles.extra}>\n <div className={styles.extra_top}>\n <CloseSmall\n className={styles.extra_top_icon}\n onClick={() => {\n dispatch(setVisibility({ component: 'showExtra', visibility: false }));\n playSeClick();\n }}\n onMouseEnter={playSeClick}\n theme=\"outline\"\n size=\"4em\"\n fill=\"#fff\"\n strokeWidth={3}\n />\n <div className={styles.extra_title}>{t('title')}</div>\n </div>\n <div className={styles.mainContainer}>\n <ExtraCg />\n <ExtraBgm />\n </div>\n </div>\n )}\n </>\n );\n}\n","import styles from './bottomControlPanelFilm.module.scss';\nimport { switchAuto } from '@/Core/controller/gamePlay/autoPlay';\nimport { switchFast } from '@/Core/controller/gamePlay/fastSkip';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { setMenuPanelTag, setVisibility } from '@/store/GUIReducer';\nimport { componentsVisibility, MenuPanelTag } from '@/store/guiInterface';\nimport { backToTitle } from '@/Core/controller/gamePlay/backToTitle';\nimport { useValue } from '@/hooks/useValue';\nimport { HamburgerButton } from '@icon-park/react';\n\nexport const BottomControlPanelFilm = () => {\n const showPanel = useValue(false);\n const stageState = useSelector((state: RootState) => state.stage);\n const dispatch = useDispatch();\n const setComponentVisibility = (component: keyof componentsVisibility, visibility: boolean) => {\n dispatch(setVisibility({ component, visibility }));\n };\n const setMenuPanel = (menuPanel: MenuPanelTag) => {\n dispatch(setMenuPanelTag(menuPanel));\n };\n return (\n <>\n {stageState.enableFilm !== '' && (\n <>\n <div\n className={styles.tag}\n onClick={() => {\n showPanel.set(!showPanel.value);\n }}\n >\n <HamburgerButton theme=\"outline\" size=\"32\" fill=\"#fff\" />\n </div>\n {showPanel.value && (\n <div className={styles.container}>\n <span\n className={styles.singleButton}\n onClick={() => {\n setComponentVisibility('showBacklog', true);\n setComponentVisibility('showTextBox', false);\n showPanel.set(!showPanel.value);\n }}\n >\n <span className={styles.button_text}>剧情回想 / BACKLOG</span>\n </span>\n <span\n className={styles.singleButton}\n onClick={() => {\n showPanel.set(!showPanel.value);\n let VocalControl: any = document.getElementById('currentVocal');\n if (VocalControl !== null) {\n VocalControl.currentTime = 0;\n VocalControl.pause();\n VocalControl?.play();\n }\n }}\n >\n <span className={styles.button_text}>重播语音 / REPLAY VOICE</span>\n </span>\n <span\n id=\"Button_ControlPanel_auto\"\n className={styles.singleButton}\n onClick={() => {\n switchAuto();\n showPanel.set(!showPanel.value);\n }}\n >\n <span className={styles.button_text}>自动模式 / AUTO</span>\n </span>\n <span\n id=\"Button_ControlPanel_fast\"\n className={styles.singleButton}\n onClick={() => {\n switchFast();\n showPanel.set(!showPanel.value);\n }}\n >\n <span className={styles.button_text}>快进 / FAST</span>\n </span>\n <span\n className={styles.singleButton}\n onClick={() => {\n showPanel.set(!showPanel.value);\n setMenuPanel(MenuPanelTag.Save);\n setComponentVisibility('showMenuPanel', true);\n }}\n >\n <span className={styles.button_text}>存档 / SAVE</span>\n </span>\n <span\n className={styles.singleButton}\n onClick={() => {\n showPanel.set(!showPanel.value);\n setMenuPanel(MenuPanelTag.Load);\n setComponentVisibility('showMenuPanel', true);\n }}\n >\n <span className={styles.button_text}>读档 / LOAD</span>\n </span>\n <span\n className={styles.singleButton}\n onClick={() => {\n showPanel.set(!showPanel.value);\n setMenuPanel(MenuPanelTag.Option);\n setComponentVisibility('showMenuPanel', true);\n }}\n >\n <span className={styles.button_text}>选项 / OPTIONS</span>\n </span>\n <span\n className={styles.singleButton}\n onClick={() => {\n showPanel.set(!showPanel.value);\n backToTitle();\n }}\n >\n <span className={styles.button_text}>标题 / TITLE</span>\n </span>\n </div>\n )}\n </>\n )}\n </>\n );\n};\n","export function getPixiSscreenshot() {\n const canvas: HTMLCanvasElement = document.getElementById('pixiCanvas')! as HTMLCanvasElement;\n canvas.toBlob((b) => {\n if (b) {\n const a = document.createElement('a');\n document.body.append(a);\n a.download = 'screenshot';\n a.href = URL.createObjectURL(b);\n a.click();\n a.remove();\n }\n }, 'image/png');\n}\n","import styles from './devPanel.module.scss';\nimport { useValue } from '@/hooks/useValue';\nimport { getPixiSscreenshot } from '@/UI/DevPanel/devFunctions/getPixiSscreenshot';\nimport { useEffect } from 'react';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { useTranslation } from 'react-i18next';\n\nimport { WebGAL } from '@/Core/WebGAL';\n\nexport default function DevPanel() {\n // 控制显隐\n function isShowDevPanel() {\n const hash = window.location.hash;\n return !!hash.match(/dev/);\n }\n const isOpenDevPanel = useValue(false);\n const hash = useValue(window.location.hash);\n const stageState = useSelector((state: RootState) => state.stage);\n useEffect(() => {\n window.onhashchange = () => {\n hash.set(window.location.hash);\n };\n }, []);\n const isShow = isShowDevPanel();\n\n const { t, i18n } = useTranslation();\n\n const devMainArea = (\n <>\n <div onClick={() => getPixiSscreenshot()}>Save PIXI Screenshot</div>\n <div>Current Language:{i18n.language}</div>\n <div onClick={() => WebGAL.gameplay.pixiStage?.removeAnimation('snow-Ticker')}>Remove Snow Ticker</div>\n <div>Stage State</div>\n <div>{JSON.stringify(stageState, null, ' ')}</div>\n </>\n );\n return (\n <>\n {isShow && isOpenDevPanel.value && (\n <div className={styles.devPanelMain}>\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <div\n onClick={() => isOpenDevPanel.set(false)}\n style={{ fontSize: '150%', padding: '0 0 0 15px', cursor: 'pointer' }}\n >\n ×\n </div>\n <div style={{ padding: '0 0 0 15px', fontSize: '115%' }}>WebGAL DEV PANEL</div>\n </div>\n <div style={{ padding: '10px 10px 10px 10px', overflow: 'auto' }}>{devMainArea}</div>\n </div>\n )}\n {!isOpenDevPanel.value && isShow && (\n <div onClick={() => isOpenDevPanel.set(true)} className={styles.devPanelOpener}>\n Open Dev Panel\n </div>\n )}\n </>\n );\n}\n","import useLanguage from '@/hooks/useLanguage';\nimport { useEffect, useState } from 'react';\nimport s from './translation.module.scss';\nimport languages, { language } from '@/config/language';\n\nexport default function Translation() {\n const setLanguage = useLanguage();\n\n const [isShowSelectLanguage, setIsShowSelectLanguage] = useState(false);\n\n useEffect(() => {\n const lang = window?.localStorage.getItem('lang');\n if (!lang) {\n setIsShowSelectLanguage(true);\n } else {\n setLanguage(Number(window?.localStorage.getItem('lang')), false);\n }\n }, []);\n\n const setLang = (langId: language) => {\n setIsShowSelectLanguage(false);\n setLanguage(langId);\n };\n\n return (\n <>\n {isShowSelectLanguage && (\n <div className={s.trans}>\n <div className={s.langWrapper}>\n <div className={s.lang}>LANGUAGE SELECT</div>\n <div className={s.langSelect}>\n {Object.keys(languages).map((key) => (\n <div\n key={key}\n className={s.langSelectButton}\n onClick={() => setLang(language[key as unknown as language] as unknown as language)}\n >\n {languages[key]}\n </div>\n ))}\n </div>\n </div>\n </div>\n )}\n </>\n );\n}\n","import styles from './panicYoozle.module.scss';\nimport { useEffect } from 'react';\n\nexport const PanicYoozle = () => {\n useEffect(() => {\n const panicTitle = 'Yoozle Search';\n const originalTitle = document.title;\n document.title = panicTitle;\n return () => {\n document.title = originalTitle;\n };\n }, []);\n return (\n <div className={styles.yoozle_container}>\n <div className={styles.yoozle_title}>\n <span>\n <span className={styles.yoozle_blue} style={{ marginRight: '1px' }}>\n Y\n </span>\n <span className={styles.yoozle_red}>o</span>\n <span className={styles.yoozle_yellow}>o</span>\n <span className={styles.yoozle_blue}>z</span>\n <span className={styles.yoozle_green}>l</span>\n <span className={`${styles.yoozle_red} ${styles.yoozle_e_rotate}`}>e</span>\n </span>\n </div>\n <div className={styles.yoozle_search}>\n <input className={styles.yoozle_search_bar} type=\"text\" defaultValue=\"\" />\n <div className={styles.yoozle_search_buttons}>\n <input className={styles.yoozle_button} type=\"submit\" value=\"Yoozle Search\" />\n <input className={styles.yoozle_button} type=\"submit\" value=\"Feeling Lucky\" />\n </div>\n </div>\n </div>\n );\n};\n","import styles from './panicOverlay.module.scss';\nimport { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport { useSelector } from 'react-redux';\nimport { RootState } from '@/store/store';\nimport { PanicYoozle } from '@/UI/PanicOverlay/PanicYoozle/PanicYoozle';\n\nexport const PanicOverlay = () => {\n const GUIStore = useSelector((state: RootState) => state.GUI);\n const [showOverlay, setShowOverlay] = useState(false);\n useEffect(() => {\n setShowOverlay(GUIStore.showPanicOverlay);\n }, [GUIStore.showPanicOverlay]);\n return ReactDOM.createPortal(\n <div className={showOverlay ? styles.panic_overlay_main : ''}>{showOverlay && <PanicYoozle />}</div>,\n document.querySelector('div#panic-overlay')!,\n );\n};\n","import { setStorage } from '@/Core/controller/storage/storageController';\nimport { RootState } from '@/store/store';\nimport { fullScreenOption } from '@/store/userDataInterface';\nimport { setOptionData } from '@/store/userDataReducer';\nimport { useEffect } from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { keyboard } from './useHotkey';\n\nexport function useFullScreen() {\n const userDataState = useSelector((state: RootState) => state.userData);\n const GUIState = useSelector((state: RootState) => state.GUI);\n const dispatch = useDispatch();\n const fullScreen = userDataState.optionData.fullScreen;\n const isEnterGame = GUIState.isEnterGame;\n\n useEffect(() => {\n switch (fullScreen) {\n case fullScreenOption.on: {\n if (isEnterGame) {\n document.documentElement.requestFullscreen();\n if (keyboard) keyboard.lock(['Escape', 'F11']);\n }\n break;\n }\n case fullScreenOption.off: {\n if (document.fullscreenElement) {\n document.exitFullscreen();\n if (keyboard) keyboard.unlock();\n }\n break;\n }\n }\n }, [fullScreen]);\n}\n","import Title from '@/UI/Title/Title';\nimport Logo from '@/UI/Logo/Logo';\nimport { useEffect } from 'react';\nimport { initializeScript } from './Core/initializeScript';\nimport Menu from '@/UI/Menu/Menu';\nimport { Stage } from '@/Stage/Stage';\nimport { BottomControlPanel } from '@/UI/BottomControlPanel/BottomControlPanel';\nimport { Backlog } from '@/UI/Backlog/Backlog';\nimport { Extra } from '@/UI/Extra/Extra';\nimport { BottomControlPanelFilm } from '@/UI/BottomControlPanel/BottomControlPanelFilm';\nimport GlobalDialog from '@/UI/GlobalDialog/GlobalDialog';\nimport DevPanel from '@/UI/DevPanel/DevPanel';\nimport Translation from '@/UI/Translation/Translation';\nimport { PanicOverlay } from '@/UI/PanicOverlay/PanicOverlay';\nimport { useFullScreen } from './hooks/useFullScreen';\n\nfunction App() {\n useEffect(() => {\n initializeScript();\n }, []);\n\n useFullScreen();\n\n // Provider用于对各组件提供状态\n return (\n <div className=\"App\">\n <Translation />\n <Stage />\n <BottomControlPanel />\n <BottomControlPanelFilm />\n <Backlog />\n <Title />\n <Logo />\n <Extra />\n <Menu />\n <GlobalDialog />\n <PanicOverlay />\n <DevPanel />\n </div>\n );\n}\n\nexport default App;\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _toArray(arr) {\n return arrayWithHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableRest();\n}","import _typeof from '@babel/runtime/helpers/esm/typeof';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';\nimport _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';\nimport _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport _toArray from '@babel/runtime/helpers/esm/toArray';\n\nfunction ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nvar consoleLogger = {\n type: 'logger',\n log: function log(args) {\n this.output('log', args);\n },\n warn: function warn(args) {\n this.output('warn', args);\n },\n error: function error(args) {\n this.output('error', args);\n },\n output: function output(type, args) {\n if (console && console[type]) console[type].apply(console, args);\n }\n};\nvar Logger = function () {\n function Logger(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Logger);\n this.init(concreteLogger, options);\n }\n _createClass(Logger, [{\n key: \"init\",\n value: function init(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.prefix = options.prefix || 'i18next:';\n this.logger = concreteLogger || consoleLogger;\n this.options = options;\n this.debug = options.debug;\n }\n }, {\n key: \"setDebug\",\n value: function setDebug(bool) {\n this.debug = bool;\n }\n }, {\n key: \"log\",\n value: function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return this.forward(args, 'log', '', true);\n }\n }, {\n key: \"warn\",\n value: function warn() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return this.forward(args, 'warn', '', true);\n }\n }, {\n key: \"error\",\n value: function error() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n return this.forward(args, 'error', '');\n }\n }, {\n key: \"deprecate\",\n value: function deprecate() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);\n }\n }, {\n key: \"forward\",\n value: function forward(args, lvl, prefix, debugOnly) {\n if (debugOnly && !this.debug) return null;\n if (typeof args[0] === 'string') args[0] = \"\".concat(prefix).concat(this.prefix, \" \").concat(args[0]);\n return this.logger[lvl](args);\n }\n }, {\n key: \"create\",\n value: function create(moduleName) {\n return new Logger(this.logger, _objectSpread$6(_objectSpread$6({}, {\n prefix: \"\".concat(this.prefix, \":\").concat(moduleName, \":\")\n }), this.options));\n }\n }, {\n key: \"clone\",\n value: function clone(options) {\n options = options || this.options;\n options.prefix = options.prefix || this.prefix;\n return new Logger(this.logger, options);\n }\n }]);\n return Logger;\n}();\nvar baseLogger = new Logger();\n\nvar EventEmitter = function () {\n function EventEmitter() {\n _classCallCheck(this, EventEmitter);\n this.observers = {};\n }\n _createClass(EventEmitter, [{\n key: \"on\",\n value: function on(events, listener) {\n var _this = this;\n events.split(' ').forEach(function (event) {\n _this.observers[event] = _this.observers[event] || [];\n _this.observers[event].push(listener);\n });\n return this;\n }\n }, {\n key: \"off\",\n value: function off(event, listener) {\n if (!this.observers[event]) return;\n if (!listener) {\n delete this.observers[event];\n return;\n }\n this.observers[event] = this.observers[event].filter(function (l) {\n return l !== listener;\n });\n }\n }, {\n key: \"emit\",\n value: function emit(event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (this.observers[event]) {\n var cloned = [].concat(this.observers[event]);\n cloned.forEach(function (observer) {\n observer.apply(void 0, args);\n });\n }\n if (this.observers['*']) {\n var _cloned = [].concat(this.observers['*']);\n _cloned.forEach(function (observer) {\n observer.apply(observer, [event].concat(args));\n });\n }\n }\n }]);\n return EventEmitter;\n}();\n\nfunction defer() {\n var res;\n var rej;\n var promise = new Promise(function (resolve, reject) {\n res = resolve;\n rej = reject;\n });\n promise.resolve = res;\n promise.reject = rej;\n return promise;\n}\nfunction makeString(object) {\n if (object == null) return '';\n return '' + object;\n}\nfunction copy(a, s, t) {\n a.forEach(function (m) {\n if (s[m]) t[m] = s[m];\n });\n}\nfunction getLastOfPath(object, path, Empty) {\n function cleanKey(key) {\n return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;\n }\n function canNotTraverseDeeper() {\n return !object || typeof object === 'string';\n }\n var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');\n while (stack.length > 1) {\n if (canNotTraverseDeeper()) return {};\n var key = cleanKey(stack.shift());\n if (!object[key] && Empty) object[key] = new Empty();\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n object = object[key];\n } else {\n object = {};\n }\n }\n if (canNotTraverseDeeper()) return {};\n return {\n obj: object,\n k: cleanKey(stack.shift())\n };\n}\nfunction setPath(object, path, newValue) {\n var _getLastOfPath = getLastOfPath(object, path, Object),\n obj = _getLastOfPath.obj,\n k = _getLastOfPath.k;\n obj[k] = newValue;\n}\nfunction pushPath(object, path, newValue, concat) {\n var _getLastOfPath2 = getLastOfPath(object, path, Object),\n obj = _getLastOfPath2.obj,\n k = _getLastOfPath2.k;\n obj[k] = obj[k] || [];\n if (concat) obj[k] = obj[k].concat(newValue);\n if (!concat) obj[k].push(newValue);\n}\nfunction getPath(object, path) {\n var _getLastOfPath3 = getLastOfPath(object, path),\n obj = _getLastOfPath3.obj,\n k = _getLastOfPath3.k;\n if (!obj) return undefined;\n return obj[k];\n}\nfunction getPathWithDefaults(data, defaultData, key) {\n var value = getPath(data, key);\n if (value !== undefined) {\n return value;\n }\n return getPath(defaultData, key);\n}\nfunction deepExtend(target, source, overwrite) {\n for (var prop in source) {\n if (prop !== '__proto__' && prop !== 'constructor') {\n if (prop in target) {\n if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) {\n if (overwrite) target[prop] = source[prop];\n } else {\n deepExtend(target[prop], source[prop], overwrite);\n }\n } else {\n target[prop] = source[prop];\n }\n }\n }\n return target;\n}\nfunction regexEscape(str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\nvar _entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\nfunction escape(data) {\n if (typeof data === 'string') {\n return data.replace(/[&<>\"'\\/]/g, function (s) {\n return _entityMap[s];\n });\n }\n return data;\n}\nvar isIE10 = typeof window !== 'undefined' && window.navigator && typeof window.navigator.userAgentData === 'undefined' && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;\nvar chars = [' ', ',', '?', '!', ';'];\nfunction looksLikeObjectPath(key, nsSeparator, keySeparator) {\n nsSeparator = nsSeparator || '';\n keySeparator = keySeparator || '';\n var possibleChars = chars.filter(function (c) {\n return nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0;\n });\n if (possibleChars.length === 0) return true;\n var r = new RegExp(\"(\".concat(possibleChars.map(function (c) {\n return c === '?' ? '\\\\?' : c;\n }).join('|'), \")\"));\n var matched = !r.test(key);\n if (!matched) {\n var ki = key.indexOf(keySeparator);\n if (ki > 0 && !r.test(key.substring(0, ki))) {\n matched = true;\n }\n }\n return matched;\n}\nfunction deepFind(obj, path) {\n var keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';\n if (!obj) return undefined;\n if (obj[path]) return obj[path];\n var paths = path.split(keySeparator);\n var current = obj;\n for (var i = 0; i < paths.length; ++i) {\n if (!current) return undefined;\n if (typeof current[paths[i]] === 'string' && i + 1 < paths.length) {\n return undefined;\n }\n if (current[paths[i]] === undefined) {\n var j = 2;\n var p = paths.slice(i, i + j).join(keySeparator);\n var mix = current[p];\n while (mix === undefined && paths.length > i + j) {\n j++;\n p = paths.slice(i, i + j).join(keySeparator);\n mix = current[p];\n }\n if (mix === undefined) return undefined;\n if (mix === null) return null;\n if (path.endsWith(p)) {\n if (typeof mix === 'string') return mix;\n if (p && typeof mix[p] === 'string') return mix[p];\n }\n var joinedPath = paths.slice(i + j).join(keySeparator);\n if (joinedPath) return deepFind(mix, joinedPath, keySeparator);\n return undefined;\n }\n current = current[paths[i]];\n }\n return current;\n}\n\nfunction ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct$3() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nvar ResourceStore = function (_EventEmitter) {\n _inherits(ResourceStore, _EventEmitter);\n var _super = _createSuper$3(ResourceStore);\n function ResourceStore(data) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n ns: ['translation'],\n defaultNS: 'translation'\n };\n _classCallCheck(this, ResourceStore);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n _this.data = data || {};\n _this.options = options;\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n if (_this.options.ignoreJSONStructure === undefined) {\n _this.options.ignoreJSONStructure = true;\n }\n return _this;\n }\n _createClass(ResourceStore, [{\n key: \"addNamespaces\",\n value: function addNamespaces(ns) {\n if (this.options.ns.indexOf(ns) < 0) {\n this.options.ns.push(ns);\n }\n }\n }, {\n key: \"removeNamespaces\",\n value: function removeNamespaces(ns) {\n var index = this.options.ns.indexOf(ns);\n if (index > -1) {\n this.options.ns.splice(index, 1);\n }\n }\n }, {\n key: \"getResource\",\n value: function getResource(lng, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;\n var path = [lng, ns];\n if (key && typeof key !== 'string') path = path.concat(key);\n if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n }\n var result = getPath(this.data, path);\n if (result || !ignoreJSONStructure || typeof key !== 'string') return result;\n return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);\n }\n }, {\n key: \"addResource\",\n value: function addResource(lng, ns, key, value) {\n var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n silent: false\n };\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var path = [lng, ns];\n if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n value = ns;\n ns = path[1];\n }\n this.addNamespaces(ns);\n setPath(this.data, path, value);\n if (!options.silent) this.emit('added', lng, ns, key, value);\n }\n }, {\n key: \"addResources\",\n value: function addResources(lng, ns, resources) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n silent: false\n };\n for (var m in resources) {\n if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {\n silent: true\n });\n }\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"addResourceBundle\",\n value: function addResourceBundle(lng, ns, resources, deep, overwrite) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {\n silent: false\n };\n var path = [lng, ns];\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n deep = resources;\n resources = ns;\n ns = path[1];\n }\n this.addNamespaces(ns);\n var pack = getPath(this.data, path) || {};\n if (deep) {\n deepExtend(pack, resources, overwrite);\n } else {\n pack = _objectSpread$5(_objectSpread$5({}, pack), resources);\n }\n setPath(this.data, path, pack);\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"removeResourceBundle\",\n value: function removeResourceBundle(lng, ns) {\n if (this.hasResourceBundle(lng, ns)) {\n delete this.data[lng][ns];\n }\n this.removeNamespaces(ns);\n this.emit('removed', lng, ns);\n }\n }, {\n key: \"hasResourceBundle\",\n value: function hasResourceBundle(lng, ns) {\n return this.getResource(lng, ns) !== undefined;\n }\n }, {\n key: \"getResourceBundle\",\n value: function getResourceBundle(lng, ns) {\n if (!ns) ns = this.options.defaultNS;\n if (this.options.compatibilityAPI === 'v1') return _objectSpread$5(_objectSpread$5({}, {}), this.getResource(lng, ns));\n return this.getResource(lng, ns);\n }\n }, {\n key: \"getDataByLanguage\",\n value: function getDataByLanguage(lng) {\n return this.data[lng];\n }\n }, {\n key: \"hasLanguageSomeTranslations\",\n value: function hasLanguageSomeTranslations(lng) {\n var data = this.getDataByLanguage(lng);\n var n = data && Object.keys(data) || [];\n return !!n.find(function (v) {\n return data[v] && Object.keys(data[v]).length > 0;\n });\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return this.data;\n }\n }]);\n return ResourceStore;\n}(EventEmitter);\n\nvar postProcessor = {\n processors: {},\n addPostProcessor: function addPostProcessor(module) {\n this.processors[module.name] = module;\n },\n handle: function handle(processors, value, key, options, translator) {\n var _this = this;\n processors.forEach(function (processor) {\n if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);\n });\n return value;\n }\n};\n\nfunction ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct$2() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nvar checkedLoadedFor = {};\nvar Translator = function (_EventEmitter) {\n _inherits(Translator, _EventEmitter);\n var _super = _createSuper$2(Translator);\n function Translator(services) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, Translator);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, _assertThisInitialized(_this));\n _this.options = options;\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n _this.logger = baseLogger.create('translator');\n return _this;\n }\n _createClass(Translator, [{\n key: \"changeLanguage\",\n value: function changeLanguage(lng) {\n if (lng) this.language = lng;\n }\n }, {\n key: \"exists\",\n value: function exists(key) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n if (key === undefined || key === null) {\n return false;\n }\n var resolved = this.resolve(key, options);\n return resolved && resolved.res !== undefined;\n }\n }, {\n key: \"extractFromKey\",\n value: function extractFromKey(key, options) {\n var nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;\n if (nsSeparator === undefined) nsSeparator = ':';\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var namespaces = options.ns || this.options.defaultNS || [];\n var wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;\n var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);\n if (wouldCheckForNsInKey && !seemsNaturalLanguage) {\n var m = key.match(this.interpolator.nestingRegexp);\n if (m && m.length > 0) {\n return {\n key: key,\n namespaces: namespaces\n };\n }\n var parts = key.split(nsSeparator);\n if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();\n key = parts.join(keySeparator);\n }\n if (typeof namespaces === 'string') namespaces = [namespaces];\n return {\n key: key,\n namespaces: namespaces\n };\n }\n }, {\n key: \"translate\",\n value: function translate(keys, options, lastKey) {\n var _this2 = this;\n if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {\n options = this.options.overloadTranslationOptionHandler(arguments);\n }\n if (_typeof(options) === 'object') options = _objectSpread$4({}, options);\n if (!options) options = {};\n if (keys === undefined || keys === null) return '';\n if (!Array.isArray(keys)) keys = [String(keys)];\n var returnDetails = options.returnDetails !== undefined ? options.returnDetails : this.options.returnDetails;\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),\n key = _this$extractFromKey.key,\n namespaces = _this$extractFromKey.namespaces;\n var namespace = namespaces[namespaces.length - 1];\n var lng = options.lng || this.language;\n var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;\n if (lng && lng.toLowerCase() === 'cimode') {\n if (appendNamespaceToCIMode) {\n var nsSeparator = options.nsSeparator || this.options.nsSeparator;\n if (returnDetails) {\n return {\n res: \"\".concat(namespace).concat(nsSeparator).concat(key),\n usedKey: key,\n exactUsedKey: key,\n usedLng: lng,\n usedNS: namespace\n };\n }\n return \"\".concat(namespace).concat(nsSeparator).concat(key);\n }\n if (returnDetails) {\n return {\n res: key,\n usedKey: key,\n exactUsedKey: key,\n usedLng: lng,\n usedNS: namespace\n };\n }\n return key;\n }\n var resolved = this.resolve(keys, options);\n var res = resolved && resolved.res;\n var resUsedKey = resolved && resolved.usedKey || key;\n var resExactUsedKey = resolved && resolved.exactUsedKey || key;\n var resType = Object.prototype.toString.apply(res);\n var noObject = ['[object Number]', '[object Function]', '[object RegExp]'];\n var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;\n var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;\n var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';\n if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {\n if (!options.returnObjects && !this.options.returnObjects) {\n if (!this.options.returnedObjectHandler) {\n this.logger.warn('accessing an object - but returnObjects options is not enabled!');\n }\n var r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread$4(_objectSpread$4({}, options), {}, {\n ns: namespaces\n })) : \"key '\".concat(key, \" (\").concat(this.language, \")' returned an object instead of string.\");\n if (returnDetails) {\n resolved.res = r;\n return resolved;\n }\n return r;\n }\n if (keySeparator) {\n var resTypeIsArray = resType === '[object Array]';\n var copy = resTypeIsArray ? [] : {};\n var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;\n for (var m in res) {\n if (Object.prototype.hasOwnProperty.call(res, m)) {\n var deepKey = \"\".concat(newKeyToUse).concat(keySeparator).concat(m);\n copy[m] = this.translate(deepKey, _objectSpread$4(_objectSpread$4({}, options), {\n joinArrays: false,\n ns: namespaces\n }));\n if (copy[m] === deepKey) copy[m] = res[m];\n }\n }\n res = copy;\n }\n } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {\n res = res.join(joinArrays);\n if (res) res = this.extendTranslation(res, keys, options, lastKey);\n } else {\n var usedDefault = false;\n var usedKey = false;\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n var hasDefaultValue = Translator.hasDefaultValue(options);\n var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';\n var defaultValue = options[\"defaultValue\".concat(defaultValueSuffix)] || options.defaultValue;\n if (!this.isValidLookup(res) && hasDefaultValue) {\n usedDefault = true;\n res = defaultValue;\n }\n if (!this.isValidLookup(res)) {\n usedKey = true;\n res = key;\n }\n var missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;\n var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;\n var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;\n if (usedKey || usedDefault || updateMissing) {\n this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);\n if (keySeparator) {\n var fk = this.resolve(key, _objectSpread$4(_objectSpread$4({}, options), {}, {\n keySeparator: false\n }));\n if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');\n }\n var lngs = [];\n var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);\n if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {\n for (var i = 0; i < fallbackLngs.length; i++) {\n lngs.push(fallbackLngs[i]);\n }\n } else if (this.options.saveMissingTo === 'all') {\n lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);\n } else {\n lngs.push(options.lng || this.language);\n }\n var send = function send(l, k, specificDefaultValue) {\n var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;\n if (_this2.options.missingKeyHandler) {\n _this2.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);\n } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {\n _this2.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);\n }\n _this2.emit('missingKey', l, namespace, k, res);\n };\n if (this.options.saveMissing) {\n if (this.options.saveMissingPlurals && needsPluralHandling) {\n lngs.forEach(function (language) {\n _this2.pluralResolver.getSuffixes(language, options).forEach(function (suffix) {\n send([language], key + suffix, options[\"defaultValue\".concat(suffix)] || defaultValue);\n });\n });\n } else {\n send(lngs, key, defaultValue);\n }\n }\n }\n res = this.extendTranslation(res, keys, options, resolved, lastKey);\n if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = \"\".concat(namespace, \":\").concat(key);\n if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {\n if (this.options.compatibilityAPI !== 'v1') {\n res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? \"\".concat(namespace, \":\").concat(key) : key, usedDefault ? res : undefined);\n } else {\n res = this.options.parseMissingKeyHandler(res);\n }\n }\n }\n if (returnDetails) {\n resolved.res = res;\n return resolved;\n }\n return res;\n }\n }, {\n key: \"extendTranslation\",\n value: function extendTranslation(res, key, options, resolved, lastKey) {\n var _this3 = this;\n if (this.i18nFormat && this.i18nFormat.parse) {\n res = this.i18nFormat.parse(res, _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), options), resolved.usedLng, resolved.usedNS, resolved.usedKey, {\n resolved: resolved\n });\n } else if (!options.skipInterpolation) {\n if (options.interpolation) this.interpolator.init(_objectSpread$4(_objectSpread$4({}, options), {\n interpolation: _objectSpread$4(_objectSpread$4({}, this.options.interpolation), options.interpolation)\n }));\n var skipOnVariables = typeof res === 'string' && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);\n var nestBef;\n if (skipOnVariables) {\n var nb = res.match(this.interpolator.nestingRegexp);\n nestBef = nb && nb.length;\n }\n var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;\n if (this.options.interpolation.defaultVariables) data = _objectSpread$4(_objectSpread$4({}, this.options.interpolation.defaultVariables), data);\n res = this.interpolator.interpolate(res, data, options.lng || this.language, options);\n if (skipOnVariables) {\n var na = res.match(this.interpolator.nestingRegexp);\n var nestAft = na && na.length;\n if (nestBef < nestAft) options.nest = false;\n }\n if (!options.lng && this.options.compatibilityAPI !== 'v1' && resolved && resolved.res) options.lng = resolved.usedLng;\n if (options.nest !== false) res = this.interpolator.nest(res, function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (lastKey && lastKey[0] === args[0] && !options.context) {\n _this3.logger.warn(\"It seems you are nesting recursively key: \".concat(args[0], \" in key: \").concat(key[0]));\n return null;\n }\n return _this3.translate.apply(_this3, args.concat([key]));\n }, options);\n if (options.interpolation) this.interpolator.reset();\n }\n var postProcess = options.postProcess || this.options.postProcess;\n var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;\n if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {\n res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread$4({\n i18nResolved: resolved\n }, options) : options, this);\n }\n return res;\n }\n }, {\n key: \"resolve\",\n value: function resolve(keys) {\n var _this4 = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var found;\n var usedKey;\n var exactUsedKey;\n var usedLng;\n var usedNS;\n if (typeof keys === 'string') keys = [keys];\n keys.forEach(function (k) {\n if (_this4.isValidLookup(found)) return;\n var extracted = _this4.extractFromKey(k, options);\n var key = extracted.key;\n usedKey = key;\n var namespaces = extracted.namespaces;\n if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n var needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && _this4.pluralResolver.shouldUseIntlApi();\n var needsContextHandling = options.context !== undefined && (typeof options.context === 'string' || typeof options.context === 'number') && options.context !== '';\n var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);\n namespaces.forEach(function (ns) {\n if (_this4.isValidLookup(found)) return;\n usedNS = ns;\n if (!checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {\n checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] = true;\n _this4.logger.warn(\"key \\\"\".concat(usedKey, \"\\\" for languages \\\"\").concat(codes.join(', '), \"\\\" won't get resolved as namespace \\\"\").concat(usedNS, \"\\\" was not yet loaded\"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n }\n codes.forEach(function (code) {\n if (_this4.isValidLookup(found)) return;\n usedLng = code;\n var finalKeys = [key];\n if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {\n _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);\n } else {\n var pluralSuffix;\n if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count, options);\n var zeroSuffix = \"\".concat(_this4.options.pluralSeparator, \"zero\");\n if (needsPluralHandling) {\n finalKeys.push(key + pluralSuffix);\n if (needsZeroSuffixLookup) {\n finalKeys.push(key + zeroSuffix);\n }\n }\n if (needsContextHandling) {\n var contextKey = \"\".concat(key).concat(_this4.options.contextSeparator).concat(options.context);\n finalKeys.push(contextKey);\n if (needsPluralHandling) {\n finalKeys.push(contextKey + pluralSuffix);\n if (needsZeroSuffixLookup) {\n finalKeys.push(contextKey + zeroSuffix);\n }\n }\n }\n }\n var possibleKey;\n while (possibleKey = finalKeys.pop()) {\n if (!_this4.isValidLookup(found)) {\n exactUsedKey = possibleKey;\n found = _this4.getResource(code, ns, possibleKey, options);\n }\n }\n });\n });\n });\n return {\n res: found,\n usedKey: usedKey,\n exactUsedKey: exactUsedKey,\n usedLng: usedLng,\n usedNS: usedNS\n };\n }\n }, {\n key: \"isValidLookup\",\n value: function isValidLookup(res) {\n return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');\n }\n }, {\n key: \"getResource\",\n value: function getResource(code, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);\n return this.resourceStore.getResource(code, ns, key, options);\n }\n }], [{\n key: \"hasDefaultValue\",\n value: function hasDefaultValue(options) {\n var prefix = 'defaultValue';\n for (var option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {\n return true;\n }\n }\n return false;\n }\n }]);\n return Translator;\n}(EventEmitter);\n\nfunction capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\nvar LanguageUtil = function () {\n function LanguageUtil(options) {\n _classCallCheck(this, LanguageUtil);\n this.options = options;\n this.supportedLngs = this.options.supportedLngs || false;\n this.logger = baseLogger.create('languageUtils');\n }\n _createClass(LanguageUtil, [{\n key: \"getScriptPartFromCode\",\n value: function getScriptPartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return null;\n var p = code.split('-');\n if (p.length === 2) return null;\n p.pop();\n if (p[p.length - 1].toLowerCase() === 'x') return null;\n return this.formatLanguageCode(p.join('-'));\n }\n }, {\n key: \"getLanguagePartFromCode\",\n value: function getLanguagePartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return code;\n var p = code.split('-');\n return this.formatLanguageCode(p[0]);\n }\n }, {\n key: \"formatLanguageCode\",\n value: function formatLanguageCode(code) {\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];\n var p = code.split('-');\n if (this.options.lowerCaseLng) {\n p = p.map(function (part) {\n return part.toLowerCase();\n });\n } else if (p.length === 2) {\n p[0] = p[0].toLowerCase();\n p[1] = p[1].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n } else if (p.length === 3) {\n p[0] = p[0].toLowerCase();\n if (p[1].length === 2) p[1] = p[1].toUpperCase();\n if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());\n }\n return p.join('-');\n }\n return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;\n }\n }, {\n key: \"isSupportedCode\",\n value: function isSupportedCode(code) {\n if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {\n code = this.getLanguagePartFromCode(code);\n }\n return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;\n }\n }, {\n key: \"getBestMatchFromCodes\",\n value: function getBestMatchFromCodes(codes) {\n var _this = this;\n if (!codes) return null;\n var found;\n codes.forEach(function (code) {\n if (found) return;\n var cleanedLng = _this.formatLanguageCode(code);\n if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng;\n });\n if (!found && this.options.supportedLngs) {\n codes.forEach(function (code) {\n if (found) return;\n var lngOnly = _this.getLanguagePartFromCode(code);\n if (_this.isSupportedCode(lngOnly)) return found = lngOnly;\n found = _this.options.supportedLngs.find(function (supportedLng) {\n if (supportedLng === lngOnly) return supportedLng;\n if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;\n if (supportedLng.indexOf(lngOnly) === 0) return supportedLng;\n });\n });\n }\n if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];\n return found;\n }\n }, {\n key: \"getFallbackCodes\",\n value: function getFallbackCodes(fallbacks, code) {\n if (!fallbacks) return [];\n if (typeof fallbacks === 'function') fallbacks = fallbacks(code);\n if (typeof fallbacks === 'string') fallbacks = [fallbacks];\n if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;\n if (!code) return fallbacks[\"default\"] || [];\n var found = fallbacks[code];\n if (!found) found = fallbacks[this.getScriptPartFromCode(code)];\n if (!found) found = fallbacks[this.formatLanguageCode(code)];\n if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];\n if (!found) found = fallbacks[\"default\"];\n return found || [];\n }\n }, {\n key: \"toResolveHierarchy\",\n value: function toResolveHierarchy(code, fallbackCode) {\n var _this2 = this;\n var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);\n var codes = [];\n var addCode = function addCode(c) {\n if (!c) return;\n if (_this2.isSupportedCode(c)) {\n codes.push(c);\n } else {\n _this2.logger.warn(\"rejecting language code not found in supportedLngs: \".concat(c));\n }\n };\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));\n if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));\n if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));\n } else if (typeof code === 'string') {\n addCode(this.formatLanguageCode(code));\n }\n fallbackCodes.forEach(function (fc) {\n if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc));\n });\n return codes;\n }\n }]);\n return LanguageUtil;\n}();\n\nvar sets = [{\n lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],\n nr: [1, 2],\n fc: 1\n}, {\n lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kk', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],\n nr: [1, 2],\n fc: 2\n}, {\n lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],\n nr: [1],\n fc: 3\n}, {\n lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],\n nr: [1, 2, 5],\n fc: 4\n}, {\n lngs: ['ar'],\n nr: [0, 1, 2, 3, 11, 100],\n fc: 5\n}, {\n lngs: ['cs', 'sk'],\n nr: [1, 2, 5],\n fc: 6\n}, {\n lngs: ['csb', 'pl'],\n nr: [1, 2, 5],\n fc: 7\n}, {\n lngs: ['cy'],\n nr: [1, 2, 3, 8],\n fc: 8\n}, {\n lngs: ['fr'],\n nr: [1, 2],\n fc: 9\n}, {\n lngs: ['ga'],\n nr: [1, 2, 3, 7, 11],\n fc: 10\n}, {\n lngs: ['gd'],\n nr: [1, 2, 3, 20],\n fc: 11\n}, {\n lngs: ['is'],\n nr: [1, 2],\n fc: 12\n}, {\n lngs: ['jv'],\n nr: [0, 1],\n fc: 13\n}, {\n lngs: ['kw'],\n nr: [1, 2, 3, 4],\n fc: 14\n}, {\n lngs: ['lt'],\n nr: [1, 2, 10],\n fc: 15\n}, {\n lngs: ['lv'],\n nr: [1, 2, 0],\n fc: 16\n}, {\n lngs: ['mk'],\n nr: [1, 2],\n fc: 17\n}, {\n lngs: ['mnk'],\n nr: [0, 1, 2],\n fc: 18\n}, {\n lngs: ['mt'],\n nr: [1, 2, 11, 20],\n fc: 19\n}, {\n lngs: ['or'],\n nr: [2, 1],\n fc: 2\n}, {\n lngs: ['ro'],\n nr: [1, 2, 20],\n fc: 20\n}, {\n lngs: ['sl'],\n nr: [5, 1, 2, 3],\n fc: 21\n}, {\n lngs: ['he', 'iw'],\n nr: [1, 2, 20, 21],\n fc: 22\n}];\nvar _rulesPluralsTypes = {\n 1: function _(n) {\n return Number(n > 1);\n },\n 2: function _(n) {\n return Number(n != 1);\n },\n 3: function _(n) {\n return 0;\n },\n 4: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 5: function _(n) {\n return Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);\n },\n 6: function _(n) {\n return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);\n },\n 7: function _(n) {\n return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 8: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);\n },\n 9: function _(n) {\n return Number(n >= 2);\n },\n 10: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);\n },\n 11: function _(n) {\n return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);\n },\n 12: function _(n) {\n return Number(n % 10 != 1 || n % 100 == 11);\n },\n 13: function _(n) {\n return Number(n !== 0);\n },\n 14: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);\n },\n 15: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 16: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);\n },\n 17: function _(n) {\n return Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1);\n },\n 18: function _(n) {\n return Number(n == 0 ? 0 : n == 1 ? 1 : 2);\n },\n 19: function _(n) {\n return Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3);\n },\n 20: function _(n) {\n return Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2);\n },\n 21: function _(n) {\n return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);\n },\n 22: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);\n }\n};\nvar deprecatedJsonVersions = ['v1', 'v2', 'v3'];\nvar suffixesOrder = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 4,\n other: 5\n};\nfunction createRules() {\n var rules = {};\n sets.forEach(function (set) {\n set.lngs.forEach(function (l) {\n rules[l] = {\n numbers: set.nr,\n plurals: _rulesPluralsTypes[set.fc]\n };\n });\n });\n return rules;\n}\nvar PluralResolver = function () {\n function PluralResolver(languageUtils) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, PluralResolver);\n this.languageUtils = languageUtils;\n this.options = options;\n this.logger = baseLogger.create('pluralResolver');\n if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === 'v4') && (typeof Intl === 'undefined' || !Intl.PluralRules)) {\n this.options.compatibilityJSON = 'v3';\n this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');\n }\n this.rules = createRules();\n }\n _createClass(PluralResolver, [{\n key: \"addRule\",\n value: function addRule(lng, obj) {\n this.rules[lng] = obj;\n }\n }, {\n key: \"getRule\",\n value: function getRule(code) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.shouldUseIntlApi()) {\n try {\n return new Intl.PluralRules(code, {\n type: options.ordinal ? 'ordinal' : 'cardinal'\n });\n } catch (_unused) {\n return;\n }\n }\n return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];\n }\n }, {\n key: \"needsPlural\",\n value: function needsPlural(code) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var rule = this.getRule(code, options);\n if (this.shouldUseIntlApi()) {\n return rule && rule.resolvedOptions().pluralCategories.length > 1;\n }\n return rule && rule.numbers.length > 1;\n }\n }, {\n key: \"getPluralFormsOfKey\",\n value: function getPluralFormsOfKey(code, key) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return this.getSuffixes(code, options).map(function (suffix) {\n return \"\".concat(key).concat(suffix);\n });\n }\n }, {\n key: \"getSuffixes\",\n value: function getSuffixes(code) {\n var _this = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var rule = this.getRule(code, options);\n if (!rule) {\n return [];\n }\n if (this.shouldUseIntlApi()) {\n return rule.resolvedOptions().pluralCategories.sort(function (pluralCategory1, pluralCategory2) {\n return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2];\n }).map(function (pluralCategory) {\n return \"\".concat(_this.options.prepend).concat(pluralCategory);\n });\n }\n return rule.numbers.map(function (number) {\n return _this.getSuffix(code, number, options);\n });\n }\n }, {\n key: \"getSuffix\",\n value: function getSuffix(code, count) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var rule = this.getRule(code, options);\n if (rule) {\n if (this.shouldUseIntlApi()) {\n return \"\".concat(this.options.prepend).concat(rule.select(count));\n }\n return this.getSuffixRetroCompatible(rule, count);\n }\n this.logger.warn(\"no plural rule found for: \".concat(code));\n return '';\n }\n }, {\n key: \"getSuffixRetroCompatible\",\n value: function getSuffixRetroCompatible(rule, count) {\n var _this2 = this;\n var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));\n var suffix = rule.numbers[idx];\n if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n if (suffix === 2) {\n suffix = 'plural';\n } else if (suffix === 1) {\n suffix = '';\n }\n }\n var returnSuffix = function returnSuffix() {\n return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();\n };\n if (this.options.compatibilityJSON === 'v1') {\n if (suffix === 1) return '';\n if (typeof suffix === 'number') return \"_plural_\".concat(suffix.toString());\n return returnSuffix();\n } else if (this.options.compatibilityJSON === 'v2') {\n return returnSuffix();\n } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n return returnSuffix();\n }\n return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();\n }\n }, {\n key: \"shouldUseIntlApi\",\n value: function shouldUseIntlApi() {\n return !deprecatedJsonVersions.includes(this.options.compatibilityJSON);\n }\n }]);\n return PluralResolver;\n}();\n\nfunction ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction deepFindWithDefaults(data, defaultData, key) {\n var keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';\n var ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var path = getPathWithDefaults(data, defaultData, key);\n if (!path && ignoreJSONStructure && typeof key === 'string') {\n path = deepFind(data, key, keySeparator);\n if (path === undefined) path = deepFind(defaultData, key, keySeparator);\n }\n return path;\n}\nvar Interpolator = function () {\n function Interpolator() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Interpolator);\n this.logger = baseLogger.create('interpolator');\n this.options = options;\n this.format = options.interpolation && options.interpolation.format || function (value) {\n return value;\n };\n this.init(options);\n }\n _createClass(Interpolator, [{\n key: \"init\",\n value: function init() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!options.interpolation) options.interpolation = {\n escapeValue: true\n };\n var iOpts = options.interpolation;\n this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;\n this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;\n this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;\n this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';\n this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';\n this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';\n this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';\n this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';\n this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t(');\n this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')');\n this.nestingOptionsSeparator = iOpts.nestingOptionsSeparator ? iOpts.nestingOptionsSeparator : iOpts.nestingOptionsSeparator || ',';\n this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000;\n this.alwaysFormat = iOpts.alwaysFormat !== undefined ? iOpts.alwaysFormat : false;\n this.resetRegExp();\n }\n }, {\n key: \"reset\",\n value: function reset() {\n if (this.options) this.init(this.options);\n }\n }, {\n key: \"resetRegExp\",\n value: function resetRegExp() {\n var regexpStr = \"\".concat(this.prefix, \"(.+?)\").concat(this.suffix);\n this.regexp = new RegExp(regexpStr, 'g');\n var regexpUnescapeStr = \"\".concat(this.prefix).concat(this.unescapePrefix, \"(.+?)\").concat(this.unescapeSuffix).concat(this.suffix);\n this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');\n var nestingRegexpStr = \"\".concat(this.nestingPrefix, \"(.+?)\").concat(this.nestingSuffix);\n this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');\n }\n }, {\n key: \"interpolate\",\n value: function interpolate(str, data, lng, options) {\n var _this = this;\n var match;\n var value;\n var replaces;\n var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};\n function regexSafe(val) {\n return val.replace(/\\$/g, '$$$$');\n }\n var handleFormat = function handleFormat(key) {\n if (key.indexOf(_this.formatSeparator) < 0) {\n var path = deepFindWithDefaults(data, defaultData, key, _this.options.keySeparator, _this.options.ignoreJSONStructure);\n return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {\n interpolationkey: key\n })) : path;\n }\n var p = key.split(_this.formatSeparator);\n var k = p.shift().trim();\n var f = p.join(_this.formatSeparator).trim();\n return _this.format(deepFindWithDefaults(data, defaultData, k, _this.options.keySeparator, _this.options.ignoreJSONStructure), f, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {\n interpolationkey: k\n }));\n };\n this.resetRegExp();\n var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;\n var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;\n var todos = [{\n regex: this.regexpUnescape,\n safeValue: function safeValue(val) {\n return regexSafe(val);\n }\n }, {\n regex: this.regexp,\n safeValue: function safeValue(val) {\n return _this.escapeValue ? regexSafe(_this.escape(val)) : regexSafe(val);\n }\n }];\n todos.forEach(function (todo) {\n replaces = 0;\n while (match = todo.regex.exec(str)) {\n var matchedVar = match[1].trim();\n value = handleFormat(matchedVar);\n if (value === undefined) {\n if (typeof missingInterpolationHandler === 'function') {\n var temp = missingInterpolationHandler(str, match, options);\n value = typeof temp === 'string' ? temp : '';\n } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {\n value = '';\n } else if (skipOnVariables) {\n value = match[0];\n continue;\n } else {\n _this.logger.warn(\"missed to pass in variable \".concat(matchedVar, \" for interpolating \").concat(str));\n value = '';\n }\n } else if (typeof value !== 'string' && !_this.useRawValueToEscape) {\n value = makeString(value);\n }\n var safeValue = todo.safeValue(value);\n str = str.replace(match[0], safeValue);\n if (skipOnVariables) {\n todo.regex.lastIndex += value.length;\n todo.regex.lastIndex -= match[0].length;\n } else {\n todo.regex.lastIndex = 0;\n }\n replaces++;\n if (replaces >= _this.maxReplaces) {\n break;\n }\n }\n });\n return str;\n }\n }, {\n key: \"nest\",\n value: function nest(str, fc) {\n var _this2 = this;\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var match;\n var value;\n var clonedOptions;\n function handleHasOptions(key, inheritedOptions) {\n var sep = this.nestingOptionsSeparator;\n if (key.indexOf(sep) < 0) return key;\n var c = key.split(new RegExp(\"\".concat(sep, \"[ ]*{\")));\n var optionsString = \"{\".concat(c[1]);\n key = c[0];\n optionsString = this.interpolate(optionsString, clonedOptions);\n var matchedSingleQuotes = optionsString.match(/'/g);\n var matchedDoubleQuotes = optionsString.match(/\"/g);\n if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {\n optionsString = optionsString.replace(/'/g, '\"');\n }\n try {\n clonedOptions = JSON.parse(optionsString);\n if (inheritedOptions) clonedOptions = _objectSpread$3(_objectSpread$3({}, inheritedOptions), clonedOptions);\n } catch (e) {\n this.logger.warn(\"failed parsing options string in nesting for key \".concat(key), e);\n return \"\".concat(key).concat(sep).concat(optionsString);\n }\n delete clonedOptions.defaultValue;\n return key;\n }\n while (match = this.nestingRegexp.exec(str)) {\n var formatters = [];\n clonedOptions = _objectSpread$3({}, options);\n clonedOptions = clonedOptions.replace && typeof clonedOptions.replace !== 'string' ? clonedOptions.replace : clonedOptions;\n clonedOptions.applyPostProcessor = false;\n delete clonedOptions.defaultValue;\n var doReduce = false;\n if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {\n var r = match[1].split(this.formatSeparator).map(function (elem) {\n return elem.trim();\n });\n match[1] = r.shift();\n formatters = r;\n doReduce = true;\n }\n value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);\n if (value && match[0] === str && typeof value !== 'string') return value;\n if (typeof value !== 'string') value = makeString(value);\n if (!value) {\n this.logger.warn(\"missed to resolve \".concat(match[1], \" for nesting \").concat(str));\n value = '';\n }\n if (doReduce) {\n value = formatters.reduce(function (v, f) {\n return _this2.format(v, f, options.lng, _objectSpread$3(_objectSpread$3({}, options), {}, {\n interpolationkey: match[1].trim()\n }));\n }, value.trim());\n }\n str = str.replace(match[0], value);\n this.regexp.lastIndex = 0;\n }\n return str;\n }\n }]);\n return Interpolator;\n}();\n\nfunction ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction parseFormatStr(formatStr) {\n var formatName = formatStr.toLowerCase().trim();\n var formatOptions = {};\n if (formatStr.indexOf('(') > -1) {\n var p = formatStr.split('(');\n formatName = p[0].toLowerCase().trim();\n var optStr = p[1].substring(0, p[1].length - 1);\n if (formatName === 'currency' && optStr.indexOf(':') < 0) {\n if (!formatOptions.currency) formatOptions.currency = optStr.trim();\n } else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {\n if (!formatOptions.range) formatOptions.range = optStr.trim();\n } else {\n var opts = optStr.split(';');\n opts.forEach(function (opt) {\n if (!opt) return;\n var _opt$split = opt.split(':'),\n _opt$split2 = _toArray(_opt$split),\n key = _opt$split2[0],\n rest = _opt$split2.slice(1);\n var val = rest.join(':').trim().replace(/^'+|'+$/g, '');\n if (!formatOptions[key.trim()]) formatOptions[key.trim()] = val;\n if (val === 'false') formatOptions[key.trim()] = false;\n if (val === 'true') formatOptions[key.trim()] = true;\n if (!isNaN(val)) formatOptions[key.trim()] = parseInt(val, 10);\n });\n }\n }\n return {\n formatName: formatName,\n formatOptions: formatOptions\n };\n}\nfunction createCachedFormatter(fn) {\n var cache = {};\n return function invokeFormatter(val, lng, options) {\n var key = lng + JSON.stringify(options);\n var formatter = cache[key];\n if (!formatter) {\n formatter = fn(lng, options);\n cache[key] = formatter;\n }\n return formatter(val);\n };\n}\nvar Formatter = function () {\n function Formatter() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Formatter);\n this.logger = baseLogger.create('formatter');\n this.options = options;\n this.formats = {\n number: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.NumberFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val);\n };\n }),\n currency: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.NumberFormat(lng, _objectSpread$2(_objectSpread$2({}, opt), {}, {\n style: 'currency'\n }));\n return function (val) {\n return formatter.format(val);\n };\n }),\n datetime: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.DateTimeFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val);\n };\n }),\n relativetime: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val, opt.range || 'day');\n };\n }),\n list: createCachedFormatter(function (lng, opt) {\n var formatter = new Intl.ListFormat(lng, _objectSpread$2({}, opt));\n return function (val) {\n return formatter.format(val);\n };\n })\n };\n this.init(options);\n }\n _createClass(Formatter, [{\n key: \"init\",\n value: function init(services) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n var iOpts = options.interpolation;\n this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';\n }\n }, {\n key: \"add\",\n value: function add(name, fc) {\n this.formats[name.toLowerCase().trim()] = fc;\n }\n }, {\n key: \"addCached\",\n value: function addCached(name, fc) {\n this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);\n }\n }, {\n key: \"format\",\n value: function format(value, _format, lng) {\n var _this = this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var formats = _format.split(this.formatSeparator);\n var result = formats.reduce(function (mem, f) {\n var _parseFormatStr = parseFormatStr(f),\n formatName = _parseFormatStr.formatName,\n formatOptions = _parseFormatStr.formatOptions;\n if (_this.formats[formatName]) {\n var formatted = mem;\n try {\n var valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};\n var l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;\n formatted = _this.formats[formatName](mem, l, _objectSpread$2(_objectSpread$2(_objectSpread$2({}, formatOptions), options), valOptions));\n } catch (error) {\n _this.logger.warn(error);\n }\n return formatted;\n } else {\n _this.logger.warn(\"there was no format function for \".concat(formatName));\n }\n return mem;\n }, value);\n return result;\n }\n }]);\n return Formatter;\n}();\n\nfunction ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct$1() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction removePending(q, name) {\n if (q.pending[name] !== undefined) {\n delete q.pending[name];\n q.pendingCount--;\n }\n}\nvar Connector = function (_EventEmitter) {\n _inherits(Connector, _EventEmitter);\n var _super = _createSuper$1(Connector);\n function Connector(backend, store, services) {\n var _this;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n _classCallCheck(this, Connector);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n _this.backend = backend;\n _this.store = store;\n _this.services = services;\n _this.languageUtils = services.languageUtils;\n _this.options = options;\n _this.logger = baseLogger.create('backendConnector');\n _this.waitingReads = [];\n _this.maxParallelReads = options.maxParallelReads || 10;\n _this.readingCalls = 0;\n _this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;\n _this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;\n _this.state = {};\n _this.queue = [];\n if (_this.backend && _this.backend.init) {\n _this.backend.init(services, options.backend, options);\n }\n return _this;\n }\n _createClass(Connector, [{\n key: \"queueLoad\",\n value: function queueLoad(languages, namespaces, options, callback) {\n var _this2 = this;\n var toLoad = {};\n var pending = {};\n var toLoadLanguages = {};\n var toLoadNamespaces = {};\n languages.forEach(function (lng) {\n var hasAllNamespaces = true;\n namespaces.forEach(function (ns) {\n var name = \"\".concat(lng, \"|\").concat(ns);\n if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {\n _this2.state[name] = 2;\n } else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {\n if (pending[name] === undefined) pending[name] = true;\n } else {\n _this2.state[name] = 1;\n hasAllNamespaces = false;\n if (pending[name] === undefined) pending[name] = true;\n if (toLoad[name] === undefined) toLoad[name] = true;\n if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;\n }\n });\n if (!hasAllNamespaces) toLoadLanguages[lng] = true;\n });\n if (Object.keys(toLoad).length || Object.keys(pending).length) {\n this.queue.push({\n pending: pending,\n pendingCount: Object.keys(pending).length,\n loaded: {},\n errors: [],\n callback: callback\n });\n }\n return {\n toLoad: Object.keys(toLoad),\n pending: Object.keys(pending),\n toLoadLanguages: Object.keys(toLoadLanguages),\n toLoadNamespaces: Object.keys(toLoadNamespaces)\n };\n }\n }, {\n key: \"loaded\",\n value: function loaded(name, err, data) {\n var s = name.split('|');\n var lng = s[0];\n var ns = s[1];\n if (err) this.emit('failedLoading', lng, ns, err);\n if (data) {\n this.store.addResourceBundle(lng, ns, data);\n }\n this.state[name] = err ? -1 : 2;\n var loaded = {};\n this.queue.forEach(function (q) {\n pushPath(q.loaded, [lng], ns);\n removePending(q, name);\n if (err) q.errors.push(err);\n if (q.pendingCount === 0 && !q.done) {\n Object.keys(q.loaded).forEach(function (l) {\n if (!loaded[l]) loaded[l] = {};\n var loadedKeys = q.loaded[l];\n if (loadedKeys.length) {\n loadedKeys.forEach(function (n) {\n if (loaded[l][n] === undefined) loaded[l][n] = true;\n });\n }\n });\n q.done = true;\n if (q.errors.length) {\n q.callback(q.errors);\n } else {\n q.callback();\n }\n }\n });\n this.emit('loaded', loaded);\n this.queue = this.queue.filter(function (q) {\n return !q.done;\n });\n }\n }, {\n key: \"read\",\n value: function read(lng, ns, fcName) {\n var _this3 = this;\n var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;\n var callback = arguments.length > 5 ? arguments[5] : undefined;\n if (!lng.length) return callback(null, {});\n if (this.readingCalls >= this.maxParallelReads) {\n this.waitingReads.push({\n lng: lng,\n ns: ns,\n fcName: fcName,\n tried: tried,\n wait: wait,\n callback: callback\n });\n return;\n }\n this.readingCalls++;\n var resolver = function resolver(err, data) {\n _this3.readingCalls--;\n if (_this3.waitingReads.length > 0) {\n var next = _this3.waitingReads.shift();\n _this3.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);\n }\n if (err && data && tried < _this3.maxRetries) {\n setTimeout(function () {\n _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);\n }, wait);\n return;\n }\n callback(err, data);\n };\n var fc = this.backend[fcName].bind(this.backend);\n if (fc.length === 2) {\n try {\n var r = fc(lng, ns);\n if (r && typeof r.then === 'function') {\n r.then(function (data) {\n return resolver(null, data);\n })[\"catch\"](resolver);\n } else {\n resolver(null, r);\n }\n } catch (err) {\n resolver(err);\n }\n return;\n }\n return fc(lng, ns, resolver);\n }\n }, {\n key: \"prepareLoading\",\n value: function prepareLoading(languages, namespaces) {\n var _this4 = this;\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var callback = arguments.length > 3 ? arguments[3] : undefined;\n if (!this.backend) {\n this.logger.warn('No backend was added via i18next.use. Will not load resources.');\n return callback && callback();\n }\n if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);\n if (typeof namespaces === 'string') namespaces = [namespaces];\n var toLoad = this.queueLoad(languages, namespaces, options, callback);\n if (!toLoad.toLoad.length) {\n if (!toLoad.pending.length) callback();\n return null;\n }\n toLoad.toLoad.forEach(function (name) {\n _this4.loadOne(name);\n });\n }\n }, {\n key: \"load\",\n value: function load(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {}, callback);\n }\n }, {\n key: \"reload\",\n value: function reload(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {\n reload: true\n }, callback);\n }\n }, {\n key: \"loadOne\",\n value: function loadOne(name) {\n var _this5 = this;\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var s = name.split('|');\n var lng = s[0];\n var ns = s[1];\n this.read(lng, ns, 'read', undefined, undefined, function (err, data) {\n if (err) _this5.logger.warn(\"\".concat(prefix, \"loading namespace \").concat(ns, \" for language \").concat(lng, \" failed\"), err);\n if (!err && data) _this5.logger.log(\"\".concat(prefix, \"loaded namespace \").concat(ns, \" for language \").concat(lng), data);\n _this5.loaded(name, err, data);\n });\n }\n }, {\n key: \"saveMissing\",\n value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n var clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : function () {};\n if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {\n this.logger.warn(\"did not save key \\\"\".concat(key, \"\\\" as the namespace \\\"\").concat(namespace, \"\\\" was not yet loaded\"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n return;\n }\n if (key === undefined || key === null || key === '') return;\n if (this.backend && this.backend.create) {\n var opts = _objectSpread$1(_objectSpread$1({}, options), {}, {\n isUpdate: isUpdate\n });\n var fc = this.backend.create.bind(this.backend);\n if (fc.length < 6) {\n try {\n var r;\n if (fc.length === 5) {\n r = fc(languages, namespace, key, fallbackValue, opts);\n } else {\n r = fc(languages, namespace, key, fallbackValue);\n }\n if (r && typeof r.then === 'function') {\n r.then(function (data) {\n return clb(null, data);\n })[\"catch\"](clb);\n } else {\n clb(null, r);\n }\n } catch (err) {\n clb(err);\n }\n } else {\n fc(languages, namespace, key, fallbackValue, clb, opts);\n }\n }\n if (!languages || !languages[0]) return;\n this.store.addResource(languages[0], namespace, key, fallbackValue);\n }\n }]);\n return Connector;\n}(EventEmitter);\n\nfunction get() {\n return {\n debug: false,\n initImmediate: true,\n ns: ['translation'],\n defaultNS: ['translation'],\n fallbackLng: ['dev'],\n fallbackNS: false,\n supportedLngs: false,\n nonExplicitSupportedLngs: false,\n load: 'all',\n preload: false,\n simplifyPluralSuffix: true,\n keySeparator: '.',\n nsSeparator: ':',\n pluralSeparator: '_',\n contextSeparator: '_',\n partialBundledLanguages: false,\n saveMissing: false,\n updateMissing: false,\n saveMissingTo: 'fallback',\n saveMissingPlurals: true,\n missingKeyHandler: false,\n missingInterpolationHandler: false,\n postProcess: false,\n postProcessPassResolved: false,\n returnNull: true,\n returnEmptyString: true,\n returnObjects: false,\n joinArrays: false,\n returnedObjectHandler: false,\n parseMissingKeyHandler: false,\n appendNamespaceToMissingKey: false,\n appendNamespaceToCIMode: false,\n overloadTranslationOptionHandler: function handle(args) {\n var ret = {};\n if (_typeof(args[1]) === 'object') ret = args[1];\n if (typeof args[1] === 'string') ret.defaultValue = args[1];\n if (typeof args[2] === 'string') ret.tDescription = args[2];\n if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {\n var options = args[3] || args[2];\n Object.keys(options).forEach(function (key) {\n ret[key] = options[key];\n });\n }\n return ret;\n },\n interpolation: {\n escapeValue: true,\n format: function format(value, _format, lng, options) {\n return value;\n },\n prefix: '{{',\n suffix: '}}',\n formatSeparator: ',',\n unescapePrefix: '-',\n nestingPrefix: '$t(',\n nestingSuffix: ')',\n nestingOptionsSeparator: ',',\n maxReplaces: 1000,\n skipOnVariables: true\n }\n };\n}\nfunction transformOptions(options) {\n if (typeof options.ns === 'string') options.ns = [options.ns];\n if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];\n if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];\n if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {\n options.supportedLngs = options.supportedLngs.concat(['cimode']);\n }\n return options;\n}\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction noop() {}\nfunction bindMemberFunctions(inst) {\n var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));\n mems.forEach(function (mem) {\n if (typeof inst[mem] === 'function') {\n inst[mem] = inst[mem].bind(inst);\n }\n });\n}\nvar I18n = function (_EventEmitter) {\n _inherits(I18n, _EventEmitter);\n var _super = _createSuper(I18n);\n function I18n() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n _classCallCheck(this, I18n);\n _this = _super.call(this);\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n _this.options = transformOptions(options);\n _this.services = {};\n _this.logger = baseLogger;\n _this.modules = {\n external: []\n };\n bindMemberFunctions(_assertThisInitialized(_this));\n if (callback && !_this.isInitialized && !options.isClone) {\n if (!_this.options.initImmediate) {\n _this.init(options, callback);\n return _possibleConstructorReturn(_this, _assertThisInitialized(_this));\n }\n setTimeout(function () {\n _this.init(options, callback);\n }, 0);\n }\n return _this;\n }\n _createClass(I18n, [{\n key: \"init\",\n value: function init() {\n var _this2 = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n if (!options.defaultNS && options.defaultNS !== false && options.ns) {\n if (typeof options.ns === 'string') {\n options.defaultNS = options.ns;\n } else if (options.ns.indexOf('translation') < 0) {\n options.defaultNS = options.ns[0];\n }\n }\n var defOpts = get();\n this.options = _objectSpread(_objectSpread(_objectSpread({}, defOpts), this.options), transformOptions(options));\n if (this.options.compatibilityAPI !== 'v1') {\n this.options.interpolation = _objectSpread(_objectSpread({}, defOpts.interpolation), this.options.interpolation);\n }\n if (options.keySeparator !== undefined) {\n this.options.userDefinedKeySeparator = options.keySeparator;\n }\n if (options.nsSeparator !== undefined) {\n this.options.userDefinedNsSeparator = options.nsSeparator;\n }\n function createClassOnDemand(ClassOrObject) {\n if (!ClassOrObject) return null;\n if (typeof ClassOrObject === 'function') return new ClassOrObject();\n return ClassOrObject;\n }\n if (!this.options.isClone) {\n if (this.modules.logger) {\n baseLogger.init(createClassOnDemand(this.modules.logger), this.options);\n } else {\n baseLogger.init(null, this.options);\n }\n var formatter;\n if (this.modules.formatter) {\n formatter = this.modules.formatter;\n } else if (typeof Intl !== 'undefined') {\n formatter = Formatter;\n }\n var lu = new LanguageUtil(this.options);\n this.store = new ResourceStore(this.options.resources, this.options);\n var s = this.services;\n s.logger = baseLogger;\n s.resourceStore = this.store;\n s.languageUtils = lu;\n s.pluralResolver = new PluralResolver(lu, {\n prepend: this.options.pluralSeparator,\n compatibilityJSON: this.options.compatibilityJSON,\n simplifyPluralSuffix: this.options.simplifyPluralSuffix\n });\n if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {\n s.formatter = createClassOnDemand(formatter);\n s.formatter.init(s, this.options);\n this.options.interpolation.format = s.formatter.format.bind(s.formatter);\n }\n s.interpolator = new Interpolator(this.options);\n s.utils = {\n hasLoadedNamespace: this.hasLoadedNamespace.bind(this)\n };\n s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);\n s.backendConnector.on('*', function (event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n _this2.emit.apply(_this2, [event].concat(args));\n });\n if (this.modules.languageDetector) {\n s.languageDetector = createClassOnDemand(this.modules.languageDetector);\n if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);\n }\n if (this.modules.i18nFormat) {\n s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);\n if (s.i18nFormat.init) s.i18nFormat.init(this);\n }\n this.translator = new Translator(this.services, this.options);\n this.translator.on('*', function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n _this2.emit.apply(_this2, [event].concat(args));\n });\n this.modules.external.forEach(function (m) {\n if (m.init) m.init(_this2);\n });\n }\n this.format = this.options.interpolation.format;\n if (!callback) callback = noop;\n if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {\n var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];\n }\n if (!this.services.languageDetector && !this.options.lng) {\n this.logger.warn('init: no languageDetector is used and no lng is defined');\n }\n var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];\n storeApi.forEach(function (fcName) {\n _this2[fcName] = function () {\n var _this2$store;\n return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);\n };\n });\n var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];\n storeApiChained.forEach(function (fcName) {\n _this2[fcName] = function () {\n var _this2$store2;\n (_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);\n return _this2;\n };\n });\n var deferred = defer();\n var load = function load() {\n var finish = function finish(err, t) {\n if (_this2.isInitialized && !_this2.initializedStoreOnce) _this2.logger.warn('init: i18next is already initialized. You should call init just once!');\n _this2.isInitialized = true;\n if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);\n _this2.emit('initialized', _this2.options);\n deferred.resolve(t);\n callback(err, t);\n };\n if (_this2.languages && _this2.options.compatibilityAPI !== 'v1' && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2));\n _this2.changeLanguage(_this2.options.lng, finish);\n };\n if (this.options.resources || !this.options.initImmediate) {\n load();\n } else {\n setTimeout(load, 0);\n }\n return deferred;\n }\n }, {\n key: \"loadResources\",\n value: function loadResources(language) {\n var _this3 = this;\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n var usedCallback = callback;\n var usedLng = typeof language === 'string' ? language : this.language;\n if (typeof language === 'function') usedCallback = language;\n if (!this.options.resources || this.options.partialBundledLanguages) {\n if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback();\n var toLoad = [];\n var append = function append(lng) {\n if (!lng) return;\n var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);\n lngs.forEach(function (l) {\n if (toLoad.indexOf(l) < 0) toLoad.push(l);\n });\n };\n if (!usedLng) {\n var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n fallbacks.forEach(function (l) {\n return append(l);\n });\n } else {\n append(usedLng);\n }\n if (this.options.preload) {\n this.options.preload.forEach(function (l) {\n return append(l);\n });\n }\n this.services.backendConnector.load(toLoad, this.options.ns, function (e) {\n if (!e && !_this3.resolvedLanguage && _this3.language) _this3.setResolvedLanguage(_this3.language);\n usedCallback(e);\n });\n } else {\n usedCallback(null);\n }\n }\n }, {\n key: \"reloadResources\",\n value: function reloadResources(lngs, ns, callback) {\n var deferred = defer();\n if (!lngs) lngs = this.languages;\n if (!ns) ns = this.options.ns;\n if (!callback) callback = noop;\n this.services.backendConnector.reload(lngs, ns, function (err) {\n deferred.resolve();\n callback(err);\n });\n return deferred;\n }\n }, {\n key: \"use\",\n value: function use(module) {\n if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');\n if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');\n if (module.type === 'backend') {\n this.modules.backend = module;\n }\n if (module.type === 'logger' || module.log && module.warn && module.error) {\n this.modules.logger = module;\n }\n if (module.type === 'languageDetector') {\n this.modules.languageDetector = module;\n }\n if (module.type === 'i18nFormat') {\n this.modules.i18nFormat = module;\n }\n if (module.type === 'postProcessor') {\n postProcessor.addPostProcessor(module);\n }\n if (module.type === 'formatter') {\n this.modules.formatter = module;\n }\n if (module.type === '3rdParty') {\n this.modules.external.push(module);\n }\n return this;\n }\n }, {\n key: \"setResolvedLanguage\",\n value: function setResolvedLanguage(l) {\n if (!l || !this.languages) return;\n if (['cimode', 'dev'].indexOf(l) > -1) return;\n for (var li = 0; li < this.languages.length; li++) {\n var lngInLngs = this.languages[li];\n if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;\n if (this.store.hasLanguageSomeTranslations(lngInLngs)) {\n this.resolvedLanguage = lngInLngs;\n break;\n }\n }\n }\n }, {\n key: \"changeLanguage\",\n value: function changeLanguage(lng, callback) {\n var _this4 = this;\n this.isLanguageChangingTo = lng;\n var deferred = defer();\n this.emit('languageChanging', lng);\n var setLngProps = function setLngProps(l) {\n _this4.language = l;\n _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);\n _this4.resolvedLanguage = undefined;\n _this4.setResolvedLanguage(l);\n };\n var done = function done(err, l) {\n if (l) {\n setLngProps(l);\n _this4.translator.changeLanguage(l);\n _this4.isLanguageChangingTo = undefined;\n _this4.emit('languageChanged', l);\n _this4.logger.log('languageChanged', l);\n } else {\n _this4.isLanguageChangingTo = undefined;\n }\n deferred.resolve(function () {\n return _this4.t.apply(_this4, arguments);\n });\n if (callback) callback(err, function () {\n return _this4.t.apply(_this4, arguments);\n });\n };\n var setLng = function setLng(lngs) {\n if (!lng && !lngs && _this4.services.languageDetector) lngs = [];\n var l = typeof lngs === 'string' ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);\n if (l) {\n if (!_this4.language) {\n setLngProps(l);\n }\n if (!_this4.translator.language) _this4.translator.changeLanguage(l);\n if (_this4.services.languageDetector && _this4.services.languageDetector.cacheUserLanguage) _this4.services.languageDetector.cacheUserLanguage(l);\n }\n _this4.loadResources(l, function (err) {\n done(err, l);\n });\n };\n if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {\n setLng(this.services.languageDetector.detect());\n } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {\n if (this.services.languageDetector.detect.length === 0) {\n this.services.languageDetector.detect().then(setLng);\n } else {\n this.services.languageDetector.detect(setLng);\n }\n } else {\n setLng(lng);\n }\n return deferred;\n }\n }, {\n key: \"getFixedT\",\n value: function getFixedT(lng, ns, keyPrefix) {\n var _this5 = this;\n var fixedT = function fixedT(key, opts) {\n var options;\n if (_typeof(opts) !== 'object') {\n for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n rest[_key3 - 2] = arguments[_key3];\n }\n options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));\n } else {\n options = _objectSpread({}, opts);\n }\n options.lng = options.lng || fixedT.lng;\n options.lngs = options.lngs || fixedT.lngs;\n options.ns = options.ns || fixedT.ns;\n options.keyPrefix = options.keyPrefix || keyPrefix || fixedT.keyPrefix;\n var keySeparator = _this5.options.keySeparator || '.';\n var resultKey;\n if (options.keyPrefix && Array.isArray(key)) {\n resultKey = key.map(function (k) {\n return \"\".concat(options.keyPrefix).concat(keySeparator).concat(k);\n });\n } else {\n resultKey = options.keyPrefix ? \"\".concat(options.keyPrefix).concat(keySeparator).concat(key) : key;\n }\n return _this5.t(resultKey, options);\n };\n if (typeof lng === 'string') {\n fixedT.lng = lng;\n } else {\n fixedT.lngs = lng;\n }\n fixedT.ns = ns;\n fixedT.keyPrefix = keyPrefix;\n return fixedT;\n }\n }, {\n key: \"t\",\n value: function t() {\n var _this$translator;\n return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);\n }\n }, {\n key: \"exists\",\n value: function exists() {\n var _this$translator2;\n return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);\n }\n }, {\n key: \"setDefaultNamespace\",\n value: function setDefaultNamespace(ns) {\n this.options.defaultNS = ns;\n }\n }, {\n key: \"hasLoadedNamespace\",\n value: function hasLoadedNamespace(ns) {\n var _this6 = this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!this.isInitialized) {\n this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);\n return false;\n }\n if (!this.languages || !this.languages.length) {\n this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);\n return false;\n }\n var lng = options.lng || this.resolvedLanguage || this.languages[0];\n var fallbackLng = this.options ? this.options.fallbackLng : false;\n var lastLng = this.languages[this.languages.length - 1];\n if (lng.toLowerCase() === 'cimode') return true;\n var loadNotPending = function loadNotPending(l, n) {\n var loadState = _this6.services.backendConnector.state[\"\".concat(l, \"|\").concat(n)];\n return loadState === -1 || loadState === 2;\n };\n if (options.precheck) {\n var preResult = options.precheck(this, loadNotPending);\n if (preResult !== undefined) return preResult;\n }\n if (this.hasResourceBundle(lng, ns)) return true;\n if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;\n if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;\n return false;\n }\n }, {\n key: \"loadNamespaces\",\n value: function loadNamespaces(ns, callback) {\n var _this7 = this;\n var deferred = defer();\n if (!this.options.ns) {\n if (callback) callback();\n return Promise.resolve();\n }\n if (typeof ns === 'string') ns = [ns];\n ns.forEach(function (n) {\n if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);\n });\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"loadLanguages\",\n value: function loadLanguages(lngs, callback) {\n var deferred = defer();\n if (typeof lngs === 'string') lngs = [lngs];\n var preloaded = this.options.preload || [];\n var newLngs = lngs.filter(function (lng) {\n return preloaded.indexOf(lng) < 0;\n });\n if (!newLngs.length) {\n if (callback) callback();\n return Promise.resolve();\n }\n this.options.preload = preloaded.concat(newLngs);\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"dir\",\n value: function dir(lng) {\n if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);\n if (!lng) return 'rtl';\n var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];\n var languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());\n return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';\n }\n }, {\n key: \"cloneInstance\",\n value: function cloneInstance() {\n var _this8 = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n var mergedOptions = _objectSpread(_objectSpread(_objectSpread({}, this.options), options), {\n isClone: true\n });\n var clone = new I18n(mergedOptions);\n if (options.debug !== undefined || options.prefix !== undefined) {\n clone.logger = clone.logger.clone(options);\n }\n var membersToCopy = ['store', 'services', 'language'];\n membersToCopy.forEach(function (m) {\n clone[m] = _this8[m];\n });\n clone.services = _objectSpread({}, this.services);\n clone.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n clone.translator = new Translator(clone.services, clone.options);\n clone.translator.on('*', function (event) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n clone.emit.apply(clone, [event].concat(args));\n });\n clone.init(mergedOptions, callback);\n clone.translator.options = clone.options;\n clone.translator.backendConnector.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n return clone;\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return {\n options: this.options,\n store: this.store,\n language: this.language,\n languages: this.languages,\n resolvedLanguage: this.resolvedLanguage\n };\n }\n }]);\n return I18n;\n}(EventEmitter);\n_defineProperty(I18n, \"createInstance\", function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n return new I18n(options, callback);\n});\nvar instance = I18n.createInstance();\ninstance.createInstance = I18n.createInstance;\n\nvar createInstance = instance.createInstance;\nvar dir = instance.dir;\nvar init = instance.init;\nvar loadResources = instance.loadResources;\nvar reloadResources = instance.reloadResources;\nvar use = instance.use;\nvar changeLanguage = instance.changeLanguage;\nvar getFixedT = instance.getFixedT;\nvar t = instance.t;\nvar exists = instance.exists;\nvar setDefaultNamespace = instance.setDefaultNamespace;\nvar hasLoadedNamespace = instance.hasLoadedNamespace;\nvar loadNamespaces = instance.loadNamespaces;\nvar loadLanguages = instance.loadLanguages;\n\nexport { changeLanguage, createInstance, instance as default, dir, exists, getFixedT, hasLoadedNamespace, init, loadLanguages, loadNamespaces, loadResources, reloadResources, setDefaultNamespace, t, use };\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.scss';\nimport App from './App';\nimport './assets/style/animation.scss';\nimport 'modern-css-reset/dist/reset.min.css';\n\n/**\n * i18n\n */\nimport i18n from 'i18next';\nimport { initReactI18next, Trans } from 'react-i18next';\nimport { defaultLanguage, i18nTranslationResources, language } from './config/language';\nimport { webgalStore } from './store/store';\nimport { Provider } from 'react-redux';\n\ni18n\n .use(initReactI18next) // passes i18n down to react-i18next\n .init({\n // the translations\n // (tip move them in a JSON file and import them,\n // or even better, manage them via a UI: https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui)\n resources: i18nTranslationResources || {},\n lng: language[defaultLanguage] || 'zhCn', // if you're using a language detector, do not define the lng option\n fallbackLng: 'zhCn',\n\n interpolation: {\n escapeValue: false, // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape\n },\n })\n .then(() => console.log('WebGAL i18n Ready!'));\n\n// eslint-disable-next-line react/no-deprecated\nReactDOM.render(\n <React.StrictMode>\n <Trans>\n <Provider store={webgalStore}>\n <App />\n </Provider>\n </Trans>\n </React.StrictMode>,\n document.getElementById('root'),\n);\n"],"file":"assets/index-cb16cf2a.js"} \ No newline at end of file diff --git a/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-8f09b33a.js b/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-99a9f9bd.js similarity index 94% rename from packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-8f09b33a.js rename to packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-99a9f9bd.js index 510558863..3be3d93b4 100644 --- a/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-8f09b33a.js +++ b/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-99a9f9bd.js @@ -1,2 +1,2 @@ -import{r as w,W as p,C,T as k,S as M,a as y}from"./index-2d7a304e.js";const P=f=>{const S=p.gameplay.pixiStage.effectsContainer,g=p.gameplay.pixiStage.currentApp,e=new C;S.addChild(e);const n=k.from("./game/tex/cherryBlossoms.png");e.x=g.screen.width/2,e.y=g.screen.height/2,e.pivot.x=e.width/2,e.pivot.y=e.height/2,e.scale.x=1,e.scale.y=1;const i=[];function l(d){var o;const c=y.width,m=y.height,r=new M(n);let s=.25;r.scale.x=.15*s,r.scale.y=.15*s,r.anchor.set(.5),r.x=Math.random()*c-.5*c,r.y=0-.5*m,r.dropSpeed=Math.random()*5,r.acc=Math.random(),e.addChild(r),i.push(r);let h=0;for(const t of i){h++;const a=Math.random();t.dropSpeed=t.acc*.01+t.dropSpeed,t.y+=d*f*t.dropSpeed*.3+.7,h%2===0?(t.x+=d*a*.5,t.rotation+=d*a*.03):(t.x-=d*a*.5,t.rotation-=d*a*.03)}i.length>=200&&((o=i.shift())==null||o.destroy(),e.removeChild(e.children[0]))}return p.gameplay.pixiStage.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:l},"cherryBlossoms-Ticker"),{container:e,tickerKey:"cherryBlossoms-Ticker"}};w("cherryBlossoms",()=>P(3));const T=(f,u)=>{var c;const g=p.gameplay.pixiStage.effectsContainer,e=p.gameplay.pixiStage.currentApp,n=new C;g.addChild(n);const i=k.from("./game/tex/raindrop.png");n.x=e.screen.width/2,n.y=e.screen.height/2,n.pivot.x=n.width/2,n.pivot.y=n.height/2,n.scale.x=1,n.scale.y=1;const l=[];function d(m){var h;const r=y.width,s=y.height;for(let o=0;o<u;o++){const t=new M(i);let a=Math.random();a<=.5&&(a=.5),t.scale.x=.48*a,t.scale.y=.48*a,t.anchor.set(.5),t.x=Math.random()*r-.5*r,t.y=0-.5*s,t.dropSpeed=Math.random()*2,t.acc=Math.random(),t.alpha=Math.random(),t.alpha>=.5&&(t.alpha=.5),t.alpha<=.2&&(t.alpha=.2),n.addChild(t),l.push(t),l.length>=2500&&((h=l.shift())==null||h.destroy(),n.removeChild(n.children[0]))}for(const o of l)o.dropSpeed=o.acc*.01+o.dropSpeed,o.y+=m*f*o.dropSpeed*1.1+3}return(c=p.gameplay.pixiStage)==null||c.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:d},"rain-Ticker"),{container:n,tickerKey:"rain-Ticker"}};w("rain",()=>T(6,10));const b=f=>{var d;const S=p.gameplay.pixiStage.effectsContainer,g=p.gameplay.pixiStage.currentApp,e=new C;S.addChild(e);const n=k.from("./game/tex/snowFlake_min.png");e.x=g.screen.width/2,e.y=g.screen.height/2,e.pivot.x=e.width/2,e.pivot.y=e.height/2,e.scale.x=1,e.scale.y=1;const i=[];function l(c){var t;const m=y.width,r=y.height,s=new M(n);let h=Math.random();h<=.5&&(h=.5),s.scale.x=.144*h,s.scale.y=.144*h,s.anchor.set(.5),s.x=Math.random()*m-.5*m,s.y=0-.5*r,s.dropSpeed=Math.random()*2,s.acc=Math.random(),e.addChild(s),i.push(s);let o=0;for(const a of i){o++;const x=Math.random();a.dropSpeed=a.acc*.01+a.dropSpeed,a.y+=c*f*a.dropSpeed*.3+.7,o%2===0?(a.x+=c*x*.5,a.rotation+=c*x*.03):(a.x-=c*x*.5,a.rotation-=c*x*.03)}i.length>=500&&((t=i.shift())==null||t.destroy(),e.removeChild(e.children[0]))}return(d=p.gameplay.pixiStage)==null||d.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:l},"snow-Ticker"),{container:e,tickerKey:"snow-Ticker"}};w("snow",()=>b(3)); -//# sourceMappingURL=initRegister-8f09b33a.js.map +import{r as w,W as p,C,T as k,S as M,a as y}from"./index-cb16cf2a.js";const P=f=>{const S=p.gameplay.pixiStage.effectsContainer,g=p.gameplay.pixiStage.currentApp,e=new C;S.addChild(e);const n=k.from("./game/tex/cherryBlossoms.png");e.x=g.screen.width/2,e.y=g.screen.height/2,e.pivot.x=e.width/2,e.pivot.y=e.height/2,e.scale.x=1,e.scale.y=1;const i=[];function l(d){var o;const c=y.width,m=y.height,r=new M(n);let s=.25;r.scale.x=.15*s,r.scale.y=.15*s,r.anchor.set(.5),r.x=Math.random()*c-.5*c,r.y=0-.5*m,r.dropSpeed=Math.random()*5,r.acc=Math.random(),e.addChild(r),i.push(r);let h=0;for(const t of i){h++;const a=Math.random();t.dropSpeed=t.acc*.01+t.dropSpeed,t.y+=d*f*t.dropSpeed*.3+.7,h%2===0?(t.x+=d*a*.5,t.rotation+=d*a*.03):(t.x-=d*a*.5,t.rotation-=d*a*.03)}i.length>=200&&((o=i.shift())==null||o.destroy(),e.removeChild(e.children[0]))}return p.gameplay.pixiStage.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:l},"cherryBlossoms-Ticker"),{container:e,tickerKey:"cherryBlossoms-Ticker"}};w("cherryBlossoms",()=>P(3));const T=(f,u)=>{var c;const g=p.gameplay.pixiStage.effectsContainer,e=p.gameplay.pixiStage.currentApp,n=new C;g.addChild(n);const i=k.from("./game/tex/raindrop.png");n.x=e.screen.width/2,n.y=e.screen.height/2,n.pivot.x=n.width/2,n.pivot.y=n.height/2,n.scale.x=1,n.scale.y=1;const l=[];function d(m){var h;const r=y.width,s=y.height;for(let o=0;o<u;o++){const t=new M(i);let a=Math.random();a<=.5&&(a=.5),t.scale.x=.48*a,t.scale.y=.48*a,t.anchor.set(.5),t.x=Math.random()*r-.5*r,t.y=0-.5*s,t.dropSpeed=Math.random()*2,t.acc=Math.random(),t.alpha=Math.random(),t.alpha>=.5&&(t.alpha=.5),t.alpha<=.2&&(t.alpha=.2),n.addChild(t),l.push(t),l.length>=2500&&((h=l.shift())==null||h.destroy(),n.removeChild(n.children[0]))}for(const o of l)o.dropSpeed=o.acc*.01+o.dropSpeed,o.y+=m*f*o.dropSpeed*1.1+3}return(c=p.gameplay.pixiStage)==null||c.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:d},"rain-Ticker"),{container:n,tickerKey:"rain-Ticker"}};w("rain",()=>T(6,10));const b=f=>{var d;const S=p.gameplay.pixiStage.effectsContainer,g=p.gameplay.pixiStage.currentApp,e=new C;S.addChild(e);const n=k.from("./game/tex/snowFlake_min.png");e.x=g.screen.width/2,e.y=g.screen.height/2,e.pivot.x=e.width/2,e.pivot.y=e.height/2,e.scale.x=1,e.scale.y=1;const i=[];function l(c){var t;const m=y.width,r=y.height,s=new M(n);let h=Math.random();h<=.5&&(h=.5),s.scale.x=.144*h,s.scale.y=.144*h,s.anchor.set(.5),s.x=Math.random()*m-.5*m,s.y=0-.5*r,s.dropSpeed=Math.random()*2,s.acc=Math.random(),e.addChild(s),i.push(s);let o=0;for(const a of i){o++;const x=Math.random();a.dropSpeed=a.acc*.01+a.dropSpeed,a.y+=c*f*a.dropSpeed*.3+.7,o%2===0?(a.x+=c*x*.5,a.rotation+=c*x*.03):(a.x-=c*x*.5,a.rotation-=c*x*.03)}i.length>=500&&((t=i.shift())==null||t.destroy(),e.removeChild(e.children[0]))}return(d=p.gameplay.pixiStage)==null||d.registerAnimation({setStartState:()=>{},setEndState:()=>{},tickerFunc:l},"snow-Ticker"),{container:e,tickerKey:"snow-Ticker"}};w("snow",()=>b(3)); +//# sourceMappingURL=initRegister-99a9f9bd.js.map diff --git a/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-8f09b33a.js.map b/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-99a9f9bd.js.map similarity index 99% rename from packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-8f09b33a.js.map rename to packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-99a9f9bd.js.map index 792a5bcaf..9e8480d7a 100644 --- a/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-8f09b33a.js.map +++ b/packages/terre2/assets/templates/WebGAL_Template/assets/initRegister-99a9f9bd.js.map @@ -1 +1 @@ -{"version":3,"file":"initRegister-8f09b33a.js","sources":["../../src/Core/gameScripts/pixi/performs/cherryBlossoms.ts","../../src/Core/gameScripts/pixi/performs/rain.ts","../../src/Core/gameScripts/pixi/performs/snow.ts"],"sourcesContent":["import * as PIXI from 'pixi.js';\nimport { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n\nconst pixicherryBlossoms = (cherryBlossomsSpeed: number) => {\n // アニメーション パラメータ\n // 倍率を設定\n // 动画参数\n // 设置缩放的系数\n const scalePreset = 0.15;\n\n const effectsContainer = WebGAL!.gameplay!.pixiStage!.effectsContainer;\n const app = WebGAL!.gameplay!.pixiStage!.currentApp!;\n const container = new PIXI.Container();\n effectsContainer.addChild(container);\n // テクスチャを作成\n // 创建纹理\n const texture = PIXI.Texture.from('./game/tex/cherryBlossoms.png');\n // コンテナを中央に移動\n // 将容器移到中心\n container.x = app.screen.width / 2;\n container.y = app.screen.height / 2;\n container.pivot.x = container.width / 2;\n container.pivot.y = container.height / 2;\n // ズームを調整\n // 调整缩放\n container.scale.x = 1;\n container.scale.y = 1;\n // container.rotation = -0.2;\n const bunnyList: any = [];\n // アニメーションの更新を監視\n // 监听动画更新\n function tickerFn(delta: number) {\n // 桜の位置を制御するために使用される長さと幅を取得します\n // 获取长宽,用于控制花出现位置\n const stageWidth = SCREEN_CONSTANTS.width;\n const stageHeight = SCREEN_CONSTANTS.height;\n // オブジェクトを作成\n // 创建对象\n const bunny = new PIXI.Sprite(texture);\n let scaleRand = 0.25;\n\n bunny.scale.x = scalePreset * scaleRand;\n bunny.scale.y = scalePreset * scaleRand;\n // アンカーポイントを設定\n // 设置锚点\n bunny.anchor.set(0.5);\n // ランダムな桜の位置\n // 随机花位置\n bunny.x = Math.random() * stageWidth - 0.5 * stageWidth;\n bunny.y = 0 - 0.5 * stageHeight;\n // @ts-ignore\n bunny['dropSpeed'] = Math.random() * 5;\n // @ts-ignore\n bunny['acc'] = Math.random();\n container.addChild(bunny);\n bunnyList.push(bunny);\n\n let count = 0;\n for (const e of bunnyList) {\n count++;\n const randomNumber = Math.random();\n e['dropSpeed'] = e['acc'] * 0.01 + e['dropSpeed'];\n e.y += delta * cherryBlossomsSpeed * e['dropSpeed'] * 0.3 + 0.7;\n const addX = count % 2 === 0;\n if (addX) {\n e.x += delta * randomNumber * 0.5;\n e.rotation += delta * randomNumber * 0.03;\n } else {\n e.x -= delta * randomNumber * 0.5;\n e.rotation -= delta * randomNumber * 0.03;\n }\n }\n // 同じ画面上の桜の数を制御します\n // 控制同屏花数\n if (bunnyList.length >= 200) {\n bunnyList.shift()?.destroy();\n container.removeChild(container.children[0]);\n }\n }\n WebGAL!.gameplay!.pixiStage!.registerAnimation(\n { setStartState: () => {}, setEndState: () => {}, tickerFunc: tickerFn },\n 'cherryBlossoms-Ticker',\n );\n return { container, tickerKey: 'cherryBlossoms-Ticker' };\n};\n\nregisterPerform('cherryBlossoms', () => pixicherryBlossoms(3));\n","import * as PIXI from 'pixi.js';\nimport { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n\nconst pixiRain = (rainSpeed: number, number: number) => {\n // 动画参数\n // 设置缩放的系数\n const scalePreset = 0.48;\n\n const effectsContainer = WebGAL.gameplay.pixiStage!.effectsContainer!;\n const app = WebGAL.gameplay.pixiStage!.currentApp!;\n const container = new PIXI.Container();\n effectsContainer.addChild(container);\n // 创建纹理\n const texture = PIXI.Texture.from('./game/tex/raindrop.png');\n // 将容器移到中心\n container.x = app.screen.width / 2;\n container.y = app.screen.height / 2;\n container.pivot.x = container.width / 2;\n container.pivot.y = container.height / 2;\n // 调整缩放\n container.scale.x = 1;\n container.scale.y = 1;\n // container.rotation = -0.2;\n const bunnyList: PIXI.Sprite[] = [];\n // 监听动画更新\n function ticker(delta: number) {\n // 获取长宽,用于控制雪花出现位置\n const stageWidth = SCREEN_CONSTANTS.width;\n const stageHeight = SCREEN_CONSTANTS.height;\n for (let i = 0; i < number; i++) {\n // 创建对象\n const bunny = new PIXI.Sprite(texture);\n // 随机雨点大小\n let scaleRand = Math.random();\n if (scaleRand <= 0.5) {\n scaleRand = 0.5;\n }\n bunny.scale.x = scalePreset * scaleRand;\n bunny.scale.y = scalePreset * scaleRand;\n // 设置锚点\n bunny.anchor.set(0.5);\n // 随机雪花位置\n bunny.x = Math.random() * stageWidth - 0.5 * stageWidth;\n bunny.y = 0 - 0.5 * stageHeight;\n // @ts-ignore\n bunny['dropSpeed'] = Math.random() * 2;\n // @ts-ignore\n bunny['acc'] = Math.random();\n bunny['alpha'] = Math.random();\n if (bunny['alpha'] >= 0.5) {\n bunny['alpha'] = 0.5;\n }\n if (bunny['alpha'] <= 0.2) {\n bunny['alpha'] = 0.2;\n }\n container.addChild(bunny);\n // 控制每片雨点\n bunnyList.push(bunny);\n\n // 控制同屏雨点数\n if (bunnyList.length >= 2500) {\n bunnyList.shift()?.destroy();\n container.removeChild(container.children[0]);\n }\n }\n // 雨点落下\n for (const e of bunnyList) {\n // @ts-ignore\n e['dropSpeed'] = e['acc'] * 0.01 + e['dropSpeed'];\n // @ts-ignore\n e.y += delta * rainSpeed * e['dropSpeed'] * 1.1 + 3;\n }\n }\n WebGAL.gameplay.pixiStage?.registerAnimation(\n { setStartState: () => {}, setEndState: () => {}, tickerFunc: ticker },\n 'rain-Ticker',\n );\n return { container, tickerKey: 'rain-Ticker' };\n};\n\nregisterPerform('rain', () => pixiRain(6, 10));\n","import * as PIXI from 'pixi.js';\nimport { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n\nconst pixiSnow = (snowSpeed: number) => {\n // 动画参数\n // 设置缩放的系数\n const scalePreset = 0.144;\n\n const effectsContainer = WebGAL.gameplay.pixiStage!.effectsContainer!;\n const app = WebGAL.gameplay.pixiStage!.currentApp!;\n const container = new PIXI.Container();\n effectsContainer.addChild(container);\n // 创建纹理\n const texture = PIXI.Texture.from('./game/tex/snowFlake_min.png');\n // 将容器移到中心\n container.x = app.screen.width / 2;\n container.y = app.screen.height / 2;\n container.pivot.x = container.width / 2;\n container.pivot.y = container.height / 2;\n // 调整缩放\n container.scale.x = 1;\n container.scale.y = 1;\n // container.rotation = -0.2;\n const bunnyList: any = [];\n // 监听动画更新\n function tickerFn(delta: number) {\n // 获取长宽,用于控制雪花出现位置\n const stageWidth = SCREEN_CONSTANTS.width;\n const stageHeight = SCREEN_CONSTANTS.height;\n // 创建对象\n const bunny = new PIXI.Sprite(texture);\n // 随机雪花大小\n let scaleRand = Math.random();\n if (scaleRand <= 0.5) {\n scaleRand = 0.5;\n }\n bunny.scale.x = scalePreset * scaleRand;\n bunny.scale.y = scalePreset * scaleRand;\n // 设置锚点\n bunny.anchor.set(0.5);\n // 随机雪花位置\n bunny.x = Math.random() * stageWidth - 0.5 * stageWidth;\n bunny.y = 0 - 0.5 * stageHeight;\n // @ts-ignore\n bunny['dropSpeed'] = Math.random() * 2;\n // @ts-ignore\n bunny['acc'] = Math.random();\n container.addChild(bunny);\n // 控制每片雪花\n bunnyList.push(bunny);\n let count = 0; // 用于判断雪花往左还是往右飘,是2的倍数则往左\n for (const e of bunnyList) {\n count++;\n const randomNumber = Math.random();\n e['dropSpeed'] = e['acc'] * 0.01 + e['dropSpeed'];\n e.y += delta * snowSpeed * e['dropSpeed'] * 0.3 + 0.7;\n const addX = count % 2 === 0;\n if (addX) {\n e.x += delta * randomNumber * 0.5;\n e.rotation += delta * randomNumber * 0.03;\n } else {\n e.x -= delta * randomNumber * 0.5;\n e.rotation -= delta * randomNumber * 0.03;\n }\n }\n // 控制同屏雪花数\n if (bunnyList.length >= 500) {\n bunnyList.shift()?.destroy();\n container.removeChild(container.children[0]);\n }\n }\n WebGAL.gameplay.pixiStage?.registerAnimation(\n { setStartState: () => {}, setEndState: () => {}, tickerFunc: tickerFn },\n 'snow-Ticker',\n );\n return { container, tickerKey: 'snow-Ticker' };\n};\n\nregisterPerform('snow', () => pixiSnow(3));\n"],"names":["pixicherryBlossoms","cherryBlossomsSpeed","effectsContainer","WebGAL","app","container","PIXI.Container","texture","PIXI.Texture","bunnyList","tickerFn","delta","stageWidth","SCREEN_CONSTANTS","stageHeight","bunny","PIXI.Sprite","scaleRand","count","e","randomNumber","_a","registerPerform","pixiRain","rainSpeed","number","ticker","i","pixiSnow","snowSpeed"],"mappings":"sEAMA,MAAMA,EAAsBC,GAAgC,CAOpD,MAAAC,EAAmBC,EAAQ,SAAU,UAAW,iBAChDC,EAAMD,EAAQ,SAAU,UAAW,WACnCE,EAAY,IAAIC,EACtBJ,EAAiB,SAASG,CAAS,EAGnC,MAAME,EAAUC,EAAa,KAAK,+BAA+B,EAGvDH,EAAA,EAAID,EAAI,OAAO,MAAQ,EACvBC,EAAA,EAAID,EAAI,OAAO,OAAS,EACxBC,EAAA,MAAM,EAAIA,EAAU,MAAQ,EAC5BA,EAAA,MAAM,EAAIA,EAAU,OAAS,EAGvCA,EAAU,MAAM,EAAI,EACpBA,EAAU,MAAM,EAAI,EAEpB,MAAMI,EAAiB,CAAA,EAGvB,SAASC,EAASC,EAAe,OAG/B,MAAMC,EAAaC,EAAiB,MAC9BC,EAAcD,EAAiB,OAG/BE,EAAQ,IAAIC,EAAYT,CAAO,EACrC,IAAIU,EAAY,IAEVF,EAAA,MAAM,EAAI,IAAcE,EACxBF,EAAA,MAAM,EAAI,IAAcE,EAGxBF,EAAA,OAAO,IAAI,EAAG,EAGpBA,EAAM,EAAI,KAAK,OAAO,EAAIH,EAAa,GAAMA,EACvCG,EAAA,EAAI,EAAI,GAAMD,EAEpBC,EAAM,UAAe,KAAK,OAAA,EAAW,EAE/BA,EAAA,IAAS,KAAK,OAAO,EAC3BV,EAAU,SAASU,CAAK,EACxBN,EAAU,KAAKM,CAAK,EAEpB,IAAIG,EAAQ,EACZ,UAAWC,KAAKV,EAAW,CACzBS,IACM,MAAAE,EAAe,KAAK,SAC1BD,EAAE,UAAeA,EAA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} \ No newline at end of file +{"version":3,"file":"initRegister-99a9f9bd.js","sources":["../../src/Core/gameScripts/pixi/performs/cherryBlossoms.ts","../../src/Core/gameScripts/pixi/performs/rain.ts","../../src/Core/gameScripts/pixi/performs/snow.ts"],"sourcesContent":["import * as PIXI from 'pixi.js';\nimport { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n\nconst pixicherryBlossoms = (cherryBlossomsSpeed: number) => {\n // アニメーション パラメータ\n // 倍率を設定\n // 动画参数\n // 设置缩放的系数\n const scalePreset = 0.15;\n\n const effectsContainer = WebGAL!.gameplay!.pixiStage!.effectsContainer;\n const app = WebGAL!.gameplay!.pixiStage!.currentApp!;\n const container = new PIXI.Container();\n effectsContainer.addChild(container);\n // テクスチャを作成\n // 创建纹理\n const texture = PIXI.Texture.from('./game/tex/cherryBlossoms.png');\n // コンテナを中央に移動\n // 将容器移到中心\n container.x = app.screen.width / 2;\n container.y = app.screen.height / 2;\n container.pivot.x = container.width / 2;\n container.pivot.y = container.height / 2;\n // ズームを調整\n // 调整缩放\n container.scale.x = 1;\n container.scale.y = 1;\n // container.rotation = -0.2;\n const bunnyList: any = [];\n // アニメーションの更新を監視\n // 监听动画更新\n function tickerFn(delta: number) {\n // 桜の位置を制御するために使用される長さと幅を取得します\n // 获取长宽,用于控制花出现位置\n const stageWidth = SCREEN_CONSTANTS.width;\n const stageHeight = SCREEN_CONSTANTS.height;\n // オブジェクトを作成\n // 创建对象\n const bunny = new PIXI.Sprite(texture);\n let scaleRand = 0.25;\n\n bunny.scale.x = scalePreset * scaleRand;\n bunny.scale.y = scalePreset * scaleRand;\n // アンカーポイントを設定\n // 设置锚点\n bunny.anchor.set(0.5);\n // ランダムな桜の位置\n // 随机花位置\n bunny.x = Math.random() * stageWidth - 0.5 * stageWidth;\n bunny.y = 0 - 0.5 * stageHeight;\n // @ts-ignore\n bunny['dropSpeed'] = Math.random() * 5;\n // @ts-ignore\n bunny['acc'] = Math.random();\n container.addChild(bunny);\n bunnyList.push(bunny);\n\n let count = 0;\n for (const e of bunnyList) {\n count++;\n const randomNumber = Math.random();\n e['dropSpeed'] = e['acc'] * 0.01 + e['dropSpeed'];\n e.y += delta * cherryBlossomsSpeed * e['dropSpeed'] * 0.3 + 0.7;\n const addX = count % 2 === 0;\n if (addX) {\n e.x += delta * randomNumber * 0.5;\n e.rotation += delta * randomNumber * 0.03;\n } else {\n e.x -= delta * randomNumber * 0.5;\n e.rotation -= delta * randomNumber * 0.03;\n }\n }\n // 同じ画面上の桜の数を制御します\n // 控制同屏花数\n if (bunnyList.length >= 200) {\n bunnyList.shift()?.destroy();\n container.removeChild(container.children[0]);\n }\n }\n WebGAL!.gameplay!.pixiStage!.registerAnimation(\n { setStartState: () => {}, setEndState: () => {}, tickerFunc: tickerFn },\n 'cherryBlossoms-Ticker',\n );\n return { container, tickerKey: 'cherryBlossoms-Ticker' };\n};\n\nregisterPerform('cherryBlossoms', () => pixicherryBlossoms(3));\n","import * as PIXI from 'pixi.js';\nimport { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n\nconst pixiRain = (rainSpeed: number, number: number) => {\n // 动画参数\n // 设置缩放的系数\n const scalePreset = 0.48;\n\n const effectsContainer = WebGAL.gameplay.pixiStage!.effectsContainer!;\n const app = WebGAL.gameplay.pixiStage!.currentApp!;\n const container = new PIXI.Container();\n effectsContainer.addChild(container);\n // 创建纹理\n const texture = PIXI.Texture.from('./game/tex/raindrop.png');\n // 将容器移到中心\n container.x = app.screen.width / 2;\n container.y = app.screen.height / 2;\n container.pivot.x = container.width / 2;\n container.pivot.y = container.height / 2;\n // 调整缩放\n container.scale.x = 1;\n container.scale.y = 1;\n // container.rotation = -0.2;\n const bunnyList: PIXI.Sprite[] = [];\n // 监听动画更新\n function ticker(delta: number) {\n // 获取长宽,用于控制雪花出现位置\n const stageWidth = SCREEN_CONSTANTS.width;\n const stageHeight = SCREEN_CONSTANTS.height;\n for (let i = 0; i < number; i++) {\n // 创建对象\n const bunny = new PIXI.Sprite(texture);\n // 随机雨点大小\n let scaleRand = Math.random();\n if (scaleRand <= 0.5) {\n scaleRand = 0.5;\n }\n bunny.scale.x = scalePreset * scaleRand;\n bunny.scale.y = scalePreset * scaleRand;\n // 设置锚点\n bunny.anchor.set(0.5);\n // 随机雪花位置\n bunny.x = Math.random() * stageWidth - 0.5 * stageWidth;\n bunny.y = 0 - 0.5 * stageHeight;\n // @ts-ignore\n bunny['dropSpeed'] = Math.random() * 2;\n // @ts-ignore\n bunny['acc'] = Math.random();\n bunny['alpha'] = Math.random();\n if (bunny['alpha'] >= 0.5) {\n bunny['alpha'] = 0.5;\n }\n if (bunny['alpha'] <= 0.2) {\n bunny['alpha'] = 0.2;\n }\n container.addChild(bunny);\n // 控制每片雨点\n bunnyList.push(bunny);\n\n // 控制同屏雨点数\n if (bunnyList.length >= 2500) {\n bunnyList.shift()?.destroy();\n container.removeChild(container.children[0]);\n }\n }\n // 雨点落下\n for (const e of bunnyList) {\n // @ts-ignore\n e['dropSpeed'] = e['acc'] * 0.01 + e['dropSpeed'];\n // @ts-ignore\n e.y += delta * rainSpeed * e['dropSpeed'] * 1.1 + 3;\n }\n }\n WebGAL.gameplay.pixiStage?.registerAnimation(\n { setStartState: () => {}, setEndState: () => {}, tickerFunc: ticker },\n 'rain-Ticker',\n );\n return { container, tickerKey: 'rain-Ticker' };\n};\n\nregisterPerform('rain', () => pixiRain(6, 10));\n","import * as PIXI from 'pixi.js';\nimport { registerPerform } from '@/Core/util/pixiPerformManager/pixiPerformManager';\n\nimport { WebGAL } from '@/Core/WebGAL';\nimport { SCREEN_CONSTANTS } from '@/Core/util/constants';\n\nconst pixiSnow = (snowSpeed: number) => {\n // 动画参数\n // 设置缩放的系数\n const scalePreset = 0.144;\n\n const effectsContainer = WebGAL.gameplay.pixiStage!.effectsContainer!;\n const app = WebGAL.gameplay.pixiStage!.currentApp!;\n const container = new PIXI.Container();\n effectsContainer.addChild(container);\n // 创建纹理\n const texture = PIXI.Texture.from('./game/tex/snowFlake_min.png');\n // 将容器移到中心\n container.x = app.screen.width / 2;\n container.y = app.screen.height / 2;\n container.pivot.x = container.width / 2;\n container.pivot.y = container.height / 2;\n // 调整缩放\n container.scale.x = 1;\n container.scale.y = 1;\n // container.rotation = -0.2;\n const bunnyList: any = [];\n // 监听动画更新\n function tickerFn(delta: number) {\n // 获取长宽,用于控制雪花出现位置\n const stageWidth = SCREEN_CONSTANTS.width;\n const stageHeight = SCREEN_CONSTANTS.height;\n // 创建对象\n const bunny = new PIXI.Sprite(texture);\n // 随机雪花大小\n let scaleRand = Math.random();\n if (scaleRand <= 0.5) {\n scaleRand = 0.5;\n }\n bunny.scale.x = scalePreset * scaleRand;\n bunny.scale.y = scalePreset * scaleRand;\n // 设置锚点\n bunny.anchor.set(0.5);\n // 随机雪花位置\n bunny.x = Math.random() * stageWidth - 0.5 * stageWidth;\n bunny.y = 0 - 0.5 * stageHeight;\n // @ts-ignore\n bunny['dropSpeed'] = Math.random() * 2;\n // @ts-ignore\n bunny['acc'] = Math.random();\n container.addChild(bunny);\n // 控制每片雪花\n bunnyList.push(bunny);\n let count = 0; // 用于判断雪花往左还是往右飘,是2的倍数则往左\n for (const e of bunnyList) {\n count++;\n const randomNumber = Math.random();\n e['dropSpeed'] = e['acc'] * 0.01 + e['dropSpeed'];\n e.y += delta * snowSpeed * e['dropSpeed'] * 0.3 + 0.7;\n const addX = count % 2 === 0;\n if (addX) {\n e.x += delta * randomNumber * 0.5;\n e.rotation += delta * randomNumber * 0.03;\n } else {\n e.x -= delta * randomNumber * 0.5;\n e.rotation -= delta * randomNumber * 0.03;\n }\n }\n // 控制同屏雪花数\n if (bunnyList.length >= 500) {\n bunnyList.shift()?.destroy();\n container.removeChild(container.children[0]);\n }\n }\n WebGAL.gameplay.pixiStage?.registerAnimation(\n { setStartState: () => {}, setEndState: () => {}, tickerFunc: tickerFn },\n 'snow-Ticker',\n );\n return { container, tickerKey: 'snow-Ticker' };\n};\n\nregisterPerform('snow', () => pixiSnow(3));\n"],"names":["pixicherryBlossoms","cherryBlossomsSpeed","effectsContainer","WebGAL","app","container","PIXI.Container","texture","PIXI.Texture","bunnyList","tickerFn","delta","stageWidth","SCREEN_CONSTANTS","stageHeight","bunny","PIXI.Sprite","scaleRand","count","e","randomNumber","_a","registerPerform","pixiRain","rainSpeed","number","ticker","i","pixiSnow","snowSpeed"],"mappings":"sEAMA,MAAMA,EAAsBC,GAAgC,CAOpD,MAAAC,EAAmBC,EAAQ,SAAU,UAAW,iBAChDC,EAAMD,EAAQ,SAAU,UAAW,WACnCE,EAAY,IAAIC,EACtBJ,EAAiB,SAASG,CAAS,EAGnC,MAAME,EAAUC,EAAa,KAAK,+BAA+B,EAGvDH,EAAA,EAAID,EAAI,OAAO,MAAQ,EACvBC,EAAA,EAAID,EAAI,OAAO,OAAS,EACxBC,EAAA,MAAM,EAAIA,EAAU,MAAQ,EAC5BA,EAAA,MAAM,EAAIA,EAAU,OAAS,EAGvCA,EAAU,MAAM,EAAI,EACpBA,EAAU,MAAM,EAAI,EAEpB,MAAMI,EAAiB,CAAA,EAGvB,SAASC,EAASC,EAAe,OAG/B,MAAMC,EAAaC,EAAiB,MAC9BC,EAAcD,EAAiB,OAG/BE,EAAQ,IAAIC,EAAYT,CAAO,EACrC,IAAIU,EAAY,IAEVF,EAAA,MAAM,EAAI,IAAcE,EACxBF,EAAA,MAAM,EAAI,IAAcE,EAGxBF,EAAA,OAAO,IAAI,EAAG,EAGpBA,EAAM,EAAI,KAAK,OAAO,EAAIH,EAAa,GAAMA,EACvCG,EAAA,EAAI,EAAI,GAAMD,EAEpBC,EAAM,UAAe,KAAK,OAAA,EAAW,EAE/BA,EAAA,IAAS,KAAK,OAAO,EAC3BV,EAAU,SAASU,CAAK,EACxBN,EAAU,KAAKM,C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AAI,WAAYX,CAAS,EACvE,eAEK,CAAE,UAAAL,EAAW,UAAW,cACjC,EAEAiB,EAAgB,OAAQ,IAAMM,EAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/packages/terre2/assets/templates/WebGAL_Template/index.html b/packages/terre2/assets/templates/WebGAL_Template/index.html index 7b7378148..9a3cf0a4f 100644 --- a/packages/terre2/assets/templates/WebGAL_Template/index.html +++ b/packages/terre2/assets/templates/WebGAL_Template/index.html @@ -7,7 +7,7 @@ <link rel="manifest" href="./manifest.json" /> <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>--> <title>WebGAL - + From 73ace256c1dd37c1bb15c4006a8595d8be3620b8 Mon Sep 17 00:00:00 2001 From: Mahiru Date: Fri, 30 Aug 2024 19:57:26 +0800 Subject: [PATCH 2/2] update version --- package.json | 2 +- packages/origine2/package.json | 2 +- packages/origine2/src/config/info.ts | 2 +- .../templates/WebGAL_Template/game/template/template.json | 2 +- packages/terre2/package.json | 2 +- .../src/Modules/manage-template/manage-template.service.ts | 3 ++- packages/terre2/src/main.ts | 2 +- releasenote.md | 6 ++++++ 8 files changed, 14 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index beacd93f1..53a4bff47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webgal-terre", - "version": "4.5.5", + "version": "4.5.6", "private": true, "scripts": { "dev": "concurrently \"yarn dev:terre\" \"yarn dev:origine\" \"yarn dev:start-dev-server\"", diff --git a/packages/origine2/package.json b/packages/origine2/package.json index 3302fda09..2fe235a8a 100644 --- a/packages/origine2/package.json +++ b/packages/origine2/package.json @@ -1,7 +1,7 @@ { "name": "webgal-origine-2", "private": true, - "version": "4.5.5", + "version": "4.5.6", "license": "MPL-2.0", "scripts": { "dev": "lingui extract && lingui compile --typescript && vite --host", diff --git a/packages/origine2/src/config/info.ts b/packages/origine2/src/config/info.ts index fbe7496d7..5a3bdf754 100644 --- a/packages/origine2/src/config/info.ts +++ b/packages/origine2/src/config/info.ts @@ -4,6 +4,6 @@ export interface Info { } export const __INFO: Info = { - version: '4.5.5', + version: '4.5.6', buildTime: '2024-08-17T14:10:41.796Z', // 编译时会通过 version-sync.js 自动更新 }; diff --git a/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json b/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json index 742428439..8a398b19a 100644 --- a/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json +++ b/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json @@ -1,4 +1,4 @@ { "name":"Default Template", - "webgal-version":"4.5.5" + "webgal-version":"4.5.6" } diff --git a/packages/terre2/package.json b/packages/terre2/package.json index 6cd7cfdd6..ca5013ec4 100644 --- a/packages/terre2/package.json +++ b/packages/terre2/package.json @@ -1,6 +1,6 @@ { "name": "webgal-terre-2", - "version": "4.5.5", + "version": "4.5.6", "description": "", "author": "", "private": true, diff --git a/packages/terre2/src/Modules/manage-template/manage-template.service.ts b/packages/terre2/src/Modules/manage-template/manage-template.service.ts index 696a49754..82b75cde3 100644 --- a/packages/terre2/src/Modules/manage-template/manage-template.service.ts +++ b/packages/terre2/src/Modules/manage-template/manage-template.service.ts @@ -2,6 +2,7 @@ import { ConsoleLogger, Injectable, NotFoundException } from '@nestjs/common'; import { IFileInfo, WebgalFsService } from '../webgal-fs/webgal-fs.service'; import * as fsp from 'fs/promises'; import { webgalParser } from '../../util/webgal-parser'; +import { version_number } from '../../main'; @Injectable() export class ManageTemplateService { @@ -47,7 +48,7 @@ export class ManageTemplateService { */ const templateConfig = { name: templateName, - 'webgal-version': '4.5.5', + 'webgal-version': version_number, }; const templateConfigText = JSON.stringify(templateConfig, undefined, 2); diff --git a/packages/terre2/src/main.ts b/packages/terre2/src/main.ts index 359276a2c..7e04c9d39 100644 --- a/packages/terre2/src/main.ts +++ b/packages/terre2/src/main.ts @@ -8,7 +8,7 @@ import { env } from 'process'; import { WsAdapter } from '@nestjs/platform-ws'; let WEBGAL_PORT = 3000; // default port -const version_number = `4.5.5`; +export const version_number = `4.5.6`; if (env.WEBGAL_PORT) { WEBGAL_PORT = Number.parseInt(env.WEBGAL_PORT); } diff --git a/releasenote.md b/releasenote.md index be43a7b55..11e61d884 100644 --- a/releasenote.md +++ b/releasenote.md @@ -12,6 +12,8 @@ #### 修复 +4.5.6 修复:无法从状态中获取到对应 key 的变量时,返回 {key} 以避免变换不生效 + 修复引擎的若干错误 @@ -29,6 +31,8 @@ Reapply template after game creation #### Fixes +4.5.6 Fix: When the corresponding key variable cannot be obtained from the state, return {key} to avoid ineffective transformation. + Fix several bugs in the engine @@ -47,6 +51,8 @@ Fix several bugs in the engine #### 修正 +4.5.6 修正:状態から対応する key の変数が取得できない場合、{key} を返すようにし、変換が無効になるのを回避しました + エンジンのいくつかのバグを修正 [//]: # ()