@next2d/player 2.0.4 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/next2d.js +2 -2
- package/package.json +16 -16
- package/src/index.js +1 -1
package/next2d.js
CHANGED
|
@@ -656,7 +656,7 @@ void main() {
|
|
|
656
656
|
`;break;case"text":s.push(new re(...Object.values(c.textFormat))),r+=c.text;break;default:continue}}}if(e.compositionStartIndex===u.textTable.length){const i=u.textTable[e.compositionStartIndex-1];if(!i)return;for(let c=0;c<n;++c)s.push(new re(...Object.values(i.textFormat))),r+=t[c]}}s.length&&(e.$textFormats=s),e.text=r,e.$textFormats=null,u=X(e);let a=e.compositionStartIndex+n;for(let i=e.compositionStartIndex;i<a;++i){const c=u.textTable[i];if(!c)break;if(c.textFormat.underline=!0,c.mode==="wrap"){if(i===e.compositionStartIndex){let o=1;for(;;){const d=u.textTable[i-o];if(!d)break;if(d.mode==="text"){d.textFormat.underline=!0;break}o++}}i>e.compositionStartIndex&&a++}}e.compositionEndIndex=e.focusIndex=a},ro=e=>{const t=Le();t&&no(t,e.data)},ao=e=>{if(e.compositionEndIndex>-1){const t=X(e);for(let u=e.compositionStartIndex;u<e.compositionEndIndex;++u){const s=t.textTable[u];s&&(s.textFormat.underline=!1)}e.focusIndex=e.compositionEndIndex}oe.blur(),oe.value="",e.focus&&oe.focus(),e.selectIndex=-1,e.compositionStartIndex=-1,e.compositionEndIndex=-1},io=()=>{const e=Le();e&&ao(e)},Jn=(e,t)=>{if(e.focusIndex===-1||e.compositionStartIndex>-1)return;e.selectIndex>-1&&fs(e);const u=X(e);if(2>u.textTable.length){e.focusIndex=2,e.appendText(t);return}const s=[];let n="";for(let r=1;r<u.textTable.length;++r){const a=u.textTable[r];if(a){if(e.focusIndex===r)for(let i=0;i<t.length;++i)s.push(new re(...Object.values(a.textFormat))),n+=t[i];switch(a.mode){case"break":s.push(new re(...Object.values(a.textFormat))),n+=`
|
|
657
657
|
`;break;case"text":s.push(new re(...Object.values(a.textFormat))),n+=a.text;break;default:continue}}}if(u.textTable.length===e.focusIndex){let r;if(u.textTable.length){const a=u.textTable[u.textTable.length-1];r=new re(...Object.values(a.textFormat))}else r=e.defaultTextFormat,e.focusIndex++;for(let a=0;a<t.length;++a)s.push(new re(...Object.values(r.toObject()))),n+=t[a]}e.$textFormats=s,e.text=n,e.$textFormats=null,e.focusIndex+=t.length,e.selectIndex=-1,oe.value=""},co=e=>{if(!e.data)return;const t=Le();t&&(Jn(t,e.data),t.hasEventListener(x.INPUT)&&t.dispatchEvent(new x(x.INPUT)))},oo=e=>{e.addEventListener("compositionstart",Ic),e.addEventListener("compositionupdate",ro),e.addEventListener("compositionend",io),e.addEventListener("input",co)};let jn=null;const _s=e=>{jn=e},Le=()=>jn,oe=document.createElement("textarea");oo(oe);oe.tabIndex=-1;let Ee="";Ee+="position: fixed;";Ee+="top: 0;";Ee+="left: 0;";Ee+="font-size: 16px;";Ee+="border: 0;";Ee+="resize: none;";Ee+="opacity: 0;";Ee+="z-index: -1;";Ee+="pointer-events: none;";oe.setAttribute("style",Ee);const Uu=document.createElement("canvas");Uu.width=Uu.height=1;const De=Uu.getContext("2d");let er=0;const At=()=>er,ht=e=>{er=e},lo=e=>De?(De.fillStyle=e,+`0x${De.fillStyle.slice(1)}`):0,Je=e=>isNaN(+e)?lo(`${e}`):+e,ho=(e,t=1)=>({R:(e&16711680)>>16,G:(e&65280)>>8,B:e&255,A:t*255}),ft=(e,t,u,s=null)=>{const n=+e;return isNaN(n)&&s!==null?s:Math.min(Math.max(t,isNaN(n)?0:n),u)};let tr;const qt=()=>tr,ur=e=>{tr=e},Ke={x:0,y:0};class re{align;bold;color;font;italic;leading;leftMargin;letterSpacing;rightMargin;size;underline;constructor(t=null,u=null,s=null,n=null,r=null,a=null,i=null,c=null,o=null,d=null,h=null){this.font=t,this.size=u,this.color=s,this.bold=n,this.italic=r,this.underline=a,this.align=i,this.leftMargin=c,this.rightMargin=o,this.leading=d,this.letterSpacing=h}clone(){return new re(this.font,this.size,this.color,this.bold,this.italic,this.underline,this.align,this.leftMargin,this.rightMargin,this.leading,this.letterSpacing)}toObject(){return{font:this.font,size:this.size,color:Je(this.color),bold:this.bold,italic:this.italic,underline:this.underline,align:this.align,leftMargin:this.leftMargin,rightMargin:this.rightMargin,leading:this.leading,letterSpacing:this.letterSpacing}}}const fo=e=>{e.align="left",e.bold=!1,e.color=0,e.font="Times New Roman",e.italic=!1,e.leading=0,e.leftMargin=0,e.letterSpacing=0,e.rightMargin=0,e.size=12,e.underline=!1},bo=e=>{let t="";if(e.font&&(t+=`font-family: ${e.font};`),e.size&&(t+=`font-size: ${e.size}px;`),e.color){const u=ho(Je(e.color)),s=u.R.toString(16).padStart(2,"0"),n=u.G.toString(16).padStart(2,"0"),r=u.B.toString(16).padStart(2,"0");t+=`color: #${s}${n}${r};`}return e.bold&&(t+="font-weight: bold;"),e.italic&&(t+="font-style: italic;"),e.underline&&(t+="text-decoration: underline;"),e.align&&(t+=`text-align: ${e.align};`),e.leftMargin&&(t+=`margin-left: ${e.leftMargin}px;`),e.rightMargin&&(t+=`margin-right: ${e.rightMargin}px;`),e.leading&&(t+=`margin-bottom: ${e.leading}px;`),e.letterSpacing&&(t+=`letter-spacing: ${e.letterSpacing}px;`),t},U=e=>{e.changed=!0;const t=e.parent;t&&!t.changed&&U(t)},qu=e=>{e.$textData=null,U(e),e.uniqueKey!==""&&O.has(e.uniqueKey)&&(O.removeById(e.uniqueKey),O.$removeIds.push(+e.uniqueKey))},$o=e=>{if(U(e),e.autoSize==="none"){e.xMin=e.bounds.xMin,e.yMin=e.bounds.yMin,e.xMax=e.bounds.xMax,e.yMax=e.bounds.yMax;return}const t=e.defaultTextFormat,u=e.textWidth+4+Zn(t);if(e.wordWrap)e.xMin=e.bounds.xMin,e.xMax=e.bounds.xMax;else switch(e.autoSize){case"left":e.xMax=u+e.xMin;break;case"center":e.xMax=u+e.xMin;break;case"right":e.xMax=e.bounds.xMax-(e.bounds.xMax-e.bounds.xMin-(u-e.bounds.xMin));break}e.yMax=e.textHeight+e.bounds.yMin+4},mo=e=>{let t=0;const u=X(e);for(let n=0;n<u.textTable.length;++n){const r=u.textTable[n];t=Math.max(t,r.textFormat.size||0)}let s=1;if(e.width&&e.textWidth)for(;t>s&&e.textWidth+4>e.width;)qu(e),X(e,s++);if(e.height&&e.textHeight)for(;t>s&&e.textHeight+4>e.height;)qu(e),X(e,s++);U(e)},ye=e=>{qu(e),X(e),e.autoSize==="none"&&e.autoFontSize&&mo(e),$o(e)},go=(e,t)=>{const u=X(e);if(2>u.textTable.length)return;let s=2,n=0;for(let l=1;l<u.textTable.length;++l){const f=u.textTable[l];if(!f)continue;let b=!1;if(f.mode==="text"&&(b=!0,s+=f.w),n>=t){n=l;break}f.mode==="break"&&(b=!0,s=2),b&&n++}const r=u.textTable[n];if(!r)return;e.$scrollX=e.$scrollY=0;const a=r.line;let i=0;for(let l=0;l<=a;++l)i+=u.heightTable[l];const c=Math.abs(e.yMax-e.yMin);let o=0;for(let l=a;l>-1;--l){const f=u.heightTable[l];if(c<o+f)break;o+=f}if(i>c){const l=(e.textHeight-c)/c;e.$scrollY=Math.max(0,Math.min((i-o)/l,c))}const d=Math.abs(e.xMax-e.xMin);let h=0;for(let l=n;l>0;--l){const f=u.textTable[l];if(f.mode==="text"){if(d<h+f.w)break;h+=f.w}}if(s>d){const l=(e.textWidth-d)/d;e.$scrollX=Math.max(0,Math.min((s-h)/l,d+.5))}U(e)},ce=()=>{const e=qt();e!==void 0&&clearTimeout(e),ur(void 0)},xo=window.devicePixelRatio,po=e=>{const t=e.localToGlobal(new j),u=e.$textData;if(u){const n=u.textTable[e.focusIndex];if(n){for(let a=e.focusIndex-1;a>-1;--a){const i=u.textTable[a];if(!i||i.line!==n.line)break;t.x+=i.w}const r=n.mode==="break"?n.line-1:n.line;for(let a=0;a<r;++a)t.y+=u.heightTable[a]}}const s=p.rendererScale/xo;oe.style.left=`${Ke.x+t.x*s}px`,oe.style.top=`${Ke.y+t.y*s}px`},he=e=>{e.focusVisible=!e.focusVisible,U(e),ur(setTimeout(()=>he(e),500)),po(e)},To=(e,t)=>{e.willTrigger(t)&&e.dispatchEvent(new Ue(t)),oe.value="",e.focus?(setTimeout(()=>{oe.focus()},300),qt()===void 0&&(e.focusIndex===-1&&(e.focusIndex=1,e.selectIndex=-1),he(e))):(e.focusIndex=-1,e.selectIndex=-1,e.focusVisible=!1,ce(),oe.blur()),U(e)},Eo=(e,t,u,s)=>e/s*u+t,yo=(e,t,u,s)=>(e/=s)*e*u+t,Mo=(e,t,u,s)=>-(e/=s)*(e-2)*u+t,wo=(e,t,u,s)=>(e/=s/2)<1?e*e*u/2+t:-((e-=1)*(e-2)-1)*u/2+t,Ao=(e,t,u,s)=>(e/=s)*e*e*u+t,vo=(e,t,u,s)=>(e/=s,(--e*e*e+1)*u+t),Io=(e,t,u,s)=>(e/=s/2)<1?e*e*e*u/2+t:((e-=2)*e*e+2)*u/2+t,So=(e,t,u,s)=>(e/=s)*e*e*e*u+t,Ro=(e,t,u,s)=>(e/=s,(--e*e*e*e-1)*-u+t),ko=(e,t,u,s)=>(e/=s/2)<1?e*e*e*e*u/2+t:((e-=2)*e*e*e-2)*-u/2+t,Oo=(e,t,u,s)=>(e/=s)*e*e*e*e*u+t,Fo=(e,t,u,s)=>(e/=s,(--e*e*e*e*e+1)*u+t),Lo=(e,t,u,s)=>(e/=s/2)<1?e*e*e*e*e*u/2+t:((e-=2)*e*e*e*e+2)*u/2+t,Co=(e,t,u,s)=>-u*Math.cos(e/s*(Math.PI/2))+u+t,No=(e,t,u,s)=>u*Math.sin(e/s*(Math.PI/2))+t,Bo=(e,t,u,s)=>-u/2*(Math.cos(Math.PI*e/s)-1)+t,Po=(e,t,u,s)=>u*Math.pow(2,10*(e/s-1))+t,Do=(e,t,u,s)=>u*(-Math.pow(2,-10*e/s)+1)+t,_o=(e,t,u,s)=>(e/=s/2)<1?u/2*Math.pow(2,10*(e-1))+t:u/2*(-Math.pow(2,-10*(e-1))+2)+t,Uo=(e,t,u,s)=>(1-Math.sqrt(1-(e/=s)*e))*u+t,qo=(e,t,u,s)=>(e/=s,Math.sqrt(1- --e*e)*u+t),Xo=(e,t,u,s)=>(e/=s*2)<1?(Math.sqrt(1-e*e)-1)/-2*u+t:(Math.sqrt(1-(e-=2)*e)+1)/2*u+t,Vo=(e,t,u,s)=>(2.70158*(e/=s)*e*e-1.70158*e*e)*u+t,Yo=(e,t,u,s)=>(1+2.70158*Math.pow((e/=s)-1,3)+1.70158*Math.pow(e-1,2))*u+t,Wo=(e,t,u,s)=>{let n=1.70158;return(e/=s/2)<1?e*e*(((n*=1.525)+1)*e-n)*u/2+t:((e-=2)*e*(((n*=1.525)+1)*e+n)+2)*u/2+t},Ho=(e,t,u,s)=>(e/=s)===0?t:e===1?u+t:-Math.pow(2,(e*=10)-10)*Math.sin((e-10.75)*(2*Math.PI/3))*u+t,zo=(e,t,u,s)=>(e/=s)===0?t:e===1?u+t:(Math.pow(2,-10*e)*Math.sin((e*10-.75)*(2*Math.PI/3))+1)*u+t,Go=(e,t,u,s)=>(e/=s)===0?t:e===1?u+t:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5)))/2*u+t:(Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*(2*Math.PI/4.5))/2+1)*u+t,Ko=(e,t,u,s)=>(e/=s)<1/2.75?7.5625*e*e*u+t:e<2/2.75?(7.5625*(e-=1.5/2.75)*e+.75)*u+t:e<2.5/2.75?(7.5625*(e-=2.25/2.75)*e+.9375)*u+t:(7.5625*(e-=2.625/2.75)*e+.984375)*u+t,Qo=(e,t,u,s)=>u-qe.outBounce(s-e,0,u,s)+t,Zo=(e,t,u,s)=>e<s/2?qe.inBounce(e*2,t,u/2,s):qe.outBounce(e*2-s,t+u/2,u/2,s);class qe{static linear(t,u,s,n){return Eo(t,u,s,n)}static inQuad(t,u,s,n){return yo(t,u,s,n)}static outQuad(t,u,s,n){return Mo(t,u,s,n)}static inOutQuad(t,u,s,n){return wo(t,u,s,n)}static inCubic(t,u,s,n){return Ao(t,u,s,n)}static outCubic(t,u,s,n){return vo(t,u,s,n)}static inOutCubic(t,u,s,n){return Io(t,u,s,n)}static inQuart(t,u,s,n){return So(t,u,s,n)}static outQuart(t,u,s,n){return Ro(t,u,s,n)}static inOutQuart(t,u,s,n){return ko(t,u,s,n)}static inQuint(t,u,s,n){return Oo(t,u,s,n)}static outQuint(t,u,s,n){return Fo(t,u,s,n)}static inOutQuint(t,u,s,n){return Lo(t,u,s,n)}static inSine(t,u,s,n){return Co(t,u,s,n)}static outSine(t,u,s,n){return No(t,u,s,n)}static inOutSine(t,u,s,n){return Bo(t,u,s,n)}static inExpo(t,u,s,n){return Po(t,u,s,n)}static outExpo(t,u,s,n){return Do(t,u,s,n)}static inOutExpo(t,u,s,n){return _o(t,u,s,n)}static inCirc(t,u,s,n){return Uo(t,u,s,n)}static outCirc(t,u,s,n){return qo(t,u,s,n)}static inOutCirc(t,u,s,n){return Xo(t,u,s,n)}static inBack(t,u,s,n){return Vo(t,u,s,n)}static outBack(t,u,s,n){return Yo(t,u,s,n)}static inOutBack(t,u,s,n){return Wo(t,u,s,n)}static inElastic(t,u,s,n){return Ho(t,u,s,n)}static outElastic(t,u,s,n){return zo(t,u,s,n)}static inOutElastic(t,u,s,n){return Go(t,u,s,n)}static outBounce(t,u,s,n){return Ko(t,u,s,n)}static inBounce(t,u,s,n){return Qo(t,u,s,n)}static inOutBounce(t,u,s,n){return Zo(t,u,s,n)}}const Jo=e=>{cancelAnimationFrame(e.$timerId),e.hasEventListener(xe.STOP)&&e.dispatchEvent(new xe(xe.STOP)),e.entries=null,e.stopFlag=!0},sr=e=>{const t=[];for(const[u,s]of Object.entries(e))t.push({name:u,value:typeof s=="number"?s:sr(s)});return t},nr=(e,t,u,s,n)=>{for(let r=0;r<n.length;++r){const a=n[r];if(!a)continue;const i=a.name;if(!(i in t)||!(i in s))continue;if(typeof a.value!="number"){nr(e,t[i],u[i],s[i],a.value);continue}const c=u[i];e.duration>e.currentTime?t[i]=e.ease(e.currentTime,c,s[i]-c,e.duration):t[i]=s[i]}},rr=(e,t)=>e.stopFlag||!e.entries?-1:(e.currentTime=(t-e.startTime)/1e3,nr(e,e.target,e.from,e.to,e.entries),e.hasEventListener(xe.UPDATE)&&e.dispatchEvent(new xe(xe.UPDATE)),e.currentTime>=e.duration?(e.hasEventListener(xe.COMPLETE)&&e.dispatchEvent(new xe(xe.COMPLETE)),e.nextJob&&e.nextJob.start(),-1):requestAnimationFrame(u=>{rr(e,u)})),Us=e=>{e.stopFlag||(e.entries=sr(e.from),e.entries&&(e.startTime=performance.now(),e.$timerId=rr(e,e.startTime)))},jo=e=>{cancelAnimationFrame(e.$timerId),e.stopFlag=!1,e.delay?setTimeout(()=>{Us(e)},e.delay*1e3):Us(e)};class e0 extends tt{target;entries;startTime;stopFlag;$timerId;delay;duration;ease;from;to;currentTime;nextJob;constructor(t,u,s,n=0,r=1,a=null){super(),this.target=t,this.from=u,this.to=s,this.delay=n,this.duration=r,this.ease=a||qe.linear,this.currentTime=0,this.nextJob=null,this.entries=null,this.startTime=0,this.stopFlag=!1,this.$timerId=-1}chain(t){return this.nextJob=t,t}start(){jo(this)}stop(){Jo(this)}}class bs{static add(t,u,s,n=0,r=1,a=null){return new e0(t,u,s,n,r,a)}}const t0=(e,t)=>{if(!e.scrollEnabled||e.autoSize!=="none"||e.yScrollShape.hasLocalVariable("job"))return;const u=e.width;if(t=ft(t,0,u,0),e.scrollX!==t){if(e.textWidth>u){U(e);const s=e.xScrollShape;s.width=u*u/e.textWidth;const n=e.parent;if(n){s.hasLocalVariable("job")&&s.getLocalVariable("job").stop(),s.alpha=.9,s.x=e.x+1+(u-1-s.width)/(u-1)*(t-1),s.y=e.y+e.height-s.height-.5,n.addChildAt(s,n.getChildIndex(e)+1);const r=bs.add(s,{alpha:.9},{alpha:0},.5,.2,qe.outQuad);r.addEventListener(x.COMPLETE,a=>{const i=a.target.target;i.deleteLocalVariable("job"),i.parent&&i.parent.removeChild(i)}),r.start(),s.setLocalVariable("job",r)}e.$scrollX=t}e.willTrigger(x.SCROLL)&&e.dispatchEvent(new x(x.SCROLL,!0))}},u0=(e,t)=>{if(!e.scrollEnabled||e.autoSize!=="none"||!e.multiline&&!e.wordWrap||e.xScrollShape.hasLocalVariable("job"))return;const u=e.height;if(t=ft(t,0,u,0),e.scrollY!==t){if(e.textHeight>u){U(e);const s=e.yScrollShape;s.height=u*u/e.textHeight;const n=e.parent;if(n){s.hasLocalVariable("job")&&s.getLocalVariable("job").stop(),s.alpha=.9,s.x=e.x+e.width-s.width-.5,s.y=e.y+.5+(u-1-s.height)/(u-1)*(t-1),n.addChildAt(s,n.getChildIndex(e)+1);const r=bs.add(s,{alpha:.9},{alpha:0},.5,.2,qe.outQuad);r.addEventListener(x.COMPLETE,a=>{const i=a.target.target;i.deleteLocalVariable("job"),i.parent&&i.parent.removeChild(i)}),r.start(),s.setLocalVariable("job",r),e.$scrollY=t}}e.willTrigger(x.SCROLL)&&e.dispatchEvent(new x(x.SCROLL,!0))}},s0=e=>{let t="";const u=X(e);for(let s=1;s<u.textTable.length;++s){const n=u.textTable[s];if(n)switch(n.mode){case"text":t+=n.text;break;case"break":t+="\r";break;default:continue}}return t},n0=(e,t)=>{let u="";const s=X(e);for(let n=1;n<s.textTable.length;n++){const r=s.textTable[n];if(r){if(r.line>t)break;r.line===t&&r.mode==="text"&&(u+=r.text)}}return u},r0=(e,t,u,s)=>{if(0>u||u>s)return;const n=e.text,r=u?n.slice(0,u):"";e.text=r+t+n.slice(s,n.length)},a0=async e=>{if(e.focusIndex===-1||e.selectIndex===-1)return;let t="";const u=Math.min(e.focusIndex,e.selectIndex),s=Math.max(e.focusIndex,e.selectIndex)+1,n=X(e);for(let r=u;r<s;++r){const a=n.textTable[r];if(a)switch(a.mode){case"text":t+=a.text;break;case"break":t+=`
|
|
658
658
|
`;break}}await navigator.clipboard.writeText(t)},i0=async e=>{const t=await navigator.clipboard.readText();t===""||e.focusIndex===-1||e.insertText(t)},qs=e=>{if(e.selectIndex===-1)return;const t=X(e);if(2>t.textTable.length)return;const u=t.textTable[e.selectIndex];if(!u)return;const s=u.mode==="text"?u.line:u.line-1,n=e.height,r=(e.textHeight-n)/n;let a=-e.scrollY*r-2,i=0;for(let b=0;b<t.heightTable.length&&(a+=t.heightTable[b],!(a>n));++b)i++;a=-e.scrollY*r-2;let c=0;for(let b=0;b<t.heightTable.length&&(a+=t.heightTable[b],!(a>0));++b)c++;c>=u.line&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY-=t.heightTable[u.line]/r),u.line>=i&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY+=t.heightTable[u.line]/r);const o=e.width,d=(e.textWidth-o)/o;let h=2,l=e.scrollX*d-2+o;for(let b=1;e.selectIndex>=b;++b){const T=t.textTable[b];if(!T||T.line>s)break;if(T.line===s&&(e.selectIndex!==b&&(h+=T.w),l-=T.w,!(l>0))){e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX+=T.w/d;break}}e.scrollX*d-2>h&&(e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=e.width*((h-2)/e.textWidth))},c0=(e,t,u,s=!1)=>{if(e.type!=="input")return;const n=X(e);if(2>n.textTable.length){e.focusIndex=1,e.selectIndex=-1,qt()===void 0&&he(e);return}const r=e.width,a=e.height;let i=0;e.scrollX>0&&(i+=e.scrollX*(e.textWidth-r)/r);let c=0;e.scrollY>0&&(c+=e.scrollY*(e.textHeight-a)/a);const o=e.globalToLocal(new j(t,u)),d=o.x+i,h=o.y+c;let l=2,f=2,b=f+n.heightTable[0];for(let T=1;T<n.textTable.length;++T){const m=n.textTable[T];if(m){switch(m.mode){case"break":case"wrap":if(d>l&&h>f&&b>h&&r>d){const g=T;s?e.selectIndex!==g&&(e.selectIndex=g,e.focusVisible&&(e.focusVisible=!1,ce()),qs(e),U(e)):(e.focusIndex!==g||e.selectIndex>-1)&&(e.focusIndex=g,e.selectIndex=-1,U(e));return}l=2,f+=n.heightTable[m.line-1],b=f+n.heightTable[m.line];break;case"text":if(d>l&&h>f&&b>h&&l+m.w>d){let g=T;if(s)e.focusIndex>g?e.focusIndex===g+1?l+m.w/2<d&&(g=-1):l+m.w/2<d&&(g+=1):e.focusIndex===g?l+m.w/2>d&&(g=-1):l+m.w/2>d&&(g-=1),e.selectIndex!==g&&(e.selectIndex=g,e.selectIndex>-1&&(e.focusVisible=!1,ce()),qs(e),U(e));else{if(l+m.w/2<d){const w=n.textTable[g+1];(!w||w.mode==="text")&&(g+=1)}(e.focusIndex!==g||e.selectIndex>-1)&&(e.focusIndex=g,e.selectIndex=-1,U(e))}return}if(T===n.textTable.length-1&&d>l&&h>f&&b>h&&r>d){const g=n.textTable.length;s?e.selectIndex!==g&&(e.selectIndex=g,e.focusVisible&&(e.focusVisible=!1,ce()),U(e)):(e.focusIndex!==g||e.selectIndex>-1)&&(e.focusIndex=g,e.selectIndex=-1,U(e));return}l+=m.w;break}if(!s)e.focusIndex=n.textTable.length,e.selectIndex=-1,qt()===void 0?he(e):U(e);else{let g=0;for(let w=0;n.heightTable.length>w;++w)g+=n.heightTable[w];(h>g||2>h)&&(e.selectIndex=2>h?1:n.textTable.length,e.focusVisible&&(e.focusVisible=!1,ce()),U(e))}}}},o0=(e,t)=>{if(e.focusIndex===-1)return;const u=X(e);if(2>u.textTable.length)return;const s=u.textTable[e.focusIndex];if(!s)return;const n=s.mode==="text"?s.line:s.line-1;if(n===u.lineTable.length-1){t?e.selectIndex===-1?e.selectIndex=e.focusIndex:e.selectIndex===e.focusIndex&&(e.selectIndex=-1):e.selectIndex=-1,e.focusVisible=!1,e.focusIndex=u.textTable.length;const l=e.width,f=(e.textWidth-l)/l;let b=0;for(let T=1;e.focusIndex>=T;++T){const m=u.textTable[T];if(!m||m.line>n)break;m.line===n&&(b+=m.w)}e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=(b-l)/f,ce(),he(e);return}const r=e.height,a=(e.textHeight-r)/r;let i=-e.scrollY*a-2,c=0;for(let l=0;l<u.heightTable.length&&(i+=u.heightTable[l],!(i>r));++l)c++;let o=2;for(let l=1;l<u.textTable.length;++l){const f=u.textTable[l];if(f){if(e.focusIndex===l){f.mode==="text"&&(o+=f.w/2);break}if(f.line>n)break;f.line!==n||f.mode!=="text"||(o+=f.w)}}let d=2;const h=n+1;for(let l=1;l<u.textTable.length;++l){const f=u.textTable[l];if(f){if(f.line>h){t?e.selectIndex===-1?e.selectIndex=e.focusIndex:e.selectIndex===e.focusIndex&&(e.selectIndex=-1):e.selectIndex=-1,f.line>=c&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY+=u.heightTable[f.line]/a),e.focusVisible=!1,e.focusIndex=f.mode==="text"?l-1:l,e.scrollX&&d<o&&(e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=e.width*((d-2)/e.textWidth)),ce(),he(e);return}if(!(f.line!==h||f.mode!=="text")&&(d+=f.w,d>o)){if(t?e.selectIndex===-1?e.selectIndex=e.focusIndex:e.selectIndex===l-1&&(e.selectIndex=-1):e.selectIndex=-1,f.line>=c&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY+=u.heightTable[f.line]/a),e.scrollX){const b=e.width,T=(e.textWidth-b)/b;e.scrollX*T-2>d&&(e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=e.width*((d-2)/e.textWidth))}e.focusVisible=!1,e.focusIndex=l,ce(),he(e);return}}}t?e.selectIndex===-1&&(e.selectIndex=e.focusIndex):e.selectIndex=-1,e.focusVisible=!1,e.focusIndex=u.textTable.length,ce(),he(e)},l0=(e,t)=>{if(e.focusIndex===-1)return;const u=X(e);if(2>u.textTable.length)return;const s=u.textTable.length===e.focusIndex?e.focusIndex-1:e.focusIndex,n=u.textTable[s];if(!n||!n.line){t?e.selectIndex===-1?e.selectIndex=e.focusIndex:e.selectIndex===e.focusIndex&&(e.selectIndex=-1):e.selectIndex=-1,e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.focusVisible=!1,e.focusIndex=1,e.scrollX=0,ce(),he(e);return}const r=n.mode==="text"?n.line:n.line-1,a=e.height,i=(e.textHeight-a)/a;let c=0,o=-e.scrollY*i-2;for(let f=0;f<u.heightTable.length&&(o+=u.heightTable[f],!(o>0));++f)c++;let d=2;for(let f=1;f<u.textTable.length;++f){const b=u.textTable[f];if(b){if(e.focusIndex===f){b.mode==="text"&&(d+=b.w/2);break}if(b.line>r)break;b.line!==r||b.mode!=="text"||(d+=b.w)}}let h=2;const l=r-1;for(let f=1;f<u.textTable.length;++f){const b=u.textTable[f];if(b){if(b.line>l){t?e.selectIndex===-1?e.selectIndex=e.focusIndex:e.selectIndex===e.focusIndex&&(e.selectIndex=-1):e.selectIndex=-1,c>=b.line&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY-=u.heightTable[b.line]/i),e.scrollX&&(e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=e.width*((h-2)/e.textWidth)),e.focusVisible=!1,e.focusIndex=b.mode==="text"?f-1:f,ce(),he(e);return}if(!(b.line!==l||b.mode!=="text")&&(h+=b.w,h>d)){t?e.selectIndex===-1?e.selectIndex=e.focusIndex-1:e.selectIndex===f+1&&(e.selectIndex=-1):e.selectIndex=-1,c>b.line&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY-=u.heightTable[b.line]/i),e.focusVisible=!1,e.focusIndex=f,ce(),he(e);return}}}},h0=(e,t)=>{if(!e.focusIndex)return;const u=X(e);if(u.textTable.length&&e.focusIndex<2){e.focusIndex=1;return}e.focusIndex--,t?e.selectIndex===-1?e.selectIndex=e.focusIndex:e.selectIndex===e.focusIndex&&(e.selectIndex=-1):e.selectIndex=-1;const s=u.textTable[e.focusIndex];if(s){const n=s.mode==="text"?s.line:s.line-1,r=e.height,a=(e.textHeight-r)/r;let i=-e.scrollY*a-2,c=0;for(let d=0;d<u.heightTable.length&&(i+=u.heightTable[d],!(i>0));++d)c++;c>n&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY-=u.heightTable[s.line]/a);const o=u.textTable[e.focusIndex+1];if(o){const d=o.mode==="text"?o.line:o.line-1;let h=2;for(let T=1;e.focusIndex>T;++T){const m=u.textTable[T];if(!m||m.line>n)break;m.line===n&&(h+=m.w)}const l=e.width,f=(e.textWidth-l)/l,b=e.scrollX*f-2;if(h>l&&o&&n<d){e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=e.width;return}if(b>h){e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=e.width*((h-2)/e.textWidth);return}}}e.focusVisible=!1,ce(),he(e)},d0=(e,t)=>{const u=X(e);if(u.textTable.length===e.focusIndex)return;t?e.selectIndex===-1?e.selectIndex=e.focusIndex:e.selectIndex===e.focusIndex&&(e.selectIndex=-1):e.selectIndex=-1,e.focusVisible=!1,e.focusIndex++,ce(),he(e);const s=u.textTable[e.focusIndex];if(s){const n=s.mode==="text"?s.line:s.line-1,r=e.height,a=(e.textHeight-r)/r;let i=-e.scrollY*a-2,c=0;for(let b=0;b<u.heightTable.length&&(i+=u.heightTable[b],!(i>r));++b)c++;n>=c&&(e.xScrollShape.hasLocalVariable("job")&&e.xScrollShape.deleteLocalVariable("job"),e.scrollY+=u.heightTable[n]/a);const o=u.textTable[e.focusIndex-1],d=o.mode==="text"?o.line:o.line-1;if(o&&n>d){e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX=0;return}const h=e.width,l=(e.textWidth-h)/h;let f=e.scrollX*l-2+h;for(let b=1;e.focusIndex>=b;++b){const T=u.textTable[b];if(!T||T.line>n)break;if(T.line===n&&(f-=T.w,!(f>0))){e.yScrollShape.hasLocalVariable("job")&&e.yScrollShape.deleteLocalVariable("job"),e.scrollX+=T.w/l;break}}}},f0=(e,t)=>{if(e.focusIndex!==-1)switch(t.key){case"Backspace":case"Delete":e.deleteText();break;case"Enter":e.insertText(`
|
|
659
|
-
`);break;case"ArrowLeft":h0(e,t.shiftKey);break;case"ArrowRight":d0(e,t.shiftKey);break;case"ArrowUp":l0(e,t.shiftKey);break;case"ArrowDown":o0(e,t.shiftKey);break;case"a":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.selectAll());break;case"c":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.copy());break;case"v":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.paste());break}},b0=e=>{const t=X(e);2>t.textTable.length||(e.selectIndex=1,e.focusIndex=t.textTable.length,U(e))},$0=(e,t)=>{const u=e.defaultTextFormat;switch(u.font=t.font,u.size=t.size,u.align=t.align,u.color=t.color,u.leading=t.leading,u.letterSpacing=t.letterSpacing,u.leftMargin=t.leftMargin,u.rightMargin=t.rightMargin,t.fontType){case 1:u.bold=!0;break;case 2:u.italic=!0;break;case 3:u.bold=!0,u.italic=!0;break}switch(e.defaultTextFormat=u,e.type=t.inputType,e.multiline=t.multiline,e.wordWrap=t.wordWrap,e.border=t.border,e.scrollEnabled=t.scroll,e.thickness=t.thickness,e.thicknessColor=t.thicknessColor,t.autoSize){case 1:e.autoSize=t.align;break;case 2:e.autoFontSize=!0;break}e.xMin=e.bounds.xMin=t.bounds.xMin,e.xMax=e.bounds.xMax=t.bounds.xMax,e.yMin=e.bounds.yMin=t.bounds.yMin,e.yMax=e.bounds.yMax=t.bounds.yMax+4,e.text=t.text};class Xu extends cs{isText;$textData;_$isHTML;xMin;yMin;xMax;yMax;bounds;scrollEnabled;xScrollShape;yScrollShape;focusVisible;focusIndex;selectIndex;maxChars;restrict;type;compositionStartIndex;compositionEndIndex;$textFormats;$scrollX;$scrollY;cacheKey;cacheParams;_$background;_$backgroundColor;_$border;_$borderColor;_$htmlText;_$multiline;_$text;_$wordWrap;_$defaultTextFormat;_$rawHtmlText;_$autoSize;_$autoFontSize;_$focus;_$thickness;_$thicknessColor;_$stopIndex;constructor(){super(),this.isText=!0,this.$textData=null,this._$background=!1,this._$backgroundColor=16777215,this._$border=!1,this._$borderColor=0,this._$htmlText="",this._$multiline=!1,this._$text="",this._$wordWrap=!1,this.$scrollX=0,this.$scrollY=0,this.$textFormats=null,this.maxChars=0,this._$stopIndex=-1,this.compositionStartIndex=-1,this.compositionEndIndex=-1;const t=new re;fo(t),this._$defaultTextFormat=t,this._$rawHtmlText="",this.xMin=0,this.yMin=0,this.xMax=100,this.yMax=100,this.bounds={xMin:0,xMax:this.xMax,yMin:0,yMax:this.yMax},this.restrict="",this._$isHTML=!1,this._$autoSize="none",this._$autoFontSize=!1,this.focusVisible=!1,this.focusIndex=-1,this.selectIndex=-1,this.scrollEnabled=!0,this.xScrollShape=new gt,this.xScrollShape.graphics.beginFill("#000",.3).drawRoundRect(0,0,3,3,3),this.xScrollShape.scale9Grid=new me(1.5,1.5,.1,.1),this.yScrollShape=new gt,this.yScrollShape.graphics.beginFill("#000",.3).drawRoundRect(0,0,3,3,3),this.yScrollShape.scale9Grid=new me(1.5,1.5,.1,.1),this.type="static",this._$focus=!1,this._$thickness=0,this._$thicknessColor=0,this.cacheKey=0,this.cacheParams=[0,0,0]}static get namespace(){return"next2d.display.TextField"}get namespace(){return"next2d.display.TextField"}get autoFontSize(){return this._$autoFontSize}set autoFontSize(t){t!==this._$autoFontSize&&(this._$autoFontSize=!!t,ye(this))}get autoSize(){return this._$autoSize}set autoSize(t){t!==this._$autoSize&&(this._$autoSize=t,ye(this))}get background(){return this._$background}set background(t){t!==this._$background&&(this._$background=!!t,U(this))}get backgroundColor(){return this._$backgroundColor}set backgroundColor(t){t=ft(Je(t),0,16777215,16777215),t!==this._$backgroundColor&&(this._$backgroundColor=t,U(this))}get border(){return this._$border}set border(t){t!==this._$border&&(this._$border=!!t,U(this))}get borderColor(){return this._$borderColor}set borderColor(t){t=ft(Je(t),0,16777215,0),t!==this._$borderColor&&(this._$borderColor=t,U(this))}get stopIndex(){return this._$stopIndex}set stopIndex(t){t|=0,this._$stopIndex!==t&&(this._$stopIndex=t,go(this,t))}get defaultTextFormat(){return this._$defaultTextFormat.clone()}set defaultTextFormat(t){this._$rawHtmlText="",this._$isHTML?this._$text="":this._$htmlText="",this._$defaultTextFormat=t,ye(this)}get focus(){return this._$focus}set focus(t){this._$focus!==t&&this.type==="input"&&(this._$focus=!!t,To(this,this._$focus?Ue.FOCUS_IN:Ue.FOCUS_OUT))}get htmlText(){if(this._$htmlText)return this._$htmlText;const t=bo(this.defaultTextFormat);return this._$htmlText=`<span style="${t}">${this._$text.replace(/\n/g,"<br>")}</span>`,this._$htmlText}set htmlText(t){this._$htmlText!==t&&(this._$htmlText=`${t}`,this._$rawHtmlText="",this._$text="",this._$isHTML=!0,ye(this))}get length(){return this.text.length}get multiline(){return this._$multiline}set multiline(t){t!==this._$multiline&&(this._$multiline=!!t,ye(this))}get numLines(){return X(this).lineTable.length}get scrollX(){return this.$scrollX}set scrollX(t){t0(this,t)}get scrollY(){return this.$scrollY}set scrollY(t){u0(this,t)}get text(){return this._$isHTML?(this._$rawHtmlText||(this._$rawHtmlText=s0(this)),this._$rawHtmlText):this._$text}set text(t){t=`${t}`,t===""&&(this.scrollX&&(this.scrollX=0),this.scrollY&&(this.scrollY=0)),t!==this._$text&&(this._$htmlText="",this._$rawHtmlText="",this._$isHTML=!1,this._$text=t,ye(this))}get textHeight(){return X(this).textHeight}get textWidth(){return X(this).textWidth}get thickness(){return this._$thickness}set thickness(t){t|=0,t!==this._$thickness&&(this._$thickness=t,U(this))}get thicknessColor(){return this._$thicknessColor}set thicknessColor(t){t=ft(Je(t),0,16777215,0),t!==this._$thicknessColor&&(this._$thicknessColor=t,U(this))}get wordWrap(){return this._$wordWrap}set wordWrap(t){this._$wordWrap!==t&&(this._$wordWrap=!!t,ye(this))}get width(){return super.width}set width(t){if(t=+t,!isNaN(t)&&0>t)return;const u=t+this.bounds.xMin;u!==this.bounds.xMax&&(this.bounds.xMax=u,ye(this))}get height(){return super.height}set height(t){if(t=+t,!isNaN(t)&&0>t)return;const u=t+this.bounds.yMin;u!==this.bounds.yMax&&(this.bounds.yMax=u,ye(this))}appendText(t){const u=this.text;this.text=u+`${t}`}insertText(t){Jn(this,t)}deleteText(){fs(this)}getLineText(t){return this._$text||this._$htmlText?n0(this,t|0):""}replaceText(t,u,s){r0(this,t,u|0,s|0)}selectAll(){b0(this)}copy(){a0(this)}paste(){i0(this)}setFocusIndex(t,u,s=!1){c0(this,t,u,s)}keyDown(t){f0(this,t)}$sync(t,u=null){u&&super.$syncLoaderInfo(u),$0(this,t)}}const ar=[],m0=()=>ar,g0=e=>{ar.push(e)};let _e=null;const x0=()=>!!_e,p0=()=>{_e||(_e=new AudioContext),_e.resume()},ir=()=>(_e||(_e=new AudioContext),_e),T0=e=>{let t=null;switch(e.method.toUpperCase()){case"GET":if(e.data){const s=e.url.split("?");s[1]=s.length===1?e.data.toString():`${s[1]}&${e.data.toString()}`,e.url=s.join("?")}break;case"PUT":case"POST":e.data&&(t=e.data.toString());break}const u=new XMLHttpRequest;if(u.open(e.method,e.url,!0),u.responseType=e.format,u.withCredentials=e.withCredentials,e.event){const s=Object.keys(e.event);for(let n=0;n<s.length;++n){const r=s[n];u.addEventListener(r,e.event[r])}}for(let s=0;s<e.headers.length;++s){const n=e.headers[s];n&&u.setRequestHeader(n.name,n.value)}u.send(t)},$s=(e,t,u,s=null)=>{const n=+e;return isNaN(n)&&s!==null?s:Math.min(Math.max(t,isNaN(n)?0:n),u)};let cr=1;const E0=()=>cr,y0=e=>{cr=$s(e,0,1,1)},M0=[],Xt=()=>M0,w0=[],cu=()=>w0,A0=e=>{y0(e);const t=Xt();for(let s=0;s<t.length;++s){const n=t[s];n&&(n.volume=e)}const u=cu();for(let s=0;s<u.length;++s){const n=u[s];n&&(n.volume=e)}},v0=()=>{const e=Xt();for(let u=0;u<e.length;++u){const s=e[u];s&&s.stop()}const t=cu();for(let u=0;u<t.length;++u){const s=t[u];s&&s.pause()}e.length=0,t.length=0};class et{static get volume(){return E0()}static set volume(t){A0(t)}static stopAll(){v0()}}const I0=e=>{e.canLoop?e.play():(e.stop(),e.willTrigger(x.COMPLETE)&&e.dispatchEvent(new x(x.COMPLETE)))},S0=(e,t)=>{e.willTrigger(x.OPEN)&&e.dispatchEvent(new x(x.OPEN)),e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},R0=(e,t)=>{e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},ms=async e=>{if(e.byteLength)try{return await ir().decodeAudioData(e)}catch{const u=new Uint8Array(e);let s=0;for(;s>u.byteLength&&(s=u.indexOf(255,s),!(s===-1||(u[s+1]&224)===224));)++s;return await ms(u.subarray(s).buffer)}},k0=async(e,t)=>{const u=t.target;if(u)if(e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total)),199<u.status&&400>u.status){const s=await ms(u.response);s&&(e.audioBuffer=s,e.willTrigger(x.COMPLETE)&&e.dispatchEvent(new x(x.COMPLETE)))}else e.willTrigger(ke.IO_ERROR)&&e.dispatchEvent(new ke(ke.IO_ERROR,!1,u.statusText))},O0=async(e,t)=>{await new Promise(u=>{T0({format:"arraybuffer",url:t.url,method:t.method,data:t.data,headers:t.headers,withCredentials:t.withCredentials,event:{loadstart:s=>{S0(e,s)},progress:s=>{R0(e,s)},loadend:async s=>{await k0(e,s),u()}}})})},F0=async(e,t)=>{if(!t.audioBuffer){const u=new Uint8Array(t.buffer),s=await ms(u.buffer);if(!s)return;t.audioBuffer=s}e.audioBuffer=t.audioBuffer};class ou extends tt{_$source;_$gainNode;_$stopFlag;_$currentCount;_$volume;audioBuffer;loopCount;constructor(){super(),this.loopCount=0,this.audioBuffer=null,this._$volume=1,this._$currentCount=0,this._$stopFlag=!0,this._$source=null,this._$gainNode=null}get volume(){return this._$volume}set volume(t){this._$volume=$s(Math.min(et.volume,t),0,1,1),this._$gainNode&&(this._$gainNode.gain.value=this._$volume)}get canLoop(){return!this._$stopFlag&&this.loopCount>=this._$currentCount}clone(){const t=new ou;return t.volume=this._$volume,t.loopCount=this.loopCount,t.audioBuffer=this.audioBuffer,t}async load(t){await O0(this,t)}play(t=0){if(!this._$stopFlag||!this.audioBuffer)return;this.stop();const u=ir();this._$gainNode=u.createGain(),this._$gainNode.connect(u.destination),this._$gainNode.gain.value=Math.min(et.volume,this._$volume),this._$source=u.createBufferSource(),this._$source.addEventListener("ended",()=>{I0(this)}),this._$source.buffer=this.audioBuffer,this._$source.connect(this._$gainNode),this._$source.start(t),this._$stopFlag=!1,this._$currentCount++,Xt().push(this)}stop(){if(this._$stopFlag)return;this._$stopFlag=!0,this._$currentCount=0,this._$source&&(this._$source.disconnect(),this._$source=null),this._$gainNode&&(this._$gainNode.gain.value=0,this._$gainNode.disconnect(),this._$gainNode=null);const t=Xt(),u=t.indexOf(this);u>-1&&t.splice(u,1)}async $build(t){await F0(this,t)}}class L0{volume;loopCount;constructor(t=1,u=0){this.volume=t,this.loopCount=u}}const C0=()=>{const e=document.createElement("video");return e.autoplay=!1,e.crossOrigin="anonymous",e.setAttribute("playsinline",""),e},gs=e=>{e.changed=!0;const t=e.parent;t&&!t.changed&&gs(t)},N0=async e=>{e.autoPlay&&(x0()||(e.muted=!0,g0(e)),await e.play()),e.loaded=!0,gs(e),e.willTrigger(x.COMPLETE)&&e.dispatchEvent(new x(x.COMPLETE))},B0=(e,t)=>{t.currentTime=0,t.duration=e.duration,t.videoWidth=e.videoWidth,t.videoHeight=e.videoHeight;const u=new OffscreenCanvas(t.videoWidth,t.videoHeight);t.$context=u.getContext("2d"),t.$offscreenCanvas=u},P0=(e,t)=>{e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},D0=e=>{if(e.willTrigger(le.ENDED)&&e.dispatchEvent(new le(le.ENDED)),e.loop){e.currentTime=0;return}e.ended=!0,e.changed=!1,e.pause()},_0=(e,t)=>{e.addEventListener("loadedmetadata",()=>{B0(e,t)},{once:!0}),e.addEventListener("progress",u=>{P0(t,u)}),e.addEventListener("canplaythrough",async()=>{await N0(t),e.volume=t.volume},{once:!0}),e.addEventListener("ended",()=>{D0(t)})},or=e=>{if(e.paused||!e.loaded)return 0;e.willTrigger(le.PLAY)&&e.dispatchEvent(new le(le.PLAY)),gs(e);const t=cu();return t.indexOf(e)===-1&&t.push(e),e.$context&&e.$videoElement&&e.$context.drawImage(e.$videoElement,0,0,e.videoWidth,e.videoHeight),requestAnimationFrame(()=>{or(e)})},U0=(e,t)=>{t.videoData||(t.videoData=new Uint8Array(t.buffer),t.buffer=null),e.loop=t.loop,e.autoPlay=t.autoPlay,e.videoWidth=t.bounds.xMax,e.videoHeight=t.bounds.yMax,e.volume=t.volume,e.src=URL.createObjectURL(new Blob([t.videoData],{type:"video/mp4"}))};class Vu extends iu{duration;smoothing;loop;autoPlay;currentTime;videoWidth;videoHeight;loaded;ended;isVideo;$videoElement;$offscreenCanvas;$context;paused;_$timerId;_$volume;_$src;constructor(t=0,u=0){super(),this.videoWidth=t,this.videoHeight=u,this.isVideo=!0,this.duration=0,this.smoothing=!0,this.loop=!1,this.loaded=!1,this.ended=!1,this.paused=!0,this.autoPlay=!0,this.currentTime=0,this._$src="",this._$timerId=-1,this._$volume=1,this.$videoElement=null,this.$offscreenCanvas=null,this.$context=null}static get namespace(){return"next2d.media.Video"}get namespace(){return"next2d.media.Video"}get src(){return this._$src}set src(t){this._$src!==t&&(this.loaded=!1,this.currentTime=0,this.$videoElement=null,this.$offscreenCanvas=null,this.$context=null,this.$videoElement=C0(),_0(this.$videoElement,this),this._$src=this.$videoElement.src=t,this.$videoElement.load())}get muted(){return this.$videoElement?this.$videoElement.muted:!1}set muted(t){this.$videoElement&&(this.$videoElement.muted=t)}get volume(){return this._$volume}set volume(t){this._$volume=$s(Math.min(et.volume,t),0,1,1),this.$videoElement&&(this.$videoElement.volume=this._$volume)}pause(){if(!this.$videoElement||this.paused)return;this.paused=!0,this.$videoElement.pause(),cancelAnimationFrame(this._$timerId),this.willTrigger(le.PAUSE)&&this.dispatchEvent(new le(le.PAUSE));const t=cu(),u=t.indexOf(this);u>-1&&t.splice(u,1)}async play(){!this.$videoElement||!this.paused||(this.paused=!1,this.ended=!1,this.$videoElement.volume=this._$volume,await this.$videoElement.play(),this._$timerId=or(this))}seek(t){this.$videoElement&&(this.currentTime=this.$videoElement.currentTime=Math.min(this.duration,t),this.willTrigger(le.SEEK)&&this.dispatchEvent(new le(le.SEEK)))}$sync(t,u=null){u&&super.$syncLoaderInfo(u),U0(this,t)}}const dt=(e,t,u,s,n=-1)=>{const r=s.loaderInfo;if(!r)throw new Error("the loaderInfo or data is null.");e.parent=s,Oe.set(e,s.root),Ot.set(e,r),e.dictionaryId=t,e.characterId=u.characterId,e.clipDepth=u.clipDepth,e.startFrame=u.startFrame,e.endFrame=u.endFrame,e.name=u.name||"",e.placeId=n},Xs=(e,t,u,s,n=-1)=>{switch(u.extends){case Yt.namespace:{const r=new Yt;return dt(r,e,t,s,n),r.$sync(u),r}case gt.namespace:{const r=new gt;return dt(r,e,t,s,n),r.$sync(u),r}case Xu.namespace:{const r=new Xu;return dt(r,e,t,s,n),r.$sync(u),r}case Vu.namespace:{const r=new Vu;return dt(r,e,t,s,n),r.$sync(u),r}default:throw new Error(`Character extends not found: ${u.extends}`)}},vt=new Map,q0=(e,t)=>{const u=e.loaderInfo;if(!u||!u.data)return t;const s=u.data.characters[e.characterId];if(!s)return t;const n=e.currentFrame,r=s.controller[n];if(!r)return t;const a=[],i=s.dictionary;if(!t.length){for(let c=0;c<r.length;++c){if(!(c in r))continue;const o=r[c];if(typeof o!="number")continue;const d=i[o];if(!d)continue;const h=u.data.characters[d.characterId];if(!h)continue;const l=Xs(o,d,h,e,c);l&&(t.push(l),l.isContainerEnabled&&a.push(l))}return e.$container=a,t}for(let c=0;c<t.length;++c){const o=t[c];if(!o)continue;const d=o.startFrame,h=o.endFrame;if(d===1&&h===0||d<=n&&h>n){vt.set(o.dictionaryId,o);continue}o.uniqueKey&&O.has(o.uniqueKey)&&O.removeTimer(o.uniqueKey),o.willTrigger(x.REMOVED)&&o.dispatchEvent(new x(x.REMOVED,!0)),o.willTrigger(x.REMOVED_FROM_STAGE)&&o.dispatchEvent(new x(x.REMOVED_FROM_STAGE,!0)),o.isVideo&&o.pause(),o.isContainerEnabled&&as(o)}t.length=0;for(let c=0;c<r.length;++c){if(!(c in r))continue;const o=r[c];if(typeof o!="number")continue;if(vt.has(o)){const f=vt.get(o);f.placeId=c,f.placeObject=null,t.push(f);continue}const d=i[o];if(!d)continue;const h=u.data.characters[d.characterId];if(!h)continue;const l=Xs(o,d,h,e,c);l&&(t.push(l),l.isContainerEnabled&&a.push(l))}return e.$container=a,vt.clear(),t},X0=(e,t)=>{e.$labels||(e.$labels=new Map),e.$labels.set(t.frame,t)},V0=e=>{if(!e.$labels)return null;const t=e.currentFrame;return e.$labels.has(t)&&e.$labels.get(t)||null},Y0=e=>!e.$labels||!e.$labels.size?null:Array.from(e.$labels.values()),W0=(e,t)=>{if(!e.$labels||!e.$labels.size)return 0;for(const[u,s]of e.$labels)if(s.name===t)return u;return 0},H0=(e,t=null)=>{if(!t||!t.size)return;const u=e.currentFrame;if(!t.has(u))return;const s=t.get(u);s.willTrigger(x.FRAME_LABEL)&&s.dispatchEvent(new x(x.FRAME_LABEL))},z0=(e,t=null)=>{if(!t||!t.size)return;const u=e.currentFrame;t.has(u)&&Ou.push(e)},Vt=e=>{e.$canAction&&(e.$canAction=!1,H0(e,e.$labels),z0(e,e.$actions))},lu=(e,t)=>{if(e.totalFrames===1)return;let u=+t;if(isNaN(u)&&(u=W0(e,`${t}`)),1>u&&(u=1),e.currentFrame!==u){if(u>e.totalFrames){if(e.currentFrame===e.totalFrames)return;e.$wait=!0,e.$canSound=!0,e.$canAction=!0,e.$hasTimelineHeadMoved=!0,e.currentFrame=e.totalFrames,Vt(e),Y(e);return}e.currentFrame=u,e.$wait=!0,e.$canSound=!0,e.$canAction=!0,e.$hasTimelineHeadMoved=!0,Y(e),Vt(e)}},G0=(e,t)=>{e.play(),lu(e,t)},K0=(e,t)=>{e.stop(),lu(e,t),e.$wait=!1},Q0=e=>{e.totalFrames<=e.currentFrame||(e.stop(),lu(e,e.currentFrame+1))},Z0=e=>{2>e.currentFrame||(e.stop(),lu(e,e.currentFrame-1))},J0=(e,t)=>{for(let u=0;u<t.length;++u){const s=t[u];if(!s)continue;s.script||(s.script=Function(s.action));const n=s.frame;e.has(n)||e.set(n,q()),e.get(n)?.push(s.script)}},j0=(e,t)=>{for(let u=0;u<t.length;++u){const s=t[u];s&&e.set(s.frame,new qn(s.name,s.frame))}},el=async(e,t,u)=>{const s=e.loaderInfo;if(!s)return;const n=s.data;if(!n)return;const r=n.characters;for(let a=0;a<u.length;++a){const i=u[a];if(!i)continue;const c=q();for(let o=0;o<i.sound.length;++o){const d=i.sound[o];if(!d)continue;const h=r[d.characterId];if(!h)continue;const l=new ou;l.loopCount=d.loopCount|0,l.volume=Math.min(et.volume,d.volume),await l.$build(h),c.push(l)}t.set(i.frame,c)}},tl=(e,t)=>{t.actions&&(e.$actions||(e.$actions=new Map),J0(e.$actions,t.actions)),t.sounds&&(e.$sounds||(e.$sounds=new Map),el(e,e.$sounds,t.sounds)),t.labels&&(e.$labels||(e.$labels=new Map),j0(e.$labels,t.labels)),e.totalFrames=t.totalFrame||1};class Yt extends ls{$labels;$actions;$sounds;$canAction;$wait;totalFrames;currentFrame;_$stopFlag;$canSound;$hasTimelineHeadMoved;isTimelineEnabled;constructor(){super(),this.currentFrame=1,this.totalFrames=1,this.isTimelineEnabled=!0,this.$actions=null,this.$labels=null,this.$sounds=null,this.$canAction=!0,this.$wait=!1,this.$canSound=!0,this.$hasTimelineHeadMoved=!0,this._$stopFlag=!1}static get namespace(){return"next2d.display.MovieClip"}get namespace(){return"next2d.display.MovieClip"}get children(){return!this.$hasTimelineHeadMoved||this.characterId===-1?this._$children:(this.$hasTimelineHeadMoved=!1,q0(this,this._$children))}get currentFrameLabel(){return V0(this)}get currentLabels(){return Y0(this)}get isPlaying(){return!this._$stopFlag}gotoAndPlay(t){G0(this,t)}gotoAndStop(t){K0(this,t)}nextFrame(){Q0(this)}play(){this._$stopFlag=!1,Y(this)}prevFrame(){Z0(this)}stop(){this._$stopFlag=!0}addFrameLabel(t){X0(this,t)}$sync(t,u=null){u&&super.$syncLoaderInfo(u),tl(this,t)}}const Vs=async(e,t)=>{const u=new Map;if(t.symbols.length)for(let a=0;a<t.symbols.length;++a){const i=t.symbols[a];u.set(i[0],i[1])}const s=e.contentLoaderInfo;s.data={stage:t.stage,characters:t.characters,symbols:u};const n=new Yt,r=t.characters[0];dt(n,-1,{characterId:0,name:"main",clipDepth:0,endFrame:r.controller.length,startFrame:1},e),n.$sync(r,s),n.parent=null,s.content=n,s.willTrigger(x.COMPLETE)&&s.dispatchEvent(new x(x.COMPLETE))},lr=`(function(){"use strict";var l=Uint8Array,k=Uint16Array,tr=Int32Array,W=new l([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),X=new l([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ur=new l([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Y=function(r,e){for(var n=new k(31),i=0;i<31;++i)n[i]=e+=1<<r[i-1];for(var f=new tr(n[30]),i=1;i<30;++i)for(var g=n[i];g<n[i+1];++g)f[g]=g-n[i]<<5|i;return{b:n,r:f}},Z=Y(W,2),$=Z.b,cr=Z.r;$[28]=258,cr[258]=28;for(var wr=Y(X,0),gr=wr.b,O=new k(32768),v=0;v<32768;++v){var b=(v&43690)>>1|(v&21845)<<1;b=(b&52428)>>2|(b&13107)<<2,b=(b&61680)>>4|(b&3855)<<4,O[v]=((b&65280)>>8|(b&255)<<8)>>1}for(var m=function(r,e,n){for(var i=r.length,f=0,g=new k(e);f<i;++f)r[f]&&++g[r[f]-1];var s=new k(e);for(f=1;f<e;++f)s[f]=s[f-1]+g[f-1]<<1;var h;if(n){h=new k(1<<e);var p=15-e;for(f=0;f<i;++f)if(r[f])for(var C=f<<4|r[f],y=e-r[f],a=s[r[f]-1]++<<y,o=a|(1<<y)-1;a<=o;++a)h[O[a]>>p]=C}else for(h=new k(i),f=0;f<i;++f)r[f]&&(h[f]=O[s[r[f]-1]++]>>15-r[f]);return h},A=new l(288),v=0;v<144;++v)A[v]=8;for(var v=144;v<256;++v)A[v]=9;for(var v=256;v<280;++v)A[v]=7;for(var v=280;v<288;++v)A[v]=8;for(var j=new l(32),v=0;v<32;++v)j[v]=5;var hr=m(A,9,1),br=m(j,5,1),B=function(r){for(var e=r[0],n=1;n<r.length;++n)r[n]>e&&(e=r[n]);return e},c=function(r,e,n){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&n},J=function(r,e){var n=e/8|0;return(r[n]|r[n+1]<<8|r[n+2]<<16)>>(e&7)},sr=function(r){return(r+7)/8|0},yr=function(r,e,n){return(n==null||n>r.length)&&(n=r.length),new l(r.subarray(e,n))},zr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],t=function(r,e,n){var i=new Error(e||zr[r]);if(i.code=r,Error.captureStackTrace&&Error.captureStackTrace(i,t),!n)throw i;return i},N=function(r,e,n,i){var f=r.length,g=0;if(!f||e.f&&!e.l)return n||new l(0);var s=!n,h=s||e.i!=2,p=e.i;s&&(n=new l(f*3));var C=function(vr){var or=n.length;if(vr>or){var lr=new l(Math.max(or*2,vr));lr.set(n),n=lr}},y=e.f||0,a=e.p||0,o=e.b||0,F=e.l,D=e.d,E=e.m,T=e.n,R=f*8;do{if(!F){y=c(r,a,1);var _=c(r,a+1,3);if(a+=3,_)if(_==1)F=hr,D=br,E=9,T=5;else if(_==2){var H=c(r,a,31)+257,L=c(r,a+10,15)+4,d=H+c(r,a+5,31)+1;a+=14;for(var M=new l(d),K=new l(19),u=0;u<L;++u)K[ur[u]]=c(r,a+u*3,7);a+=L*3;for(var rr=B(K),Mr=(1<<rr)-1,Ur=m(K,rr,1),u=0;u<d;){var er=Ur[c(r,a,Mr)];a+=er&15;var w=er>>4;if(w<16)M[u++]=w;else{var x=0,I=0;for(w==16?(I=3+c(r,a,3),a+=2,x=M[u-1]):w==17?(I=3+c(r,a,7),a+=3):w==18&&(I=11+c(r,a,127),a+=7);I--;)M[u++]=x}}var nr=M.subarray(0,H),z=M.subarray(H);E=B(nr),T=B(z),F=m(nr,E,1),D=m(z,T,1)}else t(1);else{var w=sr(a)+4,q=r[w-4]|r[w-3]<<8,G=w+q;if(G>f){p&&t(0);break}h&&C(o+q),n.set(r.subarray(w,G),o),e.b=o+=q,e.p=a=G*8,e.f=y;continue}if(a>R){p&&t(0);break}}h&&C(o+131072);for(var Dr=(1<<E)-1,Ir=(1<<T)-1,P=a;;P=a){var x=F[J(r,a)&Dr],S=x>>4;if(a+=x&15,a>R){p&&t(0);break}if(x||t(2),S<256)n[o++]=S;else if(S==256){P=a,F=null;break}else{var ar=S-254;if(S>264){var u=S-257,U=W[u];ar=c(r,a,(1<<U)-1)+$[u],a+=U}var Q=D[J(r,a)&Ir],V=Q>>4;Q||t(3),a+=Q&15;var z=gr[V];if(V>3){var U=X[V];z+=J(r,a)&(1<<U)-1,a+=U}if(a>R){p&&t(0);break}h&&C(o+131072);var ir=o+ar;if(o<z){var fr=g-z,Or=Math.min(z,ir);for(fr+o<0&&t(3);o<Or;++o)n[o]=i[fr+o]}for(;o<ir;++o)n[o]=n[o-z]}}e.l=F,e.p=P,e.b=o,e.f=y,F&&(y=1,e.m=E,e.d=D,e.n=T)}while(!y);return o!=n.length&&s?yr(n,0,o):n.subarray(0,o)},Fr=new l(0),kr=function(r){(r[0]!=31||r[1]!=139||r[2]!=8)&&t(6,"invalid gzip data");var e=r[3],n=10;e&4&&(n+=(r[10]|r[11]<<8)+2);for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!r[n++]);return n+(e&2)},pr=function(r){var e=r.length;return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0},xr=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&t(6,"invalid zlib data"),(r[1]>>5&1)==1&&t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Sr(r,e){return N(r,{i:2},e,e)}function mr(r,e){var n=kr(r);return n+8>r.length&&t(6,"invalid gzip data"),N(r.subarray(n,-8),{i:2},new l(pr(r)),e)}function Ar(r,e){return N(r.subarray(xr(r),-4),{i:2},e,e)}function Cr(r,e){return r[0]==31&&r[1]==139&&r[2]==8?mr(r,e):(r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31?Sr(r,e):Ar(r,e)}var Er=typeof TextDecoder<"u"&&new TextDecoder,Tr=0;try{Er.decode(Fr,{stream:!0}),Tr=1}catch{}self.addEventListener("message",r=>{const e=Cr(r.data);let n="";for(let i=0;i<e.length;i+=4096)n+=String.fromCharCode(...e.subarray(i,i+4096));self.postMessage(JSON.parse(decodeURIComponent(n)))})})();
|
|
659
|
+
`);break;case"ArrowLeft":h0(e,t.shiftKey);break;case"ArrowRight":d0(e,t.shiftKey);break;case"ArrowUp":l0(e,t.shiftKey);break;case"ArrowDown":o0(e,t.shiftKey);break;case"a":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.selectAll());break;case"c":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.copy());break;case"v":(t.metaKey||t.ctrlKey)&&(t.preventDefault(),e.paste());break}},b0=e=>{const t=X(e);2>t.textTable.length||(e.selectIndex=1,e.focusIndex=t.textTable.length,U(e))},$0=(e,t)=>{const u=e.defaultTextFormat;switch(u.font=t.font,u.size=t.size,u.align=t.align,u.color=t.color,u.leading=t.leading,u.letterSpacing=t.letterSpacing,u.leftMargin=t.leftMargin,u.rightMargin=t.rightMargin,t.fontType){case 1:u.bold=!0;break;case 2:u.italic=!0;break;case 3:u.bold=!0,u.italic=!0;break}switch(e.defaultTextFormat=u,e.type=t.inputType,e.multiline=t.multiline,e.wordWrap=t.wordWrap,e.border=t.border,e.scrollEnabled=t.scroll,e.thickness=t.thickness,e.thicknessColor=t.thicknessColor,t.autoSize){case 1:e.autoSize=t.align;break;case 2:e.autoFontSize=!0;break}e.xMin=e.bounds.xMin=t.bounds.xMin,e.xMax=e.bounds.xMax=t.bounds.xMax,e.yMin=e.bounds.yMin=t.bounds.yMin,e.yMax=e.bounds.yMax=t.bounds.yMax+4,e.text=t.text};class Xu extends cs{isText;$textData;_$isHTML;xMin;yMin;xMax;yMax;bounds;scrollEnabled;xScrollShape;yScrollShape;focusVisible;focusIndex;selectIndex;maxChars;restrict;type;compositionStartIndex;compositionEndIndex;$textFormats;$scrollX;$scrollY;cacheKey;cacheParams;_$background;_$backgroundColor;_$border;_$borderColor;_$htmlText;_$multiline;_$text;_$wordWrap;_$defaultTextFormat;_$rawHtmlText;_$autoSize;_$autoFontSize;_$focus;_$thickness;_$thicknessColor;_$stopIndex;constructor(){super(),this.isText=!0,this.$textData=null,this._$background=!1,this._$backgroundColor=16777215,this._$border=!1,this._$borderColor=0,this._$htmlText="",this._$multiline=!1,this._$text="",this._$wordWrap=!1,this.$scrollX=0,this.$scrollY=0,this.$textFormats=null,this.maxChars=0,this._$stopIndex=-1,this.compositionStartIndex=-1,this.compositionEndIndex=-1;const t=new re;fo(t),this._$defaultTextFormat=t,this._$rawHtmlText="",this.xMin=0,this.yMin=0,this.xMax=100,this.yMax=100,this.bounds={xMin:0,xMax:this.xMax,yMin:0,yMax:this.yMax},this.restrict="",this._$isHTML=!1,this._$autoSize="none",this._$autoFontSize=!1,this.focusVisible=!1,this.focusIndex=-1,this.selectIndex=-1,this.scrollEnabled=!0,this.xScrollShape=new gt,this.xScrollShape.graphics.beginFill("#000",.3).drawRoundRect(0,0,3,3,3),this.xScrollShape.scale9Grid=new me(1.5,1.5,.1,.1),this.yScrollShape=new gt,this.yScrollShape.graphics.beginFill("#000",.3).drawRoundRect(0,0,3,3,3),this.yScrollShape.scale9Grid=new me(1.5,1.5,.1,.1),this.type="static",this._$focus=!1,this._$thickness=0,this._$thicknessColor=0,this.cacheKey=0,this.cacheParams=[0,0,0]}static get namespace(){return"next2d.display.TextField"}get namespace(){return"next2d.display.TextField"}get autoFontSize(){return this._$autoFontSize}set autoFontSize(t){t!==this._$autoFontSize&&(this._$autoFontSize=!!t,ye(this))}get autoSize(){return this._$autoSize}set autoSize(t){t!==this._$autoSize&&(this._$autoSize=t,ye(this))}get background(){return this._$background}set background(t){t!==this._$background&&(this._$background=!!t,U(this))}get backgroundColor(){return this._$backgroundColor}set backgroundColor(t){t=ft(Je(t),0,16777215,16777215),t!==this._$backgroundColor&&(this._$backgroundColor=t,U(this))}get border(){return this._$border}set border(t){t!==this._$border&&(this._$border=!!t,U(this))}get borderColor(){return this._$borderColor}set borderColor(t){t=ft(Je(t),0,16777215,0),t!==this._$borderColor&&(this._$borderColor=t,U(this))}get stopIndex(){return this._$stopIndex}set stopIndex(t){t|=0,this._$stopIndex!==t&&(this._$stopIndex=t,go(this,t))}get defaultTextFormat(){return this._$defaultTextFormat.clone()}set defaultTextFormat(t){this._$rawHtmlText="",this._$isHTML?this._$text="":this._$htmlText="",this._$defaultTextFormat=t,ye(this)}get focus(){return this._$focus}set focus(t){this._$focus!==t&&this.type==="input"&&(this._$focus=!!t,To(this,this._$focus?Ue.FOCUS_IN:Ue.FOCUS_OUT))}get htmlText(){if(this._$htmlText)return this._$htmlText;const t=bo(this.defaultTextFormat);return this._$htmlText=`<span style="${t}">${this._$text.replace(/\n/g,"<br>")}</span>`,this._$htmlText}set htmlText(t){this._$htmlText!==t&&(this._$htmlText=`${t}`,this._$rawHtmlText="",this._$text="",this._$isHTML=!0,ye(this))}get length(){return this.text.length}get multiline(){return this._$multiline}set multiline(t){t!==this._$multiline&&(this._$multiline=!!t,ye(this))}get numLines(){return X(this).lineTable.length}get scrollX(){return this.$scrollX}set scrollX(t){t0(this,t)}get scrollY(){return this.$scrollY}set scrollY(t){u0(this,t)}get text(){return this._$isHTML?(this._$rawHtmlText||(this._$rawHtmlText=s0(this)),this._$rawHtmlText):this._$text}set text(t){t=`${t}`,t===""&&(this.scrollX&&(this.scrollX=0),this.scrollY&&(this.scrollY=0)),t!==this._$text&&(this._$htmlText="",this._$rawHtmlText="",this._$isHTML=!1,this._$text=t,ye(this))}get textHeight(){return X(this).textHeight}get textWidth(){return X(this).textWidth}get thickness(){return this._$thickness}set thickness(t){t|=0,t!==this._$thickness&&(this._$thickness=t,U(this))}get thicknessColor(){return this._$thicknessColor}set thicknessColor(t){t=ft(Je(t),0,16777215,0),t!==this._$thicknessColor&&(this._$thicknessColor=t,U(this))}get wordWrap(){return this._$wordWrap}set wordWrap(t){this._$wordWrap!==t&&(this._$wordWrap=!!t,ye(this))}get width(){return super.width}set width(t){if(t=+t,!isNaN(t)&&0>t)return;const u=t+this.bounds.xMin;u!==this.bounds.xMax&&(this.bounds.xMax=u,ye(this))}get height(){return super.height}set height(t){if(t=+t,!isNaN(t)&&0>t)return;const u=t+this.bounds.yMin;u!==this.bounds.yMax&&(this.bounds.yMax=u,ye(this))}appendText(t){const u=this.text;this.text=u+`${t}`}insertText(t){Jn(this,t)}deleteText(){fs(this)}getLineText(t){return this._$text||this._$htmlText?n0(this,t|0):""}replaceText(t,u,s){r0(this,t,u|0,s|0)}selectAll(){b0(this)}copy(){a0(this)}paste(){i0(this)}setFocusIndex(t,u,s=!1){c0(this,t,u,s)}keyDown(t){f0(this,t)}$sync(t,u=null){u&&super.$syncLoaderInfo(u),$0(this,t)}}const ar=[],m0=()=>ar,g0=e=>{ar.push(e)};let _e=null;const x0=()=>!!_e,p0=()=>{_e||(_e=new AudioContext),_e.resume()},ir=()=>(_e||(_e=new AudioContext),_e),T0=e=>{let t=null;switch(e.method.toUpperCase()){case"GET":if(e.data){const s=e.url.split("?");s[1]=s.length===1?e.data.toString():`${s[1]}&${e.data.toString()}`,e.url=s.join("?")}break;case"PUT":case"POST":e.data&&(t=e.data.toString());break}const u=new XMLHttpRequest;if(u.open(e.method,e.url,!0),u.responseType=e.format,u.withCredentials=e.withCredentials,e.event){const s=Object.keys(e.event);for(let n=0;n<s.length;++n){const r=s[n];u.addEventListener(r,e.event[r])}}for(let s=0;s<e.headers.length;++s){const n=e.headers[s];n&&u.setRequestHeader(n.name,n.value)}u.send(t)},$s=(e,t,u,s=null)=>{const n=+e;return isNaN(n)&&s!==null?s:Math.min(Math.max(t,isNaN(n)?0:n),u)};let cr=1;const E0=()=>cr,y0=e=>{cr=$s(e,0,1,1)},M0=[],Xt=()=>M0,w0=[],cu=()=>w0,A0=e=>{y0(e);const t=Xt();for(let s=0;s<t.length;++s){const n=t[s];n&&(n.volume=e)}const u=cu();for(let s=0;s<u.length;++s){const n=u[s];n&&(n.volume=e)}},v0=()=>{const e=Xt();for(let u=0;u<e.length;++u){const s=e[u];s&&s.stop()}const t=cu();for(let u=0;u<t.length;++u){const s=t[u];s&&s.pause()}e.length=0,t.length=0};class et{static get volume(){return E0()}static set volume(t){A0(t)}static stopAll(){v0()}}const I0=e=>{e.canLoop?e.play():(e.stop(),e.willTrigger(x.COMPLETE)&&e.dispatchEvent(new x(x.COMPLETE)))},S0=(e,t)=>{e.willTrigger(x.OPEN)&&e.dispatchEvent(new x(x.OPEN)),e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},R0=(e,t)=>{e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},ms=async e=>{if(e.byteLength)try{return await ir().decodeAudioData(e)}catch{const t=new Uint8Array(e);let u=0;for(;u>t.byteLength&&(u=t.indexOf(255,u),!(u===-1||(t[u+1]&224)===224));)++u;return await ms(t.subarray(u).buffer)}},k0=async(e,t)=>{const u=t.target;if(u)if(e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total)),199<u.status&&400>u.status){const s=await ms(u.response);s&&(e.audioBuffer=s,e.willTrigger(x.COMPLETE)&&e.dispatchEvent(new x(x.COMPLETE)))}else e.willTrigger(ke.IO_ERROR)&&e.dispatchEvent(new ke(ke.IO_ERROR,!1,u.statusText))},O0=async(e,t)=>{await new Promise(u=>{T0({format:"arraybuffer",url:t.url,method:t.method,data:t.data,headers:t.headers,withCredentials:t.withCredentials,event:{loadstart:s=>{S0(e,s)},progress:s=>{R0(e,s)},loadend:async s=>{await k0(e,s),u()}}})})},F0=async(e,t)=>{if(!t.audioBuffer){const u=new Uint8Array(t.buffer),s=await ms(u.buffer);if(!s)return;t.audioBuffer=s}e.audioBuffer=t.audioBuffer};class ou extends tt{_$source;_$gainNode;_$stopFlag;_$currentCount;_$volume;audioBuffer;loopCount;constructor(){super(),this.loopCount=0,this.audioBuffer=null,this._$volume=1,this._$currentCount=0,this._$stopFlag=!0,this._$source=null,this._$gainNode=null}get volume(){return this._$volume}set volume(t){this._$volume=$s(Math.min(et.volume,t),0,1,1),this._$gainNode&&(this._$gainNode.gain.value=this._$volume)}get canLoop(){return!this._$stopFlag&&this.loopCount>=this._$currentCount}clone(){const t=new ou;return t.volume=this._$volume,t.loopCount=this.loopCount,t.audioBuffer=this.audioBuffer,t}async load(t){await O0(this,t)}play(t=0){if(!this._$stopFlag||!this.audioBuffer)return;this.stop();const u=ir();this._$gainNode=u.createGain(),this._$gainNode.connect(u.destination),this._$gainNode.gain.value=Math.min(et.volume,this._$volume),this._$source=u.createBufferSource(),this._$source.addEventListener("ended",()=>{I0(this)}),this._$source.buffer=this.audioBuffer,this._$source.connect(this._$gainNode),this._$source.start(t),this._$stopFlag=!1,this._$currentCount++,Xt().push(this)}stop(){if(this._$stopFlag)return;this._$stopFlag=!0,this._$currentCount=0,this._$source&&(this._$source.disconnect(),this._$source=null),this._$gainNode&&(this._$gainNode.gain.value=0,this._$gainNode.disconnect(),this._$gainNode=null);const t=Xt(),u=t.indexOf(this);u>-1&&t.splice(u,1)}async $build(t){await F0(this,t)}}class L0{volume;loopCount;constructor(t=1,u=0){this.volume=t,this.loopCount=u}}const C0=()=>{const e=document.createElement("video");return e.autoplay=!1,e.crossOrigin="anonymous",e.setAttribute("playsinline",""),e},gs=e=>{e.changed=!0;const t=e.parent;t&&!t.changed&&gs(t)},N0=async e=>{e.autoPlay&&(x0()||(e.muted=!0,g0(e)),await e.play()),e.loaded=!0,gs(e),e.willTrigger(x.COMPLETE)&&e.dispatchEvent(new x(x.COMPLETE))},B0=(e,t)=>{t.currentTime=0,t.duration=e.duration,t.videoWidth=e.videoWidth,t.videoHeight=e.videoHeight;const u=new OffscreenCanvas(t.videoWidth,t.videoHeight);t.$context=u.getContext("2d"),t.$offscreenCanvas=u},P0=(e,t)=>{e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},D0=e=>{if(e.willTrigger(le.ENDED)&&e.dispatchEvent(new le(le.ENDED)),e.loop){e.currentTime=0;return}e.ended=!0,e.changed=!1,e.pause()},_0=(e,t)=>{e.addEventListener("loadedmetadata",()=>{B0(e,t)},{once:!0}),e.addEventListener("progress",u=>{P0(t,u)}),e.addEventListener("canplaythrough",async()=>{await N0(t),e.volume=t.volume},{once:!0}),e.addEventListener("ended",()=>{D0(t)})},or=e=>{if(e.paused||!e.loaded)return 0;e.willTrigger(le.PLAY)&&e.dispatchEvent(new le(le.PLAY)),gs(e);const t=cu();return t.indexOf(e)===-1&&t.push(e),e.$context&&e.$videoElement&&e.$context.drawImage(e.$videoElement,0,0,e.videoWidth,e.videoHeight),requestAnimationFrame(()=>{or(e)})},U0=(e,t)=>{t.videoData||(t.videoData=new Uint8Array(t.buffer),t.buffer=null),e.loop=t.loop,e.autoPlay=t.autoPlay,e.videoWidth=t.bounds.xMax,e.videoHeight=t.bounds.yMax,e.volume=t.volume,e.src=URL.createObjectURL(new Blob([t.videoData],{type:"video/mp4"}))};class Vu extends iu{duration;smoothing;loop;autoPlay;currentTime;videoWidth;videoHeight;loaded;ended;isVideo;$videoElement;$offscreenCanvas;$context;paused;_$timerId;_$volume;_$src;constructor(t=0,u=0){super(),this.videoWidth=t,this.videoHeight=u,this.isVideo=!0,this.duration=0,this.smoothing=!0,this.loop=!1,this.loaded=!1,this.ended=!1,this.paused=!0,this.autoPlay=!0,this.currentTime=0,this._$src="",this._$timerId=-1,this._$volume=1,this.$videoElement=null,this.$offscreenCanvas=null,this.$context=null}static get namespace(){return"next2d.media.Video"}get namespace(){return"next2d.media.Video"}get src(){return this._$src}set src(t){this._$src!==t&&(this.loaded=!1,this.currentTime=0,this.$videoElement=null,this.$offscreenCanvas=null,this.$context=null,this.$videoElement=C0(),_0(this.$videoElement,this),this._$src=this.$videoElement.src=t,this.$videoElement.load())}get muted(){return this.$videoElement?this.$videoElement.muted:!1}set muted(t){this.$videoElement&&(this.$videoElement.muted=t)}get volume(){return this._$volume}set volume(t){this._$volume=$s(Math.min(et.volume,t),0,1,1),this.$videoElement&&(this.$videoElement.volume=this._$volume)}pause(){if(!this.$videoElement||this.paused)return;this.paused=!0,this.$videoElement.pause(),cancelAnimationFrame(this._$timerId),this.willTrigger(le.PAUSE)&&this.dispatchEvent(new le(le.PAUSE));const t=cu(),u=t.indexOf(this);u>-1&&t.splice(u,1)}async play(){!this.$videoElement||!this.paused||(this.paused=!1,this.ended=!1,this.$videoElement.volume=this._$volume,await this.$videoElement.play(),this._$timerId=or(this))}seek(t){this.$videoElement&&(this.currentTime=this.$videoElement.currentTime=Math.min(this.duration,t),this.willTrigger(le.SEEK)&&this.dispatchEvent(new le(le.SEEK)))}$sync(t,u=null){u&&super.$syncLoaderInfo(u),U0(this,t)}}const dt=(e,t,u,s,n=-1)=>{const r=s.loaderInfo;if(!r)throw new Error("the loaderInfo or data is null.");e.parent=s,Oe.set(e,s.root),Ot.set(e,r),e.dictionaryId=t,e.characterId=u.characterId,e.clipDepth=u.clipDepth,e.startFrame=u.startFrame,e.endFrame=u.endFrame,e.name=u.name||"",e.placeId=n},Xs=(e,t,u,s,n=-1)=>{switch(u.extends){case Yt.namespace:{const r=new Yt;return dt(r,e,t,s,n),r.$sync(u),r}case gt.namespace:{const r=new gt;return dt(r,e,t,s,n),r.$sync(u),r}case Xu.namespace:{const r=new Xu;return dt(r,e,t,s,n),r.$sync(u),r}case Vu.namespace:{const r=new Vu;return dt(r,e,t,s,n),r.$sync(u),r}default:throw new Error(`Character extends not found: ${u.extends}`)}},vt=new Map,q0=(e,t)=>{const u=e.loaderInfo;if(!u||!u.data)return t;const s=u.data.characters[e.characterId];if(!s)return t;const n=e.currentFrame,r=s.controller[n];if(!r)return t;const a=[],i=s.dictionary;if(!t.length){for(let c=0;c<r.length;++c){if(!(c in r))continue;const o=r[c];if(typeof o!="number")continue;const d=i[o];if(!d)continue;const h=u.data.characters[d.characterId];if(!h)continue;const l=Xs(o,d,h,e,c);l&&(t.push(l),l.isContainerEnabled&&a.push(l))}return e.$container=a,t}for(let c=0;c<t.length;++c){const o=t[c];if(!o)continue;const d=o.startFrame,h=o.endFrame;if(d===1&&h===0||d<=n&&h>n){vt.set(o.dictionaryId,o);continue}o.uniqueKey&&O.has(o.uniqueKey)&&O.removeTimer(o.uniqueKey),o.willTrigger(x.REMOVED)&&o.dispatchEvent(new x(x.REMOVED,!0)),o.willTrigger(x.REMOVED_FROM_STAGE)&&o.dispatchEvent(new x(x.REMOVED_FROM_STAGE,!0)),o.isVideo&&o.pause(),o.isContainerEnabled&&as(o)}t.length=0;for(let c=0;c<r.length;++c){if(!(c in r))continue;const o=r[c];if(typeof o!="number")continue;if(vt.has(o)){const f=vt.get(o);f.placeId=c,f.placeObject=null,t.push(f);continue}const d=i[o];if(!d)continue;const h=u.data.characters[d.characterId];if(!h)continue;const l=Xs(o,d,h,e,c);l&&(t.push(l),l.isContainerEnabled&&a.push(l))}return e.$container=a,vt.clear(),t},X0=(e,t)=>{e.$labels||(e.$labels=new Map),e.$labels.set(t.frame,t)},V0=e=>{if(!e.$labels)return null;const t=e.currentFrame;return e.$labels.has(t)&&e.$labels.get(t)||null},Y0=e=>!e.$labels||!e.$labels.size?null:Array.from(e.$labels.values()),W0=(e,t)=>{if(!e.$labels||!e.$labels.size)return 0;for(const[u,s]of e.$labels)if(s.name===t)return u;return 0},H0=(e,t=null)=>{if(!t||!t.size)return;const u=e.currentFrame;if(!t.has(u))return;const s=t.get(u);s.willTrigger(x.FRAME_LABEL)&&s.dispatchEvent(new x(x.FRAME_LABEL))},z0=(e,t=null)=>{if(!t||!t.size)return;const u=e.currentFrame;t.has(u)&&Ou.push(e)},Vt=e=>{e.$canAction&&(e.$canAction=!1,H0(e,e.$labels),z0(e,e.$actions))},lu=(e,t)=>{if(e.totalFrames===1)return;let u=+t;if(isNaN(u)&&(u=W0(e,`${t}`)),1>u&&(u=1),e.currentFrame!==u){if(u>e.totalFrames){if(e.currentFrame===e.totalFrames)return;e.$wait=!0,e.$canSound=!0,e.$canAction=!0,e.$hasTimelineHeadMoved=!0,e.currentFrame=e.totalFrames,Vt(e),Y(e);return}e.currentFrame=u,e.$wait=!0,e.$canSound=!0,e.$canAction=!0,e.$hasTimelineHeadMoved=!0,Y(e),Vt(e)}},G0=(e,t)=>{e.play(),lu(e,t)},K0=(e,t)=>{e.stop(),lu(e,t),e.$wait=!1},Q0=e=>{e.totalFrames<=e.currentFrame||(e.stop(),lu(e,e.currentFrame+1))},Z0=e=>{2>e.currentFrame||(e.stop(),lu(e,e.currentFrame-1))},J0=(e,t)=>{for(let u=0;u<t.length;++u){const s=t[u];if(!s)continue;s.script||(s.script=Function(s.action));const n=s.frame;e.has(n)||e.set(n,q()),e.get(n)?.push(s.script)}},j0=(e,t)=>{for(let u=0;u<t.length;++u){const s=t[u];s&&e.set(s.frame,new qn(s.name,s.frame))}},el=async(e,t,u)=>{const s=e.loaderInfo;if(!s)return;const n=s.data;if(!n)return;const r=n.characters;for(let a=0;a<u.length;++a){const i=u[a];if(!i)continue;const c=q();for(let o=0;o<i.sound.length;++o){const d=i.sound[o];if(!d)continue;const h=r[d.characterId];if(!h)continue;const l=new ou;l.loopCount=d.loopCount|0,l.volume=Math.min(et.volume,d.volume),await l.$build(h),c.push(l)}t.set(i.frame,c)}},tl=(e,t)=>{t.actions&&(e.$actions||(e.$actions=new Map),J0(e.$actions,t.actions)),t.sounds&&(e.$sounds||(e.$sounds=new Map),el(e,e.$sounds,t.sounds)),t.labels&&(e.$labels||(e.$labels=new Map),j0(e.$labels,t.labels)),e.totalFrames=t.totalFrame||1};class Yt extends ls{$labels;$actions;$sounds;$canAction;$wait;totalFrames;currentFrame;_$stopFlag;$canSound;$hasTimelineHeadMoved;isTimelineEnabled;constructor(){super(),this.currentFrame=1,this.totalFrames=1,this.isTimelineEnabled=!0,this.$actions=null,this.$labels=null,this.$sounds=null,this.$canAction=!0,this.$wait=!1,this.$canSound=!0,this.$hasTimelineHeadMoved=!0,this._$stopFlag=!1}static get namespace(){return"next2d.display.MovieClip"}get namespace(){return"next2d.display.MovieClip"}get children(){return!this.$hasTimelineHeadMoved||this.characterId===-1?this._$children:(this.$hasTimelineHeadMoved=!1,q0(this,this._$children))}get currentFrameLabel(){return V0(this)}get currentLabels(){return Y0(this)}get isPlaying(){return!this._$stopFlag}gotoAndPlay(t){G0(this,t)}gotoAndStop(t){K0(this,t)}nextFrame(){Q0(this)}play(){this._$stopFlag=!1,Y(this)}prevFrame(){Z0(this)}stop(){this._$stopFlag=!0}addFrameLabel(t){X0(this,t)}$sync(t,u=null){u&&super.$syncLoaderInfo(u),tl(this,t)}}const Vs=async(e,t)=>{const u=new Map;if(t.symbols.length)for(let a=0;a<t.symbols.length;++a){const i=t.symbols[a];u.set(i[0],i[1])}const s=e.contentLoaderInfo;s.data={stage:t.stage,characters:t.characters,symbols:u};const n=new Yt,r=t.characters[0];dt(n,-1,{characterId:0,name:"main",clipDepth:0,endFrame:r.controller.length,startFrame:1},e),n.$sync(r,s),n.parent=null,s.content=n,s.willTrigger(x.COMPLETE)&&s.dispatchEvent(new x(x.COMPLETE))},lr=`(function(){"use strict";var l=Uint8Array,k=Uint16Array,tr=Int32Array,W=new l([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),X=new l([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ur=new l([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Y=function(r,e){for(var n=new k(31),i=0;i<31;++i)n[i]=e+=1<<r[i-1];for(var f=new tr(n[30]),i=1;i<30;++i)for(var g=n[i];g<n[i+1];++g)f[g]=g-n[i]<<5|i;return{b:n,r:f}},Z=Y(W,2),$=Z.b,cr=Z.r;$[28]=258,cr[258]=28;for(var wr=Y(X,0),gr=wr.b,O=new k(32768),v=0;v<32768;++v){var b=(v&43690)>>1|(v&21845)<<1;b=(b&52428)>>2|(b&13107)<<2,b=(b&61680)>>4|(b&3855)<<4,O[v]=((b&65280)>>8|(b&255)<<8)>>1}for(var m=function(r,e,n){for(var i=r.length,f=0,g=new k(e);f<i;++f)r[f]&&++g[r[f]-1];var s=new k(e);for(f=1;f<e;++f)s[f]=s[f-1]+g[f-1]<<1;var h;if(n){h=new k(1<<e);var p=15-e;for(f=0;f<i;++f)if(r[f])for(var C=f<<4|r[f],y=e-r[f],a=s[r[f]-1]++<<y,o=a|(1<<y)-1;a<=o;++a)h[O[a]>>p]=C}else for(h=new k(i),f=0;f<i;++f)r[f]&&(h[f]=O[s[r[f]-1]++]>>15-r[f]);return h},A=new l(288),v=0;v<144;++v)A[v]=8;for(var v=144;v<256;++v)A[v]=9;for(var v=256;v<280;++v)A[v]=7;for(var v=280;v<288;++v)A[v]=8;for(var j=new l(32),v=0;v<32;++v)j[v]=5;var hr=m(A,9,1),br=m(j,5,1),B=function(r){for(var e=r[0],n=1;n<r.length;++n)r[n]>e&&(e=r[n]);return e},c=function(r,e,n){var i=e/8|0;return(r[i]|r[i+1]<<8)>>(e&7)&n},J=function(r,e){var n=e/8|0;return(r[n]|r[n+1]<<8|r[n+2]<<16)>>(e&7)},sr=function(r){return(r+7)/8|0},yr=function(r,e,n){return(n==null||n>r.length)&&(n=r.length),new l(r.subarray(e,n))},zr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],t=function(r,e,n){var i=new Error(e||zr[r]);if(i.code=r,Error.captureStackTrace&&Error.captureStackTrace(i,t),!n)throw i;return i},N=function(r,e,n,i){var f=r.length,g=0;if(!f||e.f&&!e.l)return n||new l(0);var s=!n,h=s||e.i!=2,p=e.i;s&&(n=new l(f*3));var C=function(vr){var or=n.length;if(vr>or){var lr=new l(Math.max(or*2,vr));lr.set(n),n=lr}},y=e.f||0,a=e.p||0,o=e.b||0,F=e.l,D=e.d,E=e.m,T=e.n,R=f*8;do{if(!F){y=c(r,a,1);var _=c(r,a+1,3);if(a+=3,_)if(_==1)F=hr,D=br,E=9,T=5;else if(_==2){var H=c(r,a,31)+257,L=c(r,a+10,15)+4,d=H+c(r,a+5,31)+1;a+=14;for(var M=new l(d),K=new l(19),u=0;u<L;++u)K[ur[u]]=c(r,a+u*3,7);a+=L*3;for(var rr=B(K),Mr=(1<<rr)-1,Ur=m(K,rr,1),u=0;u<d;){var er=Ur[c(r,a,Mr)];a+=er&15;var w=er>>4;if(w<16)M[u++]=w;else{var x=0,I=0;for(w==16?(I=3+c(r,a,3),a+=2,x=M[u-1]):w==17?(I=3+c(r,a,7),a+=3):w==18&&(I=11+c(r,a,127),a+=7);I--;)M[u++]=x}}var nr=M.subarray(0,H),z=M.subarray(H);E=B(nr),T=B(z),F=m(nr,E,1),D=m(z,T,1)}else t(1);else{var w=sr(a)+4,q=r[w-4]|r[w-3]<<8,G=w+q;if(G>f){p&&t(0);break}h&&C(o+q),n.set(r.subarray(w,G),o),e.b=o+=q,e.p=a=G*8,e.f=y;continue}if(a>R){p&&t(0);break}}h&&C(o+131072);for(var Dr=(1<<E)-1,Ir=(1<<T)-1,P=a;;P=a){var x=F[J(r,a)&Dr],S=x>>4;if(a+=x&15,a>R){p&&t(0);break}if(x||t(2),S<256)n[o++]=S;else if(S==256){P=a,F=null;break}else{var ar=S-254;if(S>264){var u=S-257,U=W[u];ar=c(r,a,(1<<U)-1)+$[u],a+=U}var Q=D[J(r,a)&Ir],V=Q>>4;Q||t(3),a+=Q&15;var z=gr[V];if(V>3){var U=X[V];z+=J(r,a)&(1<<U)-1,a+=U}if(a>R){p&&t(0);break}h&&C(o+131072);var ir=o+ar;if(o<z){var fr=g-z,Or=Math.min(z,ir);for(fr+o<0&&t(3);o<Or;++o)n[o]=i[fr+o]}for(;o<ir;++o)n[o]=n[o-z]}}e.l=F,e.p=P,e.b=o,e.f=y,F&&(y=1,e.m=E,e.d=D,e.n=T)}while(!y);return o!=n.length&&s?yr(n,0,o):n.subarray(0,o)},Fr=new l(0),kr=function(r){(r[0]!=31||r[1]!=139||r[2]!=8)&&t(6,"invalid gzip data");var e=r[3],n=10;e&4&&(n+=(r[10]|r[11]<<8)+2);for(var i=(e>>3&1)+(e>>4&1);i>0;i-=!r[n++]);return n+(e&2)},pr=function(r){var e=r.length;return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0},xr=function(r,e){return((r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31)&&t(6,"invalid zlib data"),(r[1]>>5&1)==1&&t(6,"invalid zlib data: "+(r[1]&32?"need":"unexpected")+" dictionary"),(r[1]>>3&4)+2};function Sr(r,e){return N(r,{i:2},e,e)}function mr(r,e){var n=kr(r);return n+8>r.length&&t(6,"invalid gzip data"),N(r.subarray(n,-8),{i:2},new l(pr(r)),e)}function Ar(r,e){return N(r.subarray(xr(r),-4),{i:2},e,e)}function Cr(r,e){return r[0]==31&&r[1]==139&&r[2]==8?mr(r,e):(r[0]&15)!=8||r[0]>>4>7||(r[0]<<8|r[1])%31?Sr(r,e):Ar(r,e)}var Er=typeof TextDecoder<"u"&&new TextDecoder,Tr=0;try{Er.decode(Fr,{stream:!0}),Tr=1}catch{}self.addEventListener("message",r=>{const e=Cr(r.data);let n="";for(let i=0;i<e.length;i+=4096)n+=String.fromCharCode(...e.subarray(i,i+4096));self.postMessage(JSON.parse(decodeURIComponent(n)))})})();
|
|
660
660
|
`,Ys=typeof self<"u"&&self.Blob&&new Blob([lr],{type:"text/javascript;charset=utf-8"});function ul(e){let t;try{if(t=Ys&&(self.URL||self.webkitURL).createObjectURL(Ys),!t)throw"";const u=new Worker(t,{name:e?.name});return u.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),u}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(lr),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Ws=new ul,hr=async(e,t)=>{t.type==="zlib"?await new Promise(u=>{Ws.onmessage=n=>{Vs(e,n.data),u()};const s=new Uint8Array(t.buffer);Ws.postMessage(s,[s.buffer])}):Vs(e,t)},sl=(e,t)=>{e.willTrigger(x.OPEN)&&e.dispatchEvent(new x(x.OPEN)),e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},nl=(e,t)=>{e.willTrigger(V.PROGRESS)&&e.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total))},rl=async(e,t)=>{const u=t.target;if(!u)return;const s=e.contentLoaderInfo;if(s.willTrigger(V.PROGRESS)&&s.dispatchEvent(new V(V.PROGRESS,!1,t.loaded,t.total)),s.willTrigger(kt.HTTP_STATUS)){const n=ui(u.getAllResponseHeaders());s.dispatchEvent(new kt(kt.HTTP_STATUS,!1,u.status,u.responseURL,n))}199<u.status&&400>u.status?(await hr(e,u.response),s.willTrigger(x.COMPLETE)&&s.dispatchEvent(new x(x.COMPLETE))):s.willTrigger(ke.IO_ERROR)&&s.dispatchEvent(new ke(ke.IO_ERROR,!1,u.statusText))},al=async(e,t)=>{await new Promise(u=>{ti({format:t.responseDataFormat,url:t.url,method:t.method,data:t.data,headers:t.headers,withCredentials:t.withCredentials,event:{loadstart:s=>{sl(e.contentLoaderInfo,s)},progress:s=>{nl(e.contentLoaderInfo,s)},loadend:async s=>{await rl(e,s),u()}}})})};class dr{contentLoaderInfo;root;constructor(){this.root=null,this.contentLoaderInfo=new Ec}get content(){return this.contentLoaderInfo.content}get loaderInfo(){return this.contentLoaderInfo}async load(t){if(t.responseDataFormat!=="json")throw new Error("The only format that can be loaded by this function is `json` format.");this.contentLoaderInfo.url=t.url,this.contentLoaderInfo.format=t.responseDataFormat,await al(this,t)}async loadJSON(t){await hr(this,t)}}const fr=()=>{for(;Ou.length;){const e=Ou.pop(),t=e.$actions;if(!t)continue;const u=e.currentFrame;if(!t.has(u))continue;const s=t.get(u);if(s)for(let n=0;n<s.length;n++)try{s[n].apply(e)}catch(r){console.error(r)}}},br=()=>{for(;Fu.length;){const e=Fu.pop(),t=e.$sounds;if(!t)continue;const u=e.currentFrame;if(!t.has(u))continue;const s=t.get(u),n=e.soundTransform;for(let r=0;r<s.length;r++){const a=s[r];a&&(n&&(a.volume=n.volume,a.loopCount=n.loopCount),a.play())}}},il=(e,t=null)=>{if(!t||!t.size)return;const u=e.currentFrame;t.has(u)&&Fu.push(e)},$r=e=>{e.$canSound&&(e.$canSound=!1,il(e,e.$sounds))},mr=e=>{const t=e.children;for(let u=t.length-1;u>-1;--u){const s=t[u];s&&s.isContainerEnabled&&(mr(s),s.isTimelineEnabled&&($r(s),Vt(s)))}},cl=e=>{mr(e),br(),fr()},ol=e=>(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e);class ll{buffer;offset;constructor(){this.buffer=new Float32Array(256),this.offset=0}push(...t){this.buffer.length<this.offset+t.length&&this.resize(t.length);for(let u=0;u<t.length;u++)this.buffer[this.offset++]=t[u]}set(t){this.buffer.length<this.offset+t.length&&this.resize(t.length),this.buffer.set(t,this.offset),this.offset+=t.length}resize(t){const u=new Float32Array(ol(this.offset+t));this.buffer.length&&u.set(this.buffer),this.buffer=u}}const E=new ll,Wt=e=>{let t=2166136261;for(let u=0;u<e.length;++u){let s=e[u]|0;for(let n=0;n<4;n++){const r=s&255;t^=r,t=Math.imul(t,16777619),s>>>=8}}return(t>>>0)%16777216},xs=e=>{switch(e){case"copy":return 0;case"add":return 1;case"alpha":return 2;case"darken":return 3;case"difference":return 4;case"erase":return 5;case"hardlight":return 6;case"invert":return 7;case"layer":return 8;case"lighten":return 9;case"multiply":return 10;case"normal":return 11;case"overlay":return 12;case"screen":return 13;case"subtract":return 14;default:return 11}},gr=(e,t,u,s,n,r,a)=>{if(!e.visible){E.push(0);return}const i=e.graphics,c=i.isDrawable;if(!c&&!e.isBitmap){E.push(0);return}const o=Ve(e),d=o?L.multiply(u,o):u;if(!fe(d[3]+d[7]/255,0,1,0)){d!==u&&L.release(d),E.push(0);return}const l=N(e),f=l?A.multiply(t,l):t,b=ae(i.xMin,i.yMin,i.xMax,i.yMax,f),T=b[0],m=b[1],g=b[2],w=b[3];F(b);const R=Math.ceil(Math.abs(g-T)),k=Math.ceil(Math.abs(w-m));switch(!0){case R===0:case k===0:case R===-1/0:case k===-1/0:case R===1/0:case k===1/0:d!==u&&L.release(d),f!==t&&A.release(f),F(b),E.push(0);return}if(r>T+R||a>m+k||T>s||m>n){d!==u&&L.release(d),f!==t&&A.release(f),F(b),E.push(0);return}const D=l&&e.scale9Grid?Math.abs(l[1])<.001&&Math.abs(l[2])<1e-4:!1;if(!e.uniqueKey)if(e.characterId&&e.loaderInfo){const G=q(e.loaderInfo.id,e.characterId);e.uniqueKey=`${Wt(new Float32Array(G))}`,ue(G)}else e.uniqueKey=e.isBitmap?`${e.instanceId}`:`${Wt(i.buffer)}`;const ee=Math.round(Math.sqrt(f[0]*f[0]+f[1]*f[1])*1e4)/1e4,_=Math.round(Math.sqrt(f[2]*f[2]+f[3]*f[3])*1e4)/1e4;(!e.isBitmap&&!e.cacheKey||e.cacheParams[0]!==ee||e.cacheParams[1]!==_||e.cacheParams[2]!==d[7])&&(e.cacheKey=O.generateKeys(ee,_,d[7]),e.cacheParams[0]=ee,e.cacheParams[1]=_,e.cacheParams[2]=d[7]);const ie=e.isBitmap?0:e.cacheKey;if(E.push(1,$n,f[0],f[1],f[2],f[3],f[4],f[5],d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],T,m,g,w,i.xMin,i.yMin,i.xMax,i.yMax,+D,+c,+e.isBitmap,+e.uniqueKey,ie),e.$cache&&!e.$cache.has(e.uniqueKey)&&(e.$cache=null),e.$cache?e.$cache.get(`${ie}`):O.get(e.uniqueKey,`${ie}`))e.$cache||(e.$cache=O.getById(e.uniqueKey),e.$cache.set(e.uniqueKey,!0)),E.push(1);else{if(E.push(0),D){const K=p.rendererScale,W=Su(K,0,0,K,0,0),se=A.multiply(W,l||mt);Mt(W);const te=e.parent.concatenatedMatrix.rawData,ne=Su(te[0],te[1],te[2],te[3],te[4]*K-T,te[5]*K-m);A.release(te);const Ye=A.multiply(ne,se),We=Ye[4]-(f[4]-T),Rr=Ye[5]-(f[5]-m);Mt(Ye);const st=ae(i.xMin,i.yMin,i.xMax,i.yMax,se),ys=st[0],Ms=st[1],kr=st[2],Or=st[3];F(st);const pt=Math.ceil(Math.abs(kr-ys)),Tt=Math.ceil(Math.abs(Or-Ms)),ge=e.scale9Grid,fu=Math.abs(i.xMax-i.xMin),bu=Math.abs(i.yMax-i.yMin),Et=ge.width>0?(ge.x-i.xMin)/fu:1e-5,yt=ge.height>0?(ge.y-i.yMin)/bu:1e-5,$u=ge.width>0?(ge.x+ge.width-i.xMin)/fu:.99999,mu=ge.height>0?(ge.y+ge.height-i.yMin)/bu:.99999,ws=Math.ceil(fu*K),As=Math.ceil(bu*K);let gu=ws*Et/pt,xu=As*yt/Tt,pu=(pt-ws*(1-$u))/pt,Tu=(Tt-As*(1-mu))/Tt;if(gu>=pu){const nt=Et/(Et+(1-$u));gu=Math.max(nt-1e-5,0),pu=Math.min(nt+1e-5,1)}if(xu>=Tu){const nt=yt/(yt+(1-mu));xu=Math.max(nt-1e-5,0),Tu=Math.min(nt+1e-5,1)}E.push(se[0],se[1],se[2],se[3],se[4],se[5],ne[0],ne[1],ne[2],ne[3],ne[4]-We,ne[5]-Rr,ys,Ms,pt,Tt,Et,yt,gu,xu,$u,mu,pu,Tu),Mt(ne),Mt(se)}const G=c||D?i.buffer:e.$bitmapBuffer;E.push(G.length),E.set(G),O.set(e.uniqueKey,`${ie}`,!0),e.$cache&&(e.$cache=null)}if(E.push(xs(e.blendMode)),e.filters?.length){let G=!1;const K=[],W=de(0,0,0,0);for(let te=0;te<e.filters.length;te++){const ne=e.filters[te];if(!ne||!ne.canApplyFilter())continue;ne.$updated&&(G=!0),ne.$updated=!1,ne.getBounds(W);const Ye=ne.toNumberArray();for(let We=0;We<Ye.length;We+=4096)K.push(...Ye.subarray(We,We+4096))}const se=K.length>0;se&&(E.push(+se,+G,W[0],W[1],W[2],W[3],K.length),E.set(new Float32Array(K))),F(W)}else E.push(0);d!==u&&L.release(d),f!==t&&A.release(f)},Yu=(e,t)=>{const u=N(e),s=u?A.multiply(t,u):t;s!==t&&A.release(s);const n=u&&e.scale9Grid?Math.abs(u[1])<.001&&Math.abs(u[2])<1e-4:!1,r=e.graphics.buffer;E.push($n,s[0],s[1],s[2],s[3],s[4],s[5],+n,r.length),E.set(r)},hl=new TextEncoder,xr=(e,t,u,s,n,r,a)=>{if(!e.visible){E.push(0);return}const i=Ve(e),c=i?L.multiply(u,i):u;if(!fe(c[3]+c[7]/255,0,1,0)){c!==u&&L.release(c),E.push(0);return}const d=N(e),h=d?A.multiply(t,d):t,l=ae(e.xMin,e.yMin,e.xMax,e.yMax,h),f=l[0],b=l[1],T=l[2],m=l[3];F(l);const g=Math.ceil(Math.abs(T-f)),w=Math.ceil(Math.abs(m-b));switch(!0){case g===0:case w===0:case g===-1/0:case w===-1/0:case g===1/0:case w===1/0:c!==u&&L.release(c),h!==t&&A.release(h),F(l),E.push(0);return}if(r>f+g||a>b+w||f>s||b>n){c!==u&&L.release(c),h!==t&&A.release(h),F(l),E.push(0);return}if(!e.uniqueKey)if(e.characterId&&e.loaderInfo){const _=q(e.loaderInfo.id,e.characterId);e.uniqueKey=`${Wt(new Float32Array(_))}`,ue(_)}else e.uniqueKey=`${e.instanceId}`;const R=Math.round(Math.sqrt(h[0]*h[0]+h[1]*h[1])*1e4)/1e4,k=Math.round(Math.sqrt(h[2]*h[2]+h[3]*h[3])*1e4)/1e4;(e.changed&&!e.cacheKey||e.cacheParams[0]!==R||e.cacheParams[1]!==k||e.cacheParams[2]!==c[7])&&(e.cacheKey=O.generateKeys(R,k,c[7]),e.cacheParams[0]=R,e.cacheParams[1]=k,e.cacheParams[2]=c[7]);const D=e.cacheKey;E.push(1,Ga,h[0],h[1],h[2],h[3],h[4],h[5],c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],f,b,T,m,e.xMin,e.yMin,e.xMax,e.yMax,+e.uniqueKey,D,+e.changed),e.$cache&&!e.$cache.has(e.uniqueKey)&&(e.$cache=null);const ee=e.$cache?e.$cache.get(`${D}`):O.get(e.uniqueKey,`${D}`);if(!ee||e.changed){E.push(0,+ee);const _=hl.encode(JSON.stringify(e.$textData));switch(E.push(_.length),E.set(_),e.autoSize){case"center":E.push(0);break;case"left":E.push(1);break;case"none":E.push(2);break;case"right":E.push(3);break}E.push(e.stopIndex,e.scrollX,e.scrollY,e.textWidth,e.textHeight,Math.abs(e.xMax-e.xMin),Math.abs(e.yMax-e.yMin),e.focusIndex,e.selectIndex,+e.focusVisible,e.thickness,e.thicknessColor,+e.wordWrap,+e.border,e.borderColor,+e.background,e.backgroundColor,e.defaultTextFormat.color||0,e.defaultTextFormat.size||0),ee||O.set(e.uniqueKey,`${D}`,!0),e.$cache&&(e.$cache=null)}else e.$cache||(e.$cache=O.getById(e.uniqueKey),e.$cache.set(e.uniqueKey,!0)),E.push(1);if(E.push(xs(e.blendMode)),e.filters?.length){let _=!1;const ie=[],$e=de(0,0,0,0);for(let K=0;K<e.filters.length;K++){const W=e.filters[K];if(!W||!W.canApplyFilter())continue;W.$updated&&(_=!0),W.$updated=!1,W.getBounds($e);const se=W.toNumberArray();for(let te=0;te<se.length;te+=4096)ie.push(...se.subarray(te,te+4096))}const G=ie.length>0;G&&(E.push(+G,+_,$e[0],$e[1],$e[2],$e[3],ie.length),E.set(new Float32Array(ie))),F($e)}else E.push(0);c!==u&&L.release(c),h!==t&&A.release(h)},pr=(e,t,u,s,n,r,a,i)=>{if(!e.visible||!e.$videoElement||!e.$offscreenCanvas||!e.loaded){E.push(0);return}const c=Ve(e),o=c?L.multiply(s,c):s;if(!fe(o[3]+o[7]/255,0,1,0)){o!==s&&L.release(o),E.push(0);return}const h=N(e),l=h?A.multiply(u,h):u,f=ae(0,0,e.videoWidth,e.videoHeight,l),b=f[0],T=f[1],m=f[2],g=f[3];F(f);const w=Math.ceil(Math.abs(m-b)),R=Math.ceil(Math.abs(g-T));switch(!0){case w===0:case R===0:case w===-1/0:case R===-1/0:case w===1/0:case R===1/0:o!==s&&L.release(o),l!==u&&A.release(l),E.push(0);return}if(a>b+w||i>T+R||b>n||T>r){o!==s&&L.release(o),l!==u&&A.release(l),E.push(0);return}if(!e.uniqueKey)if(e.characterId&&e.loaderInfo){const D=q(e.loaderInfo.id,e.characterId);e.uniqueKey=`${Wt(new Float32Array(D))}`,ue(D)}else e.uniqueKey=`${e.instanceId}`;E.push(1,Ka,l[0],l[1],l[2],l[3],l[4],l[5],o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],b,T,m,g,0,0,e.videoWidth,e.videoHeight,+e.uniqueKey,+e.changed),e.$cache&&!e.$cache.has(e.uniqueKey)&&(e.$cache=null);const k=e.$cache?e.$cache.get("0"):O.get(e.uniqueKey,"0");if(!k||e.changed){E.push(0,+k);const D=e.$context;if(D){const ee=e.videoWidth/2,_=e.videoHeight/2;D.save(),D.translate(ee,_),D.rotate(Math.PI),D.scale(-1,1),D.drawImage(e.$videoElement,-ee,-_,e.videoWidth,e.videoHeight),D.restore(),t.push(e.$offscreenCanvas.transferToImageBitmap())}k||O.set(e.uniqueKey,"0",!0),e.$cache&&(e.$cache=null)}else e.$cache||(e.$cache=O.getById(e.uniqueKey),e.$cache.set(e.uniqueKey,!0)),E.push(1);if(E.push(xs(e.blendMode)),e.filters?.length){let D=!1;const ee=[],_=de(0,0,0,0);for(let $e=0;$e<e.filters.length;$e++){const G=e.filters[$e];if(!G||!G.canApplyFilter())continue;G.$updated&&(D=!0),G.$updated=!1,G.getBounds(_);const K=G.toNumberArray();for(let W=0;W<K.length;W+=4096)ee.push(...K.subarray(W,W+4096))}const ie=ee.length>0;ie&&(E.push(+ie,+D,_[0],_[1],_[2],_[3],ee.length),E.set(new Float32Array(ee))),F(_)}else E.push(0);o!==s&&L.release(o),l!==u&&A.release(l)},Hs=(e,t,u,s,n,r)=>{let a=null;switch(!0){case e.isContainerEnabled:a=rs(e,t);break;case e.isShape:a=nu(e,t);break;case e.isText:a=au(e,t);break;case e.isVideo:a=ru(e,t);break}if(!a)return null;const i=a[0],c=a[2],o=Math.abs(c-i);if(!o)return null;const d=a[1],h=a[3],l=Math.abs(h-d);return!l||n>i+o||r>d+l||i>u||d>s?null:a},Wu=(e,t)=>{const u=N(e),s=u?A.multiply(t,u):t,n=e.children;E.push(bn,n.length);for(let r=0;r<n.length;r++){const a=n[r];if(a&&!a.isMask)switch(!0){case a.isContainerEnabled:Wu(a,s);break;case a.isShape:Yu(a,s);break}}s!==t&&A.release(s)},Tr=(e,t,u,s,n,r,a,i)=>{if(!e.visible){E.push(0);return}const c=Ve(e),o=c?L.multiply(s,c):s;if(!fe(o[3]+o[7]/255,0,1,0)){o!==s&&L.release(o),E.push(0);return}const h=e.children;if(!h.length){o!==s&&L.release(o),E.push(0);return}const l=N(e),f=l?A.multiply(u,l):u;if(!f[0]&&!f[1]||!f[2]&&!f[3]){o!==s&&L.release(o),f!==u&&A.release(f),E.push(0);return}E.push(1,bn);const b=e.mask;if(b){const g=Hs(b,f,n,r,a,i);if(!g)E.push(0);else switch(E.push(1,g[0],g[1],g[2],g[3]),!0){case b.isContainerEnabled:Wu(b,f);break;case b.isShape:Yu(b,f);break}b.changed=!1}else E.push(0);E.push(h.length);let T=0,m=!0;for(let g=0;g<h.length;++g){const w=h[g];if(!w.isMask){if(E.push(w.placeId,w.clipDepth),T&&w.placeId>T&&(T=0,m=!0),!m){w.changed=!1;continue}if(w.clipDepth){T=w.clipDepth;const R=Hs(w,f,n,r,a,i);if(m=!!R,E.push(+m),!R){w.changed=!1;continue}switch(E.push(R[0],R[1],R[2],R[3]),!0){case w.isContainerEnabled:Wu(w,f);break;case w.isShape:Yu(w,f);break}w.changed=!1;continue}switch(!0){case w.isContainerEnabled:Tr(w,t,f,o,n,r,a,i);break;case w.isShape:gr(w,f,o,n,r,a,i);break;case w.isText:xr(w,f,o,n,r,a,i);break;case w.isVideo:pr(w,t,f,o,n,r,a,i);break}w.changed=!1}}o!==s&&L.release(o),f!==u&&A.release(f)},dl=(e,t,u,s,n,r,a,i)=>{switch(E.push(p.backgroundColor),!0){case e.isContainerEnabled:Tr(e,t,u,s,n,r,a,i);break;case e.isShape:gr(e,u,s,n,r,a,i);break;case e.isText:xr(e,u,s,n,r,a,i);break;case e.isVideo:pr(e,t,u,s,n,r,a,i);break}e.changed=!1},zs=e=>{e.totalFrames===1||!e.isPlaying||(e.$wait||(++e.currentFrame,e.currentFrame>e.totalFrames&&(e.currentFrame=1)),e.$wait=!1,e.$canSound=!0,e.$canAction=!0,e.$hasTimelineHeadMoved=!0,e.$container=null,$r(e),Vt(e),Y(e))},Hu=e=>{const t=e.$container;if(t)for(let u=0;t.length>u;++u){const s=t[u];s.isTimelineEnabled&&zs(s),Hu(s)}else{const u=[],s=e.children;for(let n=0;s.length>n;++n){const r=s[n];r.isContainerEnabled&&(r.isTimelineEnabled&&zs(r),Hu(r),u.push(r))}e.$container=u}},fl=()=>{Hu(p),br(),fr()};class bl extends os{_$ready;stageWidth;stageHeight;frameRate;rendererScale;rendererWidth;rendererHeight;_$backgroundColor;constructor(){super(),this.stageWidth=0,this.stageHeight=0,this.frameRate=1,this.rendererScale=1,this.rendererWidth=0,this.rendererHeight=0,this._$ready=!1,this._$backgroundColor=-1}get backgroundColor(){return this._$backgroundColor}set backgroundColor(t){this._$backgroundColor=t==="transparent"?-1:parseInt(t.replace("#",""),16)}get pointer(){return $t}set ready(t){!t||this._$ready||(this._$ready=t,cl(this))}addChild(t){return Oe.set(t,t),be.add(t.instanceId),super.addChild(t)}$ticker(){fl()}$generateRenderQueue(t,u,s,n){dl(t,u,s,n,this.rendererWidth,this.rendererHeight,-s[4],-s[5])}$mouseHit(t,u,s){Ge(this,t,u,s,!0)}}const p=new bl;be.add(p.instanceId);const Au={command:"resize",buffer:null},Gs=[],zu=(e=!0)=>{Au.buffer=new Float32Array([M.rendererWidth,M.rendererHeight,e?1:0]),Gs[0]=Au.buffer.buffer,Ae.postMessage(Au,Gs)},Ks=window.devicePixelRatio||1,ps=()=>{Ke.x=0,Ke.y=0;const e=xt();if(!e)return;const t=e.children[0];!t||t.localName!=="canvas"||(Ke.x=(e.clientWidth-p.rendererWidth/Ks)/2,Ke.y=(e.clientHeight-p.rendererHeight/Ks)/2)},hu=()=>{const e=xt();if(!e)return;const t=e.parentElement;if(!t)return;const u=M.fullScreen||t.tagName==="BODY"?window.innerWidth:t.clientWidth,s=M.fullScreen||t.tagName==="BODY"?window.innerHeight:t.clientHeight,n=e.style;if(n.width=`${u}px`,n.height=`${s}px`,!p.stageWidth||!p.stageHeight)return;const r=Math.min(u/p.stageWidth,s/p.stageHeight)*Qe,a=M.fullScreen?window.innerWidth*Qe:p.stageWidth*r|0,i=M.fullScreen?window.innerHeight*Qe:p.stageHeight*r|0;a===M.screenWidth&&i===M.screenHeight||(M.screenWidth=u,M.screenHeight=s,p.changed=!0,e.children.length>1&&e.children[1].dispatchEvent(new Event(`${us}_blur`)),ps(),!(a===M.rendererWidth&&i===M.rendererHeight)&&(p.rendererScale=M.rendererScale=r,p.rendererWidth=M.rendererWidth=a,p.rendererHeight=M.rendererHeight=i,lt[0]=lt[3]=r,lt[4]=(M.rendererWidth-p.stageWidth*r)/2,lt[5]=(M.rendererHeight-p.stageHeight*r)/2,O.reset(),zu(),p.hasEventListener(x.RESIZE)&&p.dispatchEvent(new x(x.RESIZE))))},$l=new Float32Array([1,1,1,1,0,0,0,0]),it=[],ct={command:"render",buffer:null,length:0,imageBitmaps:null},It=[];Ae.addEventListener("message",e=>{if(e.data.message!=="render")return;const t=e.data.buffer;E.buffer.length>t.length||(E.buffer=t)});const Er=()=>{E.offset=0,It.length=0,it.length=0,p.$generateRenderQueue(p,it,lt,$l),E.offset&&(ct.buffer=E.buffer,ct.length=E.offset,It.push(E.buffer.buffer),ct.imageBitmaps=null,it.length&&(ct.imageBitmaps=it,It.push(...it)),Ae.postMessage(ct,It))},Qs={command:"removeCache",buffer:null},Zs=[],Js=()=>{const e=new Float32Array(O.$removeIds);O.$removeIds.length=0,Qs.buffer=e,Zs[0]=e.buffer,Ae.postMessage(Qs,Zs)},yr=e=>{if(M.stopFlag)return;O.$removeIds.length&&Js();const t=e-M.startTime;t>M.fps&&(M.startTime=e-t%M.fps,p.$ticker(),p.hasEventListener(x.ENTER_FRAME)&&p.dispatchEvent(new x(x.ENTER_FRAME)),p.changed&&Er(),O.$removeCache&&(O.removeTimerScheduledCache(),O.$removeIds.length&&Js())),M.timerId=requestAnimationFrame(u=>{yr(u)})},ml=()=>{M.stopFlag&&(M.stopFlag=!1,p.changed=!0,M.timerId>-1&&cancelAnimationFrame(M.timerId),M.fps=1e3/p.frameRate|0,M.startTime=performance.now(),M.timerId=requestAnimationFrame(e=>{yr(e)}))},gl=()=>{M.timerId>-1&&cancelAnimationFrame(M.timerId),M.stopFlag=!0,M.timerId=-1,et.stopAll()},xl=e=>{const t=Le();if(t){t.keyDown(e);return}p.hasEventListener(P.KEY_DOWN)&&(Xe(e),p.dispatchEvent(new P(P.KEY_DOWN)))},pl=e=>{Le()||p.hasEventListener(P.KEY_UP)&&(Xe(e),p.dispatchEvent(new P(P.KEY_UP)))},Tl=()=>{window.addEventListener(P.KEY_DOWN,xl),window.addEventListener(P.KEY_UP,pl)};class El{rendererWidth;rendererHeight;screenWidth;screenHeight;rendererScale;fixedWidth;fixedHeight;stopFlag;startTime;fps;tagId;_$fullScreen;timerId;mouseState;constructor(){this.rendererWidth=0,this.rendererHeight=0,this.rendererScale=1,this.screenWidth=0,this.screenHeight=0,this.stopFlag=!0,this.startTime=0,this.fps=16,this.timerId=-1,this.mouseState="up",this.fixedWidth=0,this.fixedHeight=0,this.tagId="",this._$fullScreen=!1,Tl()}get fullScreen(){return this._$fullScreen}set fullScreen(t){this._$fullScreen!==t&&(this._$fullScreen=t,hu())}play(){ml()}stop(){gl()}cacheClear(){O.reset(),Ae.postMessage({command:"cacheClear"})}setOptions(t=null){t&&(this.fixedWidth=t.width||this.fixedWidth,this.fixedHeight=t.height||this.fixedHeight,this.tagId=t.tagId||this.tagId,this._$fullScreen=!!t.fullScreen,t.bgColor&&(p.backgroundColor=t.bgColor))}}const M=new El;let js="auto";const Ts=()=>{M.stopFlag||(Z.x=p.pointer.x,Z.y=p.pointer.y,Z.pointer="auto",Z.hit=null,Eu.beginPath(),Eu.setTransform(1,0,0,1,0,0),p.$mouseHit(Eu,bt,Z),M.mouseState==="up"&&js!==Z.pointer&&(rn().style.cursor=js=Z.pointer))},Es=e=>{let t=window.scrollX,u=window.scrollY;const s=xt();if(s){const c=s.getBoundingClientRect();t+=c.left,u+=c.top}const n=e.target;if(n){const c=n.getBoundingClientRect();t+=c.left,u+=c.top}const r=(M.rendererWidth-p.stageWidth*M.rendererScale)/2,a=(M.rendererHeight-p.stageHeight*M.rendererScale)/2,i=M.rendererScale/Qe;p.pointer.x=(e.pageX-t)/i-r/M.rendererScale,p.pointer.y=(e.pageY-u)/i-a/M.rendererScale},yl=()=>{const e=Z.hit,t=Le();t&&(!e||t.instanceId!==e.instanceId)&&(t.focus=!1,_s(null)),e?(e.isText&&(e.focus?setTimeout(()=>{oe.focus()},300):(e.focus=!0,_s(e)),e.setFocusIndex(Z.x-bt[4],Z.y-bt[5])),e.willTrigger(v.POINTER_DOWN)&&e.dispatchEvent(new v(v.POINTER_DOWN))):p.willTrigger(v.POINTER_DOWN)&&p.dispatchEvent(new v(v.POINTER_DOWN))},Ml=()=>{const e=Z.hit;e?e.willTrigger(v.DOUBLE_CLICK)&&e.dispatchEvent(new v(v.DOUBLE_CLICK)):p.willTrigger(v.DOUBLE_CLICK)&&p.dispatchEvent(new v(v.DOUBLE_CLICK))};let en,St=!1;const wl=e=>{const t=e.target;t&&(M.mouseState="down",t.setPointerCapture(e.pointerId),Xe(e),Es(e),Ts(),Z.hit&&e.preventDefault(),clearTimeout(en),St?(St=!1,Ml()):(St=!0,en=setTimeout(()=>{St=!1},300),yl()))},Al=()=>{const e=p.dropTarget,t=Z.hit;t?(t.willTrigger(v.POINTER_UP)&&t.dispatchEvent(new v(v.POINTER_UP)),e&&e.instanceId!==t.instanceId&&e.willTrigger(v.POINTER_UP)&&e.dispatchEvent(new v(v.POINTER_UP))):e&&e.willTrigger(v.POINTER_UP)?e.dispatchEvent(new v(v.POINTER_UP)):p.willTrigger(v.POINTER_UP)&&p.dispatchEvent(new v(v.POINTER_UP))},vl=e=>{const t=e.target;t&&(M.mouseState="up",t.releasePointerCapture(e.pointerId),Xe(e),Es(e),Ts(),Al())},Il=()=>{const e=p.dropTarget;if(e){const n=e.parent?e.parent.globalToLocal(p.pointer):e.globalToLocal(p.pointer);let r=0,a=0;e.$lockCenter?(r=n.x-e.width/2,a=n.y-e.height/2):(r=n.x+e.$offsetX,a=n.y+e.$offsetY);const i=e.$boundedRect;i&&(r=Bt(r,i.left,i.right),a=Bt(a,i.top,i.bottom)),e.x=r,e.y=a}const t=Le();if(t&&M.mouseState==="down"){t.setFocusIndex(Z.x-bt[4],Z.y-bt[5],!0);return}const u=cn(),s=Z.hit;s?(s.willTrigger(v.POINTER_MOVE)&&s.dispatchEvent(new v(v.POINTER_MOVE)),u?u.instanceId!==s.instanceId&&(u.willTrigger(v.POINTER_OUT)&&u.dispatchEvent(new v(v.POINTER_OUT)),s.willTrigger(v.POINTER_OVER)&&s.dispatchEvent(new v(v.POINTER_OVER))):s.willTrigger(v.POINTER_OVER)&&s.dispatchEvent(new v(v.POINTER_OVER)),vs(s)):(u&&(u.willTrigger(v.POINTER_OUT)&&u.dispatchEvent(new v(v.POINTER_OUT)),vs(null)),p.hasEventListener(v.POINTER_MOVE)&&p.dispatchEvent(new v(v.POINTER_MOVE)))},Sl=e=>{e.target&&(Xe(e),Es(e),Ts(),Z.hit&&e.preventDefault(),Il())},Rl=e=>{Xe(e);const t=cn();t&&t.willTrigger(v.POINTER_LEAVE)&&(e.preventDefault(),t.dispatchEvent(new v(v.POINTER_LEAVE)))},kl=e=>{Xe(e);const t=Z.hit;if(t&&t.isText&&t.scrollEnabled){e.preventDefault(),e.deltaX&&(t.scrollX+=e.deltaX/(t.textWidth/t.width)),e.deltaY&&(t.scrollY+=e.deltaY/(t.textHeight/t.height));return}p.willTrigger(Ze.WHEEL)&&(e.preventDefault(),p.dispatchEvent(new Ze(Ze.WHEEL)))},Ol=e=>{const t=()=>{p0();const u=m0();for(let s=0;s<u.length;++s){const n=u[s];n&&(n.muted=!1)}u.length=0,e.removeEventListener(v.POINTER_UP,t)};e.addEventListener(v.POINTER_UP,t),e.addEventListener(v.POINTER_DOWN,wl,{passive:!1}),e.addEventListener(v.POINTER_UP,vl),e.addEventListener(v.POINTER_MOVE,Sl,{passive:!1}),e.addEventListener(v.POINTER_LEAVE,Rl),e.addEventListener(Ze.WHEEL,kl)},du=document.createElement("canvas");Lr(du);Cr(du,Qe);Ol(du);Br(du);const Gu={Event:x,EventDispatcher:tt,EventPhase:ze,FocusEvent:Ue,HTTPStatusEvent:kt,IOErrorEvent:ke,PointerEvent:v,JobEvent:xe,ProgressEvent:V,VideoEvent:le};Object.entries(Gu).forEach(([e,t])=>{Object.defineProperty(Gu,e,{get(){return t}})});const Ku={Sprite:ls,MovieClip:Yt,BitmapData:Pe,BlendMode:na,DisplayObject:iu,DisplayObjectContainer:os,FrameLabel:qn,Graphics:y,InteractiveObject:cs,Loader:dr,Shape:gt,stage:p};Object.entries(Ku).forEach(([e,t])=>{Object.defineProperty(Ku,e,{get(){return t}})});const Qu={BevelFilter:Kt,BlurFilter:Qt,ColorMatrixFilter:Zt,ConvolutionFilter:Jt,DisplacementMapFilter:jt,DropShadowFilter:eu,GlowFilter:tu,GradientBevelFilter:uu,GradientGlowFilter:su};Object.entries(Qu).forEach(([e,t])=>{Object.defineProperty(Qu,e,{get(){return t}})});const Zu={ColorTransform:L,Matrix:A,Point:j,Rectangle:me};Object.entries(Zu).forEach(([e,t])=>{Object.defineProperty(Zu,e,{get(){return t}})});const Ju={Sound:ou,SoundMixer:et,SoundTransform:L0,Video:Vu};Object.entries(Ju).forEach(([e,t])=>{Object.defineProperty(Ju,e,{get(){return t}})});class Mr{requestHeaders;url;contentType;data;method;responseDataFormat;withCredentials;constructor(t=""){this.url=`${t}`,this.contentType="application/json",this.data=null,this.method="GET",this.requestHeaders=[],this.responseDataFormat="json",this.withCredentials=!1}get headers(){const t=[];return t.push({name:"Content-Type",value:this.contentType}),this.requestHeaders.length&&t.push(...this.requestHeaders),t}}const ju={URLRequest:Mr};Object.entries(ju).forEach(([e,t])=>{Object.defineProperty(ju,e,{get(){return t}})});const es={TextFormat:re,TextField:Xu};Object.entries(es).forEach(([e,t])=>{Object.defineProperty(es,e,{get(){return t}})});const ts={Easing:qe,Tween:bs};Object.entries(ts).forEach(([e,t])=>{Object.defineProperty(ts,e,{get(){return t}})});const wr=()=>{const e=xt();if(e)for(;e.firstChild;)e.removeChild(e.firstChild)},Ar=()=>{const e=xt();if(!e)return;const t=rn();t&&(e.appendChild(t),e.appendChild(oe))},vr=()=>{p.ready=!0,Er(),p.changed=!1,M.play()},Fl=()=>{const e=document.createElement("div");if(Fr(e),e.id=us,e.tabIndex=-1,!M.tagId)document.body.appendChild(e);else{const t=document.getElementById(M.tagId);if(!t)return alert(`Element not found with tag ID: ${M.tagId}`),e;t.appendChild(e)}return e},Ll=(e,t=0,u=0)=>{let s="";if(s+="display:flex;",s+="align-items:center;",s+="justify-content:center;",s+="background-color:transparent;",s+="overflow:hidden;",s+="padding:0;",s+="margin:0;",s+="user-select:none;",s+="outline:none;",t&&u)s+=`width:${t}px;`,s+=`height:${u}px;`;else{const n=e.parentElement;if(!n)throw new Error("parent element is null.");n.tagName==="BODY"?(s+=`width:${window.innerWidth}px;`,s+=`height:${window.innerHeight}px;`):(s+=`width:${n.clientWidth}px;`,s+=`height:${n.clientHeight}px;`)}e.setAttribute("style",s)},Cl=e=>{const t=`${us}_loading`;e.innerHTML=`<style>
|
|
661
661
|
#${t} {
|
|
662
662
|
width: 50px;
|
|
@@ -676,4 +676,4 @@ void main() {
|
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
</style>
|
|
679
|
-
<div id="${t}"></div>`};let tn=-1;const Nl=()=>{window.addEventListener("resize",()=>{cancelAnimationFrame(tn),tn=requestAnimationFrame(hu)})},Ir=(e=null)=>{M.setOptions(e);const t=Fl();Ll(t,M.fixedWidth,M.fixedHeight),Cl(t),!M.fixedWidth&&!M.fixedHeight&&Nl(),hu()},Bl=async(e,t=null)=>{if(e==="develop"){const r=location.search.slice(1).split("&")[0];if(!r)return;e=`${location.origin}/${r}`}if(!e)return;e.charAt(1)==="/"&&(e=e.slice(1)),Ir(t);const u=new dr,s=u.contentLoaderInfo;if(s.addEventListener(ke.IO_ERROR,r=>{alert("Error: "+r.text)}),await u.load(new Mr(e)),!s.data)return;const n=s.data.stage;p.stageWidth=n.width,p.stageHeight=n.height,p.frameRate=Bt(n.fps,1,60,60),p.backgroundColor=t&&t.bgColor?t.bgColor:n.bgColor,p.addChild(s.content),hu(),vr(),wr(),Ar(),ps()};let un=!1;const Pl=(e=240,t=240,u=60,s=null)=>{if(un)return p.getChildAt(0);un=!0,p.stageWidth=e|0,p.stageHeight=t|0,p.frameRate=Bt(u,1,60,60),Ir(s);const n=p.addChild(new ls);return vr(),wr(),Ar(),ps(),n},Be={command:"capture",buffer:null,width:0,height:0,length:0,imageBitmaps:null},Rt=[],ot=[],Dl=async(e,t,u,s)=>await new Promise(n=>{if(E.offset=0,Rt.length=0,ot.length=0,p.$generateRenderQueue(e,ot,t,u),!E.offset)return n(s);Be.buffer=E.buffer,Be.width=s.width,Be.height=s.height,Be.length=E.offset,Rt.push(E.buffer.buffer),Be.imageBitmaps=null,ot.length&&(Be.imageBitmaps=ot,Rt.push(...ot));const r=a=>{if(a.data.message!=="capture")return;const i=a.data.buffer;return E.buffer.length<i.length&&(E.buffer=i),s.getContext("2d").drawImage(a.data.imageBitmap,0,0),Ae.removeEventListener("message",r),n(s)};Ae.addEventListener("message",r),Ae.postMessage(Be,Rt)}),Sr=async e=>{switch(!0){case e.isVideo:
|
|
679
|
+
<div id="${t}"></div>`};let tn=-1;const Nl=()=>{window.addEventListener("resize",()=>{cancelAnimationFrame(tn),tn=requestAnimationFrame(hu)})},Ir=(e=null)=>{M.setOptions(e);const t=Fl();Ll(t,M.fixedWidth,M.fixedHeight),Cl(t),!M.fixedWidth&&!M.fixedHeight&&Nl(),hu()},Bl=async(e,t=null)=>{if(e==="develop"){const r=location.search.slice(1).split("&")[0];if(!r)return;e=`${location.origin}/${r}`}if(!e)return;e.charAt(1)==="/"&&(e=e.slice(1)),Ir(t);const u=new dr,s=u.contentLoaderInfo;if(s.addEventListener(ke.IO_ERROR,r=>{alert("Error: "+r.text)}),await u.load(new Mr(e)),!s.data)return;const n=s.data.stage;p.stageWidth=n.width,p.stageHeight=n.height,p.frameRate=Bt(n.fps,1,60,60),p.backgroundColor=t&&t.bgColor?t.bgColor:n.bgColor,p.addChild(s.content),hu(),vr(),wr(),Ar(),ps()};let un=!1;const Pl=(e=240,t=240,u=60,s=null)=>{if(un)return p.getChildAt(0);un=!0,p.stageWidth=e|0,p.stageHeight=t|0,p.frameRate=Bt(u,1,60,60),Ir(s);const n=p.addChild(new ls);return vr(),wr(),Ar(),ps(),n},Be={command:"capture",buffer:null,width:0,height:0,length:0,imageBitmaps:null},Rt=[],ot=[],Dl=async(e,t,u,s)=>await new Promise(n=>{if(E.offset=0,Rt.length=0,ot.length=0,p.$generateRenderQueue(e,ot,t,u),!E.offset)return n(s);Be.buffer=E.buffer,Be.width=s.width,Be.height=s.height,Be.length=E.offset,Rt.push(E.buffer.buffer),Be.imageBitmaps=null,ot.length&&(Be.imageBitmaps=ot,Rt.push(...ot));const r=a=>{if(a.data.message!=="capture")return;const i=a.data.buffer;return E.buffer.length<i.length&&(E.buffer=i),s.getContext("2d").drawImage(a.data.imageBitmap,0,0),Ae.removeEventListener("message",r),n(s)};Ae.addEventListener("message",r),Ae.postMessage(Be,Rt)}),Sr=async e=>{switch(!0){case e.isVideo:{const t=e.muted;e.muted=!0,await e.play(),e.pause(),e.muted=t,await new Promise(u=>{const s=async()=>{e.loaded?(e.seek(0),u()):requestAnimationFrame(s)};requestAnimationFrame(s)})}break;case e.isContainerEnabled:{const t=e.children;for(let u=0;u<t.length;++u){const s=t[u];s&&(!s.isVideo&&!s.isContainerEnabled||await Sr(s))}}break}},_l=new Float32Array([1,0,0,1,0,0]),Ul=new Float32Array([1,1,1,1,0,0,0,0]),ql=async(e,t=null)=>{t&&t.videoSync&&await Sr(e);const u=t&&t.colorTransform?t.colorTransform.rawData:Ul,s=e.getBounds(),n=new Float32Array([1,0,0,1,-s.x,-s.y]),r=t&&t.matrix?A.multiply(t.matrix.rawData,n):A.multiply(_l,n),a=t&&t.canvas?t.canvas:O.getCanvas(),i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(r[2]*r[2]+r[3]*r[3]),o=Math.ceil(e.width*i),d=Math.ceil(e.height*c);if(o<=0||d<=0)return a;a.width=o,a.height=d;const h=M.stopFlag;h||M.stop();let l=!1;const f=M.rendererWidth,b=M.rendererHeight,T=M.rendererScale;if(o>f||d>b){l=!0;const m=Math.min(o/p.stageWidth,d/p.stageHeight)*Qe;p.rendererScale=M.rendererScale=m,p.rendererWidth=M.rendererWidth=o,p.rendererHeight=M.rendererHeight=d,zu(!1)}return await Dl(e,r,u,a),l&&(p.rendererScale=M.rendererScale=T,p.rendererWidth=M.rendererWidth=f,p.rendererHeight=M.rendererHeight=b,zu(!1)),h||M.play(),A.release(r),t&&t.colorTransform&&L.release(u),a};class Xl{display;events;filters;geom;media;net;text;ui;_$promise;constructor(){this.display=Ku,this.events=Gu,this.filters=Qu,this.geom=Zu,this.media=Ju,this.net=ju,this.text=es,this.ui=ts,this._$promise=new Promise(t=>{document.readyState==="loading"?window.addEventListener("DOMContentLoaded",()=>t(),{once:!0}):t()})}async load(t,u=null){await Promise.all([this._$promise]),await Bl(t,u)}async createRootMovieClip(t=240,u=240,s=60,n=null){return await Promise.all([this._$promise]),Pl(t,u,s,n)}async captureToCanvas(t,u=null){return ql(t,u)}}"next2d"in window||(console.log("%c Next2D Player %c 2.1.1 %c https://next2d.app","color: #fff; background: #5f5f5f","color: #fff; background: #4bc729",""),window.next2d=new Xl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next2d/player",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Experience the fast and beautiful anti-aliased rendering of WebGL. You can create rich, interactive graphics, cross-platform applications and games without worrying about browser or device compatibility.",
|
|
5
5
|
"author": "Toshiyuki Ienaga<ienaga@next2d.app> (https://github.com/ienaga/)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"fflate": "^0.8.2",
|
|
45
45
|
"htmlparser2": "^10.0.0",
|
|
46
|
-
"@next2d/cache": "2.
|
|
47
|
-
"@next2d/core": "2.
|
|
48
|
-
"@next2d/display": "2.
|
|
49
|
-
"@next2d/events": "2.
|
|
50
|
-
"@next2d/filters": "2.
|
|
51
|
-
"@next2d/geom": "2.
|
|
52
|
-
"@next2d/media": "2.
|
|
53
|
-
"@next2d/net": "2.
|
|
54
|
-
"@next2d/render-queue": "2.
|
|
55
|
-
"@next2d/text": "2.
|
|
56
|
-
"@next2d/ui": "2.
|
|
46
|
+
"@next2d/cache": "2.1.1",
|
|
47
|
+
"@next2d/core": "2.1.1",
|
|
48
|
+
"@next2d/display": "2.1.1",
|
|
49
|
+
"@next2d/events": "2.1.1",
|
|
50
|
+
"@next2d/filters": "2.1.1",
|
|
51
|
+
"@next2d/geom": "2.1.1",
|
|
52
|
+
"@next2d/media": "2.1.1",
|
|
53
|
+
"@next2d/net": "2.1.1",
|
|
54
|
+
"@next2d/render-queue": "2.1.1",
|
|
55
|
+
"@next2d/text": "2.1.1",
|
|
56
|
+
"@next2d/ui": "2.1.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@eslint/eslintrc": "^3.3.1",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
63
63
|
"@rollup/plugin-terser": "^0.4.4",
|
|
64
64
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
65
|
-
"@types/node": "^22.13.
|
|
66
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
67
|
-
"@typescript-eslint/parser": "^8.
|
|
65
|
+
"@types/node": "^22.13.13",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^8.28.0",
|
|
67
|
+
"@typescript-eslint/parser": "^8.28.0",
|
|
68
68
|
"@vitest/web-worker": "^3.0.9",
|
|
69
69
|
"eslint": "^9.23.0",
|
|
70
70
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"rollup": "^4.37.0",
|
|
74
74
|
"tslib": "^2.8.1",
|
|
75
75
|
"typescript": "^5.8.2",
|
|
76
|
-
"vite": "^6.2.
|
|
76
|
+
"vite": "^6.2.3",
|
|
77
77
|
"vitest": "^3.0.9",
|
|
78
78
|
"vitest-webgl-canvas-mock": "^1.1.0"
|
|
79
79
|
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { Next2D } from "@next2d/core";
|
|
3
3
|
if (!("next2d" in window)) {
|
|
4
|
-
console.log("%c Next2D Player %c 2.
|
|
4
|
+
console.log("%c Next2D Player %c 2.1.1 %c https://next2d.app", "color: #fff; background: #5f5f5f", "color: #fff; background: #4bc729", "");
|
|
5
5
|
window.next2d = new Next2D();
|
|
6
6
|
}
|